Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
gva::tinyfsm::Fsm< F > Class Template Reference
Inheritance diagram for gva::tinyfsm::Fsm< F >:
Inheritance graph
Collaboration diagram for gva::tinyfsm::Fsm< F >:
Collaboration graph

Public Types

using fsmtype = Fsm< F >
 Templated FSM.
 
using state_ptr_t = F *
 Current state pointer.
 

Static Public Member Functions

template<typename S >
static constexpr Sstate (void)
 public, leaving ability to access state instance (e.g. on Reset)
 
template<typename S >
static constexpr bool is_in_state (void)
 Check if in state.
 
static void set_initial_state ()
 state machine functions
 
static void Reset ()
 Reset state machine.
 
static void enter ()
 Enter state.
 
static void start ()
 start state
 
template<typename E >
static void dispatch (E const &event)
 Dispatch a new state.
 

Static Public Attributes

static state_ptr_t current_state_ptr
 Current state pointer.
 

Protected Member Functions

template<typename S >
void transit (void)
 state transition functions
 
template<typename S , typename ActionFunction >
void transit (ActionFunction action_function)
 Transition to new state.
 
template<typename S , typename ActionFunction , typename ConditionFunction >
void transit (ActionFunction action_function, ConditionFunction condition_function)
 Transit to new state.
 

Member Function Documentation

◆ dispatch()

template<typename F >
template<typename E >
static void gva::tinyfsm::Fsm< F >::dispatch ( E const event)
inlinestatic

Dispatch a new state.

Template Parameters
E
Parameters
event

◆ is_in_state()

template<typename F >
template<typename S >
static constexpr bool gva::tinyfsm::Fsm< F >::is_in_state ( void  )
inlinestaticconstexpr

Check if in state.

Template Parameters
S
Returns
true
false

◆ transit() [1/3]

template<typename F >
template<typename S , typename ActionFunction >
void gva::tinyfsm::Fsm< F >::transit ( ActionFunction  action_function)
inlineprotected

Transition to new state.

Template Parameters
S
ActionFunction
Parameters
action_function

◆ transit() [2/3]

template<typename F >
template<typename S , typename ActionFunction , typename ConditionFunction >
void gva::tinyfsm::Fsm< F >::transit ( ActionFunction  action_function,
ConditionFunction  condition_function 
)
inlineprotected

Transit to new state.

Template Parameters
S
ActionFunction
ConditionFunction
Parameters
action_function
condition_function

◆ transit() [3/3]

template<typename F >
template<typename S >
void gva::tinyfsm::Fsm< F >::transit ( void  )
inlineprotected

state transition functions

Transition to new state

Template Parameters
S

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