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

Per-state deadline declaration — a mandatory column. More...

#include <fsm.hpp>

Public Member Functions

constexpr timeout_spec ()=default
 
constexpr timeout_spec (no_timeout_t)
 
constexpr timeout_spec (timeout_kind kk, uint32_t m, Event e)
 

Public Attributes

timeout_kind k = timeout_kind::unspecified
 
uint32_t ms = 0
 Duration in milliseconds after state entry.
 
Event event {}
 Event dispatched when the deadline expires.
 

Detailed Description

template<class Event>
struct fsm::timeout_spec< Event >

Per-state deadline declaration — a mandatory column.

Every state must declare fsm::after(ms, Event) or fsm::no_timeout; the poison default makes omission a compile error. This closes the stale-deadline bug class: a previous state's timeout cannot survive by omission.

Constructor & Destructor Documentation

◆ timeout_spec() [1/3]

template<class Event >
constexpr fsm::timeout_spec< Event >::timeout_spec ( )
constexprdefault

◆ timeout_spec() [2/3]

template<class Event >
constexpr fsm::timeout_spec< Event >::timeout_spec ( no_timeout_t  )
inlineconstexpr

◆ timeout_spec() [3/3]

template<class Event >
constexpr fsm::timeout_spec< Event >::timeout_spec ( timeout_kind  kk,
uint32_t  m,
Event  e 
)
inlineconstexpr

Member Data Documentation

◆ event

template<class Event >
Event fsm::timeout_spec< Event >::event {}

Event dispatched when the deadline expires.

◆ k

template<class Event >
timeout_kind fsm::timeout_spec< Event >::k = timeout_kind::unspecified

◆ ms

template<class Event >
uint32_t fsm::timeout_spec< Event >::ms = 0

Duration in milliseconds after state entry.


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