FACT++  1.0
StateMachineImp::StateMachineImp ( std::ostream &  out = std::cout,
const std::string &  name = "" 
)

The state of the state machine (fCurrentState) is initialized with kSM_NotReady

Default state names for kSM_NotReady, kSM_Ready, kSM_Error and kSM_FatalError are set via AddStateName.

fExitRequested is set to 0, fRunning to false.

Furthermore, the ostream is propagated to MessageImp, as well as stored in fOut.

MessageImp is used for messages which are distributed (e.g. via DIM), fOut is used for messages which are only displayed on the local console.

Subsequent, i.e. derived classes should setup all allowed state transitions as well as all allowed configuration event by AddEvent and AddStateName.

Parameters
outA refrence to an ostream which allows to redirect the log-output to something else than cout. The default is cout. The reference is propagated to fLog
nameThe server name stored in fName

Definition at line 122 of file StateMachineImp.cc.

References SetDefaultStateNames().

Referenced by Wrapper().

123  : MessageImp(out), fName(name), fCurrentState(kSM_NotReady),
124  fBufferEvents(true), fRunning(false), fExitRequested(0)
125 {
127 }
int fCurrentState
Name of the state-machine / server (e.g. DRIVE)
int fExitRequested
Machine is in main-loop.
bool fRunning
Flag if events should be buffered outside the event loop.
Mainloop not running, state machine stopped.
MessageImp(std::ostream &out=std::cout)
Definition: MessageImp.cc:39
std::string fName
bool fBufferEvents
Conditional to signal run the an event is waiting.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: