otsdaq  v2_00_00
AllSupervisorInfo.h
1 #ifndef _ots_AllSupervisorInfo_h
2 #define _ots_AllSupervisorInfo_h
3 
4 #include <map>
5 #include <vector>
6 
7 #include "otsdaq-core/SupervisorInfo/SupervisorInfo.h"
8 #include "otsdaq-core/SupervisorInfo/SupervisorDescriptorInfoBase.h"
9 
10 namespace ots
11 {
12 
14 typedef std::map<unsigned int, const SupervisorInfo&> SupervisorInfoMap;
15 
18 {
19 
20 public:
21  AllSupervisorInfo (void);
22  AllSupervisorInfo (xdaq::ApplicationContext* applicationContext);
23  ~AllSupervisorInfo (void);
24 
25  void init (xdaq::ApplicationContext* applicationContext);
26  void destroy (void);
27 
28  //BOOLs
29  bool isWizardMode (void) const { return theWizardInfo_?true:false; }
30 
31 
32  //SETTERs
33  void setSupervisorStatus (xdaq::Application* app, const std::string& status);
34  void setSupervisorStatus (const SupervisorInfo& appInfo, const std::string& status);
35  void setSupervisorStatus (const unsigned int& id, const std::string& status);
36 
37 
38  //GETTERs (so searching and iterating is easier)
39  const std::map<unsigned int, SupervisorInfo>& getAllSupervisorInfo (void) const { return allSupervisorInfo_; }
40  const SupervisorInfoMap& getAllFETypeSupervisorInfo (void) const { return allFETypeSupervisorInfo_; }
41  const SupervisorInfoMap& getAllDMTypeSupervisorInfo (void) const { return allDMTypeSupervisorInfo_; }
42  const SupervisorInfoMap& getAllLogbookTypeSupervisorInfo (void) const { return allLogbookTypeSupervisorInfo_; }
43 
44  const SupervisorInfo& getSupervisorInfo (xdaq::Application* app) const;
45  const SupervisorInfo& getGatewayInfo (void) const;
46  XDAQ_CONST_CALL xdaq::ApplicationDescriptor* getGatewayDescriptor (void) const;
47  const SupervisorInfo& getWizardInfo (void) const;
48  XDAQ_CONST_CALL xdaq::ApplicationDescriptor* getWizardDescriptor (void) const;
49 
50  std::vector<const SupervisorInfo*> getOrderedSupervisorDescriptors (const std::string& stateMachineCommand) const;
51 
52 private:
53 
54  SupervisorInfo* theSupervisorInfo_;
55  SupervisorInfo* theWizardInfo_;
56 
57 
58  std::map<unsigned int, SupervisorInfo> allSupervisorInfo_;
59  SupervisorInfoMap allFETypeSupervisorInfo_, allDMTypeSupervisorInfo_, allLogbookTypeSupervisorInfo_;
60 
61 
62 };
63 
64 }
65 
66 #endif