1 #include "otsdaq/Configurable/Configurable.h"
3 #include "otsdaq/TablePlugins/XDAQContextTable.h"
8 Configurable::Configurable(
const ConfigurationTree& theXDAQContextConfigTree,
const std::string& theConfigurationPath)
9 : theXDAQContextConfigTree_(theXDAQContextConfigTree)
10 , theConfigurationPath_(theConfigurationPath)
11 , theConfigurationRecordName_(
12 (theXDAQContextConfigTree_.getNode(theConfigurationPath_).isLinkNode() && theXDAQContextConfigTree_.getNode(theConfigurationPath_).isDisconnected())
13 ? theXDAQContextConfigTree_.getNode(theConfigurationPath_).getDisconnectedLinkID()
14 : theXDAQContextConfigTree_.getNode(theConfigurationPath_).getValueAsString())
16 __CFG_COUT__ <<
" Configurable class constructed. " << __E__;
20 Configurable::~Configurable(
void) {}
27 return theXDAQContextConfigTree_.getNode(theConfigurationPath_);
31 const ConfigurationManager* Configurable::getConfigurationManager()
const {
return theXDAQContextConfigTree_.getConfigurationManager(); }
34 const std::string& Configurable::getContextUID()
const
36 return theXDAQContextConfigTree_.getForwardNode(theConfigurationPath_, 1 ).getValueAsString();
40 const std::string& Configurable::getApplicationUID()
const
42 return theXDAQContextConfigTree_.getForwardNode(theConfigurationPath_, 3 ).getValueAsString();
46 unsigned int Configurable::getApplicationLID()
const
50 return contextConfig->getApplicationNode(getConfigurationManager(), getContextUID(), getApplicationUID())
51 .getNode(contextConfig->colApplication_.colId_)
52 .getValue<
unsigned int>();
56 std::string Configurable::getContextAddress()
const
60 return contextConfig->getContextNode(getConfigurationManager(), getContextUID()).getNode(contextConfig->colContext_.colAddress_).getValue<std::string>();
64 unsigned int Configurable::getContextPort()
const
68 return contextConfig->getContextNode(getConfigurationManager(), getContextUID()).getNode(contextConfig->colContext_.colPort_).getValue<
unsigned int>();