FACT++  1.0
bool StateMachineImp::HandleNewState ( int  newstate,
const EventImp evt,
const char *  txt 
)
protected

This function handles a new state issued by one of the event handlers.

Parameters
newstateA possible new state
evtA pointer to the event which was responsible for the state change, NULL if no event was responsible.
txtText which is issued if the current state has changed and the new state is identical to the target state as stored in the event reference, or when no alternative text was given, or the pointer to evt is NULL.
altAn alternative text which is issues when the newstate of a state change doesn't match the expected target state.
Returns
false if newstate is kSM_FatalError, true otherwise

Definition at line 832 of file StateMachineImp.cc.

References fCurrentState, EventImp::GetName(), kSM_FatalError, kSM_KeepState, and SetCurrentState().

Referenced by HandleEvent(), and Run().

834 {
835  if (newstate==kSM_FatalError)
836  return false;
837 
838  if (newstate==fCurrentState || newstate==kSM_KeepState)
839  return true;
840 
841  SetCurrentState(newstate, txt, evt ? evt->GetName() : "");
842 
843  return true;
844 }
int fCurrentState
Name of the state-machine / server (e.g. DRIVE)
Fatal error: stop program.
virtual std::string GetName() const
Definition: EventImp.h:51
virtual std::string SetCurrentState(int state, const char *txt="", const std::string &cmd="")

+ Here is the call graph for this function:

+ Here is the caller graph for this function: