Defines the transitions class and related helper functions.
More...
#include "../base/type_traits.h"
Go to the source code of this file.
|
| 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...
|
| |
|
| enum | result { none,
sibling,
inner,
inner_entry
} |
| |
|
| 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...
|
| |
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
- Copyright
- Copyright (c) 2023
◆ transition_t
template<std::size_t Index, class Transition >
Type alias for the transition type at a specific index.
- Template Parameters
-
| Index | The index of the transition. |
| Transition | The transitions object. |
◆ 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
-
| T | The list of state types. |
| Func | The type of the function to apply to each transition. |
- Parameters
-
| trans | The transitions object. |
| func | The 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
-
| Index | The index of the transition. |
| Transition | The transitions object. |
- Parameters
-
- 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
-
- Returns
- A transitions object representing the transition.