StateTransitionRule Class Template
Defines a valid state transition with optional guard. More...
Declaration
Private Member Typedefs Index
template <typename StateType> | |
| using | StateTransitionIdType = StateTransitionIdType< StateType > |
Public Constructors Index
template <typename StateType> | |
| constexpr | StateTransitionRule (const StateType from, const StateTransitionIdType transitionId, const StateType to, GuardCallback< StateType > guard=nullptr) |
|
Constructs a transition rule. More... | |
Public Member Functions Index
template <typename StateType> | |
| StateType | from () const noexcept |
|
Returns the source state. More... | |
template <typename StateType> | |
| StateType | to () const noexcept |
|
Returns the target state. More... | |
template <typename StateType> | |
| StateTransitionIdType | transitionId () const noexcept |
|
Returns the transition identifier. More... | |
template <typename StateType> | |
| auto | guard () const noexcept -> GuardCallback< StateType > |
|
Returns the guard callback. More... | |
Private Member Attributes Index
template <typename StateType> | |
| StateType | from_ |
|
The state this rule applies to. More... | |
template <typename StateType> | |
| StateTransitionIdType | transitionId_ |
|
The transition ID that triggers this rule. More... | |
template <typename StateType> | |
| StateType | to_ |
|
The target state after transition. More... | |
template <typename StateType> | |
| GuardCallback< StateType > | guard_ = nullptr |
|
Optional guard callback. More... | |
Description
Defines a valid state transition with optional guard.
Rules are registered with the StateManager and define which transitions are valid. Each rule specifies a source state, transition ID, target state, and an optional guard callback.
- Template Parameters
-
StateType The state enum type.
- See Also
- See Also
Definition at line 47 of file StateTransitionRule.ixx.
Private Member Typedefs
StateTransitionIdType
|
Definition at line 49 of file StateTransitionRule.ixx.
Public Constructors
StateTransitionRule()
| inline constexpr |
Constructs a transition rule.
- Parameters
-
from The source state.
transitionId The transition that triggers this rule.
to The target state.
guard Optional guard callback (default: nullptr).
Definition at line 81 of file StateTransitionRule.ixx.
References helios::engine::state::types::StateTransitionRule< StateType >::from, helios::engine::state::types::StateTransitionRule< StateType >::guard, helios::engine::state::types::StateTransitionRule< StateType >::to and helios::engine::state::types::StateTransitionRule< StateType >::transitionId.
Public Member Functions
from()
| inline nodiscard noexcept |
Returns the source state.
- Returns
The state this rule applies to.
Definition at line 97 of file StateTransitionRule.ixx.
Referenced by helios::engine::state::types::StateTransitionRule< StateType >::StateTransitionRule.
guard()
| inline nodiscard noexcept |
Returns the guard callback.
- Returns
The guard function pointer, or nullptr if no guard.
Definition at line 122 of file StateTransitionRule.ixx.
Referenced by helios::engine::state::types::StateTransitionRule< StateType >::StateTransitionRule.
to()
| inline nodiscard noexcept |
Returns the target state.
- Returns
The state after transition.
Definition at line 106 of file StateTransitionRule.ixx.
Referenced by helios::engine::state::types::StateTransitionRule< StateType >::StateTransitionRule.
transitionId()
| inline nodiscard noexcept |
Returns the transition identifier.
- Returns
The transition ID that triggers this rule.
Definition at line 113 of file StateTransitionRule.ixx.
Referenced by helios::engine::state::types::StateTransitionRule< StateType >::StateTransitionRule.
Private Member Attributes
from_
|
The state this rule applies to.
Definition at line 54 of file StateTransitionRule.ixx.
guard_
|
Optional guard callback.
Definition at line 69 of file StateTransitionRule.ixx.
to_
|
The target state after transition.
Definition at line 64 of file StateTransitionRule.ixx.
transitionId_
|
The transition ID that triggers this rule.
Definition at line 59 of file StateTransitionRule.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.