![]() |
![]() |
00001 #ifndef DQMSERVICES_DQMBASECLIENT_H 00002 #define DQMSERVICES_DQMBASECLIENT_H 00003 00004 #include "DQMServices/XdaqCollector/interface/StateMachine.h" 00005 00006 #include "xdata/UnsignedLong.h" 00007 #include "xdata/String.h" 00008 #include "xdata/Vector.h" 00009 #include "xdata/Boolean.h" 00010 00011 00012 #include <string> 00013 00014 namespace dqm{ 00015 class Updater; 00016 } 00017 00018 class DQMOldReceiver; 00019 class DQMBaseClient : public dqm::StateMachine 00020 { 00021 00022 public: 00023 00024 DQMBaseClient(xdaq::ApplicationStub *s, 00025 std::string name = "DQMBaseClient", 00026 std::string server = "localhost", 00027 int port = 9090, 00028 int reconnect_delay_secs = 5, 00029 bool actAsServer = false); 00030 void fireConfiguration(std::string name, std::string server, int port); 00031 virtual ~DQMBaseClient(){finalize();} 00032 void Default(xgi::Input * in, xgi::Output * out ) throw (xgi::exception::Exception); 00033 virtual void general(xgi::Input * in, xgi::Output * out ) throw (xgi::exception::Exception); 00034 virtual void configure()=0; 00035 virtual void newRun()=0; 00036 virtual void endRun()=0; 00037 virtual void finalize(){}; 00038 00039 std::string getApplicationURL() 00040 { 00041 return applicationURL; 00042 } 00043 std::string getContextURL() 00044 { 00045 return contextURL; 00046 } 00047 00048 protected: 00049 00050 DQMOldReceiver *mui_; 00051 dqm::Updater *upd_; 00052 00053 private: 00054 00055 void configureAction(toolbox::Event::Reference e) 00056 throw (toolbox::fsm::exception::Exception); 00057 00058 void enableAction(toolbox::Event::Reference e) 00059 throw (toolbox::fsm::exception::Exception); 00060 00061 void suspendAction(toolbox::Event::Reference e) 00062 throw (toolbox::fsm::exception::Exception); 00063 00064 void resumeAction(toolbox::Event::Reference e) 00065 throw (toolbox::fsm::exception::Exception); 00066 00067 void haltAction(toolbox::Event::Reference e) 00068 throw (toolbox::fsm::exception::Exception); 00069 00070 void nullAction(toolbox::Event::Reference e) 00071 throw (toolbox::fsm::exception::Exception); 00072 00073 std::string contextURL; 00074 std::string applicationURL; 00075 00076 std::string name_; 00077 00078 xdata::String server_; 00079 00080 xdata::UnsignedLong port_; 00081 xdata::UnsignedLong reconnect_delay_secs_; 00082 00083 xdata::Boolean actAsServer_; 00084 00085 xdata::Vector<xdata::String> subs_; 00086 00087 }; 00088 #endif