1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_Session.hxx
4 // Created: 20 Mar 2014
5 // Author: Mikhail PONIKAROV
7 #include <ModelAPI_Session.h>
8 // to avoid unresolved ModelAPI_Document()
9 #include <ModelAPI_Document.h>
10 // to avoid unresolved ModelAPI_Feature()
11 #include <ModelAPI_Feature.h>
12 #include <ModelAPI_Object.h>
13 // to avoid unresolved ModelAPI_Data()
14 #include <ModelAPI_Data.h>
15 // to avoid unresolved ModelAPI_Plugin()
16 #include <ModelAPI_Plugin.h>
17 #include <ModelAPI_Attribute.h>
18 #include <ModelAPI_AttributeDocRef.h>
19 #include <ModelAPI_AttributeDouble.h>
20 #include <ModelAPI_AttributeBoolean.h>
21 #include <ModelAPI_AttributeInteger.h>
22 #include <ModelAPI_AttributeString.h>
23 #include <ModelAPI_AttributeReference.h>
24 #include <ModelAPI_AttributeRefAttr.h>
25 #include <ModelAPI_AttributeRefList.h>
26 #include <ModelAPI_AttributeBoolean.h>
27 #include <ModelAPI_AttributeSelection.h>
28 #include <ModelAPI_AttributeSelectionList.h>
29 #include <ModelAPI_Events.h>
30 #include <ModelAPI_Validator.h>
32 #include <Config_ModuleReader.h>
46 /// Manager that will be initialized from Model package, one per application
47 std::shared_ptr<ModelAPI_Session> MY_MANAGER;
49 void ModelAPI_Session::setSession(std::shared_ptr<ModelAPI_Session> theManager)
51 MY_MANAGER = theManager;
54 std::shared_ptr<ModelAPI_Session> ModelAPI_Session::get()
56 if (!MY_MANAGER) { // import Model library that implements this interface of ModelAPI
57 Config_ModuleReader::loadLibrary("Model");
62 const ModelAPI_EventCreator* MY_API_CREATOR = 0; ///< instance of the events creator, one pre application
64 const ModelAPI_EventCreator* ModelAPI_EventCreator::get()
66 if (!MY_API_CREATOR) { // import Model library that implements this interface of ModelAPI
67 Config_ModuleReader::loadLibrary("Model");
69 return MY_API_CREATOR;
72 void ModelAPI_EventCreator::set(const ModelAPI_EventCreator* theCreator)
74 MY_API_CREATOR = theCreator;