simple_state_machine< EnumT > Class Template Reference

#include <ArmarXCore/core/util/SimpleStatemachine.h>

Public Types

using enum_t = EnumT
 
using hook_function_t = std::function< void(const state_t &)>
 
using state_function_t = std::function< enum_t(state_t &)>
 
using state_machine_t = simple_state_machine< enum_t >
 
using state_t = ::armarx::state_t< enum_t >
 
using transition_function_t = std::function< void(const state_t &)>
 

Public Member Functions

template<enum_t state>
void configure_state (state_function_t f)
 
template<enum_t state0, enum_t state1>
void configure_transition (transition_function_t f=noop_transition)
 
template<enum_t state0>
state_t run ()
 
void set_post_state_exit_callback (hook_function_t f)
 
void set_post_transition_callback (hook_function_t f)
 
void set_pre_state_enter_callback (hook_function_t f)
 
void set_pre_transition_callback (hook_function_t f)
 

Static Public Member Functions

static void noop_transition (const state_t &)
 

Detailed Description

template<class EnumT>
class armarx::simple_state_machine< EnumT >

Definition at line 35 of file SimpleStatemachine.h.

Member Typedef Documentation

◆ enum_t

using enum_t = EnumT

Definition at line 67 of file SimpleStatemachine.h.

◆ hook_function_t

using hook_function_t = std::function<void(const state_t&)>

Definition at line 73 of file SimpleStatemachine.h.

◆ state_function_t

using state_function_t = std::function<enum_t(state_t&)>

Definition at line 71 of file SimpleStatemachine.h.

◆ state_machine_t

Definition at line 69 of file SimpleStatemachine.h.

◆ state_t

Definition at line 68 of file SimpleStatemachine.h.

◆ transition_function_t

using transition_function_t = std::function<void(const state_t&)>

Definition at line 72 of file SimpleStatemachine.h.

Member Function Documentation

◆ configure_state()

void configure_state ( state_function_t  f)
inline

Definition at line 80 of file SimpleStatemachine.h.

◆ configure_transition()

void configure_transition ( transition_function_t  f = noop_transition)
inline

Definition at line 87 of file SimpleStatemachine.h.

◆ noop_transition()

static void noop_transition ( const state_t )
inlinestatic

Definition at line 77 of file SimpleStatemachine.h.

◆ run()

state_t run ( )
inline

Definition at line 113 of file SimpleStatemachine.h.

◆ set_post_state_exit_callback()

void set_post_state_exit_callback ( hook_function_t  f)
inline

Definition at line 103 of file SimpleStatemachine.h.

◆ set_post_transition_callback()

void set_post_transition_callback ( hook_function_t  f)
inline

Definition at line 93 of file SimpleStatemachine.h.

◆ set_pre_state_enter_callback()

void set_pre_state_enter_callback ( hook_function_t  f)
inline

Definition at line 108 of file SimpleStatemachine.h.

◆ set_pre_transition_callback()

void set_pre_transition_callback ( hook_function_t  f)
inline

Definition at line 98 of file SimpleStatemachine.h.


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