7fd59977 |
1 | // File: PAppStd.cxx |
2 | // Created: Sep 7 16:30:02 2000 |
3 | // Author: TURIN Anatoliy <ati@nnov.matra-dtv.fr> |
4 | // Copyright: Matra Datavision 2000 |
5 | |
6 | #include <StdDrivers.ixx> |
7 | #include <StdDrivers_DocumentStorageDriver.hxx> |
8 | #include <StdDrivers_DocumentRetrievalDriver.hxx> |
9 | #include <StdSchema.hxx> |
10 | #include <StdLSchema.hxx> |
11 | #include <ShapeSchema.hxx> |
12 | #include <Storage_HArrayOfSchema.hxx> |
13 | |
14 | #include <Standard_Failure.hxx> |
15 | #include <Standard_GUID.hxx> |
16 | #include <Plugin_Macro.hxx> |
17 | |
18 | // avoid warnings on 'extern "C"' functions returning C++ classes |
19 | #ifdef WNT |
20 | #pragma warning(4:4190) |
21 | #endif |
22 | |
23 | static Standard_GUID StdStorageDriver ("ad696000-5b34-11d1-b5ba-00a0c9064368"); |
24 | static Standard_GUID StdRetrievalDriver ("ad696001-5b34-11d1-b5ba-00a0c9064368"); |
25 | static Standard_GUID StdSchemaID ("ad696002-5b34-11d1-b5ba-00a0c9064368"); |
26 | |
27 | Handle(Standard_Transient) StdDrivers::Factory(const Standard_GUID& aGUID) { |
28 | |
29 | if(aGUID == StdSchemaID) { |
30 | #ifdef DEB |
31 | cout << "StdSchema : Plugin" << endl; |
32 | #endif |
33 | static Handle(StdLSchema) model_ss = new StdLSchema; |
34 | static Standard_Boolean aNeedNested = Standard_True; |
35 | if(aNeedNested) { |
36 | aNeedNested = Standard_False; |
37 | #ifdef DEB |
38 | cout << "StdSchema: Adding nested schema" << endl; |
39 | #endif |
40 | Handle(StdSchema) aSchema = new StdSchema; |
41 | Handle(ShapeSchema) aSSchema = new ShapeSchema; |
42 | Handle(Storage_HArrayOfSchema) aSchemas = new Storage_HArrayOfSchema(0,1); |
43 | aSchemas->SetValue(0, aSSchema); |
44 | aSchemas->SetValue(1, aSchema); |
45 | model_ss->SetNestedSchemas(aSchemas); |
46 | } |
47 | return model_ss; |
48 | } |
49 | |
50 | if(aGUID == StdStorageDriver) { |
51 | #ifdef DEB |
52 | cout << "StdDrivers : Storage Plugin" << endl; |
53 | #endif |
54 | static Handle(StdDrivers_DocumentStorageDriver) model_sd = new StdDrivers_DocumentStorageDriver; |
55 | return model_sd; |
56 | } |
57 | if(aGUID == StdRetrievalDriver) { |
58 | #ifdef DEB |
59 | cout << "StdDrivers : Retrieval Plugin" << endl; |
60 | #endif |
61 | static Handle(StdDrivers_DocumentRetrievalDriver) model_rd = new StdDrivers_DocumentRetrievalDriver; |
62 | return model_rd; |
63 | } |
64 | |
65 | Standard_Failure::Raise ("StdDrivers : unknown GUID"); |
66 | Handle(Standard_Transient) t; |
67 | return t; |
68 | } |
69 | |
70 | // Declare entry point PLUGINFACTORY |
71 | PLUGIN(StdDrivers) |