ApparatusFramework::StateMachine Class Reference
[Pattern Services]

#include <PatternServices/current/include/StateMachine.h>

List of all members.

Public Member Functions

 StateMachine ()
virtual ~StateMachine ()

Protected Member Functions

void handleStateMsg (Msg *pMsg)
void nextState (State *pState)
const unsigned int getCurrentStateID ()
StategetState (const unsigned int stateID)
void registerState (State *pState)
void enterFirstState (State *pState)

Friends

class State

Detailed Description

The class stateMachine implements a base class for state machines. To implement a state machine it can be inherited from this class. This class has to be used together with the state class.

Definition at line 104 of file StateMachine.h.


Constructor & Destructor Documentation

ApparatusFramework::StateMachine::StateMachine (  ) 

constructors, destructors Constructs a new state machine object.

virtual ApparatusFramework::StateMachine::~StateMachine (  )  [virtual]

Destroys a state machine object and releases all the associated resources.


Member Function Documentation

void ApparatusFramework::StateMachine::enterFirstState ( State pState  )  [protected]

Enters the state machine inside the specified first state.

Parameters:
pState Pointer to the first state, in which the state machine has to be entered.
const unsigned int ApparatusFramework::StateMachine::getCurrentStateID (  )  [protected]

Returns the id of the current set state.

Returns:
stateId The id of the current set state.
State* ApparatusFramework::StateMachine::getState ( const unsigned int  stateID  )  [protected]

Returns the pointer of the state for the specified state id.

Parameters:
stateID The id for the demanded state.
Returns:
State* Pointer to the state for the specified state id. The pointer is 0, if no registered state can be found for the specified state id.
void ApparatusFramework::StateMachine::handleStateMsg ( Msg pMsg  )  [protected]

modifiers This method has to be called from the inherited state machine, if an state event occurred. The event is a message and is handled by the current state.

Parameters:
pMsg message to be handled
void ApparatusFramework::StateMachine::nextState ( State pState  )  [protected]

This method sets the state machine inside the defined next state.

Parameters:
pState The state, in which the state machine has to be set.
void ApparatusFramework::StateMachine::registerState ( State pState  )  [protected]

Registers a state by the state machine.

Parameters:
pState Pointer to the state, which has to be registered by the state machine.

Friends And Related Function Documentation

friend class State [friend]

Makes friend with our State class.

Definition at line 111 of file StateMachine.h.

© 2004-2010 bbv Software Services AG / Apparatus Services