Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

StateMachine Class Reference
[State Machine Utilities]

#include <StateMachine.hh>

Inherits Module.

Inherited by ExperimentRunner.

List of all members.


Detailed Description

Abstract base class for all state machine implementations.

This class provides a template for all state machine implementations. It defines a uniform interface for defining and running state machines, automatically handling event checking and state transitions. A state machine contains a list of its state classed, all derived from the State class, a list of event objects, all derived from the Event class and finally a list of arcs which are instances of the Arc class.


Public Member Functions

 StateMachine (char *n)
 StateMachine (char *n, State *i)
 StateMachine (char *n, uint index)
 StateMachine (char *n, uint index, bool user)
 StateMachine (char *n, uint index, State *i)
void initialize (State *i)
StategetCurState (void)
void init (void)
void uninit (void)
void activate (void)
void deactivate (void)
void update (void)

Related Functions

(Note that these are not member functions.)

 Transition(_from_, _event_, _to_)
 EventObject(_name_)
 StateObject(_name_)


Constructor & Destructor Documentation

StateMachine::StateMachine char *  n  )  [inline]
 

Constructor with only a name specification. The module index is set to 0 and the initial state must be explicitly defined through initialize before activation.

StateMachine::StateMachine char *  n,
State i
[inline]
 

Constructor to specify a name and the initial state. The module index is set to 0.

StateMachine::StateMachine char *  n,
uint  index
[inline]
 

Constructor to specify a name and the module index. The initial state is set to NULL and must be explicitly defined through initialize before activation.

StateMachine::StateMachine char *  n,
uint  index,
bool  user
[inline]
 

Constructor to specify a name, the module index and the multi/single user properties. The initial state is set to NULL and must be explicitly defined through initialize before activation.

StateMachine::StateMachine char *  n,
uint  index,
State i
[inline]
 

Constructor to specify a name, the module index and the initial state.


Member Function Documentation

State* StateMachine::getCurState void   )  [inline]
 

This method returns a pointer to the current state.

void StateMachine::initialize State i  )  [inline]
 

This method sets the initial state for the state machine execution.


Friends And Related Function Documentation

EventObject _name_   )  [related]
 

Convenience macro to define a subclass of the Event class within a StateMachine subclass declaration.

usage: EventObject ( MyEvent ) * myEvent;

StateObject _name_   )  [related]
 

Convenience macro to define a subclass of the Event class within a StateMachine subclass declaration.

usage: StateObject ( MyState ) * myState

Transition _from_,
_event_,
_to_   )  [related]
 

Convenience macro to define a directed arc between two states, associated with an event object.


RHexLib Reference Documentation