iaux::iaStateMachine Class Reference

#include <iaStateMachine.h>

Public Member Functions

iaStateID addState (const iaString &name="")
 
void setInitialState (iaStateID id)
 
iaStateID getInitialState () const
 
iaStateID getCurrentState () const
 
iaTransitionID addTransition (iaStateID from, iaStateID to)
 
std::vector< iaTransitionIDgetOutgoingTransitions (iaStateID stateID)
 
void activateGate (iaTransitionID transitionID, uint32 index)
 
void deactivateGate (iaTransitionID transitionID, uint32 index)
 
void openGate (iaTransitionID transitionID, uint32 index)
 
void closeGate (iaTransitionID transitionID, uint32 index)
 
void resetGates (iaTransitionID transitionID)
 
void update ()
 
void start ()
 
void registerEnterStateDelegate (iaEnterStateDelegate enterStateDelegate)
 
void registerReEnterStateDelegate (iaReEnterStateDelegate reEnterStateDelegate)
 
void registerLeaveStateDelegate (iaLeaveStateDelegate leaveStateDelegate)
 
void registerUpdateStateDelegate (iaUpdateStateDelegate updateStateDelegate)
 
void unregisterEnterStateDelegate (iaEnterStateDelegate enterStateDelegate)
 
void unregisterReEnterStateDelegate (iaReEnterStateDelegate reEnterStateDelegate)
 
void unregisterLeaveStateDelegate (iaLeaveStateDelegate leaveStateDelegate)
 
void unregisterUpdateStateDelegate (iaUpdateStateDelegate updateStateDelegate)
 
 iaStateMachine ()=default
 
 ~iaStateMachine ()=default
 

Detailed Description

state machine

Constructor & Destructor Documentation

◆ iaStateMachine()

iaux::iaStateMachine::iaStateMachine ( )
default

does nothing

◆ ~iaStateMachine()

iaux::iaStateMachine::~iaStateMachine ( )
default

does nothing

Member Function Documentation

◆ activateGate()

void iaux::iaStateMachine::activateGate ( iaTransitionID  transitionID,
uint32  index 
)

activate a gate for given transition

Parameters
transitionIDthe given transition
indexthe gate index to activate (0-15)

◆ addState()

iaStateID iaux::iaStateMachine::addState ( const iaString name = "")

creates and adds a new state

Parameters
nameoptional name of state
Returns
new state id

◆ addTransition()

uint32 iaux::iaStateMachine::addTransition ( iaStateID  from,
iaStateID  to 
)

creates transition form source state to destination state

Parameters
fromsource state
todestination state
Returns
transition id

◆ closeGate()

void iaux::iaStateMachine::closeGate ( iaTransitionID  transitionID,
uint32  index 
)

close a gate for given transition

Parameters
transitionIDthe given transition
indexthe gate index to close (0-15)

◆ deactivateGate()

void iaux::iaStateMachine::deactivateGate ( iaTransitionID  transitionID,
uint32  index 
)

deactivate a gate for given transition

Parameters
transitionIDthe given transition
indexthe gate index to deactivate (0-15)

◆ getCurrentState()

iaStateID iaux::iaStateMachine::getCurrentState ( ) const
Returns
current state id

◆ getInitialState()

iaStateID iaux::iaStateMachine::getInitialState ( ) const
Returns
initial state

◆ getOutgoingTransitions()

std::vector< iaTransitionID > iaux::iaStateMachine::getOutgoingTransitions ( iaStateID  stateID)
Returns
outgoing transition for given state id
Parameters
stateIDthe given state id

◆ openGate()

void iaux::iaStateMachine::openGate ( iaTransitionID  transitionID,
uint32  index 
)

open a gate for given transition

Parameters
transitionIDthe given transition
indexthe gate index to open (0-15)

◆ registerEnterStateDelegate()

void iaux::iaStateMachine::registerEnterStateDelegate ( iaEnterStateDelegate  enterStateDelegate)

register delegate to enter event of specified state

Parameters
enterStateDelegateenter state delegate

◆ registerLeaveStateDelegate()

void iaux::iaStateMachine::registerLeaveStateDelegate ( iaLeaveStateDelegate  leaveStateDelegate)

register delegate to leave event of specified state

Parameters
leaveStateDelegateleave state delegate

◆ registerReEnterStateDelegate()

void iaux::iaStateMachine::registerReEnterStateDelegate ( iaReEnterStateDelegate  reEnterStateDelegate)

register delegate to reenter event of specified state

Parameters
reEnterStateDelegatereenter state delegate

◆ registerUpdateStateDelegate()

void iaux::iaStateMachine::registerUpdateStateDelegate ( iaUpdateStateDelegate  updateStateDelegate)

register delegate to update event of specified state

Parameters
updateStateDelegateupdate state delegate

◆ resetGates()

void iaux::iaStateMachine::resetGates ( iaTransitionID  transitionID)

closes all gates on for given transition

Parameters
transitionIDthe given transition

◆ setInitialState()

void iaux::iaStateMachine::setInitialState ( iaStateID  id)

sets the initial state by id

Parameters
idthe specified state id

◆ start()

void iaux::iaStateMachine::start ( )

finalizes the state machine.

after this you can not manipulate the state machine anymore

◆ unregisterEnterStateDelegate()

void iaux::iaStateMachine::unregisterEnterStateDelegate ( iaEnterStateDelegate  enterStateDelegate)

unregister delegate from enter event with specified state

Parameters
enterStateDelegateenter state delegate

◆ unregisterLeaveStateDelegate()

void iaux::iaStateMachine::unregisterLeaveStateDelegate ( iaLeaveStateDelegate  leaveStateDelegate)

unregister delegate from leave event with specified state

Parameters
leaveStateDelegateleave state delegate

◆ unregisterReEnterStateDelegate()

void iaux::iaStateMachine::unregisterReEnterStateDelegate ( iaReEnterStateDelegate  reEnterStateDelegate)

unregister delegate from reenter event with specified state

Parameters
reEnterStateDelegatereenter state delegate

◆ unregisterUpdateStateDelegate()

void iaux::iaStateMachine::unregisterUpdateStateDelegate ( iaUpdateStateDelegate  updateStateDelegate)

unregister delegate from update event with specified state

Parameters
updateStateDelegateupdate state delegate

◆ update()

void iaux::iaStateMachine::update ( )

calls the update of the current state


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