1 #include "otsdaq/CoreSupervisors/FEDataManagerSupervisor.h"
3 #include "../ARTDAQDataManager/ARTDAQDataManager.h"
4 #include "otsdaq/ConfigurationInterface/ConfigurationManager.h"
5 #include "otsdaq/DataManager/DataManager.h"
6 #include "otsdaq/DataManager/DataManagerSingleton.h"
15 FEDataManagerSupervisor::FEDataManagerSupervisor(xdaq::ApplicationStub* s,
16 bool artdaqDataManager)
19 __SUP_COUT__ <<
"Constructor." << __E__;
28 __SUP_COUTV__(CoreSupervisorBase::theStateMachineImplementation_.size());
40 __SUP_COUT__ <<
"Adding ARTDAQ Data Manager now...!" << __E__;
41 CoreSupervisorBase::theStateMachineImplementation_.push_back(
42 DataManagerSingleton::getInstance<ARTDAQDataManager>(
43 CorePropertySupervisorBase::getContextTreeNode(),
44 CorePropertySupervisorBase::getSupervisorConfigurationPath(),
45 CorePropertySupervisorBase::getSupervisorUID()));
49 __SUP_COUT__ <<
"Adding Data Manager now...!" << __E__;
50 CoreSupervisorBase::theStateMachineImplementation_.push_back(
51 DataManagerSingleton::getInstance<DataManager>(
52 CorePropertySupervisorBase::getContextTreeNode(),
53 CorePropertySupervisorBase::getSupervisorConfigurationPath(),
54 CorePropertySupervisorBase::getSupervisorUID()));
59 __SUP_COUT__ <<
"Constructed." << __E__;
63 FEDataManagerSupervisor::~FEDataManagerSupervisor(
void)
65 __SUP_COUT__ <<
"Destroying..." << __E__;
72 theStateMachineImplementation_.pop_back();
74 __SUP_COUT__ <<
"Destructed." << __E__;
83 __SUP_COUT__ <<
"transitionConfiguring" << __E__;
90 if(theStateMachineImplementation_.size() != 2)
92 __SUP_SS__ <<
"State machine size is not 2! It is "
93 << theStateMachineImplementation_.size() <<
". What happened??"
99 theStateMachineImplementation_[0] = theStateMachineImplementation_[1];
100 theStateMachineImplementation_[1] = p;
102 CoreSupervisorBase::transitionConfiguring(e);
107 std::cout << ss.str() << __E__;
116 theStateMachineImplementation_[1] = theStateMachineImplementation_[0];
117 theStateMachineImplementation_[0] = p;
128 __SUP_COUT__ <<
"transitionStarting" << __E__;
133 if(theStateMachineImplementation_.size() != 2)
135 __SUP_SS__ <<
"State machine size is not 2! It is "
136 << theStateMachineImplementation_.size() <<
". What happened??"
141 theStateMachineImplementation_[0] = theStateMachineImplementation_[1];
142 theStateMachineImplementation_[1] = p;
144 CoreSupervisorBase::transitionStarting(e);
147 theStateMachineImplementation_[1] = theStateMachineImplementation_[0];
148 theStateMachineImplementation_[0] = p;
159 __SUP_COUT__ <<
"transitionStarting" << __E__;
164 if(theStateMachineImplementation_.size() != 2)
166 __SUP_SS__ <<
"State machine size is not 2! It is "
167 << theStateMachineImplementation_.size() <<
". What happened??"
172 theStateMachineImplementation_[0] = theStateMachineImplementation_[1];
173 theStateMachineImplementation_[1] = p;
175 CoreSupervisorBase::transitionResuming(e);
178 theStateMachineImplementation_[1] = theStateMachineImplementation_[0];
179 theStateMachineImplementation_[0] = p;
191 DataManager* FEDataManagerSupervisor::extractDataManager()
195 for(
unsigned int i = 0; i < theStateMachineImplementation_.size(); ++i)
200 dynamic_cast<DataManager*
>(theStateMachineImplementation_[i]);
204 throw(std::runtime_error(
""));
206 __SUP_COUT__ <<
"State Machine " << i <<
" WAS of type DataManager" << __E__;
212 __SUP_COUT__ <<
"State Machine " << i <<
" was NOT of type DataManager"
217 __SUP_COUT__ <<
"theDataManager pointer = " << theDataManager_ << __E__;
219 return theDataManager_;
bool parentSupervisorHasFrontends_
static void deleteInstance(std::string instanceUID)
There is no way I can realize that the singletonized class has been deleted!
virtual void transitionConfiguring(toolbox::Event::Reference e) override
virtual void transitionStarting(toolbox::Event::Reference e) override
virtual void transitionResuming(toolbox::Event::Reference e) override