]> SALOME platform Git repositories - modules/shaper.git/blob - src/Config/Config_ModuleReader.h
Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom.git into Dev_0.6.1
[modules/shaper.git] / src / Config / Config_ModuleReader.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * Config_XMLModuleReader.h
5  *
6  *  Created on: Mar 20, 2014
7  *      Author: sbh
8  */
9
10 #ifndef CONFIG_MODULEREADER_H_
11 #define CONFIG_MODULEREADER_H_
12
13 #include <Config_def.h>
14 #include <Config_XMLReader.h>
15
16 #include <map>
17 #include <list>
18 #include <string>
19
20 class Config_ModuleReader : public Config_XMLReader
21 {
22   enum PluginType {
23     Binary = 0,
24     Intrenal = 1,
25     Python = 2
26   };
27
28  public:
29   CONFIG_EXPORT Config_ModuleReader(const char* theEventGenerated = 0);
30   CONFIG_EXPORT virtual ~Config_ModuleReader();
31
32   CONFIG_EXPORT const std::map<std::string, std::string>& featuresInFiles() const;
33
34   CONFIG_EXPORT std::string getModuleName();
35
36   CONFIG_EXPORT static void loadPlugin(const std::string thePluginName);
37   /// loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform
38   CONFIG_EXPORT static void loadLibrary(const std::string theLibName);
39   /// loads the python module with specified name
40   CONFIG_EXPORT static void loadScript(const std::string theFileName);
41
42  protected:
43   void processNode(xmlNodePtr aNode);
44   bool processChildren(xmlNodePtr aNode);
45
46   std::list<std::string> importPlugin(const std::string& thePluginLibrary,
47                                       const std::string& thePluginFile);
48   std::string addPlugin(const std::string& aPluginLibrary,
49                         const std::string& aPluginScript,
50                         const std::string& aPluginConf);
51
52  private:
53   std::map<std::string, std::string> myFeaturesInFiles;
54   static std::map<std::string, PluginType> myPluginTypes;
55   const char* myEventGenerated;
56
57 };
58
59 #endif /* CONFIG_XMLMODULEREADER_H_ */