Generic Finite State Machine.
More...
#include <fsm.hpp>
|
| FSM ()=delete |
|
| FSM (const std::shared_ptr< DataType > &data_to_mutate, const StateType &begin_state, Subject *subject) |
| Finite state machine constructor. More...
|
|
| FSM (const std::shared_ptr< DataType > &data_to_mutate, const StateType &begin_state, const StateType &end_state, Subject *subject) |
| Finite state machine constructor for a terminated FSM. More...
|
|
void | transition (const TransitionType transition_type) |
| Sends a transition value to the FSM, causing the current state to react, and possible transition. More...
|
|
constexpr bool | inFinalState () const noexcept |
| Check to see if the FSM is in it's final state. More...
|
|
void | start () |
| Starts the FSM. More...
|
|
void | update (const double delta) |
| Update is called once per update loop in the engine. More...
|
|
void | stop () |
| Stops the FSM. More...
|
|
template<typename DataType, typename StateType, typename TransitionType, typename... Reactor>
class Events::FSM::FSM< DataType, StateType, TransitionType, Reactor >
Generic Finite State Machine.
- Template Parameters
-
DataType | The Data to be mutated by this finite state machine. |
StateType | The Enum that holds all possible states for the FSM. |
TransitionType | The Enum that holds all possible transitions for the FSM. |
Reactor | Variadic. One reactor for each State in StateType |
template<typename DataType , typename StateType , typename TransitionType , typename... Reactor>
template<typename DataType , typename StateType , typename TransitionType , typename... Reactor>
Events::FSM::FSM< DataType, StateType, TransitionType, Reactor >::FSM |
( |
const std::shared_ptr< DataType > & |
data_to_mutate, |
|
|
const StateType & |
begin_state, |
|
|
Subject * |
subject |
|
) |
| |
|
inline |
Finite state machine constructor.
- Parameters
-
[in] | data_to_mutate | The data to mutate |
[in] | subject | The subject |
[in] | begin_state | The begin state |
template<typename DataType , typename StateType , typename TransitionType , typename... Reactor>
Events::FSM::FSM< DataType, StateType, TransitionType, Reactor >::FSM |
( |
const std::shared_ptr< DataType > & |
data_to_mutate, |
|
|
const StateType & |
begin_state, |
|
|
const StateType & |
end_state, |
|
|
Subject * |
subject |
|
) |
| |
|
inline |
Finite state machine constructor for a terminated FSM.
- Parameters
-
[in] | data_to_mutate | The data to mutate |
[in] | subject | The subject |
[in] | begin_state | The begin state |
[in] | end_state | The end state |
template<typename DataType , typename StateType , typename TransitionType , typename... Reactor>
constexpr bool Events::FSM::FSM< DataType, StateType, TransitionType, Reactor >::inFinalState |
( |
| ) |
const |
|
inlinenoexcept |
Check to see if the FSM is in it's final state.
- Returns
- Returns true if this is a terminated FSM and it is in its final state. False otherwise.
template<typename DataType , typename StateType , typename TransitionType , typename... Reactor>
void Events::FSM::FSM< DataType, StateType, TransitionType, Reactor >::start |
( |
| ) |
|
|
inline |
template<typename DataType , typename StateType , typename TransitionType , typename... Reactor>
template<typename DataType , typename StateType , typename TransitionType , typename... Reactor>
void Events::FSM::FSM< DataType, StateType, TransitionType, Reactor >::transition |
( |
const TransitionType |
transition_type | ) |
|
|
inline |
template<typename DataType , typename StateType , typename TransitionType , typename... Reactor>
void Events::FSM::FSM< DataType, StateType, TransitionType, Reactor >::update |
( |
const double |
delta | ) |
|
|
inline |
The documentation for this class was generated from the following file: