1 // Created on: 2000-09-07
2 // Created by: TURIN Anatoliy
3 // Copyright (c) 2000-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
8 // under the terms of the GNU Lesser General Public 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.
16 #include <StdDrivers.ixx>
17 #include <StdDrivers_DocumentStorageDriver.hxx>
18 #include <StdDrivers_DocumentRetrievalDriver.hxx>
19 #include <StdSchema.hxx>
20 #include <StdLSchema.hxx>
21 #include <ShapeSchema.hxx>
22 #include <Storage_HArrayOfSchema.hxx>
24 #include <Standard_Failure.hxx>
25 #include <Standard_GUID.hxx>
26 #include <Plugin_Macro.hxx>
28 static Standard_GUID StdStorageDriver ("ad696000-5b34-11d1-b5ba-00a0c9064368");
29 static Standard_GUID StdRetrievalDriver ("ad696001-5b34-11d1-b5ba-00a0c9064368");
30 static Standard_GUID StdSchemaID ("ad696002-5b34-11d1-b5ba-00a0c9064368");
32 Handle(Standard_Transient) StdDrivers::Factory(const Standard_GUID& aGUID) {
34 if(aGUID == StdSchemaID) {
36 cout << "StdSchema : Plugin" << endl;
38 static Handle(StdLSchema) model_ss = new StdLSchema;
39 static Standard_Boolean aNeedNested = Standard_True;
41 aNeedNested = Standard_False;
43 cout << "StdSchema: Adding nested schema" << endl;
45 Handle(StdSchema) aSchema = new StdSchema;
46 Handle(ShapeSchema) aSSchema = new ShapeSchema;
47 Handle(Storage_HArrayOfSchema) aSchemas = new Storage_HArrayOfSchema(0,1);
48 aSchemas->SetValue(0, aSSchema);
49 aSchemas->SetValue(1, aSchema);
50 model_ss->SetNestedSchemas(aSchemas);
55 if(aGUID == StdStorageDriver) {
57 cout << "StdDrivers : Storage Plugin" << endl;
59 static Handle(StdDrivers_DocumentStorageDriver) model_sd = new StdDrivers_DocumentStorageDriver;
62 if(aGUID == StdRetrievalDriver) {
64 cout << "StdDrivers : Retrieval Plugin" << endl;
66 static Handle(StdDrivers_DocumentRetrievalDriver) model_rd = new StdDrivers_DocumentRetrievalDriver;
70 Standard_Failure::Raise ("StdDrivers : unknown GUID");
71 Handle(Standard_Transient) t;
76 #pragma warning(disable:4190) /* disable warning on C++ type returned by C function; should be OK for C++ usage */
79 // Declare entry point PLUGINFACTORY