1 // Created on: 2002-10-29
2 // Created by: Michael SAZONOV
3 // Copyright (c) 2002-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
21 #include <BinDrivers.ixx>
22 #include <BinLDrivers.hxx>
24 #include <BinMDataStd.hxx>
25 #include <BinMDataXtd.hxx>
26 #include <BinMNaming.hxx>
27 #include <BinMDocStd.hxx>
28 #include <BinMFunction.hxx>
29 #include <BinMPrsStd.hxx>
30 #include <Standard_Failure.hxx>
31 #include <BinDrivers_DocumentStorageDriver.hxx>
32 #include <BinDrivers_DocumentRetrievalDriver.hxx>
33 #include <Plugin_Macro.hxx>
35 // avoid warnings on 'extern "C"' functions returning C++ classes
37 #pragma warning(4:4190)
40 static Standard_GUID BinStorageDriver ("03a56835-8269-11d5-aab2-0050044b1af1");
41 static Standard_GUID BinRetrievalDriver("03a56836-8269-11d5-aab2-0050044b1af1");
43 //=======================================================================
45 //purpose : PLUGIN FACTORY
46 //=======================================================================
47 Handle(Standard_Transient) BinDrivers::Factory(const Standard_GUID& theGUID)
49 if (theGUID == BinStorageDriver)
51 cout << "BinDrivers : Storage Plugin" << endl;
52 static Handle(BinDrivers_DocumentStorageDriver) model_sd =
53 new BinDrivers_DocumentStorageDriver;
57 if (theGUID == BinRetrievalDriver)
59 cout << "BinDrivers : Retrieval Plugin" << endl;
60 static Handle(BinDrivers_DocumentRetrievalDriver) model_rd =
61 new BinDrivers_DocumentRetrievalDriver;
65 Standard_Failure::Raise ("BinDrivers : unknown GUID");
69 //=======================================================================
70 //function : AttributeDrivers
72 //=======================================================================
74 Handle(BinMDF_ADriverTable) BinDrivers::AttributeDrivers
75 (const Handle(CDM_MessageDriver)& aMsgDrv)
77 Handle(BinMDF_ADriverTable) aTable = new BinMDF_ADriverTable;
79 BinMDF ::AddDrivers (aTable, aMsgDrv);
80 BinMDataStd ::AddDrivers (aTable, aMsgDrv);
81 BinMDataXtd ::AddDrivers (aTable, aMsgDrv);
82 BinMNaming ::AddDrivers (aTable, aMsgDrv);
83 BinMDocStd ::AddDrivers (aTable, aMsgDrv);
84 BinMFunction ::AddDrivers (aTable, aMsgDrv);
85 BinMPrsStd ::AddDrivers (aTable, aMsgDrv);
89 //=======================================================================
90 //function : StorageVersion
92 //=======================================================================
94 TCollection_AsciiString BinDrivers::StorageVersion()
96 return BinLDrivers::StorageVersion();