19#ifndef RTC_COMPONENTACTIONLISTENER_H
20#define RTC_COMPONENTACTIONLISTENER_H
25#include <rtm/idl/RTCSkel.h>
153 static const char*
const typeString[] =
160 "PRE_ON_DEACTIVATED",
165 "PRE_ON_STATE_UPDATE",
166 "PRE_ON_RATE_CHANGED",
167 "PRE_COMPONENT_ACTION_LISTENER_NUM"
169 return typeString[
static_cast<uint8_t
>(type)];
320 static const char*
const typeString[] =
322 "POST_ON_INITIALIZE",
327 "POST_ON_DEACTIVATED",
332 "POST_ON_STATE_UPDATE",
333 "POST_ON_RATE_CHANGED",
334 "POST_COMPONENT_ACTION_LISTENER_NUM"
336 return typeString[
static_cast<uint8_t
>(type)];
366 ReturnCode_t ret) = 0;
440 static const char*
const typeString[] =
444 "PORT_ACTION_LISTENER_NUM"
446 return typeString[
static_cast<uint8_t
>(type)];
475 virtual void operator()(const ::RTC::PortProfile& pprof) = 0;
550 static const char*
const typeString[] =
554 "EC_ACTION_LISTENER_NUM"
556 return typeString[
static_cast<uint8_t
>(type)];
609 using Entry = std::pair<PreComponentActionListener*, bool>;
691 std::vector<Entry> m_listeners;
714 using Entry = std::pair<PostComponentActionListener*, bool>;
797 std::vector<Entry> m_listeners;
821 using Entry = std::pair<PortActionListener*, bool>;
901 void notify(
const RTC::PortProfile& pprofile);
904 std::vector<Entry> m_listeners;
926 using Entry = std::pair<ExecutionContextActionListener*, bool>;
1007 std::vector<Entry> m_listeners;
1262 if (
static_cast<uint8_t
>(type) < preaction_.size())
1264 preaction_[
static_cast<uint8_t
>(type)].
notify(ec_id);
1293 if (
static_cast<uint8_t
>(type) < postaction_.size())
1295 postaction_[
static_cast<uint8_t
>(type)].
notify(ec_id, ret);
1322 if (
static_cast<uint8_t
>(type) < portaction_.size())
1324 portaction_[
static_cast<uint8_t
>(type)].
notify(pprofile);
1351 if (
static_cast<uint8_t
>(type) < ecaction_.size())
1353 ecaction_[
static_cast<uint8_t
>(type)].
notify(ec_id);
ComponentActionListeners class.
Definition ComponentActionListener.h:1026
bool removeListener(PostComponentActionListenerType type, PostComponentActionListener *listener)
Remove the listener.
bool removeListener(PortActionListenerType type, PortActionListener *listener)
Remove the listener.
ComponentActionListeners()
Constructor .
bool addListener(ExecutionContextActionListenerType type, ExecutionContextActionListener *listener, bool autoclean)
Add the listener.
bool notify(ExecutionContextActionListenerType type, UniqueId ec_id)
Definition ComponentActionListener.h:1349
bool addListener(PortActionListenerType type, PortActionListener *listener, bool autoclean)
Add the listener.
bool removeListener(ExecutionContextActionListenerType type, ExecutionContextActionListener *listener)
Remove the listener.
bool notify(PostComponentActionListenerType type, UniqueId ec_id, ReturnCode_t ret)
Definition ComponentActionListener.h:1291
bool removeListener(PreComponentActionListenerType type, PreComponentActionListener *listener)
Remove the listener.
~ComponentActionListeners()
Destructor .
bool addListener(PostComponentActionListenerType type, PostComponentActionListener *listener, bool autoclean)
Add the listener.
bool addListener(PreComponentActionListenerType type, PreComponentActionListener *listener, bool autoclean)
Add the listener.
bool notify(PortActionListenerType type, const RTC::PortProfile &pprofile)
Definition ComponentActionListener.h:1320
bool notify(PreComponentActionListenerType type, UniqueId ec_id)
Definition ComponentActionListener.h:1260
ExecutionContextActionListener holder class.
Definition ComponentActionListener.h:925
ExecutionContextActionListenerHolder()
Constructor .
void removeListener(ExecutionContextActionListener *listener)
Remove the listener.
void addListener(ExecutionContextActionListener *listener, bool autoclean)
Add the listener.
virtual ~ExecutionContextActionListenerHolder()
Destructor .
void notify(UniqueId ec_id)
Notify listeners.
ExecutionContextActionListener class.
Definition ComponentActionListener.h:521
virtual ~ExecutionContextActionListener()
Destructor .
virtual void operator()(UniqueId ec_id)=0
Virtual Callback function.
static const char * toString(ExecutionContextActionListenerType type)
Convert PreComponentActionListenerType into the string.
Definition ComponentActionListener.h:546
PortActionListener holder class.
Definition ComponentActionListener.h:820
PortActionListenerHolder()
Constructor .
virtual ~PortActionListenerHolder()
Destructor .
void removeListener(PortActionListener *listener)
Remove the listener.
void notify(const RTC::PortProfile &pprofile)
Notify listeners.
void addListener(PortActionListener *listener, bool autoclean)
Add the listener.
PortActionListener class.
Definition ComponentActionListener.h:411
virtual void operator()(const ::RTC::PortProfile &pprof)=0
Virtual Callback function.
virtual ~PortActionListener()
Destructor .
static const char * toString(PortActionListenerType type)
Convert PreComponentActionListenerType into the string.
Definition ComponentActionListener.h:436
PostComponentActionListener holder class.
Definition ComponentActionListener.h:713
void addListener(PostComponentActionListener *listener, bool autoclean)
Add the listener.
PostComponentActionListenerHolder()
Constructor .
void notify(UniqueId ec_id, ReturnCode_t ret)
Notify listeners.
virtual ~PostComponentActionListenerHolder()
Destructor .
void removeListener(PostComponentActionListener *listener)
Remove the listener.
PostComponentActionListener class.
Definition ComponentActionListener.h:290
static const char * toString(PostComponentActionListenerType type)
Convert PostComponentActionListenerType into the string.
Definition ComponentActionListener.h:315
virtual ~PostComponentActionListener()
Destructor .
virtual void operator()(UniqueId ec_id, ReturnCode_t ret)=0
Virtual Callback function.
PreComponentActionListener holder class.
Definition ComponentActionListener.h:608
void removeListener(PreComponentActionListener *listener)
Remove the listener.
PreComponentActionListenerHolder()
Constructor .
void notify(UniqueId ec_id)
Notify listeners.
void addListener(PreComponentActionListener *listener, bool autoclean)
Add the listener.
virtual ~PreComponentActionListenerHolder()
Destructor .
PreComponentActionListener class.
Definition ComponentActionListener.h:123
virtual void operator()(UniqueId ec_id)=0
Virtual Callback function.
virtual ~PreComponentActionListener()
Destructor .
static const char * toString(PreComponentActionListenerType type)
Convert PreComponentActionListenerType into the string.
Definition ComponentActionListener.h:148
ExecutionContextActionListenerType
The types of ExecutionContextActionListener.
Definition ComponentActionListener.h:494
ExecutionContextHandle_t UniqueId
Definition ComponentActionListener.h:34
PreComponentActionListenerType
The types of ConnectorDataListener.
Definition ComponentActionListener.h:60
@ PRE_COMPONENT_ACTION_LISTENER_NUM
PortActionListenerType
The types of PortActionListener.
Definition ComponentActionListener.h:384
@ PORT_ACTION_LISTENER_NUM
PostComponentActionListenerType
The types of ConnectorDataListener.
Definition ComponentActionListener.h:226
@ POST_COMPONENT_ACTION_LISTENER_NUM