libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::msm::hash::machine< STT > Class Template Reference

Instantiate this object to use the created state-machine. More...

#include <msm.hpp>

Public Types

using element_type = STT
 
using states = typename element_type::transition_table::states
 
using end_states = typename element_type::transition_table::end_states
 

Public Member Functions

constexpr machine ()=default
 
template<class Arg , class... Args, class = typename std::enable_if<!std::is_convertible<Arg, machine>::value>::type>
constexpr machine (Arg &&arg, Args &&...args) noexcept(noexcept(states_to_actions_table_t(std::forward< Arg >(arg), std::forward< Args >(args)...)))
 
constexpr machine (machine const &) noexcept(noexcept(states_to_actions_table_t(std::declval< states_to_actions_table_t >())))
 
template<class Params >
end_states process (states s, Params &p) const noexcept(noexcept(std::declval< states_to_actions_table_t >()[s].process(reinterpret_cast< void * >(&p))))
 Call this method to perform your state transition from the start state to the next state. More...
 
template<class Params >
end_states process (states s, Params &p) noexcept(noexcept(std::declval< states_to_actions_table_t >()[s].process(reinterpret_cast< void * >(&p))))
 Call this method to perform your state transition from the start state to the next state. More...
 

Detailed Description

template<class STT>
class jmmcg::LIBJMMCG_VER_NAMESPACE::msm::hash::machine< STT >

Instantiate this object to use the created state-machine.

Definition at line 428 of file msm.hpp.

Member Typedef Documentation

◆ element_type

template<class STT >
using jmmcg::LIBJMMCG_VER_NAMESPACE::msm::hash::machine< STT >::element_type = STT

Definition at line 430 of file msm.hpp.

◆ end_states

template<class STT >
using jmmcg::LIBJMMCG_VER_NAMESPACE::msm::hash::machine< STT >::end_states = typename element_type::transition_table::end_states

Definition at line 432 of file msm.hpp.

◆ states

template<class STT >
using jmmcg::LIBJMMCG_VER_NAMESPACE::msm::hash::machine< STT >::states = typename element_type::transition_table::states

Definition at line 431 of file msm.hpp.

Constructor & Destructor Documentation

◆ machine() [1/3]

template<class STT >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::msm::hash::machine< STT >::machine ( )
constexprdefault

◆ machine() [2/3]

template<class STT >
template<class Arg , class... Args, class = typename std::enable_if<!std::is_convertible<Arg, machine>::value>::type>
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::msm::hash::machine< STT >::machine ( Arg &&  arg,
Args &&...  args 
)
inlineexplicitconstexprnoexcept

Definition at line 918 of file msm_impl.hpp.

◆ machine() [3/3]

template<class STT >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::msm::hash::machine< STT >::machine ( machine< STT > const &  m)
inlineconstexprnoexcept

Definition at line 924 of file msm_impl.hpp.

Member Function Documentation

◆ process() [1/2]

template<class STT >
template<class Params >
hash::machine< STT >::end_states jmmcg::LIBJMMCG_VER_NAMESPACE::msm::hash::machine< STT >::process ( states  s,
Params &  p 
) )[s] const
inlinenoexcept

Call this method to perform your state transition from the start state to the next state.

Algorithmic complexity: O(1) where n is the number of entries in the meta-state table with a small constant. This is thread-safe (thus re-entrant) only if all of the called actions are.

Parameters
sThe start state for the transition to be selected. If s is not found in the state_transition_table, then there is no effect, nothing happens.
pThe parameters to pass to the event selected by the start state from the state_transition_table. Note that the events must have a member-using called argument_type that specifies this type, otherwise there will be a compile-time error.
Returns
The resultant state of the row selected by the input state, s. If the row was a guard-row, then if the guard permitted it the resultant state, otherwise the input state, s.

Definition at line 930 of file msm_impl.hpp.

◆ process() [2/2]

template<class STT >
template<class Params >
hash::machine< STT >::end_states jmmcg::LIBJMMCG_VER_NAMESPACE::msm::hash::machine< STT >::process ( states  s,
Params &  p 
) )[s]
inlinenoexcept

Call this method to perform your state transition from the start state to the next state.

Algorithmic complexity: O(1) where n is the number of entries in the meta-state table with a small constant. This is thread-safe (thus re-entrant) only if all of the called actions are.

Parameters
sThe start state for the transition to be selected. If s is not found in the state_transition_table, then there is no effect, nothing happens.
pThe parameters to pass to the event selected by the start state from the state_transition_table. Note that the events must have a member-using called argument_type that specifies this type, otherwise there will be a compile-time error.
Returns
The resultant state of the row selected by the input state, s. If the row was a guard-row, then if the guard permitted it the resultant state, otherwise the input state, s.

Definition at line 940 of file msm_impl.hpp.


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