X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_ModuleReader.h;h=911e5d813c8afa10b11f37a859812378cccb5202;hb=60e95a5502a6940c6c27ce5d561b3c684b0b0a4f;hp=2281eb5cd33910e46bd16949e25b8b8b7afe6f7e;hpb=7ba8e2b57ff8965ae644b538c167b7b301e6e41b;p=modules%2Fshaper.git diff --git a/src/Config/Config_ModuleReader.h b/src/Config/Config_ModuleReader.h index 2281eb5cd..911e5d813 100644 --- a/src/Config/Config_ModuleReader.h +++ b/src/Config/Config_ModuleReader.h @@ -15,8 +15,13 @@ #include #include +#include #include +/*! + * \class Config_ModuleReader + * \brief Class to process plugins.xml - definition of plugins (scripts, libraries). + */ class Config_ModuleReader : public Config_XMLReader { enum PluginType { @@ -33,16 +38,20 @@ class Config_ModuleReader : public Config_XMLReader CONFIG_EXPORT std::string getModuleName(); - CONFIG_EXPORT static void loadPlugin(const std::string thePluginName); + CONFIG_EXPORT static void loadPlugin(const std::string& thePluginName); /// loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform - CONFIG_EXPORT static void loadLibrary(const std::string theLibName); + CONFIG_EXPORT static void loadLibrary(const std::string& theLibName); /// loads the python module with specified name - CONFIG_EXPORT static void loadScript(const std::string theFileName); + CONFIG_EXPORT static void loadScript(const std::string& theFileName); + // extends set of modules, which will be used for dependency + // checking (if there is no required module in the set, a plugin will not be loaded) + CONFIG_EXPORT static void addDependencyModule(const std::string& theModuleName); protected: void processNode(xmlNodePtr aNode); bool processChildren(xmlNodePtr aNode); + bool hasRequiredModules(xmlNodePtr aNode) const; std::list importPlugin(const std::string& thePluginLibrary, const std::string& thePluginFile); std::string addPlugin(const std::string& aPluginLibrary, @@ -52,8 +61,8 @@ class Config_ModuleReader : public Config_XMLReader private: std::map myFeaturesInFiles; static std::map myPluginTypes; + static std::set myDependencyModules; const char* myEventGenerated; - }; #endif /* CONFIG_XMLMODULEREADER_H_ */