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>

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 | |
| CYIAbstractStatePriv * | m_pPriv |
| yi::deprecated::CYIStateMachine::CYIStateMachine | ( | CYIState * | parent = 0 | ) |
|
virtual |
| 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.
| 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.