b311480e |
1 | // Created on: 2002-10-29 |
2 | // Created by: Michael SAZONOV |
973c2be1 |
3 | // Copyright (c) 2002-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | #include <BinLDrivers.ixx> |
17 | #include <BinMDF.hxx> |
18 | #include <BinMDataStd.hxx> |
19 | #include <BinMFunction.hxx> |
20 | //#include <BinMNaming.hxx> |
21 | #include <BinMDocStd.hxx> |
22 | #include <Standard_Failure.hxx> |
23 | #include <BinLDrivers_DocumentStorageDriver.hxx> |
24 | #include <BinLDrivers_DocumentRetrievalDriver.hxx> |
25 | #include <Plugin_Macro.hxx> |
26 | |
7fd59977 |
27 | static Standard_GUID BinLStorageDriver ("13a56835-8269-11d5-aab2-0050044b1af1"); |
28 | static Standard_GUID BinLRetrievalDriver("13a56836-8269-11d5-aab2-0050044b1af1"); |
7dcac1df |
29 | #define CURRENT_DOCUMENT_VERSION 7 |
7fd59977 |
30 | |
31 | //======================================================================= |
32 | //function : Factory |
33 | //purpose : PLUGIN FACTORY |
34 | //======================================================================= |
35 | Handle(Standard_Transient) BinLDrivers::Factory(const Standard_GUID& theGUID) |
36 | { |
37 | if (theGUID == BinLStorageDriver) |
38 | { |
63c629aa |
39 | #ifdef BINLDRIVERS_DEB |
7fd59977 |
40 | cout << "BinLDrivers : Storage Plugin" << endl; |
63c629aa |
41 | #endif |
7fd59977 |
42 | static Handle(BinLDrivers_DocumentStorageDriver) model_sd = |
43 | new BinLDrivers_DocumentStorageDriver; |
44 | return model_sd; |
45 | } |
46 | |
47 | if (theGUID == BinLRetrievalDriver) |
48 | { |
63c629aa |
49 | #ifdef BINLDRIVERS_DEB |
7fd59977 |
50 | cout << "BinLDrivers : Retrieval Plugin" << endl; |
63c629aa |
51 | #endif |
7fd59977 |
52 | static Handle(BinLDrivers_DocumentRetrievalDriver) model_rd = |
53 | new BinLDrivers_DocumentRetrievalDriver; |
54 | return model_rd; |
55 | } |
56 | |
57 | Standard_Failure::Raise ("BinLDrivers : unknown GUID"); |
58 | return NULL; |
59 | } |
60 | |
61 | //======================================================================= |
62 | //function : AttributeDrivers |
63 | //purpose : |
64 | //======================================================================= |
65 | |
66 | Handle(BinMDF_ADriverTable) BinLDrivers::AttributeDrivers |
67 | (const Handle(CDM_MessageDriver)& aMsgDrv) |
68 | { |
69 | Handle(BinMDF_ADriverTable) aTable = new BinMDF_ADriverTable; |
70 | |
71 | BinMDF ::AddDrivers (aTable, aMsgDrv); |
72 | BinMDataStd ::AddDrivers (aTable, aMsgDrv); |
73 | BinMFunction ::AddDrivers (aTable, aMsgDrv); |
74 | BinMDocStd ::AddDrivers (aTable, aMsgDrv); |
75 | |
76 | // BinMNaming ::AddDrivers (aTable, aMsgDrv); |
77 | // BinMPrsStd ::AddDrivers (aTable, aMsgDrv); |
78 | return aTable; |
79 | } |
80 | |
81 | //======================================================================= |
82 | //function : StorageVersion |
83 | //purpose : |
84 | //======================================================================= |
85 | |
86 | TCollection_AsciiString BinLDrivers::StorageVersion() |
87 | { |
88 | TCollection_AsciiString aVersionStr (CURRENT_DOCUMENT_VERSION); |
89 | return aVersionStr; |
90 | } |
498ce76b |
91 | |
92 | #ifdef _MSC_VER |
93 | #pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */ |
94 | #endif |
7fd59977 |
95 | PLUGIN(BinLDrivers) |