Go to the documentation of this file.
19 #ifndef RTC_FSMACTIONLISTENER_H
20 #define RTC_FSMACTIONLISTENER_H
27 #include <rtm/idl/RTCSkel.h>
29 #include <rtm/idl/ExtendedFsmServiceStub.h>
259 static const char*
const typeString[] =
265 "PRE_ON_STATE_CHANGE",
266 "PRE_FSM_ACTION_LISTENER_NUM"
270 return typeString[
static_cast<uint8_t
>(type)];
502 static const char*
const typeString[] =
508 "POST_ON_STATE_CHANGE",
509 "POST_FSM_ACTION_LISTENER_NUM"
513 return typeString[
static_cast<uint8_t
>(type)];
543 ReturnCode_t ret) = 0;
748 static const char*
const typeString[] =
754 "ADD_FSM_TRANSITION",
755 "REMOVE_FSM_TRANSITION",
758 "FSM_PROFILE_LISTENER_NUM"
762 return typeString[
static_cast<uint8_t
>(type)];
791 virtual void operator()(const ::RTC::FsmProfile& fsmprof) = 0;
969 static const char*
const typeString[] =
973 "FSM_STRUCTURE_LISTENER_NUM"
977 return typeString[
static_cast<uint8_t
>(type)];
1006 virtual void operator()(::RTC::FsmStructure& pprof) = 0;
1030 using Entry = std::pair<PreFsmActionListener*, bool>;
1109 void notify(
const char* state);
1112 std::vector<Entry> m_listeners;
1135 using Entry = std::pair<PostFsmActionListener*, bool>;
1215 void notify(
const char* state, ReturnCode_t ret);
1218 std::vector<Entry> m_listeners;
1242 using Entry = std::pair<FsmProfileListener*, bool>;
1320 void notify(RTC::FsmProfile& profile);
1323 std::vector<Entry> m_listeners;
1345 using Entry = std::pair<FsmStructureListener*, bool>;
1423 void notify(RTC::FsmStructure& structure);
1426 std::vector<Entry> m_listeners;
1681 if (
static_cast<uint8_t
>(type) < preaction_.size())
1683 preaction_[
static_cast<uint8_t
>(type)].
notify(state);
1712 if (
static_cast<uint8_t
>(type) < postaction_.size())
1714 postaction_[
static_cast<uint8_t
>(type)].
notify(state, ret);
1741 if (
static_cast<uint8_t
>(type) < profile_.size())
1743 profile_[
static_cast<uint8_t
>(type)].
notify(profile);
1770 if (
static_cast<uint8_t
>(type) < structure_.size())
1772 structure_[
static_cast<uint8_t
>(type)].
notify(structure);
1822 #endif // RTC_FSMACTIONLISTENER_H
PostFsmActionListenerType
The types of PostFsmActionListener.
Definition: FsmActionListener.h:332
virtual ~FsmProfileListener()
Destructor.
PreFsmActionListenerHolder()
Constructor.
virtual ~PreFsmActionListenerHolder()
Destructor.
void notify(const char *state, ReturnCode_t ret)
Notify listeners.
bool removeListener(PreFsmActionListenerType type, PreFsmActionListener *listener)
Remove the listener.
virtual ~PostFsmActionListenerHolder()
Destructor.
@ PRE_FSM_ACTION_LISTENER_NUM
virtual ~FsmProfileListenerHolder()
Destructor.
virtual void operator()(const char *)=0
Virtual Callback function.
static const char * toString(PostFsmActionListenerType type)
Convert PostFsmActionListenerType into the string.
Definition: FsmActionListener.h:500
virtual ~PreFsmActionListener()
Destructor.
@ FSM_PROFILE_LISTENER_NUM
virtual ~FsmStructureListenerHolder()
Destructor.
virtual void operator()(const ::RTC::FsmProfile &fsmprof)=0
Virtual Callback function.
void addListener(PostFsmActionListener *listener, bool autoclean)
Add the listener.
PreFsmActionListenerType
The types of PreFsmActionListener.
Definition: FsmActionListener.h:89
bool notify(PreFsmActionListenerType type, const char *state)
Definition: FsmActionListener.h:1679
FsmProfileListener holder class.
Definition: FsmActionListener.h:1240
FsmProfileListenerHolder()
Constructor.
PreFsmActionListener holder class.
Definition: FsmActionListener.h:1028
FsmStructureListenerType
The types of FsmStructureListener.
Definition: FsmActionListener.h:811
void addListener(FsmProfileListener *listener, bool autoclean)
Add the listener.
PostFsmActionListener class.
Definition: FsmActionListener.h:474
bool notify(PostFsmActionListenerType type, const char *state, ReturnCode_t ret)
Definition: FsmActionListener.h:1710
FsmProfileListenerType
The types of FsmProfileListener.
Definition: FsmActionListener.h:574
virtual ~FsmStructureListener()
Destructor.
@ FSM_STRUCTURE_LISTENER_NUM
FsmStructureListener holder class.
Definition: FsmActionListener.h:1343
FsmStructureListener class.
Definition: FsmActionListener.h:941
bool addListener(PreFsmActionListenerType type, PreFsmActionListener *listener, bool autoclean=true)
Add the listener.
FsmStructureListenerHolder()
Constructor.
PreFsmActionListener class.
Definition: FsmActionListener.h:231
virtual void operator()(const char *state, ReturnCode_t ret)=0
Virtual Callback function.
FsmProfileListener class.
Definition: FsmActionListener.h:722
static const char * toString(FsmProfileListenerType type)
Convert FsmProfileListenerType into the string.
Definition: FsmActionListener.h:746
FsmActionListeners()
Constructor.
void notify(const char *state)
Notify listeners.
bool notify(FsmProfileListenerType type, RTC::FsmProfile &profile)
Definition: FsmActionListener.h:1739
@ POST_FSM_ACTION_LISTENER_NUM
static const char * toString(FsmStructureListenerType type)
Convert FsmStructureListenerType into the string.
Definition: FsmActionListener.h:967
void notify(RTC::FsmProfile &profile)
Notify listeners.
PostFsmActionListenerHolder()
Constructor.
PostFsmActionListener holder class.
Definition: FsmActionListener.h:1133
void addListener(PreFsmActionListener *listener, bool autoclean)
Add the listener.
~FsmActionListeners()
Destructor.
void removeListener(PostFsmActionListener *listener)
Remove the listener.
void removeListener(FsmProfileListener *listener)
Remove the listener.
FsmActionListeners class.
Definition: FsmActionListener.h:1444
virtual void operator()(::RTC::FsmStructure &pprof)=0
Virtual Callback function.
static const char * toString(PreFsmActionListenerType type)
Convert PreFsmActionListenerType into the string.
Definition: FsmActionListener.h:257
void notify(RTC::FsmStructure &structure)
Notify listeners.
void removeListener(FsmStructureListener *listener)
Remove the listener.
void removeListener(PreFsmActionListener *listener)
Remove the listener.
virtual ~PostFsmActionListener()
Destructor.
void addListener(FsmStructureListener *listener, bool autoclean)
Add the listener.
bool notify(FsmStructureListenerType type, RTC::FsmStructure &structure)
Definition: FsmActionListener.h:1768