1 // Created on: 2000-09-07
2 // Created by: TURIN Anatoliy
3 // Copyright (c) 2000-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
21 #include <StdDrivers.ixx>
22 #include <StdDrivers_DocumentStorageDriver.hxx>
23 #include <StdDrivers_DocumentRetrievalDriver.hxx>
24 #include <StdSchema.hxx>
25 #include <StdLSchema.hxx>
26 #include <ShapeSchema.hxx>
27 #include <Storage_HArrayOfSchema.hxx>
29 #include <Standard_Failure.hxx>
30 #include <Standard_GUID.hxx>
31 #include <Plugin_Macro.hxx>
33 // avoid warnings on 'extern "C"' functions returning C++ classes
35 #pragma warning(4:4190)
38 static Standard_GUID StdStorageDriver ("ad696000-5b34-11d1-b5ba-00a0c9064368");
39 static Standard_GUID StdRetrievalDriver ("ad696001-5b34-11d1-b5ba-00a0c9064368");
40 static Standard_GUID StdSchemaID ("ad696002-5b34-11d1-b5ba-00a0c9064368");
42 Handle(Standard_Transient) StdDrivers::Factory(const Standard_GUID& aGUID) {
44 if(aGUID == StdSchemaID) {
46 cout << "StdSchema : Plugin" << endl;
48 static Handle(StdLSchema) model_ss = new StdLSchema;
49 static Standard_Boolean aNeedNested = Standard_True;
51 aNeedNested = Standard_False;
53 cout << "StdSchema: Adding nested schema" << endl;
55 Handle(StdSchema) aSchema = new StdSchema;
56 Handle(ShapeSchema) aSSchema = new ShapeSchema;
57 Handle(Storage_HArrayOfSchema) aSchemas = new Storage_HArrayOfSchema(0,1);
58 aSchemas->SetValue(0, aSSchema);
59 aSchemas->SetValue(1, aSchema);
60 model_ss->SetNestedSchemas(aSchemas);
65 if(aGUID == StdStorageDriver) {
67 cout << "StdDrivers : Storage Plugin" << endl;
69 static Handle(StdDrivers_DocumentStorageDriver) model_sd = new StdDrivers_DocumentStorageDriver;
72 if(aGUID == StdRetrievalDriver) {
74 cout << "StdDrivers : Retrieval Plugin" << endl;
76 static Handle(StdDrivers_DocumentRetrievalDriver) model_rd = new StdDrivers_DocumentRetrievalDriver;
80 Standard_Failure::Raise ("StdDrivers : unknown GUID");
81 Handle(Standard_Transient) t;
85 // Declare entry point PLUGINFACTORY