FACT++  1.0
bool StateMachine::ProcessCommand ( const std::string &  str,
const char *  ptr,
size_t  siz 
)

This is (analog to StateMachineDim::commandHandler()) the function which is called if an event from the console is received. It then is supposed to send the event to the messge queue or handle it directly if the machine was not yet started.

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 PostCommand into the fifo.

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

Definition at line 63 of file StateMachine.cc.

Referenced by StateMachine().

64 {
65  EventImp *evt = FindEvent(str);
66  if (!evt)
67  return false;
68 
69  PostEvent(*evt, ptr, siz);
70  return true;
71 }
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.
char str[80]
Definition: test_client.c:7
EventImp * FindEvent(const std::string &evt)

+ Here is the caller graph for this function: