00001 #ifndef _ots_RunControlStateMachine_h_
00002 #define _ots_RunControlStateMachine_h_
00003
00004 #include "otsdaq-core/FiniteStateMachine/FiniteStateMachine.h"
00005 #include "otsdaq-core/ProgressBar/ProgressBar.h"
00006
00007 #include "toolbox/lang/Class.h"
00008 #include <string>
00009
00010
00011 namespace ots
00012 {
00013
00014 class RunControlStateMachine : public virtual toolbox::lang::Class
00015 {
00016
00017 public:
00018
00019 RunControlStateMachine(std::string name="Undefined Name");
00020 virtual ~RunControlStateMachine(void);
00021
00022 void reset(void);
00023 void setStateMachineName(std::string name){stateMachineName_ = name;}
00024
00025
00026
00027 virtual void stateInitial (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00028
00029
00030
00031
00032
00033
00034 virtual void statePaused (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00035
00036
00037
00038
00039
00040
00041 virtual void stateRunning (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00042
00043
00044
00045
00046
00047 virtual void stateHalted (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00048
00049
00050 virtual void stateShutdown (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00051
00052
00053
00054
00055
00056
00057 virtual void stateConfigured (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00058
00059 virtual void inError (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00060
00061 virtual void transitionConfiguring (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00062 virtual void transitionHalting (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00063 virtual void transitionShuttingDown(toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00064 virtual void transitionStartingUp (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00065 virtual void transitionInitializing(toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00066 virtual void transitionPausing (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00067 virtual void transitionResuming (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00068 virtual void transitionStarting (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00069 virtual void transitionStopping (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00070 virtual void enteringError (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00071
00072
00073 xoap::MessageReference runControlMessageHandler(xoap::MessageReference message) throw (xoap::exception::Exception);
00074
00075 static const std::string FAILED_STATE_NAME;
00076
00077 protected:
00078 FiniteStateMachine theStateMachine_;
00079 ProgressBar theProgressBar_;
00080 std::string stateMachineName_;
00081
00082 };
00083
00084 }
00085
00086 #endif
00087