fsm 0.4.1
Header-only C++20 hierarchical table-driven FSM
Loading...
Searching...
No Matches
fsm::state_spec< State, Event, Context > Struct Template Reference

One state's specification: hierarchy links, actions, deadline. More...

#include <fsm.hpp>

Public Types

using hook_fn = void(*)(Context &)
 

Public Attributes

state_id< State > state
 Which state this spec describes (mandatory).
 
parent_spec< State > parent
 Mandatory: fsm::root or fsm::child_of(P).
 
initial_spec< State > initial {}
 fsm::start_at(C) on composites; default leaf.
 
hook_fn entry = nullptr
 Run on entry (before the deadline is armed).
 
hook_fn exit = nullptr
 Run on exit (deadline already disarmed).
 
timeout_spec< Event > deadline
 Mandatory: fsm::after(...) or fsm::no_timeout.
 

Detailed Description

template<class State, class Event, class Context>
struct fsm::state_spec< State, Event, Context >

One state's specification: hierarchy links, actions, deadline.

Exactly one spec per state enum value is required (validated).

Member Typedef Documentation

◆ hook_fn

template<class State , class Event , class Context >
using fsm::state_spec< State, Event, Context >::hook_fn = void (*)(Context&)

Entry/exit hook run on state entry/exit. nullptr = none.

Member Data Documentation

◆ deadline

template<class State , class Event , class Context >
timeout_spec<Event> fsm::state_spec< State, Event, Context >::deadline

Mandatory: fsm::after(...) or fsm::no_timeout.

◆ entry

template<class State , class Event , class Context >
hook_fn fsm::state_spec< State, Event, Context >::entry = nullptr

Run on entry (before the deadline is armed).

◆ exit

template<class State , class Event , class Context >
hook_fn fsm::state_spec< State, Event, Context >::exit = nullptr

Run on exit (deadline already disarmed).

◆ initial

template<class State , class Event , class Context >
initial_spec<State> fsm::state_spec< State, Event, Context >::initial {}

fsm::start_at(C) on composites; default leaf.

◆ parent

template<class State , class Event , class Context >
parent_spec<State> fsm::state_spec< State, Event, Context >::parent

Mandatory: fsm::root or fsm::child_of(P).

◆ state

template<class State , class Event , class Context >
state_id<State> fsm::state_spec< State, Event, Context >::state

Which state this spec describes (mandatory).


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