OpenRTM-aist 2.0.2
Loading...
Searching...
No Matches
StaticFSM.h File Reference

Static FSM framework based on Macho. More...

#include <rtm/RTObject.h>
#include <rtm/Macho.h>
#include <rtm/RingBuffer.h>
#include <rtm/EventBase.h>
Include dependency graph for StaticFSM.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RTC::Machine< TOP >
 
class  RTC::Link< C, P >
 

Namespaces

namespace  RTC
 RT-Component.
 

Macros

#define FSM_TOPSTATE(TOP)
 State machine definition macros.
 
#define FSM_SUBSTATE(STATE, SUPERSTATE)
 Macho's SUBSTATE macro for RTC::Link.
 
#define FSM_STATE(S)
 Macho's STATE macro for RTC::Link.
 
#define FSM_INIT_VALUE(S)
 

Detailed Description

Static FSM framework based on Macho.

Date
$Date$
Author
Noriaki Ando n-and.nosp@m.o@ai.nosp@m.st.go.nosp@m..jp

Copyright (C) 2017 National Institute of Advanced Industrial Science and Technology (AIST), Japan All rights reserved.

$Id$

Macro Definition Documentation

◆ FSM_INIT_VALUE

#define FSM_INIT_VALUE ( S)
Value:
template<> \
Definition Macho.h:1648
Definition Macho.h:618

◆ FSM_STATE

#define FSM_STATE ( S)
Value:
public: \
using SELF = S; \
S(::Macho::_StateInstance & instance) \
: ::RTC::Link<S, SUPER>(instance) \
{ \
using MustDeriveFromLink = ::CheckSameType<::RTC::Link<S, SUPER>, \
LINK>::Check; \
static_assert(static_cast<MustDeriveFromLink*>(nullptr)==nullptr, \
"dummy assert for suppress warning"); \
} \
~S() override {} \
static const char * _state_name() { return #S; } \
Box & box() { return *static_cast<Box *>(_box()); } \
friend class ::_VS8_Bug_101615
Definition Macho.h:629
Definition Macho.h:214

Macho's STATE macro for RTC::Link.

◆ FSM_SUBSTATE

#define FSM_SUBSTATE ( STATE,
SUPERSTATE )
Value:
struct STATE \
: public ::RTC::Link< STATE, SUPERSTATE >
#define STATE(S)
Definition Macho.h:236

Macho's SUBSTATE macro for RTC::Link.

◆ FSM_TOPSTATE

#define FSM_TOPSTATE ( TOP)
Value:
struct TOP \
: public ::RTC::Link< TOP, ::Macho::TopBase< TOP > >

State machine definition macros.

FSM basic structure

namespace <FSM name> { FSM_TOPSTATE(Top) { struct Box { Box() : <initializer> {} : <some operations> : }; FSM_STATE(Top); : virtual void event_operations() {}; : private: virtual RTC::ReturnCode_t onInit(); virtual RTC::ReturnCode_t onEntry(); virtual RTC::ReturnCode_t onExit(); };

FSM_SUBSTATE(OtherState, Top) { FSM_STATE(OtherState); virtual void event_operation(); private: virtual RTC::ReturnCode_t onEntry(); virtual RTC::ReturnCode_t onExit(); };

FSM_SUBSTATE(OtherState2, Top) : other states

}; // end of <FSM name>

Macho's TOPSTATE macro for RTC::Link