otsdaq  v2_00_00
ARTDAQAggregatorConfiguration_configuration.cc
1 #include "otsdaq-core/ConfigurationPluginDataFormats/ARTDAQAggregatorConfiguration.h"
2 #include "otsdaq-core/Macros/ConfigurationPluginMacros.h"
3 
4 #include <iostream>
5 
6 using namespace ots;
7 
8 //==============================================================================
9 ARTDAQAggregatorConfiguration::ARTDAQAggregatorConfiguration(void)
10 : ConfigurationBase("ARTDAQAggregatorConfiguration")
11 {
13  //WARNING: the names and the order MUST match the ones in the enum //
15  //FSSRDACsConfigurationInfo.xml
16  //<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
17  //<ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ConfigurationInfo.xsd">
18  // <CONFIGURATION Name="ARTDAQAggregatorConfiguration">
19  // <VIEW Name="ARTDAQ_AGGREGATOR_CONFIGURATION" Type="File,Database,DatabaseTest">
20  // <COLUMN Name="SupervisorInstance" StorageName="SUPERVISOR_INSTANCE" DataType="NUMBER" />
21  // <COLUMN Name="AggregatorID" StorageName="AGGREGATOR_ID" DataType="VARCHAR2"/>
22  // <COLUMN Name="Status" StorageName="STATUS" DataType="VARCHAR2"/>
23  // <COLUMN Name="ConfigurationString" StorageName="CONFIGURATION_STRING" DataType="VARCHAR2"/>
24  // </VIEW>
25  // </CONFIGURATION>
26  //</ROOT>
27 
28 }
29 
30 //==============================================================================
31 ARTDAQAggregatorConfiguration::~ARTDAQAggregatorConfiguration(void)
32 {}
33 
34 //==============================================================================
35 void ARTDAQAggregatorConfiguration::init(ConfigurationManager *configManager)
36 {
37 }
38 
39 //==============================================================================
40 std::string ARTDAQAggregatorConfiguration::getAggregatorID(unsigned int supervisorInstance) const
41 {
42  std::string tmpID;
43  ConfigurationBase::activeConfigurationView_->getValue(tmpID, ConfigurationBase::activeConfigurationView_->findRow(SupervisorInstance,supervisorInstance), AggregatorID);
44  return tmpID;
45 }
46 
47 //==============================================================================
48 bool ARTDAQAggregatorConfiguration::getStatus(unsigned int supervisorInstance) const
49 {
50  bool tmpStatus;
51  ConfigurationBase::activeConfigurationView_->getValue(tmpStatus, ConfigurationBase::activeConfigurationView_->findRow(SupervisorInstance,supervisorInstance), Status);
52  return tmpStatus;
53 }
54 
55 //==============================================================================
56 const std::string ARTDAQAggregatorConfiguration::getConfigurationString(unsigned int supervisorInstance) const
57 {
58  std::string tmpConfiguration;
59  ConfigurationBase::activeConfigurationView_->getValue(tmpConfiguration, ConfigurationBase::activeConfigurationView_->findRow(SupervisorInstance,supervisorInstance), ConfigurationString);
60  return tmpConfiguration;
61 }
62 
63 DEFINE_OTS_CONFIGURATION(ARTDAQAggregatorConfiguration)