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 | // |
973c2be1 |
7 | // This library is free software; you can redistribute it and / or modify it |
8 | // under the terms of the GNU Lesser General Public version 2.1 as published |
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 | { |
39 | cout << "BinLDrivers : Storage Plugin" << endl; |
40 | static Handle(BinLDrivers_DocumentStorageDriver) model_sd = |
41 | new BinLDrivers_DocumentStorageDriver; |
42 | return model_sd; |
43 | } |
44 | |
45 | if (theGUID == BinLRetrievalDriver) |
46 | { |
47 | cout << "BinLDrivers : Retrieval Plugin" << endl; |
48 | static Handle(BinLDrivers_DocumentRetrievalDriver) model_rd = |
49 | new BinLDrivers_DocumentRetrievalDriver; |
50 | return model_rd; |
51 | } |
52 | |
53 | Standard_Failure::Raise ("BinLDrivers : unknown GUID"); |
54 | return NULL; |
55 | } |
56 | |
57 | //======================================================================= |
58 | //function : AttributeDrivers |
59 | //purpose : |
60 | //======================================================================= |
61 | |
62 | Handle(BinMDF_ADriverTable) BinLDrivers::AttributeDrivers |
63 | (const Handle(CDM_MessageDriver)& aMsgDrv) |
64 | { |
65 | Handle(BinMDF_ADriverTable) aTable = new BinMDF_ADriverTable; |
66 | |
67 | BinMDF ::AddDrivers (aTable, aMsgDrv); |
68 | BinMDataStd ::AddDrivers (aTable, aMsgDrv); |
69 | BinMFunction ::AddDrivers (aTable, aMsgDrv); |
70 | BinMDocStd ::AddDrivers (aTable, aMsgDrv); |
71 | |
72 | // BinMNaming ::AddDrivers (aTable, aMsgDrv); |
73 | // BinMPrsStd ::AddDrivers (aTable, aMsgDrv); |
74 | return aTable; |
75 | } |
76 | |
77 | //======================================================================= |
78 | //function : StorageVersion |
79 | //purpose : |
80 | //======================================================================= |
81 | |
82 | TCollection_AsciiString BinLDrivers::StorageVersion() |
83 | { |
84 | TCollection_AsciiString aVersionStr (CURRENT_DOCUMENT_VERSION); |
85 | return aVersionStr; |
86 | } |
498ce76b |
87 | |
88 | #ifdef _MSC_VER |
89 | #pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */ |
90 | #endif |
7fd59977 |
91 | PLUGIN(BinLDrivers) |