Salome HOME
Boost has been removed from code
[modules/shaper.git] / src / Config / Config_FeatureReader.h
1 /*
2  * Config_FeatureReader.h
3  *
4  *  Created on: Mar 20, 2014
5  *      Author: sbh
6  */
7
8 #ifndef CONFIG_FEATUREREADER_H_
9 #define CONFIG_FEATUREREADER_H_
10
11 #include <Config_def.h>
12 #include <Config_XMLReader.h>
13 #include <memory>
14
15 #include <string>
16 #include <list>
17 #include <map>
18
19 class Config_FeatureMessage;
20
21 class Config_FeatureReader : public Config_XMLReader
22 {
23  public:
24   Config_FeatureReader(const std::string& theXmlFile, const std::string& theLibraryName,
25                        const char* theEventGenerated = 0);
26   virtual ~Config_FeatureReader();
27
28   std::list<std::string> features() const;
29
30  protected:
31   void processNode(xmlNodePtr aNode);
32   bool processChildren(xmlNodePtr aNode);
33
34   void fillFeature(xmlNodePtr theRoot, 
35                    const std::shared_ptr<Config_FeatureMessage>& outFeatureMessage);
36
37   void storeAttribute(xmlNodePtr theNode, const char* theNodeAttribute);
38   std::string restoreAttribute(xmlNodePtr theNode, const char* theNodeAttribute);
39   std::string restoreAttribute(const char* theNodeName, const char* theNodeAttribute);
40
41  private:
42   /// A map to store all parent's attributes.
43   /// The key has from "Node_Name:Node_Attribute"
44   std::map<std::string, std::string> myParentAttributes;
45   std::string myLibraryName;
46
47   std::list<std::string> myFeatures;
48   /// event generated on feature data sending, by default it is Config_FeatureMessage::GUI_EVENT()
49   const char* myEventGenerated;
50   bool myIsProcessWidgets;
51 };
52
53 #endif /* CONFIG_FEATUREREADER_H_ */