otsdaq  v1_01_03
 All Classes Namespaces Functions
TemplateConfiguration_configuration.cc
1 #include "otsdaq-core/ConfigurationPluginDataFormats/TemplateConfiguration.h"
2 #include "otsdaq-core/Macros/ConfigurationPluginMacros.h"
3 
4 #include <iostream>
5 #include <string>
6 
7 using namespace ots;
8 
9 //==============================================================================
10 TemplateConfiguration::TemplateConfiguration(void)
11 : ConfigurationBase("TemplateConfiguration")
12 {
13  //TemplateConfigurationInfo.xml
14  //<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
15  //<ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ConfigurationInfo.xsd">
16  // <CONFIGURATION Name="TemplateConfiguration">
17  // <VIEW Name="TEMPLATE_CONFIGURATION" Type="File,Database,DatabaseTest">
18  // <COLUMN Name="ColumnName" StorageName="COLUMN_NAME" DataType="VARCHAR2"/>
19  // </VIEW>
20  // </CONFIGURATION>
21  //</ROOT>
22 
23 }
24 
25 //==============================================================================
26 TemplateConfiguration::~TemplateConfiguration(void)
27 {
28 }
29 
30 //==============================================================================
31 void TemplateConfiguration::init(ConfigurationManager *configManager)
32 {
33  //do something to validate or refactor table
34  __MOUT__ << "*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*" << std::endl;
35  __MOUT__ << configManager->__SELF_NODE__ << std::endl;
36 
37  // __MOUT__ << configManager->getNode(this->getConfigurationName()).getValueAsString()
38  // << std::endl;
39 
40  std::string value;
41  auto childrenMap = configManager->__SELF_NODE__.getChildren();
42  for(auto &childPair: childrenMap)
43  {
44  //do something for each row in table
45  __MOUT__ << childPair.first << std::endl;
46  // __MOUT__ << childPair.second.getNode(colNames_.colColumnName_) << std::endl;
47  childPair.second.getNode(colNames_.colColumnName_ ).getValue(value);
48  }
49 }
50 
51 DEFINE_OTS_CONFIGURATION(TemplateConfiguration)