Loading...
Searching...
No Matches
etl::state_chart< TObject, void > Class Template Reference

`#include <state_chart.h>`

## Public Types

typedef void | parameter_t
typedef state_chart_traits::state_id_t | state_id_t
typedef state_chart_traits::event_id_t | event_id_t
typedef state_chart_traits::transition< TObject, void > | transition
typedef state_chart_traits::state< TObject > | state
Public Types inherited from etl::istate_chart< void >
typedef void | parameter_t
typedef state_chart_traits::state_id_t | state_id_t
typedef state_chart_traits::event_id_t | event_id_t

## Public Member Functions

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
virtual void | start (bool on_entry_initial=true) ETL_OVERRIDE
| Start the state chart.
void | process_event (event_id_t event_id) ETL_OVERRIDE
Public Member Functions inherited from etl::istate_chart< void >
| istate_chart (state_id_t initial_state_id)
state_id_t | get_state_id () const

## Additional Inherited Members

Protected Attributes inherited from etl::istate_chart< void >
state_id_t | current_state_id
| The current state id.

## Detailed Description

template<typename TObject>
class etl::state_chart< TObject, void >

Simple Finite State Machine Runtime tables. Event has no parameter.

## Constructor & Destructor Documentation

## state_chart()

template<typename TObject>

ETL_CONSTEXPR etl::state_chart< TObject, void >::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_ )

inline

Constructor.

Parameters

  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.

## Member Function Documentation

## get_object() [1/2]

template<typename TObject>

TObject & etl::state_chart< TObject, void >::get_object | ( |  | ) |

inline

Gets a reference to the implementation object.

Returns
  Reference to the implementation object.

## get_object() [2/2]

template<typename TObject>

const TObject & etl::state_chart< TObject, void >::get_object | ( |  | ) | const

inline

Gets a const reference to the implementation object.

Returns
  Const reference to the implementation object.

## process_event()

template<typename TObject>

void etl::state_chart< TObject, void >::process_event | ( | event_id_t | event_id | ) |

inline virtual

Processes the specified event. The state machine will action the first item in the transition table that satisfies the conditions for executing the action.

Parameters

  event_id | The id of the event to process.

Implements etl::istate_chart< void >.

## set_state_table()

template<typename TObject>

void etl::state_chart< TObject, void >::set_state_table | ( | const state * | state_table_begin_,
|  | const state * | state_table_end_ )

inline

Sets the state table.

Parameters

  state_table_begin_ | The start of the state table.
  state_table_end_ | The end of the state table.

## set_transition_table()

template<typename TObject>

void etl::state_chart< TObject, void >::set_transition_table | ( | const transition * | transition_table_begin_,
|  | const transition * | transition_table_end_ )

inline

Sets the transition table.

Parameters

  state_table_begin_ | The start of the state table.
  state_table_end_ | The end of the state table.

## start()

template<typename TObject>

virtual void etl::state_chart< TObject, void >::start | ( | bool | on_entry_initial = true | ) |

inline virtual

Start the state chart.

Implements etl::istate_chart< void >.

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

- include/etl/state_chart.h