1 #ifndef _ots_SupervisorInfo_h_
2 #define _ots_SupervisorInfo_h_
5 #include "otsdaq/Macros/CoutMacros.h"
6 #include "otsdaq/TablePlugins/XDAQContextTable.h"
8 #pragma GCC diagnostic push
9 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
10 #pragma GCC diagnostic ignored "-Wunused-variable"
11 #pragma GCC diagnostic ignored "-Wunused-parameter"
13 #pragma GCC diagnostic ignored "-Wcatch-value"
15 #include "xdaq/Application.h"
16 #include "xdaq/ContextDescriptor.h"
17 #pragma GCC diagnostic pop
18 #include "otsdaq/Macros/XDAQApplicationMacros.h"
28 SupervisorInfo(XDAQ_CONST_CALL xdaq::ApplicationDescriptor* descriptor,
const std::string& name,
const std::string& contextName)
29 : descriptor_(descriptor)
30 , contextDescriptor_(descriptor ? descriptor->getContextDescriptor() : 0)
33 contextName_(contextName)
35 id_(descriptor ? descriptor->getLocalId() : 0)
36 , class_(descriptor ? descriptor->getClassName() :
"")
37 , contextURL_(contextDescriptor_ ? contextDescriptor_->getURL() :
"")
38 , URN_(descriptor ? descriptor->getURN() :
"")
39 , URL_(contextURL_ +
"/" + URN_)
41 , status_(SupervisorInfo::APP_STATUS_UNKNOWN)
47 if(contextName_ ==
"")
48 contextName_ = class_;
63 static const std::string APP_STATUS_UNKNOWN;
66 bool isGatewaySupervisor(
void)
const {
return class_ == XDAQContextTable::GATEWAY_SUPERVISOR_CLASS; }
67 bool isWizardSupervisor(
void)
const {
return class_ == XDAQContextTable::WIZARD_SUPERVISOR_CLASS; }
68 bool isTypeFESupervisor(
void)
const {
return XDAQContextTable::FETypeClassNames_.find(class_) != XDAQContextTable::FETypeClassNames_.end(); }
69 bool isTypeDMSupervisor(
void)
const {
return XDAQContextTable::DMTypeClassNames_.find(class_) != XDAQContextTable::DMTypeClassNames_.end(); }
70 bool isTypeLogbookSupervisor(
void)
const {
return XDAQContextTable::LogbookTypeClassNames_.find(class_) != XDAQContextTable::LogbookTypeClassNames_.end(); }
71 bool isTypeMacroMakerSupervisor(
void)
const {
return XDAQContextTable::MacroMakerTypeClassNames_.find(class_) != XDAQContextTable::MacroMakerTypeClassNames_.end(); }
72 bool isTypeConfigurationGUISupervisor(
void)
const {
return XDAQContextTable::ConfigurationGUITypeClassNames_.find(class_) != XDAQContextTable::ConfigurationGUITypeClassNames_.end(); }
73 bool isTypeChatSupervisor(
void)
const {
return XDAQContextTable::ChatTypeClassNames_.find(class_) != XDAQContextTable::ChatTypeClassNames_.end(); }
74 bool isTypeConsoleSupervisor(
void)
const {
return XDAQContextTable::ConsoleTypeClassNames_.find(class_) != XDAQContextTable::ConsoleTypeClassNames_.end(); }
77 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* getDescriptor (
void)
const {
return descriptor_; }
78 const xdaq::ContextDescriptor* getContextDescriptor (
void)
const {
return contextDescriptor_; }
79 const std::string& getName (
void)
const {
return name_; }
80 const std::string& getContextName (
void)
const {
return contextName_; }
81 const unsigned int& getId (
void)
const {
return id_; }
82 const std::string& getClass (
void)
const {
return class_; }
83 const std::string& getStatus (
void)
const {
return status_; }
84 time_t getLastStatusTime (
void)
const {
return lastStatusTime_; }
85 const unsigned int& getProgress (
void)
const {
return progress_; }
86 const std::string& getDetail (
void)
const {
return detail_; }
87 const std::string& getURL (
void)
const {
return contextURL_; }
88 const std::string& getURN (
void)
const {
return URN_; }
89 const std::string& getFullURL (
void)
const {
return URL_; }
90 const uint16_t& getPort (
void)
const {
return port_; }
93 void setStatus(
const std::string& status,
const unsigned int progress,
const std::string& detail =
"");
97 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* descriptor_;
98 XDAQ_CONST_CALL xdaq::ContextDescriptor* contextDescriptor_;
100 std::string contextName_;
103 std::string contextURL_;
108 unsigned int progress_;
110 time_t lastStatusTime_;