]> SALOME platform Git repositories - modules/shaper.git/blob - src/Config/Config_FeatureReader.h
Salome HOME
Process validators on the first feature's creation using the Config_ValidatorReader
[modules/shaper.git] / src / Config / Config_FeatureReader.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * Config_FeatureReader.h
5  *
6  *  Created on: Mar 20, 2014
7  *      Author: sbh
8  */
9
10 #ifndef CONFIG_FEATUREREADER_H_
11 #define CONFIG_FEATUREREADER_H_
12
13 #include <Config_def.h>
14 #include <Config_XMLReader.h>
15 #include <memory>
16
17 #include <string>
18 #include <list>
19
20 class Config_FeatureMessage;
21
22 /*!
23  * \class Config_FeatureReader
24  * \ingroup Config
25  * \brief Class to process feature's xml definition.
26  */
27 class Config_FeatureReader : public Config_XMLReader
28 {
29  public:
30   /// Constructor
31   Config_FeatureReader(const std::string& theXmlFile,
32                        const std::string& theLibraryName,
33                        const char* theEventGenerated = 0);
34   virtual ~Config_FeatureReader();
35   /// Returns list of all features defined in reader's file
36   std::list<std::string> features() const;
37
38  protected:
39   /// Overloaded method. Defines how to process each node
40   virtual void processNode(xmlNodePtr aNode);
41   /// Overloaded method. Defines if the given node should be parsed recursively
42   virtual bool processChildren(xmlNodePtr aNode);
43
44   /// Fills feature message
45   void fillFeature(xmlNodePtr theRoot, 
46                    const std::shared_ptr<Config_FeatureMessage>& outFeatureMessage);
47
48  private:
49   std::string myLibraryName;
50
51   std::list<std::string> myFeatures;
52   /// event generated on feature data sending, by default it is Config_FeatureMessage::GUI_EVENT()
53   const char* myEventGenerated;
54   bool myIsProcessWidgets;
55 };
56
57 #endif /* CONFIG_FEATUREREADER_H_ */