]> SALOME platform Git repositories - modules/shaper.git/blob - src/Model/Model_PluginManager.cxx
Salome HOME
Auto-formatting according to the defined code standard.
[modules/shaper.git] / src / Model / Model_PluginManager.cxx
1 // File:        Model_PluginManager.cxx
2 // Created:     20 Mar 2014
3 // Author:      Mikhail PONIKAROV
4
5 #include <Model_PluginManager.hxx>
6 #include <ModelAPI_Feature.hxx>
7 #include <Model_Feature.hxx>
8 #include <Event_Loop.hxx>
9 #include <Config_FeatureMessage.h>
10
11 using namespace std;
12
13 boost::shared_ptr<ModelAPI_Feature> Model_PluginManager::CreateFeature(string theFeatureID)
14 {
15   return boost::shared_ptr<ModelAPI_Feature>(new Model_Feature());
16 }
17
18 Model_PluginManager::Model_PluginManager()
19 {
20   static Event_ID aFeatureEvent = Event_Loop::EventByName("Feature");
21
22   static Model_PluginManager* myImpl = new Model_PluginManager();
23   ModelAPI_PluginManager::SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager>(myImpl));
24   // register the configuration reading listener
25   Event_Loop* aLoop = Event_Loop::Loop();
26   aLoop->RegisterListener(myImpl, aFeatureEvent);
27 }
28
29 void Model_PluginManager::ProcessEvent(const Event_Message* theMessage)
30 {
31   const Config_FeatureMessage* aMsg = dynamic_cast<const Config_FeatureMessage*>(theMessage);
32   if (aMsg) {
33     // proccess the plugin info, load plugin
34   }
35 }