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