00001 #ifndef _ots_AllSupervisorInfo_h
00002 #define _ots_AllSupervisorInfo_h
00003
00004 #include <map>
00005 #include <vector>
00006
00007 #include "otsdaq-core/SupervisorInfo/SupervisorInfo.h"
00008 #include "otsdaq-core/SupervisorInfo/SupervisorDescriptorInfoBase.h"
00009
00010 namespace ots
00011 {
00012
00014 typedef std::map<unsigned int, const SupervisorInfo&> SupervisorInfoMap;
00015
00017 class AllSupervisorInfo : public SupervisorDescriptorInfoBase
00018 {
00019
00020 public:
00021 AllSupervisorInfo (void);
00022 AllSupervisorInfo (xdaq::ApplicationContext* applicationContext);
00023 ~AllSupervisorInfo (void);
00024
00025 void init (xdaq::ApplicationContext* applicationContext);
00026 void destroy (void);
00027
00028
00029 bool isWizardMode (void) const { return theWizardInfo_?true:false; }
00030
00031
00032
00033 void setSupervisorStatus (xdaq::Application* app, const std::string& status);
00034 void setSupervisorStatus (const SupervisorInfo& appInfo, const std::string& status);
00035 void setSupervisorStatus (const unsigned int& id, const std::string& status);
00036
00037
00038
00039 const std::map<unsigned int, SupervisorInfo>& getAllSupervisorInfo (void) const { return allSupervisorInfo_; }
00040 const SupervisorInfoMap& getAllFETypeSupervisorInfo (void) const { return allFETypeSupervisorInfo_; }
00041 const SupervisorInfoMap& getAllDMTypeSupervisorInfo (void) const { return allDMTypeSupervisorInfo_; }
00042 const SupervisorInfoMap& getAllLogbookTypeSupervisorInfo (void) const { return allLogbookTypeSupervisorInfo_; }
00043
00044 const SupervisorInfo& getSupervisorInfo (xdaq::Application* app) const;
00045 const SupervisorInfo& getGatewayInfo (void) const;
00046 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* getGatewayDescriptor (void) const;
00047 const SupervisorInfo& getWizardInfo (void) const;
00048 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* getWizardDescriptor (void) const;
00049
00050 std::vector<const SupervisorInfo*> getOrderedSupervisorDescriptors (const std::string& stateMachineCommand) const;
00051
00052 private:
00053
00054 SupervisorInfo* theSupervisorInfo_;
00055 SupervisorInfo* theWizardInfo_;
00056
00057
00058 std::map<unsigned int, SupervisorInfo> allSupervisorInfo_;
00059 SupervisorInfoMap allFETypeSupervisorInfo_, allDMTypeSupervisorInfo_, allLogbookTypeSupervisorInfo_;
00060
00061
00062 };
00063
00064 }
00065
00066 #endif