|
fsm
|
Wrapper around std::variant, which is current implementation of states container. More...
#include <state_container.h>
Public Member Functions | |
| template<class State > | |
| void | enter () |
| Enter 'State' state. More... | |
| template<class State , class Context > | |
| void | enter (Context &ctx) |
| Enter 'State' state. More... | |
| void | exit () |
| Exit current state. | |
| template<class F > | |
| auto | visit (F &&fun) |
| template<class State > | |
| auto | is_in () const |
| template<class State > | |
| auto & | state () |
Wrapper around std::variant, which is current implementation of states container.
This is done in separate class to abstract it out in case we want to replace std::variant with something else.
|
inline |
Enter 'State' state.
It is realized by emplacing a new State object within a std::variant.
|
inline |
Enter 'State' state.
Emplace new State and pass a Context to its constructor. This is caller responsibility to determine if given State have proper constructor.
1.8.13