X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_PluginManager.h;h=6b25bf4a378dfc68758dc6f500b33ee692219054;hb=4e60e46af3ebb4d1d8e1709e7806ed134edd4be7;hp=34e5cca94d86107731235dd0cc50172140ca623d;hpb=24fd5aa4e000a03e484c5d4c544e5e08b08a747f;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_PluginManager.h b/src/ModelAPI/ModelAPI_PluginManager.h index 34e5cca94..6b25bf4a3 100644 --- a/src/ModelAPI/ModelAPI_PluginManager.h +++ b/src/ModelAPI/ModelAPI_PluginManager.h @@ -7,7 +7,7 @@ #include "ModelAPI.h" #include -#include +#include class ModelAPI_Feature; class ModelAPI_Plugin; @@ -23,11 +23,8 @@ class ModelAPI_Document; class MODELAPI_EXPORT ModelAPI_PluginManager { public: - /// Creates the feature object using plugins functionality - virtual std::shared_ptr createFeature(std::string theFeatureID) = 0; - /// Returns the real implementation (the alone instance per application) of the plugin manager - static std::shared_ptr get(); + static boost::shared_ptr get(); /// Registers the plugin that creates features. /// It is obligatory for each plugin to call this function on loading to be found by @@ -35,22 +32,37 @@ public: virtual void registerPlugin(ModelAPI_Plugin* thePlugin) = 0; /// Returns the root document of the application (that may contains sub-documents) - virtual std::shared_ptr rootDocument() = 0; + virtual boost::shared_ptr rootDocument() = 0; + + /// Return true if root document has been already created + virtual bool hasRootDocument() = 0; /// Returns the current document that used for current work in the application - virtual std::shared_ptr currentDocument() = 0; + virtual boost::shared_ptr currentDocument() = 0; /// Defines the current document that used for current work in the application - virtual void setCurrentDocument(std::shared_ptr theDoc) = 0; + virtual void setCurrentDocument(boost::shared_ptr theDoc) = 0; - /// loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform - static void ModelAPI_PluginManager::loadLibrary(const std::string theLibName); + /// Copies the document to the new one wit hthe given id + virtual boost::shared_ptr copy( + boost::shared_ptr theSource, std::string theID) = 0; /// Is needed for python wrapping by swig, call Get to get an instance ModelAPI_PluginManager(); + /// To virtually destroy the fields of successors + virtual ~ModelAPI_PluginManager() {} + protected: - static void SetPluginManager(std::shared_ptr theManager); + /// Creates the feature object using plugins functionality + virtual boost::shared_ptr createFeature(std::string theFeatureID) = 0; + + static void SetPluginManager(boost::shared_ptr theManager); + + friend class Model_Document; }; +typedef boost::shared_ptr PluginManagerPtr; + + #endif