Changeset 16726
- Timestamp:
- 06/05/13 20:35:45 (12 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/StateMachineImp.cc
r16282 r16726 122 122 StateMachineImp::StateMachineImp(ostream &out, const std::string &name) 123 123 : MessageImp(out), fName(name), fCurrentState(kSM_NotReady), 124 f Running(false), fBufferEvents(true), fExitRequested(0)124 fBufferEvents(true), fRunning(false), fExitRequested(0) 125 125 { 126 126 SetDefaultStateNames(); -
trunk/FACT++/src/StateMachineImp.h
r16089 r16726 49 49 std::mutex fMutexEvt; /// Mutex to ensure thread-safe access to the command fifo 50 50 51 bool fBufferEvents; /// Flag if events should be buffered outside the event loop 52 53 protected: 51 54 bool fRunning; /// Machine is in main-loop 52 bool fBufferEvents; /// Flag if events should be buffered outside the event loop53 55 int fExitRequested; /// This is a flag which is set true if the main loop should stop 54 56 55 57 /// Push a command into the fifo. The fifo takes over ownership 56 v oid PushEvent(Event *cmd);58 virtual void PushEvent(Event *cmd); 57 59 /// Pop a command from the fifo. 58 60 std::shared_ptr<Event> PopEvent(); … … 60 62 bool HandleNewState(int newstate, const EventImp *evt, const char *txt); 61 63 62 virtual EventImp *CreateEvent(const std::string &name, const std::string &fmt) = 0; 63 virtual EventImp *CreateService(const std::string &); 64 64 protected: 65 65 /// Is called continously to execute actions in the current state 66 66 virtual int Execute() { return fCurrentState; } … … 70 70 //virtual int Transition(const Event &) { return kSM_FatalError; } 71 71 72 private: 73 virtual EventImp *CreateEvent(const std::string &name, const std::string &fmt) = 0; 74 virtual EventImp *CreateService(const std::string &); 75 72 76 virtual void Lock() { } 73 77 virtual void UnLock() { } … … 116 120 117 121 /// Start the mainloop 118 int Run(bool dummy);122 virtual int Run(bool dummy); 119 123 int Run() { return Run(false); } 120 124 121 125 /// Request to stop the mainloop 122 v oid Stop(int code=0);126 virtual void Stop(int code=0); 123 127 124 128 /// Used to check if the main loop is already running or still running
Note:
See TracChangeset
for help on using the changeset viewer.