fsm
Public Types | Public Member Functions | Public Attributes | List of all members
escad::transitions< S > Class Template Reference

Event handler return type. More...

#include <transitions.h>

Public Types

using list = mpl::type_list< S... >
 

Public Member Functions

constexpr transitions (transitions<> const &rhs) noexcept
 Construct new object from empty-listed transactions object. More...
 
template<class T >
 transitions (detail::transition< T >) noexcept
 Construct a new transitions object directly from detail::transition<> More...
 
template<class T >
 transitions (transitions< T >) noexcept
 
 transitions (detail::handled) noexcept
 Construct a new transitions object indicating handled event.
 
 transitions (detail::not_handled) noexcept
 Construct a new transitions object indicating not handled event.
 
bool is_transition () const
 Check if this object is a transition type. More...
 
bool is_handled () const
 Check if the event was handled. More...
 

Public Attributes

std::size_t const idx
 
result const outcome
 

Detailed Description

template<class... S>
class escad::transitions< S >

Event handler return type.

It indicates possible outcomes from an event handler. It is also used to carry on information about event handler outcome. As its created from state->handle(ev) result.

Constructor & Destructor Documentation

◆ transitions() [1/2]

template<class... S>
constexpr escad::transitions< S >::transitions ( transitions<> const &  rhs)
inlinenoexcept

Construct new object from empty-listed transactions object.

This is a case when handler declares a return type: transitions<A, B, C> handle(Foo); but calls handled() or not_handled() which returns exactly transitions<> type which needs to be converted here to transitions<A, B, C>.

◆ transitions() [2/2]

template<class... S>
template<class T >
escad::transitions< S >::transitions ( detail::transition< T >  )
inlinenoexcept

Construct a new transitions object directly from detail::transition<>

Template Parameters
Tstate

Member Function Documentation

◆ is_handled()

template<class... S>
bool escad::transitions< S >::is_handled ( ) const
inline

Check if the event was handled.

Returns
true event was handled by the state.
false event was not handled. Possibly propagate event up in the SM.

◆ is_transition()

template<class... S>
bool escad::transitions< S >::is_transition ( ) const
inline

Check if this object is a transition type.

Returns
true if the object should result in transition
false if the object is not resulting in transition

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