Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::com::helper::FiniteStateMachine< T > Class Template Reference

Finite State Machine (FMS) controller. More...

#include <finite_state_machine.h>

Inheritance diagram for ara::com::helper::FiniteStateMachine< T >:
ara::com::helper::AbstractStateMachine< T >

Public Member Functions

 FiniteStateMachine (const FiniteStateMachine &)=delete
 
FiniteStateMachineoperator= (const FiniteStateMachine &)=delete
 
void Initialize (std::initializer_list< MachineState< T > * > states, T entrypoint)
 Initalize the FSM. More...
 
GetState () const noexcept
 Get the FSM current state. More...
 
MachineState< T > * GetMachineState () const
 Get the current machine state object. More...
 
void Transit (T previousState, T nextState) override
 Tranit from the current state to a new state. More...
 

Detailed Description

template<typename T>
class ara::com::helper::FiniteStateMachine< T >

Finite State Machine (FMS) controller.

FMS controller is responsible for transiting between added states to the machine

Template Parameters
TState enumeration type
Note
FSM controller is not copyable

Member Function Documentation

◆ GetMachineState()

template<typename T >
MachineState< T > * ara::com::helper::FiniteStateMachine< T >::GetMachineState ( ) const
inline

Get the current machine state object.

Returns
Machine state object pointer

◆ GetState()

template<typename T >
T ara::com::helper::FiniteStateMachine< T >::GetState ( ) const
inlinenoexcept

Get the FSM current state.

Returns
Current state enumeration

◆ Initialize()

template<typename T >
void ara::com::helper::FiniteStateMachine< T >::Initialize ( std::initializer_list< MachineState< T > * >  states,
entrypoint 
)
inline

Initalize the FSM.

Parameters
statesMachine state list
entrypointEntrypoint state to initialize the FSM

◆ Transit()

template<typename T >
void ara::com::helper::FiniteStateMachine< T >::Transit ( previousState,
nextState 
)
inlineoverridevirtual

Tranit from the current state to a new state.

Parameters
previousStatePrevious state that the FSM is transiting from
nextStateNext state that the FSM is transiting to

Implements ara::com::helper::AbstractStateMachine< T >.