Alex exoskeleton
ALEX SoftwareDocumentation
|
Abstract class representing a state machine. Includes a number of State and Transition objects. More...
#include <StateMachine.h>
Public Member Functions | |
StateMachine (void) | |
Construct a new State Machine object. More... | |
void | initialize (State *i) |
Sets the current state. Note: No check made. More... | |
State * | getCurState (void) |
Returns a pointer to the current state. More... | |
void | activate (void) |
Calls the entry method of the current state. More... | |
virtual void | update (void) |
Processes the state machine. For each possible transition, checks if that transition should be made If no, calls during() on the current state If yes, calls exit() on the current state, entry() and then during() on the new state. More... | |
Private Attributes | |
State * | currentState |
Pointer to the current state. More... | |
Abstract class representing a state machine. Includes a number of State and Transition objects.
Definition at line 26 of file StateMachine.h.
StateMachine::StateMachine | ( | void | ) |
Construct a new State Machine object.
Definition at line 12 of file StateMachine.cpp.
void StateMachine::activate | ( | void | ) |
Calls the entry method of the current state.
Definition at line 25 of file StateMachine.cpp.
State * StateMachine::getCurState | ( | void | ) |
Returns a pointer to the current state.
Definition at line 21 of file StateMachine.cpp.
void StateMachine::initialize | ( | State * | i | ) |
Sets the current state. Note: No check made.
i | Pointer to the desired current state. |
Definition at line 16 of file StateMachine.cpp.
|
virtual |
Processes the state machine. For each possible transition, checks if that transition should be made If no, calls during() on the current state If yes, calls exit() on the current state, entry() and then during() on the new state.
Definition at line 30 of file StateMachine.cpp.
|
private |
Pointer to the current state.
Definition at line 66 of file StateMachine.h.