otsdaq  v2_00_00
TemplateConfiguration_configuration.cc
1 #include "otsdaq-core/ConfigurationPluginDataFormats/TemplateConfiguration.h"
2 #include "otsdaq-core/Macros/ConfigurationPluginMacros.h"
3 #include "otsdaq-core/ConfigurationInterface/ConfigurationManager.h"
4 
5 #include <iostream>
6 #include <string>
7 
8 using namespace ots;
9 
10 //==============================================================================
11 TemplateConfiguration::TemplateConfiguration(void)
12 : ConfigurationBase("TemplateConfiguration")
13 {
15  //WARNING: the field names used in C++ MUST match the Configuration INFO //
17 }
18 
19 //==============================================================================
20 TemplateConfiguration::~TemplateConfiguration(void)
21 {
22 }
23 
24 //==============================================================================
25 void TemplateConfiguration::init(ConfigurationManager *configManager)
26 {
27  //do something to validate or refactor table
28  __COUT__ << "*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*" << std::endl;
29  __COUT__ << configManager->__SELF_NODE__ << std::endl;
30 
31  // __COUT__ << configManager->getNode(this->getConfigurationName()).getValueAsString()
32  // << std::endl;
33 
34  std::string value;
35  std::vector<std::pair<std::string,ConfigurationTree> > children =
36  configManager->__SELF_NODE__.getChildren();
37  for(auto &childPair: children)
38  {
39  //do something for each row in table
40  __COUT__ << childPair.first << std::endl;
41  __COUT__ << childPair.second.getNode(colNames_.colColumnName_) << std::endl;
42  childPair.second.getNode(colNames_.colColumnName_ ).getValue(value);
43  }
44 }
45 
46 DEFINE_OTS_CONFIGURATION(TemplateConfiguration)