29#ifndef ETL_HFSM_INCLUDED
30#define ETL_HFSM_INCLUDED
48 hfsm(etl::message_router_id_t
id)
63 if (p_state == ETL_NULLPTR)
65 p_state = state_list[0];
88 do_exits(ETL_NULLPTR, p_state);
91 p_state = ETL_NULLPTR;
105 if (have_changed_state(next_state_id))
112 do_exits(
p_root, p_state);
116 p_state = state_list[next_state_id];
118 else if (is_self_transition(next_state_id))
120 p_state->on_exit_state();
121 p_state->on_enter_state();
167 while (
s != ETL_NULLPTR)
216 while (
p_target->p_default_child != ETL_NULLPTR)
238 while (p_current->p_active_child != ETL_NULLPTR)
240 p_current = p_current->p_active_child;
244 while (p_current !=
p_root)
246 p_current->on_exit_state();
247 p_current = p_current->p_parent;
Exception for message received but not started.
Definition fsm.h:176
Exception for null state pointer.
Definition fsm.h:112
Exception for forbidden state changes.
Definition fsm.h:164
Exception for invalid state id.
Definition fsm.h:125
The FSM class.
Definition fsm.h:344
void receive(const etl::imessage &message) ETL_OVERRIDE
Top level message handler for the FSM.
Definition fsm.h:417
bool is_started() const
Checks if the FSM has been started.
Definition fsm.h:495
void receive(const etl::imessage &message) ETL_OVERRIDE
Top level message handler for the HFSM.
Definition hfsm.h:99
void start(bool call_on_enter_state=true) ETL_OVERRIDE
Definition hfsm.h:60
virtual void reset(bool call_on_exit_state=false) ETL_OVERRIDE
Definition hfsm.h:84
hfsm(etl::message_router_id_t id)
Constructor.
Definition hfsm.h:48
Interface class for FSM states.
Definition fsm.h:216
#define ETL_ASSERT(b, e)
Definition error_handler.h:356
bitset_ext
Definition absolute.h:38
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314
uint_least8_t fsm_state_id_t
Allow alternative type for state id.
Definition fsm.h:75