Alex exoskeleton
ALEX SoftwareDocumentation
Public Member Functions | Private Attributes | List of all members
StateMachine Class Reference

Abstract class representing a state machine. Includes a number of State and Transition objects. More...

#include <StateMachine.h>

Collaboration diagram for StateMachine:
Collaboration graph

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...
 
StategetCurState (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

StatecurrentState
 Pointer to the current state. More...
 

Detailed Description

Abstract class representing a state machine. Includes a number of State and Transition objects.

Definition at line 26 of file StateMachine.h.

Constructor & Destructor Documentation

StateMachine::StateMachine ( void  )

Construct a new State Machine object.

Definition at line 12 of file StateMachine.cpp.

Member Function Documentation

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.

Returns
State* 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.

Parameters
iPointer to the desired current state.

Definition at line 16 of file StateMachine.cpp.

void StateMachine::update ( void  )
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.

Member Data Documentation

State* StateMachine::currentState
private

Pointer to the current state.

Definition at line 66 of file StateMachine.h.


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