1 // Created on: 2002-10-29
2 // Created by: Michael SAZONOV
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #include <BinLDrivers.hxx>
18 #include <BinLDrivers_DocumentRetrievalDriver.hxx>
19 #include <BinLDrivers_DocumentStorageDriver.hxx>
20 #include <BinMDataStd.hxx>
22 #include <BinMDF_ADriverTable.hxx>
23 #include <BinMDocStd.hxx>
24 #include <BinMFunction.hxx>
25 #include <CDM_MessageDriver.hxx>
26 #include <Plugin_Macro.hxx>
27 #include <Standard_Failure.hxx>
28 #include <Standard_GUID.hxx>
29 #include <Standard_Transient.hxx>
30 #include <TCollection_AsciiString.hxx>
32 //#include <BinMNaming.hxx>
33 static Standard_GUID BinLStorageDriver ("13a56835-8269-11d5-aab2-0050044b1af1");
34 static Standard_GUID BinLRetrievalDriver("13a56836-8269-11d5-aab2-0050044b1af1");
35 #define CURRENT_DOCUMENT_VERSION 8
37 //=======================================================================
39 //purpose : PLUGIN FACTORY
40 //=======================================================================
41 const Handle(Standard_Transient)& BinLDrivers::Factory(const Standard_GUID& theGUID)
43 if (theGUID == BinLStorageDriver)
46 cout << "BinLDrivers : Storage Plugin" << endl;
48 static Handle(BinLDrivers_DocumentStorageDriver) model_sd =
49 new BinLDrivers_DocumentStorageDriver;
53 if (theGUID == BinLRetrievalDriver)
56 cout << "BinLDrivers : Retrieval Plugin" << endl;
58 static Handle(BinLDrivers_DocumentRetrievalDriver) model_rd =
59 new BinLDrivers_DocumentRetrievalDriver;
63 Standard_Failure::Raise ("BinLDrivers : unknown GUID");
64 static Handle(Standard_Transient) aNullHandle;
68 //=======================================================================
69 //function : AttributeDrivers
71 //=======================================================================
73 Handle(BinMDF_ADriverTable) BinLDrivers::AttributeDrivers
74 (const Handle(CDM_MessageDriver)& aMsgDrv)
76 Handle(BinMDF_ADriverTable) aTable = new BinMDF_ADriverTable;
78 BinMDF ::AddDrivers (aTable, aMsgDrv);
79 BinMDataStd ::AddDrivers (aTable, aMsgDrv);
80 BinMFunction ::AddDrivers (aTable, aMsgDrv);
81 BinMDocStd ::AddDrivers (aTable, aMsgDrv);
86 //=======================================================================
87 //function : StorageVersion
89 //=======================================================================
91 TCollection_AsciiString BinLDrivers::StorageVersion()
93 TCollection_AsciiString aVersionStr (CURRENT_DOCUMENT_VERSION);