|
infinite_state_machine 1.0.0
Infinite State Machine Library
|
A state machine topology navigation class. More...
#include <infinite_state_machine.hpp>
Classes | |
| struct | transition |
| A struct representing the states exited and entered during a transition. More... | |
Public Member Functions | |
| virtual | ~state_machine () |
| Destructor for the state machine. | |
| struct transition | go (state< Topology > *to) |
| Transition to a new state. | |
| state< Topology > * | at () const |
| Get the current state. | |
| bool | in (state< Topology > *state) const |
| Check if a state is active. | |
A state machine topology navigation class.
This class provides methods to navigate through the state machine's topology, allowing for transitions between states and querying the current state.
Definition at line 44 of file infinite_state_machine.hpp.
|
inlinevirtual |
Destructor for the state machine.
Cleans up the state machine and releases any resources.
Definition at line 48 of file infinite_state_machine.hpp.
|
inline |
Get the current state.
nullptr if there is no active state. Definition at line 119 of file infinite_state_machine.hpp.
|
inline |
Transition to a new state.
This function handles the state transition logic, including the management of entry and exit states.
Do not make any assumptions about the topology. Specifically, do not assume that one state does not occupy more than one state machine terrain. If a state does appear in overlapping topologies, then the state will appear in both the exits and enters. Consider this a correct conclusion since the duplicated state re-enters from a different super-state. The nesting differs.
| to | The new state to transition to. |
Definition at line 87 of file infinite_state_machine.hpp.
|
inline |
Check if a state is active.
| state | The state to check. |
true if the state is active, false otherwise. Definition at line 126 of file infinite_state_machine.hpp.