You.i Engine
yi::deprecated::CYIStateMachine Class Reference

Detailed Description

This class defines a hierarchical state machine.

This is the class that controls execution of the state machine. It can have a parent (to nest it within other machines) but this is typically not necessary.

Each state machine has its own event dispatcher on its own thread.

SetInitialState() must be called before the machine can be started.

#include <deprecated/YiStateMachine.h>

Inheritance diagram for yi::deprecated::CYIStateMachine:

Public Member Functions

 CYIStateMachine (CYIState *parent=0)
 
virtual ~CYIStateMachine ()
 
bool Start ()
 
bool Stop ()
 
bool IsRunning ()
 
std::list< CYIAbstractState * > GetConfiguration ()
 
void PrintConfiguration ()
 
YI_STATEMACHINE_ERROR GetError ()
 
void ClearError ()
 
void PostEvent (std::unique_ptr< CYIEvent > e, YI_STATEMACHINE_PRIORITY priority=YI_STATEMACHINE_NORMAL)
 
- Public Member Functions inherited from yi::deprecated::CYIState
 CYIState (CYICompoundState *pParent=0, const CYIString &name="")
 
virtual ~CYIState ()
 
bool SetInitialState (CYIAbstractState *pState)
 
CYIAbstractStateGetInitialState ()
 
bool SetErrorState (CYIAbstractState *pState)
 
CYIAbstractStateGetErrorState ()
 
- Public Member Functions inherited from yi::deprecated::CYICompoundState
virtual ~CYICompoundState ()
 
std::list< CYIAbstractState * > GetStates ()
 
bool AddTransition (CYITransition *pTransition)
 
bool RemoveTransition (CYITransition *pTransition)
 
std::list< CYITransition * > GetTransitions ()
 
- Public Member Functions inherited from yi::deprecated::CYIAbstractState
virtual ~CYIAbstractState ()
 
CYICompoundStateGetParent () const
 
CYIStateMachineGetMachine () const
 
const CYIStringGetName () const
 
- Public Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const
 

Public Attributes

CYISignal Started
 
CYISignal Stopped
 
- Public Attributes inherited from yi::deprecated::CYICompoundState
CYISignal Finished
 
- Public Attributes inherited from yi::deprecated::CYIAbstractState
CYISignal StateEntered
 
CYISignal StateExited
 

Additional Inherited Members

- Protected Member Functions inherited from yi::deprecated::CYIState
 CYIState (CYIStatePriv *priv, CYICompoundState *parent)
 
- Protected Member Functions inherited from yi::deprecated::CYICompoundState
 CYICompoundState (CYICompoundStatePriv *priv, CYICompoundState *parent=0, const CYIString &name="")
 
- Protected Member Functions inherited from yi::deprecated::CYIAbstractState
virtual void OnEntry (CYIEvent *e)
 
virtual void OnExit (CYIEvent *e)
 
 CYIAbstractState (CYIAbstractStatePriv *priv, CYICompoundState *parent=0, const CYIString &name="")
 
- Protected Attributes inherited from yi::deprecated::CYIAbstractState
CYIAbstractStatePrivm_pPriv
 

Constructor & Destructor Documentation

yi::deprecated::CYIStateMachine::CYIStateMachine ( CYIState parent = 0)
virtual yi::deprecated::CYIStateMachine::~CYIStateMachine ( )
virtual

Member Function Documentation

void yi::deprecated::CYIStateMachine::ClearError ( )

Clear the last recorded error.

std::list<CYIAbstractState *> yi::deprecated::CYIStateMachine::GetConfiguration ( )

Returns the currently active states.

YI_STATEMACHINE_ERROR yi::deprecated::CYIStateMachine::GetError ( )

Returns the last recorded error.

bool yi::deprecated::CYIStateMachine::IsRunning ( )

Query if the state machine is running.

void yi::deprecated::CYIStateMachine::PostEvent ( std::unique_ptr< CYIEvent e,
YI_STATEMACHINE_PRIORITY  priority = YI_STATEMACHINE_NORMAL 
)

Post an event e to the state machine. This is typically not necessary as the state machine will take care of posting events to its own queue.

void yi::deprecated::CYIStateMachine::PrintConfiguration ( )

Prints the currently active states (if they have names). This can be useful for debugging and can stay here as long as GetConfiguration() is available.

bool yi::deprecated::CYIStateMachine::Start ( )

Start the execution of the state machine.

bool yi::deprecated::CYIStateMachine::Stop ( )

Stop the execution of the state machine.

Member Data Documentation

CYISignal yi::deprecated::CYIStateMachine::Started

This signal is emitted when the state machine starts.

CYISignal yi::deprecated::CYIStateMachine::Stopped

This signal is emitted when the state machine is stopped.


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