$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include "otsdaq-core/Configurable/Configurable.h" 00002 00003 #include "otsdaq-core/TablePluginDataFormats/XDAQContextTable.h" 00004 00005 using namespace ots; 00006 00007 //============================================================================== 00008 Configurable::Configurable(const ConfigurationTree& theXDAQContextConfigTree, 00009 const std::string& theConfigurationPath) 00010 : theXDAQContextConfigTree_(theXDAQContextConfigTree) 00011 , theConfigurationPath_(theConfigurationPath) 00012 , theConfigurationRecordName_( 00013 theXDAQContextConfigTree_.getNode(theConfigurationPath_).getValueAsString()) 00014 , selfNode_(theXDAQContextConfigTree_.getNode(theConfigurationPath_)) 00015 { 00016 __CFG_COUT__ << " Configurable class constructed. " << __E__; 00017 } 00018 00019 //============================================================================== 00020 Configurable::~Configurable(void) {} 00021 00022 //============================================================================== 00023 const ConfigurationTree& Configurable::getSelfNode() const 00024 { 00025 return selfNode_; // theXDAQContextConfigTree_.getNode(theConfigurationPath_); 00026 } 00027 00028 //============================================================================== 00029 const ConfigurationManager* Configurable::getConfigurationManager() const 00030 { 00031 return theXDAQContextConfigTree_.getConfigurationManager(); 00032 } 00033 00034 //============================================================================== 00035 const std::string& Configurable::getContextUID() const 00036 { 00037 return theXDAQContextConfigTree_ 00038 .getForwardNode(theConfigurationPath_, 1 /*steps to xdaq node*/) 00039 .getValueAsString(); 00040 } 00041 00042 //============================================================================== 00043 const std::string& Configurable::getApplicationUID() const 00044 { 00045 return theXDAQContextConfigTree_ 00046 .getForwardNode(theConfigurationPath_, 3 /*steps to app node*/) 00047 .getValueAsString(); 00048 } 00049 00050 //============================================================================== 00051 unsigned int Configurable::getApplicationLID() const 00052 { 00053 const XDAQContextTable* contextConfig = 00054 getConfigurationManager()->__GET_CONFIG__(XDAQContextTable); 00055 00056 return contextConfig 00057 ->getApplicationNode( 00058 getConfigurationManager(), getContextUID(), getApplicationUID()) 00059 .getNode(contextConfig->colApplication_.colId_) 00060 .getValue<unsigned int>(); 00061 } 00062 00063 //============================================================================== 00064 std::string Configurable::getContextAddress() const 00065 { 00066 const XDAQContextTable* contextConfig = 00067 getConfigurationManager()->__GET_CONFIG__(XDAQContextTable); 00068 00069 return contextConfig->getContextNode(getConfigurationManager(), getContextUID()) 00070 .getNode(contextConfig->colContext_.colAddress_) 00071 .getValue<std::string>(); 00072 } 00073 00074 //============================================================================== 00075 unsigned int Configurable::getContextPort() const 00076 { 00077 const XDAQContextTable* contextConfig = 00078 getConfigurationManager()->__GET_CONFIG__(XDAQContextTable); 00079 00080 return contextConfig->getContextNode(getConfigurationManager(), getContextUID()) 00081 .getNode(contextConfig->colContext_.colPort_) 00082 .getValue<unsigned int>(); 00083 }