1 #include "otsdaq/SupervisorInfo/SupervisorDescriptorInfoBase.h"
3 #include <xdaq/ContextDescriptor.h>
4 #include "otsdaq/MessageFacility/MessageFacility.h"
11 SupervisorDescriptorInfoBase::SupervisorDescriptorInfoBase(
void) {}
14 SupervisorDescriptorInfoBase::SupervisorDescriptorInfoBase(xdaq::ApplicationContext* applicationContext) { init(applicationContext); }
17 SupervisorDescriptorInfoBase::~SupervisorDescriptorInfoBase() {}
20 void SupervisorDescriptorInfoBase::destroy() { allSupervisors_.clear(); }
23 void SupervisorDescriptorInfoBase::init(xdaq::ApplicationContext* applicationContext)
25 if(applicationContext->getDefaultZone()->getApplicationGroup(
"daq") == 0)
27 __SS__ <<
"Could not find xdaq application group \"daq\" (Must not be present in "
28 "the xdaq context configuration)"
33 __COUT__ <<
"Init" << __E__;
59 std::set<XDAQ_CONST_CALL xdaq::ApplicationDescriptor*> appDescriptors;
64 allSupervisors_.clear();
65 appDescriptors = applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors();
66 for(
auto& it : appDescriptors)
69 allSupervisors_.emplace(std::pair<xdata::UnsignedIntegerT, XDAQ_CONST_CALL xdaq::ApplicationDescriptor*>(it->getLocalId(), it));
72 __SS__ <<
"Error! Duplicate Application IDs are not allowed. ID =" << it->getLocalId() << __E__;
79 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getAllDescriptors(
void)
const {
return allSupervisors_; }