1 // File: ModelAPI_PluginManager.hxx
2 // Created: 20 Mar 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef ModelAPI_PluginManager_HeaderFile
6 #define ModelAPI_PluginManager_HeaderFile
10 #include <boost/shared_ptr.hpp>
12 class ModelAPI_Feature;
13 class ModelAPI_Plugin;
14 class ModelAPI_Document;
16 /**\class ModelAPI_PluginManager
18 * \brief Object that knows (from the initial XML file) which
19 * plugin contains which feature, loads and stores reference to loaded plugins by
20 * the feature functionality request.
23 class MODELAPI_EXPORT ModelAPI_PluginManager
26 /// Creates the feature object using plugins functionality
27 virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID) = 0;
29 /// Returns the real implementation (the alone instance per application) of the plugin manager
30 static boost::shared_ptr<ModelAPI_PluginManager> get();
32 /// Registers the plugin that creates features.
33 /// It is obligatory for each plugin to call this function on loading to be found by
34 /// the plugin manager on call of the feature)
35 virtual void registerPlugin(ModelAPI_Plugin* thePlugin) = 0;
37 /// Returns the root document of the application (that may contains sub-documents)
38 virtual boost::shared_ptr<ModelAPI_Document> rootDocument() = 0;
40 /// loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform
41 static void ModelAPI_PluginManager::loadLibrary(const std::string theLibName);
43 /// Is needed for python wrapping by swig, call Get to get an instance
44 ModelAPI_PluginManager();
47 static void SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager> theManager);