$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_VStateMachine_h_ 00002 #define _ots_VStateMachine_h_ 00003 00004 #include <string> 00005 00006 namespace ots 00007 { 00008 class CoreSupervisorBase; 00009 00010 class VStateMachine 00011 { 00012 public: 00013 VStateMachine(void) { ; } 00014 virtual ~VStateMachine(void) { ; } 00015 00016 // Transitions 00017 virtual void configure(void) = 0; 00018 virtual void halt(void) = 0; 00019 virtual void pause(void) = 0; 00020 virtual void resume(void) = 0; 00021 virtual void start(std::string runNumber) = 0; 00022 virtual void stop(void) = 0; 00023 00024 // States 00025 virtual bool running(void) { return false; } 00026 virtual void paused(void) { ; } 00027 virtual void halted(void) { ; } 00028 virtual void configured(void) { ; } 00029 virtual void initial(void) { ; } 00030 virtual void inError(void) { ; } 00031 00032 void setIterationIndex(unsigned int i) { iterationIndex_ = i; } 00033 void setSubIterationIndex(unsigned int i) { subIterationIndex_ = i; } 00034 unsigned int getIterationIndex(void) { return iterationIndex_; } 00035 unsigned int getSubIterationIndex(void) { return subIterationIndex_; } 00036 void indicateIterationWork(void) { iterationWorkFlag_ = true; } 00037 void clearIterationWork(void) { iterationWorkFlag_ = false; } 00038 bool getIterationWork(void) { return iterationWorkFlag_; } 00039 void indicateSubIterationWork(void) { subIterationWorkFlag_ = true; } 00040 void clearSubIterationWork(void) { subIterationWorkFlag_ = false; } 00041 bool getSubIterationWork(void) { return subIterationWorkFlag_; } 00042 00043 CoreSupervisorBase* parentSupervisor_; // e.g. to communicate error fault and start 00044 // transition to error for entire system 00045 00046 private: 00047 unsigned int iterationIndex_, subIterationIndex_; 00048 bool iterationWorkFlag_, subIterationWorkFlag_; 00049 }; 00050 00051 } // namespace ots 00052 00053 #endif