/* * DataMiningNode.cc * * Created on: 23 août 2013 * Author: CS */ #include // Common module includes #include "OutputFormatTime.hh" // Parameters module includes #include "ServicesServer.hh" #include "Parameter.hh" #include "FileConfigurator.hh" #include "ParameterManager.hh" // XMLConfigurator module includes #include "Constant.hh" // DataMining module includes #include "Config.hh" #include "ParamNode.hh" #include "DataMiningNode.hh" #include "ParamOutputDataMining.hh" #include "DataMiningType.hh" #include "PostProcessingNode.hh" using namespace AMDA::Parameters; using namespace AMDA::XMLConfigurator; namespace AMDA { namespace ParamOutputImpl { namespace DataMining { DataMiningNode::DataMiningNode(ParamOutputDataMining::PRIORITY pTaskPriority) : NodeGrpCfg(), _outputPriority(pTaskPriority) { /* */ // Assign a class node on each parameter of Data Mining output to retrieve value. getChildList()["timeFormat"] = NodeCfgSPtr(new TimeFormatNode()); getChildList()["fileFormat"] = NodeCfgSPtr(new FileFormatNode()); getChildList()["outputStructure"] = NodeCfgSPtr(new OutputStructureNode()); getChildList()["fileName"] = NodeCfgSPtr(new FileNameNode()); getChildList()["param"] = NodeCfgSPtr(new ParamNode()); getChildList()["postProcess"] = NodeCfgSPtr(new postprocessing::PostProcessingNode()); } void DataMiningNode::proceed(xmlNodePtr pNode, const AMDA::Parameters::CfgContext& pContext) { // Get manager of the new output parameter for this node ParameterManager* lParameterManager = pContext.get(); CfgContext lContext; // Create DataMining instance boost::shared_ptr lParamOutputDataMining(new ParamOutputDataMining(*lParameterManager)); // Set priority lParamOutputDataMining->setOutputPriority(_outputPriority); // Push data mining in the context lContext.push(lParamOutputDataMining.get()); // Go to next node NodeGrpCfg::proceed(pNode, lContext); // Set param output in parameter manager list to be executed lParameterManager->getParamOutputList().push_back(lParamOutputDataMining); // When Data Mining output is set in param tag, param id can be retrived automatically. // So it's not necessary to set param tag in Data Mining output to identify param id. if (_outputPriority == ParamOutputDataMining::PRIORITY::PARAM) { xmlChar* paramName = NULL; paramName = xmlGetProp(pNode->parent->parent, (const xmlChar *) "id"); lParamOutputDataMining->setParamName(reinterpret_cast(paramName)); xmlFree(paramName); } } } // namespace Download } // namespace ParamOutputImpl } // namespace AMDA