| 1 | // Created on: 2002-10-29 |
| 2 | // Created by: Michael SAZONOV |
| 3 | // Copyright (c) 2002-2014 OPEN CASCADE SAS |
| 4 | // |
| 5 | // This file is part of Open CASCADE Technology software library. |
| 6 | // |
| 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. |
| 12 | // |
| 13 | // Alternatively, this file may be used under the terms of Open CASCADE |
| 14 | // commercial license or contractual agreement. |
| 15 | |
| 16 | |
| 17 | #include <BinDrivers.hxx> |
| 18 | #include <BinDrivers_DocumentRetrievalDriver.hxx> |
| 19 | #include <BinDrivers_DocumentStorageDriver.hxx> |
| 20 | #include <BinLDrivers.hxx> |
| 21 | #include <BinMDataStd.hxx> |
| 22 | #include <BinMDataXtd.hxx> |
| 23 | #include <BinMDF.hxx> |
| 24 | #include <BinMDF_ADriverTable.hxx> |
| 25 | #include <BinMDocStd.hxx> |
| 26 | #include <BinMFunction.hxx> |
| 27 | #include <BinMNaming.hxx> |
| 28 | #include <CDM_MessageDriver.hxx> |
| 29 | #include <Plugin_Macro.hxx> |
| 30 | #include <Standard_Failure.hxx> |
| 31 | #include <Standard_GUID.hxx> |
| 32 | #include <Standard_Transient.hxx> |
| 33 | #include <TCollection_AsciiString.hxx> |
| 34 | |
| 35 | static Standard_GUID BinStorageDriver ("03a56835-8269-11d5-aab2-0050044b1af1"); |
| 36 | static Standard_GUID BinRetrievalDriver("03a56836-8269-11d5-aab2-0050044b1af1"); |
| 37 | |
| 38 | //======================================================================= |
| 39 | //function : Factory |
| 40 | //purpose : PLUGIN FACTORY |
| 41 | //======================================================================= |
| 42 | const Handle(Standard_Transient)& BinDrivers::Factory(const Standard_GUID& theGUID) |
| 43 | { |
| 44 | if (theGUID == BinStorageDriver) |
| 45 | { |
| 46 | #ifdef OCCT_DEBUG |
| 47 | cout << "BinDrivers : Storage Plugin" << endl; |
| 48 | #endif |
| 49 | static Handle(Standard_Transient) model_sd = |
| 50 | new BinDrivers_DocumentStorageDriver; |
| 51 | return model_sd; |
| 52 | } |
| 53 | |
| 54 | if (theGUID == BinRetrievalDriver) |
| 55 | { |
| 56 | #ifdef OCCT_DEBUG |
| 57 | cout << "BinDrivers : Retrieval Plugin" << endl; |
| 58 | #endif |
| 59 | static Handle(Standard_Transient) model_rd = |
| 60 | new BinDrivers_DocumentRetrievalDriver; |
| 61 | return model_rd; |
| 62 | } |
| 63 | |
| 64 | Standard_Failure::Raise ("BinDrivers : unknown GUID"); |
| 65 | static Handle(Standard_Transient) aNullHandle; |
| 66 | return aNullHandle; |
| 67 | } |
| 68 | |
| 69 | //======================================================================= |
| 70 | //function : AttributeDrivers |
| 71 | //purpose : |
| 72 | //======================================================================= |
| 73 | |
| 74 | Handle(BinMDF_ADriverTable) BinDrivers::AttributeDrivers |
| 75 | (const Handle(CDM_MessageDriver)& aMsgDrv) |
| 76 | { |
| 77 | Handle(BinMDF_ADriverTable) aTable = new BinMDF_ADriverTable; |
| 78 | |
| 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 | return aTable; |
| 86 | } |
| 87 | |
| 88 | //======================================================================= |
| 89 | //function : StorageVersion |
| 90 | //purpose : |
| 91 | //======================================================================= |
| 92 | |
| 93 | TCollection_AsciiString BinDrivers::StorageVersion() |
| 94 | { |
| 95 | return BinLDrivers::StorageVersion(); |
| 96 | } |
| 97 | |
| 98 | PLUGIN(BinDrivers) |