otsdaq  v1_01_03
 All Classes Namespaces Functions
SupervisorsInfo.cc
1 #include "otsdaq-core/Supervisor/SupervisorsInfo.h"
2 #include "otsdaq-core/MessageFacility/MessageFacility.h"
3 #include "otsdaq-core/Macros/CoutHeaderMacros.h"
4 #include "otsdaq-core/SupervisorDescriptorInfo/SupervisorDescriptorInfoBase.h"
5 
6 #include <iostream>
7 
8 
9 using namespace ots;
10 
11 //========================================================================================================================
12 SupervisorsInfo::SupervisorsInfo(void)
13 {
14 }
15 
16 //========================================================================================================================
17 SupervisorsInfo::~SupervisorsInfo(void)
18 {
19 }
20 
21 //========================================================================================================================
22 void SupervisorsInfo::init(const SupervisorDescriptorInfoBase& supervisorDescriptorInfo)
23 {
24  SupervisorDescriptors::const_iterator it;
25  it = supervisorDescriptorInfo.getFEDescriptors().begin();
26  for(; it!=supervisorDescriptorInfo.getFEDescriptors().end(); it++)
27  theFESupervisorsInfo_[it->first] = SupervisorInfo();
28 
29 // it = supervisorsConfiguration.getARTDAQFEDescriptors().begin();
30 // for(; it!=supervisorsConfiguration.getARTDAQFEDescriptors().end(); it++)
31 // theARTDAQFESupervisorsInfo_[it->first] = SupervisorInfo();
32  for(auto it : supervisorDescriptorInfo.getARTDAQFEDataManagerDescriptors())
33  theARTDAQFEDataManagerSupervisorsInfo_[it.first] = SupervisorInfo();
34 
35  for(auto it : supervisorDescriptorInfo.getARTDAQDataManagerDescriptors())
36  theARTDAQDataManagerSupervisorsInfo_[it.first] = SupervisorInfo();
37 }
38 
39 //========================================================================================================================
40 SupervisorInfo& SupervisorsInfo::getSupervisorInfo(void)
41 {
42  return theSupervisorInfo_;
43 }
44 
45 //========================================================================================================================
46 SupervisorInfo& SupervisorsInfo::getFESupervisorInfo(xdata::UnsignedIntegerT instance)
47 {
48  if(theFESupervisorsInfo_.find(instance) == theFESupervisorsInfo_.end())
49  std::cout << __COUT_HDR_FL__ << "Couldn't find: " << instance << std::endl;
50  return theFESupervisorsInfo_.find(instance)->second;
51 }
52 
53 //========================================================================================================================
54 SupervisorInfo& SupervisorsInfo::getARTDAQFEDataManagerSupervisorInfo(xdata::UnsignedIntegerT instance)
55 {
56  if(theARTDAQFEDataManagerSupervisorsInfo_.find(instance) == theARTDAQFEDataManagerSupervisorsInfo_.end())
57  std::cout << __COUT_HDR_FL__ << "Couldn't find: " << instance << std::endl;
58  return theARTDAQFEDataManagerSupervisorsInfo_.find(instance)->second;
59 }
60 //========================================================================================================================
61 SupervisorInfo& SupervisorsInfo::getARTDAQDataManagerSupervisorInfo(xdata::UnsignedIntegerT instance)
62 {
63  if(theARTDAQDataManagerSupervisorsInfo_.find(instance) == theARTDAQDataManagerSupervisorsInfo_.end())
64  std::cout << __COUT_HDR_FL__ << "Couldn't find: " << instance << std::endl;
65  return theARTDAQDataManagerSupervisorsInfo_.find(instance)->second;
66 }
67 //========================================================================================================================
68 SupervisorInfo& SupervisorsInfo::getVisualSupervisorInfo(void)
69 {
70  return theVisualSupervisorInfo_;
71 }
72