Alex exoskeleton
ALEX SoftwareDocumentation
Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
State Class Referenceabstract

Abstract class representing a state in a StateMachine. More...

#include <State.h>

Inheritance diagram for State:
Inheritance graph
Collaboration diagram for State:
Collaboration graph

Public Member Functions

 State (StateMachine *p, const char n[]=NULL)
 Construct a new State object. More...
 
 ~State ()
 
bool addArc (Transition *t)
 
TransitiongetActiveArc (void)
 
virtual void entry (void)=0
 Called once when the state is entered. Pure virtual function, must be overwritten by each state. More...
 
virtual void during (void)=0
 Called continuously whilst in that state. Pure virtual function, must be overwritten by each state. More...
 
virtual void exit (void)=0
 Called once when the state exits. Pure virtual function, must be overwritten by each state. More...
 
const char * getName (void)
 Returns the name of the state - Note that this. More...
 
void printName (void)
 Prints the name of the state. More...
 

Public Attributes

StateMachineowner
 Pointer to the owning state machine. More...
 

Private Attributes

Transitionarclist [MAXARCS]
 List of possible transitions. More...
 
const char * name
 
int numarcs
 

Friends

class StateMachine
 

Detailed Description

Abstract class representing a state in a StateMachine.

Definition at line 30 of file State.h.

Constructor & Destructor Documentation

State::State ( StateMachine p,
const char  n[] = NULL 
)

Construct a new State object.

Parameters
pPointer to the owning state machine
nName of the state machine

Definition at line 46 of file State.h.

State::~State ( )

Definition at line 34 of file State.cpp.

Member Function Documentation

bool State::addArc ( Transition t)

Definition at line 18 of file State.cpp.

virtual void State::during ( void  )
pure virtual

Called continuously whilst in that state. Pure virtual function, must be overwritten by each state.

Implemented in ExoTestState, Sitting, InitState, Standing, StandingUp, and SittingDwn.

virtual void State::entry ( void  )
pure virtual

Called once when the state is entered. Pure virtual function, must be overwritten by each state.

Implemented in ExoTestState, Sitting, InitState, Standing, StandingUp, and SittingDwn.

virtual void State::exit ( void  )
pure virtual

Called once when the state exits. Pure virtual function, must be overwritten by each state.

Implemented in ExoTestState, Sitting, InitState, Standing, StandingUp, and SittingDwn.

Transition * State::getActiveArc ( void  )

Definition at line 8 of file State.cpp.

const char * State::getName ( void  )

Returns the name of the state - Note that this.

Returns
const char* The name of the state

Definition at line 26 of file State.cpp.

void State::printName ( void  )

Prints the name of the state.

Definition at line 30 of file State.cpp.

Friends And Related Function Documentation

friend class StateMachine
friend

Definition at line 31 of file State.h.

Member Data Documentation

Transition* State::arclist[MAXARCS]
private

List of possible transitions.

Definition at line 92 of file State.h.

const char* State::name
private

Definition at line 93 of file State.h.

int State::numarcs
private

Definition at line 94 of file State.h.

StateMachine* State::owner

Pointer to the owning state machine.

Definition at line 38 of file State.h.


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