X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_ModuleReader.h;h=75aa0f6364bf1a2120d51630bf8512a9c1f0227a;hb=5c13fa0e68725babdd09541b028c186896e27b4f;hp=f10762597e565c7113f3952839bcee978b9a9741;hpb=53a07caf91ac24e68ae9f0e3cfb1c4fb525e8aba;p=modules%2Fshaper.git diff --git a/src/Config/Config_ModuleReader.h b/src/Config/Config_ModuleReader.h index f10762597..75aa0f636 100644 --- a/src/Config/Config_ModuleReader.h +++ b/src/Config/Config_ModuleReader.h @@ -36,17 +36,22 @@ class Config_ModuleReader : public Config_XMLReader CONFIG_EXPORT Config_ModuleReader(const char* theEventGenerated = 0); /// Destructor CONFIG_EXPORT virtual ~Config_ModuleReader(); - /// Returns map that describes which file contains a feature (the feature is key, the file is value) + /// Returns map that describes which file contains a feature + /// (the feature is key, the file is value) CONFIG_EXPORT const std::map& featuresInFiles() const; + /// Returns list of module's xml files + CONFIG_EXPORT const std::set& modulePluginFiles() const; /// Returns module name: an xml attribute from the root of the plugins.xml: - /// e.g + /// e.g \code \endcode CONFIG_EXPORT std::string getModuleName(); /// Detects type of the given plugin and loads it using loadLibrary or loadScript. 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); /// loads the python module with specified name - CONFIG_EXPORT static void loadScript(const std::string& theFileName); + /// \param theFileName name of the script + /// \param theSendErr send error message in case of faile + CONFIG_EXPORT static void loadScript(const std::string& theFileName, bool theSendErr = true); /*! * Extends set of modules, used for dependency checking (if there is no * required module in the set, a plugin will not be loaded) @@ -67,10 +72,15 @@ class Config_ModuleReader : public Config_XMLReader std::string addPlugin(const std::string& aPluginLibrary, const std::string& aPluginScript, const std::string& aPluginConf); + /// Save feature in myFeaturesInFiles. + /// Generates an error if the feature name is already registered. + void addFeature(const std::string& theFeatureName, const std::string& thePluginConfig); private: std::map myFeaturesInFiles; ///< a feature name is key, a file is value - static std::map myPluginTypes; ///< a plugin name is key, a plugin type is value + std::set myPluginFiles; ///< a feature name is key, a file is value + /// a plugin name is key, a plugin type is value + static std::map myPluginTypes; static std::set myDependencyModules; ///< set of loaded modules const char* myEventGenerated; ///< gives ability to send Feature_Messages to various listeners };