fsm
Public Member Functions | List of all members
escad::detail::state_container< States > Class Template Reference

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 ()
 

Detailed Description

template<class States>
class escad::detail::state_container< States >

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.

Member Function Documentation

◆ enter() [1/2]

template<class States >
template<class State >
void escad::detail::state_container< States >::enter ( )
inline

Enter 'State' state.

It is realized by emplacing a new State object within a std::variant.

◆ enter() [2/2]

template<class States >
template<class State , class Context >
void escad::detail::state_container< States >::enter ( Context ctx)
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.


The documentation for this class was generated from the following file: