Pyrogenesis  trunk
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CFsmTransition Class Reference

An association of event, condition, action and next state. More...

#include <FSM.h>

Collaboration diagram for CFsmTransition:
Collaboration graph
[legend]

Public Member Functions

 CFsmTransition (unsigned int state)
 
 ~CFsmTransition ()
 
void RegisterAction (void *pAction, void *pContext)
 Registers an action that will be executed when the transition occurs. More...
 
void RegisterCondition (void *pCondition, void *pContext)
 Registers a condition which will be evaluated when the transition occurs. More...
 
void SetEvent (CFsmEvent *pEvent)
 Set event for which transition will occur. More...
 
CFsmEventGetEvent () const
 
void SetNextState (unsigned int nextState)
 Set next state the transition will switch the system to. More...
 
unsigned int GetNextState () const
 
unsigned int GetCurrState () const
 
const CallbackListGetActions () const
 
const CallbackListGetConditions () const
 
bool ApplyConditions () const
 Evaluates conditions for the transition. More...
 
bool RunActions () const
 Executes actions for the transition. More...
 

Private Member Functions

 NONCOPYABLE (CFsmTransition)
 

Private Attributes

unsigned int m_CurrState
 
unsigned int m_NextState
 
CFsmEventm_Event
 
CallbackList m_Actions
 
CallbackList m_Conditions
 

Detailed Description

An association of event, condition, action and next state.

Constructor & Destructor Documentation

◆ CFsmTransition()

CFsmTransition::CFsmTransition ( unsigned int  state)

◆ ~CFsmTransition()

CFsmTransition::~CFsmTransition ( )

Member Function Documentation

◆ ApplyConditions()

bool CFsmTransition::ApplyConditions ( ) const

Evaluates conditions for the transition.

Returns
whether all the conditions are true.

◆ GetActions()

const CallbackList& CFsmTransition::GetActions ( ) const
inline

◆ GetConditions()

const CallbackList& CFsmTransition::GetConditions ( ) const
inline

◆ GetCurrState()

unsigned int CFsmTransition::GetCurrState ( ) const
inline

◆ GetEvent()

CFsmEvent* CFsmTransition::GetEvent ( ) const
inline

◆ GetNextState()

unsigned int CFsmTransition::GetNextState ( ) const
inline

◆ NONCOPYABLE()

CFsmTransition::NONCOPYABLE ( CFsmTransition  )
private

◆ RegisterAction()

void CFsmTransition::RegisterAction ( void *  pAction,
void *  pContext 
)

Registers an action that will be executed when the transition occurs.

Parameters
pActionthe function which will be executed.
pContextdata passed to the function.

◆ RegisterCondition()

void CFsmTransition::RegisterCondition ( void *  pCondition,
void *  pContext 
)

Registers a condition which will be evaluated when the transition occurs.

Parameters
pConditionthe predicate which will be executed.
pContextdata passed to the predicate.

◆ RunActions()

bool CFsmTransition::RunActions ( ) const

Executes actions for the transition.

Note
If there are no actions, assume true.
Returns
whether all the actions returned true.

◆ SetEvent()

void CFsmTransition::SetEvent ( CFsmEvent pEvent)

Set event for which transition will occur.

◆ SetNextState()

void CFsmTransition::SetNextState ( unsigned int  nextState)

Set next state the transition will switch the system to.

Member Data Documentation

◆ m_Actions

CallbackList CFsmTransition::m_Actions
private

◆ m_Conditions

CallbackList CFsmTransition::m_Conditions
private

◆ m_CurrState

unsigned int CFsmTransition::m_CurrState
private

◆ m_Event

CFsmEvent* CFsmTransition::m_Event
private

◆ m_NextState

unsigned int CFsmTransition::m_NextState
private

The documentation for this class was generated from the following files: