00001 #ifndef _ots_ARTDAQDataLoggerSupervisor_h
00002 #define _ots_ARTDAQDataLoggerSupervisor_h
00003
00004 #include "otsdaq-core/WorkLoopManager/WorkLoopManager.h"
00005 #include "otsdaq-core/FiniteStateMachine/RunControlStateMachine.h"
00006 #include "otsdaq-core/SupervisorInfo/AllSupervisorInfo.h"
00007 #include "otsdaq-core/SOAPUtilities/SOAPMessenger.h"
00008
00009 #include "artdaq/Application/DataLoggerApp.hh"
00010
00011 #pragma GCC diagnostic push
00012 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
00013 #include <xdaq/Application.h>
00014 #pragma GCC diagnostic pop
00015 #include <xgi/Method.h>
00016
00017 #include <string>
00018 #include <map>
00019
00020 #include <memory>
00021
00022 namespace ots
00023 {
00024
00025 class ConfigurationManager;
00026 class ConfigurationGroupKey;
00027
00028 class DataLoggerApp: public xdaq::Application, public SOAPMessenger, public RunControlStateMachine
00029 {
00030
00031 public:
00032
00033 XDAQ_INSTANTIATOR();
00034
00035 DataLoggerApp (xdaq::ApplicationStub * s) throw (xdaq::exception::Exception);
00036 virtual ~DataLoggerApp (void);
00037 void init (void);
00038 void destroy (void);
00039 void Default (xgi::Input* in, xgi::Output* out) throw (xgi::exception::Exception);
00040
00041
00042
00043 void stateMachineXgiHandler (xgi::Input* in, xgi::Output* out ) throw (xgi::exception::Exception);
00044 void stateMachineResultXgiHandler (xgi::Input* in, xgi::Output* out ) throw (xgi::exception::Exception);
00045 xoap::MessageReference stateMachineXoapHandler (xoap::MessageReference message ) throw (xoap::exception::Exception);
00046 xoap::MessageReference stateMachineResultXoapHandler (xoap::MessageReference message ) throw (xoap::exception::Exception);
00047 bool stateMachineThread (toolbox::task::WorkLoop* workLoop);
00048
00049 xoap::MessageReference stateMachineStateRequest (xoap::MessageReference message ) throw (xoap::exception::Exception);
00050 xoap::MessageReference stateMachineErrorMessageRequest (xoap::MessageReference message ) throw (xoap::exception::Exception);
00051
00052 void stateInitial (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception);
00053 void statePaused (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception);
00054 void stateRunning (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception);
00055 void stateHalted (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception);
00056 void stateConfigured (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception);
00057 void inError (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception);
00058
00059 void transitionConfiguring (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception);
00060 void transitionHalting (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception);
00061 void transitionInitializing(toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception);
00062 void transitionPausing (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception);
00063 void transitionResuming (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception);
00064 void transitionStarting (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception);
00065 void transitionStopping (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception);
00066 void enteringError (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception);
00067
00068 private:
00069 WorkLoopManager stateMachineWorkLoopManager_;
00070 toolbox::BSem stateMachineSemaphore_;
00071
00072 AllSupervisorInfo allSupervisorInfo_;
00073 ConfigurationManager* theConfigurationManager_;
00074 std::string XDAQContextConfigurationName_;
00075 std::string supervisorConfigurationPath_;
00076 std::string supervisorContextUID_;
00077 std::string supervisorApplicationUID_;
00078
00079 artdaq::DataLoggerApp* theDataLoggerInterface_;
00080
00081 };
00082
00083 }
00084
00085 #endif