$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_AllSupervisorInfo_h 00002 #define _ots_AllSupervisorInfo_h 00003 00004 #include <map> 00005 #include <vector> 00006 00007 #include "otsdaq-core/SupervisorInfo/SupervisorDescriptorInfoBase.h" 00008 #include "otsdaq-core/SupervisorInfo/SupervisorInfo.h" 00009 00010 namespace ots 00011 { 00013 typedef std::map<unsigned int, const SupervisorInfo&> SupervisorInfoMap; 00014 00016 // AllSupervisorInfo 00017 // xdaq Supervisors can use this class to gain access to 00018 // info for all supervisors in the xdaq Context. Supervisors 00019 // are organized by type/class. Note that if a supervisor is 00020 // encountered in the xdaq context that is of unknown type, then 00021 // it is ignored and not organized. 00022 // 00023 // Supervisors should call init to setup data members of this class. 00024 // 00025 // This class, when in normal mode, also interprets the active configuration 00026 // to associate configuration UID/names to the supervisors in the xdaq context. 00027 // In wizard mode, UID/name is taken from class name. 00028 class AllSupervisorInfo : public SupervisorDescriptorInfoBase 00029 { 00030 public: 00031 AllSupervisorInfo(void); 00032 AllSupervisorInfo(xdaq::ApplicationContext* applicationContext); 00033 ~AllSupervisorInfo(void); 00034 00035 void init(xdaq::ApplicationContext* applicationContext); 00036 void destroy(void); 00037 00038 // BOOLs 00039 bool isWizardMode(void) const { return theWizardInfo_ ? true : false; } 00040 00041 // SETTERs 00042 void setSupervisorStatus(xdaq::Application* app, const std::string& status); 00043 void setSupervisorStatus(const SupervisorInfo& appInfo, const std::string& status); 00044 void setSupervisorStatus(const unsigned int& id, const std::string& status); 00045 00046 // GETTERs (so searching and iterating is easier) 00047 const std::map<unsigned int, SupervisorInfo>& getAllSupervisorInfo(void) const 00048 { 00049 return allSupervisorInfo_; 00050 } 00051 const SupervisorInfoMap& getAllFETypeSupervisorInfo(void) const 00052 { 00053 return allFETypeSupervisorInfo_; 00054 } 00055 const SupervisorInfoMap& getAllDMTypeSupervisorInfo(void) const 00056 { 00057 return allDMTypeSupervisorInfo_; 00058 } 00059 const SupervisorInfoMap& getAllLogbookTypeSupervisorInfo(void) const 00060 { 00061 return allLogbookTypeSupervisorInfo_; 00062 } 00063 const SupervisorInfoMap& getAllMacroMakerTypeSupervisorInfo(void) const 00064 { 00065 return allMacroMakerTypeSupervisorInfo_; 00066 } 00067 00068 const SupervisorInfo& getSupervisorInfo(xdaq::Application* app) const; 00069 const SupervisorInfo& getGatewayInfo(void) const; 00070 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* getGatewayDescriptor(void) const; 00071 const SupervisorInfo& getWizardInfo(void) const; 00072 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* getWizardDescriptor(void) const; 00073 00074 std::vector<std::vector<const SupervisorInfo*>> getOrderedSupervisorDescriptors( 00075 const std::string& stateMachineCommand) const; 00076 00077 private: 00078 SupervisorInfo* theSupervisorInfo_; 00079 SupervisorInfo* theWizardInfo_; 00080 00081 std::map<unsigned int, SupervisorInfo> allSupervisorInfo_; 00082 SupervisorInfoMap allFETypeSupervisorInfo_, allDMTypeSupervisorInfo_, 00083 allLogbookTypeSupervisorInfo_, allMacroMakerTypeSupervisorInfo_; 00084 }; 00085 00086 } // namespace ots 00087 00088 #endif