![]() |
Embedded Template Library
1.0
|
Simple Finite State Machine. More...
#include <state_chart.h>
Classes | |
struct | state |
State definition. More... | |
struct | transition |
Transition definition. More... | |
Public Member Functions | |
ETL_CONSTEXPR | state_chart (TObject &object_, const transition *transition_table_begin_, const transition *transition_table_end_, const state_id_t state_id_) |
ETL_CONSTEXPR | state_chart (TObject &object_, const transition *transition_table_begin_, const transition *transition_table_end_, const state *state_table_begin_, const state *state_table_end_, const state_id_t state_id_) |
void | set_transition_table (const transition *transition_table_begin_, const transition *transition_table_end_) |
void | set_state_table (const state *state_table_begin_, const state *state_table_end_) |
TObject & | get_object () |
const TObject & | get_object () const |
const state * | find_state (state_id_t state_id) |
virtual void | start (const bool on_entry_initial=true) |
virtual void | process_event (const event_id_t event_id) |
![]() | |
state_id_t | get_state_id () const |
Additional Inherited Members | |
![]() | |
typedef int | state_id_t |
typedef int | event_id_t |
![]() | |
istate_chart (state_id_t current_state_id_) | |
![]() | |
state_id_t | current_state_id |
The current state id. | |
Simple Finite State Machine.
|
inline |
Constructor.
object_ | A reference to the implementation object. |
transition_table_begin_ | The start of the table of transitions. |
transition_table_end_ | The end of the table of transitions. |
state_id_ | The initial state id. |
|
inline |
Constructor.
object_ | A reference to the implementation object. |
transition_table_begin_ | The start of the table of transitions. |
transition_table_end_ | The end of the table of transitions. |
state_table_begin_ | The start of the state table. |
state_table_end_ | The end of the state table. |
state_id_ | The initial state id. |
|
inline |
Gets the current state id.
|
inline |
Gets a reference to the implementation object.
|
inline |
Gets a const reference to the implementation object.
|
inlinevirtual |
Processes the specified event. The state machine will action the first item in the transition table that satisfies the conditions for executing the action.
event_id | The id of the event to process. |
Implements etl::istate_chart.
|
inline |
Sets the state table.
state_table_begin_ | The start of the state table. |
state_table_end_ | The end of the state table. |
|
inline |
Sets the transition table.
state_table_begin_ | The start of the state table. |
state_table_end_ | The end of the state table. |