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