20 #ifndef RTC_COMPONENTOBSERVERCONSUMER_H 21 #define RTC_COMPONENTOBSERVERCONSUMER_H 23 #include <coil/Mutex.h> 24 #include <coil/Factory.h> 25 #include <coil/stringutil.h> 29 #include <rtm/idl/SDOPackageStub.h> 30 #include "ComponentObserverStub.h" 70 const SDOPackage::ServiceProfile& profile);
79 virtual bool reinit(
const SDOPackage::ServiceProfile& profile);
88 virtual const SDOPackage::ServiceProfile&
getProfile()
const;
107 inline void updateStatus(OpenRTM::StatusKind statuskind,
const char* msg)
126 inline const char*
toString(OpenRTM::StatusKind kind)
128 static const char* kinds[] =
137 return (
size_t)kind <
sizeof(kind)/
sizeof(
char*) ? kinds[kind] :
"";
312 std::string msg(msgprefix);
358 : portAddListener(NULL), portRemoveListener(NULL),
359 portConnectListener(NULL), portDisconnectListener(NULL),
363 std::string msg(_msg);
369 onGeneric(
"ADD:", static_cast<const char*>(pprof.name));
373 onGeneric(
"REMOVE:", static_cast<const char*>(pprof.name));
412 : ecAttached(NULL), ecDetached(NULL), ecRatechanged(NULL),
413 ecStartup(NULL), ecShutdown(NULL),
469 : updateConfigParamListener(NULL), setConfigSetListener(NULL),
470 addConfigSetListener(NULL), updateConfigSetListener(NULL),
471 removeConfigSetListener(NULL), activateConfigSetListener(NULL),
474 const char* configparamname)
476 std::string msg(
"UPDATE_CONFIG_PARAM: ");
477 msg += configsetname;
479 msg += configparamname;
484 std::string msg(
"SET_CONFIG_SET: ");
490 std::string msg(
"ADD_CONFIG_SET: ");
496 std::string msg(
"UPDATE_CONFIG_SET: ");
497 msg += config_set_name;
502 std::string msg(
"REMOVE_CONFIG_SET: ");
503 msg += config_set_name;
508 std::string msg(
"ACTIVATE_CONFIG_SET: ");
509 msg += config_set_name;
553 #endif // RTC_COMPONENTOBSERVERCONSUMER_H PostComponentActionListener * deactivatedListener
CompStatMsg(ComponentObserverConsumer &coc)
PortConnectRetListener * portConnectListener
PortConnectRetListener class.
PostComponentActionListener * ecShutdown
void switchListeners(bool &next, bool &pre, void(ComponentObserverConsumer::*setfunc)(), void(ComponentObserverConsumer::*unsetfunc)())
Switching listeners connecting/disconnecting.
const char * getName(void) const
Get Names.
ConfigurationSetNameListener * removeConfigSetListener
std::string otos(Printable n)
Convert the given object to std::string.
void onDisconnect(const char *portname,::RTC::ConnectorProfile &pprof, ReturnCode_t ret)
component action listener class
ConfigurationSetListener * addConfigSetListener
void unsetComponentProfileListeners()
Unsetting ComponentProfile listener.
void unsetHeartbeat()
Unsetting heartbeat.
PostComponentActionListener class.
PostComponentActionListener * abortingListener
RTC::RTObject_impl * m_rtobj
ExecutionContextActionListener * ecAttached
PortConnectRetListener * portDisconnectListener
PostComponentActionListener * resetListener
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
ComponentObserverConsumer & m_coc
PortActionListener * portRemoveListener
PostComponentActionListener * ecRatechanged
ConfigurationSetListener class.
ConfigurationSetNameListener class.
void removeConfigSet(const char *config_set_name)
virtual bool init(RTObject_impl &rtobj, const SDOPackage::ServiceProfile &profile)
Initialization.
ConfigurationParamListener class.
void onRateChanged(UniqueId ec_id, ReturnCode_t ret)
PortAction(ComponentObserverConsumer &coc)
void onReset(UniqueId ec_id, ReturnCode_t ret)
void updateConfigParam(const char *configsetname, const char *configparamname)
ComponentObserverConsumer & m_coc
SDOPackage::ServiceProfile m_profile
void unsetExecutionContextListeners()
Unsetting EC status listener.
void heartbeat()
Sending a heartbeart signal to observer.
ConfigurationSetNameListener * activateConfigSetListener
coil::TimeValue m_interval
virtual const SDOPackage::ServiceProfile & getProfile() const
getting ServiceProfile
void onRemovePort(const ::RTC::PortProfile &pprof)
ConfigurationParamListener * updateConfigParamListener
ConfigurationSetListener * setConfigSetListener
void setComponentProfileListeners()
Setting ComponentProfile listener.
void onAddPort(const ::RTC::PortProfile &pprof)
virtual bool reinit(const SDOPackage::ServiceProfile &profile)
Re-initialization.
void onGeneric(const char *_msg, UniqueId ec_id)
void onGeneric(const char *msgprefix, UniqueId ec_id, ReturnCode_t ret)
void onDeactivated(UniqueId ec_id, ReturnCode_t ret)
void setPortProfileListeners()
Setting port profile listener.
void addConfigSet(const coil::Properties &config_set)
void setListeners(coil::Properties &prop)
Connectiong listeners to RTObject.
ECAction(ComponentObserverConsumer &coc)
PortActionListener * portAddListener
ExecutionContextHandle_t UniqueId
void onFinalize(UniqueId ec_id, ReturnCode_t ret)
ComponentObserverConsumer & m_coc
ConfigAction(ComponentObserverConsumer &coc)
void onShutdown(UniqueId ec_id, ReturnCode_t ret)
CorbaConsumer< OpenRTM::ComponentObserver > m_observer
bool removeSdoServiceConsumer(const char *id)
[local interface] Remove a SDO service provider
void setConfigurationListeners()
Setting Configuration listener.
ComponentObserverConsumer & m_coc
ListenerId m_hblistenerid
PostComponentActionListener * finalizeListener
prop
Organization::get_organization_property ();.
void onGeneric(const char *_msg, const char *portname)
void unsetComponentStatusListeners()
Unsetting RTC status listeners.
void onConnect(const char *portname,::RTC::ConnectorProfile &pprof, ReturnCode_t ret)
ConfigurationSetNameListener * updateConfigSetListener
Class represents a set of properties.
void onDetached(UniqueId ec_id)
void onStartup(UniqueId ec_id, ReturnCode_t ret)
void setExecutionContextListeners()
Setting EC status listener.
void setComponentStatusListeners()
Setting RTC status listeners.
void activateConfigSet(const char *config_set_name)
void unsetPortProfileListeners()
Unsetting port profile listener.
virtual ~ComponentObserverConsumer()
dtor
void onAttached(UniqueId ec_id)
ExecutionContextActionListener * ecDetached
virtual void finalize()
Finalization.
void updateStatus(OpenRTM::StatusKind statuskind, const char *msg)
Calling remote object.
ExecutionContextActionListener.
bool m_observed[OpenRTM::STATUS_KIND_NUM]
DLL_EXPORT void ComponentObserverConsumerInit()
PortActionListener class.
SDO service consumer base class and its factory.
PostComponentActionListener * activatedListener
void unsetConfigurationListeners()
Unsetting Configurationlistener.
void setConfigSet(const coil::Properties &config_set)
void onActivated(UniqueId ec_id, ReturnCode_t ret)
PostComponentActionListener class.
void onAborting(UniqueId ec_id, ReturnCode_t ret)
void setHeartbeat(coil::Properties &prop)
Setting heartbeat.
ComponentObserverConsumer()
ctor of ComponentObserverConsumer
PostComponentActionListener * ecStartup
const char * toString(OpenRTM::StatusKind kind)
Converting kind to string.
void updateConfigSet(const char *config_set_name)
ExecutionContextActionListener class.