Embedded Template Library 1.0
Loading...
Searching...
No Matches
etl::hfsm Class Reference

#include <hfsm.h>

Public Member Functions

 hfsm (etl::message_router_id_t id)
 Constructor.
 
void start (bool call_on_enter_state=true) ETL_OVERRIDE
 
virtual void reset (bool call_on_exit_state=false) ETL_OVERRIDE
 
void receive (const etl::imessage &message) ETL_OVERRIDE
 Top level message handler for the HFSM.
 
void receive (const etl::imessage &message) ETL_OVERRIDE
 Top level message handler for the FSM.
 
void receive (const etl::imessage &message) ETL_OVERRIDE
 Top level message handler for the FSM.
 
virtual void receive (const etl::imessage &)=0
 Top level message handler for the FSM.
 
virtual void receive (etl::message_router_id_t destination_router_id, const etl::imessage &message)
 
virtual void receive (etl::shared_message shared_msg)
 
virtual void receive (etl::message_router_id_t destination_router_id, etl::shared_message shared_msg)
 
virtual void receive (const etl::imessage &)=0
 Top level message handler for the FSM.
 
virtual void receive (etl::message_router_id_t destination_router_id, const etl::imessage &message)
 
virtual void receive (etl::shared_message shared_msg)
 
virtual void receive (etl::message_router_id_t destination_router_id, etl::shared_message shared_msg)
 
virtual void receive (const etl::imessage &)=0
 Top level message handler for the FSM.
 
virtual void receive (etl::message_router_id_t destination_router_id, const etl::imessage &message)
 
virtual void receive (etl::shared_message shared_msg)
 
virtual void receive (etl::message_router_id_t destination_router_id, etl::shared_message shared_msg)
 
virtual void receive (const etl::imessage &)=0
 Top level message handler for the FSM.
 
virtual void receive (etl::message_router_id_t destination_router_id, const etl::imessage &message)
 
virtual void receive (etl::shared_message shared_msg)
 
virtual void receive (etl::message_router_id_t destination_router_id, etl::shared_message shared_msg)
 
- Public Member Functions inherited from etl::fsm
 fsm (etl::message_router_id_t id)
 Constructor.
 
template<typename TSize >
void set_states (etl::ifsm_state **p_states, TSize size)
 Set the states for the FSM.
 
bool accepts (etl::message_id_t) const ETL_OVERRIDE
 
etl::fsm_state_id_t get_state_id () const
 Gets the current state id.
 
ifsm_stateget_state ()
 Gets a reference to the current state interface.
 
const ifsm_stateget_state () const
 Gets a const reference to the current state interface.
 
bool is_started () const
 Checks if the FSM has been started.
 
ETL_DEPRECATED bool is_null_router () const ETL_OVERRIDE
 
bool is_producer () const ETL_OVERRIDE
 
bool is_consumer () const ETL_OVERRIDE
 
 fsm (etl::message_router_id_t id)
 Constructor.
 
template<typename TSize >
void set_states (etl::ifsm_state **p_states, TSize size)
 Set the states for the FSM.
 
bool accepts (etl::message_id_t) const ETL_OVERRIDE
 Does this FSM accept the message id? Yes, it accepts everything!
 
etl::fsm_state_id_t get_state_id () const
 Gets the current state id.
 
ifsm_stateget_state ()
 Gets a reference to the current state interface.
 
const ifsm_stateget_state () const
 Gets a const reference to the current state interface.
 
bool is_started () const
 Checks if the FSM has been started.
 
ETL_DEPRECATED bool is_null_router () const ETL_OVERRIDE
 
bool is_producer () const ETL_OVERRIDE
 
bool is_consumer () const ETL_OVERRIDE
 
virtual bool accepts (etl::message_id_t) const=0
 
bool accepts (const etl::imessage &msg) const
 
virtual bool accepts (etl::message_id_t) const=0
 
bool accepts (const etl::imessage &msg) const
 
virtual bool accepts (etl::message_id_t) const=0
 
bool accepts (const etl::imessage &msg) const
 
virtual bool accepts (etl::message_id_t) const=0
 
bool accepts (const etl::imessage &msg) const
 
- Public Member Functions inherited from etl::imessage_router
bool accepts (const etl::imessage &msg) const
 
etl::message_router_id_t get_message_router_id () const
 
bool accepts (const etl::imessage &msg) const
 
etl::message_router_id_t get_message_router_id () const
 
- Public Member Functions inherited from etl::successor< imessage_router >
 successor ()
 Default constructor.
 
 successor (successor_type &s)
 Construct from a successor type.
 
void set_successor (successor_type &s)
 Set the successor.
 
void append_successor (TSuccessor &s)
 Append a successor.
 
void clear_successor ()
 Clear the successor.
 
void clear_successor_chain ()
 Clear the successor chain.
 
successor_typeget_successor () const
 
bool has_successor () const
 Does this have a successor?
 

Additional Inherited Members

- Public Types inherited from etl::imessage_router
enum  {
  NULL_MESSAGE_ROUTER = 255 , MESSAGE_BUS = 254 , ALL_MESSAGE_ROUTERS = 253 , MESSAGE_BROKER = 252 ,
  MESSAGE_ROUTER = 251 , MAX_MESSAGE_ROUTER = 249
}
 
enum  {
  NULL_MESSAGE_ROUTER = 255 , MESSAGE_BUS = 254 , ALL_MESSAGE_ROUTERS = 253 , MESSAGE_BROKER = 252 ,
  MESSAGE_ROUTER = 251 , MAX_MESSAGE_ROUTER = 249
}
 
- Public Types inherited from etl::successor< imessage_router >
typedef imessage_router successor_type
 
- Protected Member Functions inherited from etl::imessage_router
 imessage_router (etl::message_router_id_t id_)
 
 imessage_router (etl::message_router_id_t id_, imessage_router &successor_)
 
 imessage_router (etl::message_router_id_t id_)
 
 imessage_router (etl::message_router_id_t id_, imessage_router &successor_)
 

Detailed Description

The HFSM class. Builds on the FSM class by overriding the receive function and adding state hierarchy walking functions.

Member Function Documentation

◆ receive() [1/19]

virtual void etl::imessage_router::receive ( const etl::imessage message)
virtual

Top level message handler for the FSM.

Reimplemented from etl::fsm.

◆ receive() [2/19]

virtual void etl::imessage_router::receive ( const etl::imessage message)
virtual

Top level message handler for the FSM.

Reimplemented from etl::fsm.

◆ receive() [3/19]

virtual void etl::imessage_router::receive ( const etl::imessage message)
virtual

Top level message handler for the FSM.

Reimplemented from etl::fsm.

◆ receive() [4/19]

virtual void etl::imessage_router::receive ( const etl::imessage message)
virtual

Top level message handler for the FSM.

Reimplemented from etl::fsm.

◆ receive() [5/19]

void etl::fsm::receive ( const etl::imessage message)
inlinevirtual

Top level message handler for the FSM.

Reimplemented from etl::fsm.

◆ receive() [6/19]

void etl::fsm::receive ( const etl::imessage message)
inlinevirtual

Top level message handler for the FSM.

Reimplemented from etl::fsm.

◆ receive() [7/19]

void etl::hfsm::receive ( const etl::imessage message)
inlinevirtual

Top level message handler for the HFSM.

Reimplemented from etl::fsm.

◆ receive() [8/19]

virtual void etl::imessage_router::receive ( etl::message_router_id_t  destination_router_id,
const etl::imessage message 
)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [9/19]

virtual void etl::imessage_router::receive ( etl::message_router_id_t  destination_router_id,
const etl::imessage message 
)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [10/19]

virtual void etl::imessage_router::receive ( etl::message_router_id_t  destination_router_id,
const etl::imessage message 
)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [11/19]

virtual void etl::imessage_router::receive ( etl::message_router_id_t  destination_router_id,
const etl::imessage message 
)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [12/19]

virtual void etl::imessage_router::receive ( etl::message_router_id_t  destination_router_id,
etl::shared_message  shared_msg 
)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [13/19]

virtual void etl::imessage_router::receive ( etl::message_router_id_t  destination_router_id,
etl::shared_message  shared_msg 
)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [14/19]

virtual void etl::imessage_router::receive ( etl::message_router_id_t  destination_router_id,
etl::shared_message  shared_msg 
)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [15/19]

virtual void etl::imessage_router::receive ( etl::message_router_id_t  destination_router_id,
etl::shared_message  shared_msg 
)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [16/19]

virtual void etl::imessage_router::receive ( etl::shared_message  shared_msg)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [17/19]

virtual void etl::imessage_router::receive ( etl::shared_message  shared_msg)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [18/19]

virtual void etl::imessage_router::receive ( etl::shared_message  shared_msg)
inlinevirtual

Reimplemented from etl::fsm.

◆ receive() [19/19]

virtual void etl::imessage_router::receive ( etl::shared_message  shared_msg)
inlinevirtual

Reimplemented from etl::fsm.

◆ reset()

virtual void etl::hfsm::reset ( bool  call_on_exit_state = false)
inlinevirtual

Reset the HFSM to pre-started state.

Parameters
call_on_exit_stateIf true will call on_exit_state() for the current state. Default = false.

Reimplemented from etl::fsm.

◆ start()

void etl::hfsm::start ( bool  call_on_enter_state = true)
inlinevirtual

Starts the HFSM. Can only be called once. Subsequent calls will do nothing.

Parameters
call_on_enter_stateIf true will call on_enter_state() for the first state. Default = true. If the first state has child states then they will be recursively entered.

Reimplemented from etl::fsm.


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