X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_FeatureReader.h;h=75eb376e5cdd88ba8a6249a863e522e7ec1c3163;hb=0b503091623876eda1ae9214e32f8831ef03778b;hp=3f5d7f7054d0ee5e1e187a8d2228a6aa781eee1b;hpb=acebef0bc5fb22dc9672e0046085b896e957af56;p=modules%2Fshaper.git diff --git a/src/Config/Config_FeatureReader.h b/src/Config/Config_FeatureReader.h index 3f5d7f705..75eb376e5 100644 --- a/src/Config/Config_FeatureReader.h +++ b/src/Config/Config_FeatureReader.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + /* * Config_FeatureReader.h * @@ -10,7 +12,7 @@ #include #include -#include +#include #include #include @@ -18,26 +20,47 @@ class Config_FeatureMessage; +/*! + * \class Config_FeatureReader + * \ingroup Config + * \brief Class to process feature's xml definition. + */ class Config_FeatureReader : public Config_XMLReader { public: - Config_FeatureReader(const std::string& theXmlFile, const std::string& theLibraryName, + /// Constructor + Config_FeatureReader(const std::string& theXmlFile, + const std::string& theLibraryName, const char* theEventGenerated = 0); virtual ~Config_FeatureReader(); - + /// Returns list of all features defined in reader's file std::list features() const; protected: - void processNode(xmlNodePtr aNode); - bool processChildren(xmlNodePtr aNode); + /// Overloaded method. Defines how to process each node + virtual void processNode(xmlNodePtr aNode); + /// Overloaded method. Clears attribute cache on extit from attribute's node + virtual void cleanup(xmlNodePtr aNode); + + /// Overloaded method. Defines if the given node should be parsed recursively + virtual bool processChildren(xmlNodePtr aNode); + + /// Fills feature message void fillFeature(xmlNodePtr theRoot, - const boost::shared_ptr& outFeatureMessage); + const std::shared_ptr& outFeatureMessage); + /// Stores an attribute in internal map for later use. + /// Key is "Node_Name:Node_Attribute" and value is getProperty(theNodeAttribute) void storeAttribute(xmlNodePtr theNode, const char* theNodeAttribute); + /// Restores an attribute from internal map. std::string restoreAttribute(xmlNodePtr theNode, const char* theNodeAttribute); + /// Restores an attribute from internal map. std::string restoreAttribute(const char* theNodeName, const char* theNodeAttribute); + bool cleanupAttribute(xmlNodePtr theNode, const char* theNodeAttribute); + bool cleanupAttribute(const char* theNodeName, const char* theNodeAttribute); + private: /// A map to store all parent's attributes. /// The key has from "Node_Name:Node_Attribute"