Salome HOME
44dbef3b5230380426ee94e402fea24f28753050
[modules/shaper.git] / src / Model / Model_PluginManager.h
1 // File:        Model_PluginManager.hxx
2 // Created:     20 Mar 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Model_PluginManager_HeaderFile
6 #define Model_PluginManager_HeaderFile
7
8 #include "Model.h"
9 #include <ModelAPI_PluginManager.h>
10 #include <Event_Listener.h>
11 #include <map>
12
13 /**\class Model_PluginManager
14  * \ingroup DataModel
15  * \brief Object that knows (from the initial XML file) which
16  * plugin contains which feature, loads and stores reference to loaded plugins by
17  * the feature functionality request.
18  */
19
20 class Model_PluginManager : public ModelAPI_PluginManager, public Event_Listener
21 {
22   bool myPluginsInfoLoaded; ///< it true if plugins information is loaded
23   std::map<std::string, std::string> myPlugins; ///< map of feature IDs to plugin name
24 public:
25   /// Creates the feature object using plugins functionality
26   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> CreateFeature(std::string theFeatureID);
27
28   /// Processes the configuration file reading
29   MODEL_EXPORT virtual void ProcessEvent(const Event_Message* theMessage);
30
31   /// Is called only once, on startup of the application
32   Model_PluginManager();
33
34 private:
35   /// Loads (if not done yet) the information about the features and plugins
36   void LoadPluginsInfo();
37 };
38
39 #endif