StateOS
Loading...
Searching...
No Matches
stateos::StateMachineT< limit_ > Struct Template Reference

create and initialize a hierarchical state machine object More...

#include <osstatemachine.h>

Inheritance diagram for stateos::StateMachineT< limit_ >:

Public Types

using Ptr = std::unique_ptr<StateMachineT<limit_>>
 result type of Create()

Public Member Functions

 StateMachineT ()
 constructor, see the constructor parameters of the class
 StateMachineT (const std::vector< Action > &_tab)
 constructor, see the constructor parameters of the class
 StateMachineT (StateMachineT &&_src)
 move constructor
 StateMachineT (const StateMachineT &)=delete
StateMachineT & operator= (StateMachineT &&)=delete
StateMachineT & operator= (const StateMachineT &)=delete
template<class S, typename... A>
void add (S &_owner, unsigned _event, A &&... _args)
 add an action (parameters of the Action constructor) to the table of the state machine
void add (const std::vector< Action > &_tab)
 add the actions to the table of the state machine
void start (tsk_t &_task, hsm_state_t &_init)
 link the actions of the table and start the state machine (hsm_start())
void reset ()
 hsm_reset()
void kill ()
 hsm_kill()
void destroy ()
 hsm_destroy()
int give (unsigned _event)
 hsm_give()
int giveISR (unsigned _event)
 hsm_giveISR()
template<typename T>
int sendFor (unsigned _event, const T &_delay)
 hsm_sendFor()
template<typename T>
int sendUntil (unsigned _event, const T &_time)
 hsm_sendUntil()
int send (unsigned _event)
 hsm_send()
void push (unsigned _event)
 hsm_push()
void pushISR (unsigned _event)
 hsm_pushISR()
hsm_state_t * getState ()
 hsm_getState()
void startAsync (tsk_t &_task, hsm_state_t &_init)
 link the actions of the table and start the state machine (hsm_startAsync())
int giveAsync (unsigned _event)
 hsm_giveAsync()
int sendAsync (unsigned _event)
 hsm_sendAsync()

Static Public Member Functions

static Ptr Create ()
 create dynamic object with manageable resources
static Ptr Create (const std::vector< Action > &_tab)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Detailed Description

template<unsigned limit_ = 1>
struct stateos::StateMachineT< limit_ >

create and initialize a hierarchical state machine object

Constructor parameters
  • limit: size of an event queue (max number of stored events)

Member Function Documentation

◆ Create()

template<unsigned limit_ = 1>
Ptr stateos::StateMachineT< limit_ >::Create ( )
inlinestatic

create dynamic object with manageable resources

Parameters
  • limit: size of an event queue (max number of stored events)
Returns
std::unique_pointer / pointer to StateMachineT<> object
Note
use only in thread mode

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