7fd59977 |
1 | // File: BinLDrivers.cxx |
2 | // Created: 29.10.02 18:44:39 |
3 | // Author: Michael SAZONOV |
4 | // Copyright: Open CASCADE 2002 |
5 | |
6 | #include <BinLDrivers.ixx> |
7 | #include <BinMDF.hxx> |
8 | #include <BinMDataStd.hxx> |
9 | #include <BinMFunction.hxx> |
10 | //#include <BinMNaming.hxx> |
11 | #include <BinMDocStd.hxx> |
12 | #include <Standard_Failure.hxx> |
13 | #include <BinLDrivers_DocumentStorageDriver.hxx> |
14 | #include <BinLDrivers_DocumentRetrievalDriver.hxx> |
15 | #include <Plugin_Macro.hxx> |
16 | |
17 | // avoid warnings on 'extern "C"' functions returning C++ classes |
18 | #ifdef WNT |
19 | #pragma warning(4:4190) |
20 | #endif |
21 | |
22 | static Standard_GUID BinLStorageDriver ("13a56835-8269-11d5-aab2-0050044b1af1"); |
23 | static Standard_GUID BinLRetrievalDriver("13a56836-8269-11d5-aab2-0050044b1af1"); |
24 | #define CURRENT_DOCUMENT_VERSION 6 |
25 | |
26 | //======================================================================= |
27 | //function : Factory |
28 | //purpose : PLUGIN FACTORY |
29 | //======================================================================= |
30 | Handle(Standard_Transient) BinLDrivers::Factory(const Standard_GUID& theGUID) |
31 | { |
32 | if (theGUID == BinLStorageDriver) |
33 | { |
34 | cout << "BinLDrivers : Storage Plugin" << endl; |
35 | static Handle(BinLDrivers_DocumentStorageDriver) model_sd = |
36 | new BinLDrivers_DocumentStorageDriver; |
37 | return model_sd; |
38 | } |
39 | |
40 | if (theGUID == BinLRetrievalDriver) |
41 | { |
42 | cout << "BinLDrivers : Retrieval Plugin" << endl; |
43 | static Handle(BinLDrivers_DocumentRetrievalDriver) model_rd = |
44 | new BinLDrivers_DocumentRetrievalDriver; |
45 | return model_rd; |
46 | } |
47 | |
48 | Standard_Failure::Raise ("BinLDrivers : unknown GUID"); |
49 | return NULL; |
50 | } |
51 | |
52 | //======================================================================= |
53 | //function : AttributeDrivers |
54 | //purpose : |
55 | //======================================================================= |
56 | |
57 | Handle(BinMDF_ADriverTable) BinLDrivers::AttributeDrivers |
58 | (const Handle(CDM_MessageDriver)& aMsgDrv) |
59 | { |
60 | Handle(BinMDF_ADriverTable) aTable = new BinMDF_ADriverTable; |
61 | |
62 | BinMDF ::AddDrivers (aTable, aMsgDrv); |
63 | BinMDataStd ::AddDrivers (aTable, aMsgDrv); |
64 | BinMFunction ::AddDrivers (aTable, aMsgDrv); |
65 | BinMDocStd ::AddDrivers (aTable, aMsgDrv); |
66 | |
67 | // BinMNaming ::AddDrivers (aTable, aMsgDrv); |
68 | // BinMPrsStd ::AddDrivers (aTable, aMsgDrv); |
69 | return aTable; |
70 | } |
71 | |
72 | //======================================================================= |
73 | //function : StorageVersion |
74 | //purpose : |
75 | //======================================================================= |
76 | |
77 | TCollection_AsciiString BinLDrivers::StorageVersion() |
78 | { |
79 | TCollection_AsciiString aVersionStr (CURRENT_DOCUMENT_VERSION); |
80 | return aVersionStr; |
81 | } |
82 | PLUGIN(BinLDrivers) |