|
Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
|
Zero-heap, compile-time Finite State Machine. More...
#include <StateMachine.hpp>
Collaboration diagram for corium::fsm::StateMachine< Table, InitialState, OtherStates >:Public Types | |
| using | StateVariant = std::variant< InitialState, OtherStates... > |
| using | TransitionTableType = Table |
Public Member Functions | |
| template<typename State > | |
| constexpr State & | as () |
| Access reference to current state as type State (throws std::bad_variant_access if mismatch). | |
| template<typename State > | |
| constexpr const State & | as () const |
| Access const reference to current state as type State. | |
| template<typename State > | |
| constexpr bool | is () const noexcept |
| Check if current active state matches type State. | |
| template<typename Event > | |
| bool | process_event (const Event &event) |
| Process an incoming event through the state machine transition table. | |
| constexpr const StateVariant & | state () const noexcept |
| Access active state variant. | |
| constexpr StateVariant & | state () noexcept |
| Access active state variant. | |
| constexpr | StateMachine () |
| template<typename State > requires (std::is_constructible_v<StateVariant, State>) | |
| constexpr | StateMachine (State &&initial) |
Zero-heap, compile-time Finite State Machine.
| Table | TransitionTable defining valid state transitions. |
| InitialState | Default initial active state. |
| OtherStates | Additional valid states in the FSM state set. |
| using corium::fsm::StateMachine< Table, InitialState, OtherStates >::StateVariant = std::variant<InitialState, OtherStates...> |
| using corium::fsm::StateMachine< Table, InitialState, OtherStates >::TransitionTableType = Table |
|
inlineconstexpr |
Here is the call graph for this function:
|
inlineexplicitconstexpr |
Here is the call graph for this function:
|
inlineconstexpr |
Access reference to current state as type State (throws std::bad_variant_access if mismatch).
|
inlineconstexpr |
Access const reference to current state as type State.
|
inlineconstexprnoexcept |
Check if current active state matches type State.
|
inline |
Process an incoming event through the state machine transition table.
| Event | Trigger event type. |
| event | Event instance to evaluate. |
|
inlineconstexprnoexcept |
Access active state variant.
|
inlineconstexprnoexcept |
Access active state variant.