35template<
typename state_t,
typename event_t>
36using transition_t = std::pair<std::pair<state_t, event_t>, std::tuple<action_t, state_t>>;
38template<
typename state_t,
typename event_t>
41template<
typename state_t,
typename event_t>
50 return transition.first.first == m_state && transition.first.second == event;
52 if (it != m_transition_table.end()) {
53 const action_t &action = std::get<0>(it->second);
54 const state_t &state = std::get<1>(it->second);
67 m_transition_table = transition_table;
75 return m_transition_table;
std::vector< transition_t< state_t, event_t > > transition_table_t
Definition: StateMachine1.hpp:39
std::function< void()> action_t
Definition: StateMachine1.hpp:33
std::pair< std::pair< state_t, event_t >, std::tuple< action_t, state_t > > transition_t
Definition: StateMachine1.hpp:36
std::vector< transition_t< state_t, event_t, data_t > > transition_table_t
Definition: StateMachine4.hpp:57
std::pair< std::pair< state_t, event_t >, std::tuple< guard_t< state_t, event_t, data_t >, action_t< state_t, event_t, data_t >, state_t > > transition_t
Definition: StateMachine4.hpp:54
std::function< void(const data_t &)> action_t
Definition: StateMachine4.hpp:39
Definition: StateMachine1.hpp:42
void set_transition_table(const transition_table_t< state_t, event_t > &transition_table)
Definition: StateMachine1.hpp:66
void set_state(const state_t &state)
Definition: StateMachine1.hpp:62
transition_table_t< state_t, event_t > get_transition_table() const
Definition: StateMachine1.hpp:74
state_machine_t()=default
state_machine_t(const state_t &state, transition_table_t< state_t, event_t > transition_table)
Definition: StateMachine1.hpp:46
state_t get_state() const
Definition: StateMachine1.hpp:70
bool handle_event(const event_t &event)
Definition: StateMachine1.hpp:48