With this function commands are posted to the event queue. If the event loop has not yet been started with Run() the command is directly handled by HandleEvent.
Events posted when the state machine is in a negative state or kSM_FatalError are ignored.
- Parameters
-
evt | The event to be posted. The precise contents depend on what the event should be for. |
- Returns
- false if the event is ignored, true otherwise.
- Todo:
- Shell we check for the validity of a command at the current state, too?
- should we also get the output stream as an argument here?
Definition at line 343 of file StateMachineImp.cc.
References fBufferEvents, GetCurrentState(), HandleEvent(), IsRunning(), kSM_FatalError, kYellow, MessageImp::Out(), and PushEvent().
347 Out() <<
kYellow <<
"State<0 or FatalError: Event ignored." << endl;
int GetCurrentState() const
return the current state of the machine
Fatal error: stop program.
bool HandleEvent(const EventImp &evt)
std::ostream & Out() const
virtual void PushEvent(Event *cmd)
This is a flag which is set true if the main loop should stop.
Concerete implementation of an EventImp stroring name, format, data and time.
bool IsRunning() const
Used to check if the main loop is already running or still running.
bool fBufferEvents
Conditional to signal run the an event is waiting.