FACT++  1.0
void StateMachineDim::commandHandler ( )
privatevirtual

Overwritten DimCommand::exitHandler.

Overwritten DimCommand::commandHandler()

If fCurrentState is smaller than 0 or we are in kSM_FatalError state, all incoming commands are ignored.

The commandHandler will go through the list of available commands (fListOfEventss). If the received command was recognized, it is added via PushCommand into the fifo.

Todo:
  • Fix the exit when cmd is not of type EventImp
  • Fix docu
  • Do we need a possibility to suppress a call to "HandleEvent" or is a state<0 enough?

Implements DimCommandHandler.

Definition at line 194 of file StateMachineDim.cc.

References DimCommandHandler::getCommand(), StateMachineImp::HasEvent(), and StateMachineImp::PostEvent().

195 {
196  DimCommand *cmd = getCommand();
197  if (!cmd)
198  return;
199 
200  const EventImp *evt = dynamic_cast<EventImp*>(cmd);
201 
202  if (HasEvent(evt))
203  PostEvent(*evt);
204 }
A general base-class describing events issues in a state machine.
Definition: EventImp.h:11
bool PostEvent(std::ostream &lout, const std::string &str)
Post an event to the event queue.
DimCommand * getCommand()
Definition: dis.hxx:41
bool HasEvent(const EventImp *cmd)

+ Here is the call graph for this function: