/** * CfgNode.hh * * Created on: 17 oct. 2012 * Author: AKKA IS */ #ifndef CFGNODE_HH_ #define CFGNODE_HH_ #include #include #include // XML include #include #include #include #include "FileConfigurator.hh" namespace AMDA { namespace XMLConfigurator { /** * Class CfgNode * Description : Node configurator */ class NodeCfg { public: virtual ~NodeCfg() {} virtual void proceed(xmlNodePtr,const AMDA::Parameters::CfgContext& context) = 0; static int getIsValid(const xmlNodePtr, const char* xsdFile); }; typedef boost::shared_ptr NodeCfgSPtr; typedef std::map CfgChildList; class NodeGrpCfg : public NodeCfg { public: NodeGrpCfg() : NodeCfg() {} virtual ~NodeGrpCfg() { for (auto cfgChild : _cfgChildList) { cfgChild.second.reset(); } } CfgChildList& getChildList() { return _cfgChildList; } /** * Add a node parser. * @param xpath example "param/get/baseParam" * @param node A NodeCfgSPtr to parse baseParam XML node */ void addNodeParser( const char* xpath, NodeCfgSPtr node); void proceed(xmlNodePtr pNode, const AMDA::Parameters::CfgContext& pCtx); static void addNodeParser( CfgChildList* lChildList, const char* pXPath, NodeCfgSPtr pNode); protected: CfgChildList _cfgChildList; }; } /* namespace XMLParameterConfigurator */ } /* namespace AMDA */ #endif /* CFGNODE_HH_ */