fsm
Classes | Typedefs | Enumerations | Functions
transition.h File Reference

Defines the transitions class and related helper functions. More...

#include "../base/type_traits.h"
Include dependency graph for transition.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  escad::new_fsm::detail::none
 Tag type indicating no transition. More...
 
struct  escad::new_fsm::detail::sibling< T >
 Helper struct for defining a transition type. More...
 
struct  escad::new_fsm::detail::inner< T >
 
struct  escad::new_fsm::detail::inner_entry< T >
 
class  escad::new_fsm::transitions< S >
 Class representing a collection of transitions. More...
 

Typedefs

template<std::size_t Index, class Transition >
using escad::new_fsm::transition_t = mpl::type_list_element_t< Index, typename Transition::list >
 Type alias for the transition type at a specific index. More...
 

Enumerations

enum  result { none, sibling, inner, inner_entry }
 

Functions

template<class S >
auto escad::new_fsm::sibling ()
 Helper function for creating a transition object. More...
 
template<class S >
auto escad::new_fsm::inner ()
 
template<class S >
auto escad::new_fsm::inner_entry ()
 
auto escad::new_fsm::none ()
 Helper function for creating a transitions object indicating that the event was not handled. More...
 
template<class Transition , class Func , std::size_t... Is>
constexpr void escad::new_fsm::for_each_transition_impl (Transition &&t, Func &&func, std::index_sequence< Is... >)
 Helper function for getting the transition type at a specific index. More...
 
template<class... T, class Func >
constexpr void escad::new_fsm::for_each_transition (transitions< T... > const &trans, Func &&func)
 Helper function for iterating over each transition in a transitions object. More...
 

Detailed Description

Defines the transitions class and related helper functions.

Author
Martin Heubuch (marti.nosp@m.n.he.nosp@m.ubuch.nosp@m.@esc.nosp@m.ad.de)
Version
0.1
Date
2023-02-28

Typedef Documentation

◆ transition_t

template<std::size_t Index, class Transition >
using escad::new_fsm::transition_t = typedef mpl::type_list_element_t<Index, typename Transition::list>

Type alias for the transition type at a specific index.

Template Parameters
IndexThe index of the transition.
TransitionThe transitions object.

Function Documentation

◆ for_each_transition()

template<class... T, class Func >
constexpr void escad::new_fsm::for_each_transition ( transitions< T... > const &  trans,
Func &&  func 
)

Helper function for iterating over each transition in a transitions object.

Template Parameters
TThe list of state types.
FuncThe type of the function to apply to each transition.
Parameters
transThe transitions object.
funcThe function to apply to each transition.

◆ for_each_transition_impl()

template<class Transition , class Func , std::size_t... Is>
constexpr void escad::new_fsm::for_each_transition_impl ( Transition &&  t,
Func &&  func,
std::index_sequence< Is... >   
)

Helper function for getting the transition type at a specific index.

Template Parameters
IndexThe index of the transition.
TransitionThe transitions object.
Parameters
tThe transitions object.
Returns
The transition type at the specified index.

◆ none()

auto escad::new_fsm::none ( )
inline

Helper function for creating a transitions object indicating that the event was not handled.

Returns
A transitions object indicating that the event was not handled.

◆ sibling()

template<class S >
auto escad::new_fsm::sibling ( )
inline

Helper function for creating a transition object.

Template Parameters
SThe state type.
Returns
A transitions object representing the transition.