Class hfsm

Inheritance Relationships

Base Types

Class Documentation

class hfsm : public rcppsw::patterns::fsm::base_fsm, public rcppsw::er::client<hfsm>

Implements a software-based hierarchical state machine (states can contain other states).

Public Functions

inline explicit hfsm(uint8_t max_states, uint8_t initial_state = 0)
Parameters:
  • max_states – The maximum number of state machine states.

  • initial_state – Initial state machine state.

~hfsm() override = default
void change_parent(uint8_t state, rcppsw::patterns::fsm::state *new_parent)

Change the parent state of the specified state to a new state.

Parameters:
  • state – The state within THIS state machine to change the parent of.

  • new_parent – A new parent state, which can be from ANOTHER hfsm.

inline virtual void init(void) override

Initialize/reset the state machine.

Protected Functions

inline int ST_top_state(void)

The topmost state in the hierarchy, of which all states are children. If an event gets all the way up to here, that’s bad, because it should have been handled at a lower layer.

Returns:

Does not return.

inline hfsm_state_action0<hfsm, &hfsm::ST_top_state> *top_state(void)