18 #ifndef RTC_RTOBJECT_H 19 #define RTC_RTOBJECT_H 22 #include <coil/Properties.h> 25 #include <rtm/idl/RTCSkel.h> 26 #include <rtm/idl/OpenRTMSkel.h> 38 #define ECOTHER_OFFSET 1000 42 class Configuration_impl;
46 #pragma warning( disable : 4290 ) 52 class ExecutionContextBase;
90 :
public virtual POA_OpenRTM::DataFlowComponent,
91 public virtual PortableServer::RefCountServantBase
134 RTObject_impl(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
617 throw (CORBA::SystemException);
665 throw (CORBA::SystemException);
711 throw (CORBA::SystemException);
746 virtual CORBA::Boolean is_alive(ExecutionContext_ptr exec_context)
747 throw (CORBA::SystemException);
776 virtual ExecutionContext_ptr get_context(UniqueId exec_handle)
777 throw (CORBA::SystemException);
798 throw (CORBA::SystemException);
819 throw (CORBA::SystemException);
836 get_context_handle(ExecutionContext_ptr cxt)
837 throw (CORBA::SystemException);
869 UniqueId attach_context(ExecutionContext_ptr exec_context)
870 throw (CORBA::SystemException);
872 UniqueId bindContext(ExecutionContext_ptr exec_context);
916 throw (CORBA::SystemException);
940 virtual ComponentProfile* get_component_profile()
941 throw (CORBA::SystemException);
963 throw (CORBA::SystemException);
1018 throw (CORBA::SystemException);
1045 throw (CORBA::SystemException);
1076 throw (CORBA::SystemException);
1107 throw (CORBA::SystemException);
1135 virtual ReturnCode_t on_activated(UniqueId exec_handle)
1136 throw (CORBA::SystemException);
1165 virtual ReturnCode_t on_deactivated(UniqueId exec_handle)
1166 throw (CORBA::SystemException);
1201 throw (CORBA::SystemException);
1247 throw (CORBA::SystemException);
1284 throw (CORBA::SystemException);
1332 throw (CORBA::SystemException);
1377 virtual ReturnCode_t on_state_update(UniqueId exec_handle)
1378 throw (CORBA::SystemException);
1416 virtual ReturnCode_t on_rate_changed(UniqueId exec_handle)
1417 throw (CORBA::SystemException);
1459 virtual SDOPackage::OrganizationList* get_owned_organizations()
1460 throw (CORBA::SystemException,
1461 SDOPackage::NotAvailable, SDOPackage::InternalError);
1499 virtual char* get_sdo_id()
1500 throw (CORBA::SystemException,
1501 SDOPackage::NotAvailable, SDOPackage::InternalError);
1536 virtual char* get_sdo_type()
1537 throw (CORBA::SystemException,
1538 SDOPackage::NotAvailable, SDOPackage::InternalError);
1576 virtual SDOPackage::DeviceProfile* get_device_profile()
1577 throw (CORBA::SystemException,
1578 SDOPackage::NotAvailable, SDOPackage::InternalError);
1616 virtual SDOPackage::ServiceProfileList* get_service_profiles()
1617 throw (CORBA::SystemException,
1618 SDOPackage::NotAvailable, SDOPackage::InternalError);
1661 virtual SDOPackage::ServiceProfile* get_service_profile(
const char*
id)
1662 throw (CORBA::SystemException,
1663 SDOPackage::InvalidParameter, SDOPackage::NotAvailable,
1664 SDOPackage::InternalError);
1713 virtual SDOPackage::SDOService_ptr get_sdo_service(
const char*
id)
1714 throw (CORBA::SystemException,
1715 SDOPackage::InvalidParameter, SDOPackage::NotAvailable,
1716 SDOPackage::InternalError);
1762 virtual SDOPackage::Configuration_ptr get_configuration()
1763 throw (CORBA::SystemException,
1764 SDOPackage::InterfaceNotImplemented, SDOPackage::NotAvailable,
1765 SDOPackage::InternalError);
1810 virtual SDOPackage::Monitoring_ptr get_monitoring()
1811 throw (CORBA::SystemException,
1812 SDOPackage::InterfaceNotImplemented, SDOPackage::NotAvailable,
1813 SDOPackage::InternalError);
1850 virtual SDOPackage::OrganizationList* get_organizations()
1851 throw (CORBA::SystemException,
1852 SDOPackage::NotAvailable, SDOPackage::InternalError);
1886 throw (CORBA::SystemException,
1887 SDOPackage::NotAvailable, SDOPackage::InternalError);
1925 virtual CORBA::Any* get_status(
const char* name)
1926 throw (CORBA::SystemException,
1927 SDOPackage::InvalidParameter, SDOPackage::NotAvailable,
1928 SDOPackage::InternalError);
1955 return m_profile.instance_name;
1977 void setInstanceName(
const char* instance_name);
2001 return m_profile.type_name;
2026 return m_profile.description;
2052 return m_profile.version;
2077 return m_profile.vendor;
2102 return m_profile.category;
2124 std::vector<std::string> getNamingNames();
2145 void setObjRef(
const RTObject_ptr rtobj);
2166 RTObject_ptr getObjRef()
const;
2250 template <
typename VarType>
2252 const char* def_val,
2255 RTC_TRACE((
"bindParameter(%s (default: %s))", param_name, def_val));
2256 m_configsets.bindParameter(param_name, var, def_val, trans);
2281 void updateParameters(
const char* config_set);
2350 bool addPort(PortService_ptr port);
2448 void registerPort(PortService_ptr port);
2537 void registerInPort(
const char* name,
InPortBase& inport);
2594 void registerOutPort(
const char* name,
OutPortBase& outport);
2685 bool removePort(PortService_ptr port);
2747 void deletePort(PortService_ptr port);
2788 void deletePortByName(
const char* port_name);
3126 bool addSdoServiceProvider(
const SDOPackage::ServiceProfile& prof,
3136 bool removeSdoServiceProvider(
const char*
id);
3145 bool addSdoServiceConsumer(
const SDOPackage::ServiceProfile& prof);
3154 bool removeSdoServiceConsumer(
const char*
id);
3234 void setReadAll(
bool read=
true,
bool completion=
false);
3270 void setWriteAll(
bool write=
true,
bool completion=
false);
3289 void finalizePorts();
3303 void finalizeContexts();
3383 bool autoclean =
true);
3386 template <
class Listener>
3390 void (
Listener::*memfunc)(UniqueId ec_id))
3397 : m_obj(obj), m_memfunc(memfunc)
3400 void operator()(UniqueId ec_id)
3402 (m_obj.*m_memfunc)(ec_id);
3409 Noname* listener(
new Noname(obj, memfunc));
3410 addPreComponentActionListener(listener_type, listener,
true);
3434 removePreComponentActionListener(
3514 addPostComponentActionListener(
3517 bool autoclean =
true);
3519 template <
class Listener>
3523 void (
Listener::*memfunc)(UniqueId ec_id,
3531 : m_obj(obj), m_memfunc(memfunc)
3536 (m_obj.*m_memfunc)(ec_id, ret);
3543 Noname* listener(
new Noname(obj, memfunc));
3544 addPostComponentActionListener(listener_type, listener,
true);
3568 removePostComponentActionListener(
3630 bool autoclean =
true);
3632 template <
class Listener>
3636 void (
Listener::*memfunc)(
const RTC::PortProfile&))
3643 void (
Listener::*memfunc)(
const RTC::PortProfile&))
3644 : m_obj(obj), m_memfunc(memfunc)
3647 void operator()(
const RTC::PortProfile& pprofile)
3649 (m_obj.*m_memfunc)(pprofile);
3653 typedef void (
Listener::*Memfunc)(
const RTC::PortProfile&);
3656 Noname* listener(
new Noname(obj, memfunc));
3657 addPortActionListener(listener_type, listener,
true);
3741 void addExecutionContextActionListener(ECActionListenerType listener_type,
3742 ECActionListener* listener,
3743 bool autoclean =
true);
3745 template <
class Listener>
3749 void (
Listener::*memfunc)(UniqueId))
3752 :
public ECActionListener
3756 : m_obj(obj), m_memfunc(memfunc)
3759 void operator()(UniqueId ec_id)
3761 (m_obj.*m_memfunc)(ec_id);
3768 Noname* listener(
new Noname(obj, memfunc));
3769 addExecutionContextActionListener(listener_type, listener,
true);
3794 removeExecutionContextActionListener(ECActionListenerType listener_type,
3795 ECActionListener* listener);
3854 bool autoclean =
true);
3856 template <
class Listener>
3860 void (
Listener::*memfunc)(
const char*,
3868 void (
Listener::*memfunc)(
const char*, ConnectorProfile&))
3869 : m_obj(obj), m_memfunc(memfunc)
3872 void operator()(
const char* portname, ConnectorProfile& cprofile)
3874 (m_obj.*m_memfunc)(portname, cprofile);
3878 typedef void (
Listener::*Memfunc)(
const char*, ConnectorProfile&);
3881 Noname* listener(
new Noname(obj, memfunc));
3882 addPortConnectListener(listener_type, listener,
true);
3970 bool autoclean =
true);
3972 template <
class Listener>
3976 void (
Listener::*memfunc)(
const char*,
3985 void (
Listener::*memfunc)(
const char*,
3988 : m_obj(obj), m_memfunc(memfunc)
3991 void operator()(
const char* portname,
3992 ConnectorProfile& cprofile,
3995 (m_obj.*m_memfunc)(portname, cprofile, ret);
3999 typedef void (
Listener::*Memfunc)(
const char* portname,
4000 ConnectorProfile& cprofile,
4004 Noname* listener(
new Noname(obj, memfunc));
4005 addPortConnectRetListener(listener_type, listener,
true);
4068 bool autoclean =
true);
4070 template <
class Listener>
4074 void (
Listener::*memfunc)(
const char*,
4082 void (
Listener::*memfunc)(
const char*,
const char*))
4083 : m_obj(obj), m_memfunc(memfunc)
4086 void operator()(
const char* config_set_name,
4087 const char* config_param_name)
4089 (m_obj.*m_memfunc)(config_set_name, config_param_name);
4093 typedef void (
Listener::*Memfunc)(
const char*,
const char*);
4096 Noname* listener(
new Noname(obj, memfunc));
4097 addConfigurationParamListener(listener_type, listener,
true);
4161 bool autoclean =
true);
4163 template <
class Listener>
4176 : m_obj(obj), m_memfunc(memfunc)
4181 (m_obj.*m_memfunc)(config_set);
4188 Noname* listener(
new Noname(obj, memfunc));
4189 addConfigurationSetListener(listener_type, listener,
true);
4255 bool autoclean =
true);
4257 template <
class Listener>
4261 void (
Listener::*memfunc)(
const char*))
4268 : m_obj(obj), m_memfunc(memfunc)
4271 virtual void operator()(
const char* config_set_name)
4273 (m_obj.*m_memfunc)(config_set_name);
4277 typedef void (
Listener::*Memfunc)(
const char*);
4280 Noname* listener(
new Noname(obj, memfunc));
4281 addConfigurationSetNameListener(type, listener,
true);
4374 m_actionListeners.preaction_[
PRE_ON_ERROR].notify(ec_id);
4379 m_actionListeners.preaction_[
PRE_ON_RESET].notify(ec_id);
4434 m_actionListeners.postaction_[
POST_ON_ERROR].notify(ec_id, ret);
4439 m_actionListeners.postaction_[
POST_ON_RESET].notify(ec_id, ret);
4459 m_actionListeners.portaction_[
ADD_PORT].notify(pprof);
4464 m_actionListeners.portaction_[
REMOVE_PORT].notify(pprof);
4469 m_actionListeners.ecaction_[
EC_ATTACHED].notify(ec_id);
4474 m_actionListeners.ecaction_[
EC_DETACHED].notify(ec_id);
4537 return m_id == std::string(prof.id);
4806 return m_name == std::string(nv.name);
4826 if (!::CORBA::is_nil(ecs))
4829 ExecutionContext::_duplicate(ecs));
4844 : m_ec(ExecutionContext::_duplicate(ec))
4851 if (!::CORBA::is_nil(ecs))
4853 ExecutionContext_var
ec;
4854 ec = ExecutionContext::_narrow(ecs);
4855 return m_ec->_is_equivalent(ec);
4879 : m_comp(
RTC::LightweightRTObject::_duplicate(comp))
4884 if (!::CORBA::is_nil(ec) && !ec->_non_existent())
4887 ec->deactivate_component(RTC::LightweightRTObject::_duplicate(m_comp));
4897 #pragma warning( default : 4290 ) 4900 #endif // RTC_RTOBJECT ComponentProfile m_profile
ComponentProfile.
PortAdmin m_portAdmin
List of Port Object reference.
bool operator()(ExecutionContextService_ptr ecs)
PortConnectListenerType
The types of ConnectorDataListener.
const char * getVendor()
[local interface] Get vendor
Logger rtclog
Logger stream.
RTC's Port base class.
void onAddPort(const PortProfile &pprof)
void postOnStateUpdate(UniqueId ec_id, ReturnCode_t ret)
void postOnReset(UniqueId ec_id, ReturnCode_t ret)
void preOnAborting(UniqueId ec_id)
std::vector< InPortBase * > m_inports
List of InPortBase*.
void onRemovePort(const PortProfile &pprof)
EXECUTION_HANDLE_TYPE_NATIVE ExecutionContextHandle_t
PortConnectRetListener class.
const char * getCategory()
[local interface] Get category information
PostComponentActionListenerType
The types of ConnectorDataListener.
PreComponentActionListener * addPreComponentActionListener(PreCompActionListenerType listener_type, Listener &obj, void(Listener::*memfunc)(UniqueId ec_id))
ExecutionContextServiceList m_ecOther
List of participating ExecutionContextService.
bool m_readAllCompletion
flag for readAll()
SDOPackage::Configuration_impl * m_pSdoConfigImpl
The pointer to the SDO Configuration Object.
void preOnShutdown(UniqueId ec_id)
component action listener class
bool stringTo(To &val, const char *str)
Convert the given std::string to object.
ConfigurationSetListener * addConfigurationSetListener(ConfigurationSetListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const coil::Properties &config_set))
ECActionListener * addExecutionContextActionListener(ECActionListenerType listener_type, Listener &obj, void(Listener::*memfunc)(UniqueId))
RT component logger class.
deactivate_comps(LightweightRTObject_ptr comp)
SDOPackage::OrganizationList m_sdoOrganizations
SDO organization.
void onAttachExecutionContext(UniqueId ec_id)
std::vector< std::pair< std::string, std::string > > NVList
CORBA::ORB_var m_pORB
The pointer to the ORB.
PortActionListenerType
The types of PortActionListener.
void postOnExecute(UniqueId ec_id, ReturnCode_t ret)
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
Functor to find from SDOService Profile List by id.
bool m_exiting
RTC Finalize Status Flag.
SDOPackage::Configuration_var m_pSdoConfig
The pointer to the SDO Configuration Interface.
ConfigurationSetListener class.
ConfigurationSetNameListener class.
ComponentActionListeners m_actionListeners
ComponentActionListener holder.
ConfigurationParamListener class.
Configuration Administration classes.
ConfigurationSetNameListenerType
The types of ConfigurationSetNameListener.
PreComponentActionListenerType
The types of ConnectorDataListener.
PortActionListener * addPortActionListener(PortActionListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const RTC::PortProfile &))
void postOnShutdown(UniqueId ec_id, ReturnCode_t ret)
PortConnectRetListener * addPortConnectRetListener(PortConnectRetListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const char *, ConnectorProfile &, ReturnCode_t))
ExecutionContextList & m_eclist
nv_name(const char *name)
PostComponentActionListener * addPostComponentActionListener(PostCompActionListenerType listener_type, Listener &obj, void(Listener::*memfunc)(UniqueId ec_id, ReturnCode_t ret))
ConfigurationParamListener * addConfigurationParamListener(ConfigurationParamListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const char *, const char *))
void postOnError(UniqueId ec_id, ReturnCode_t ret)
bool m_readAll
flag for readAll()
Manager * m_pManager
Manager object.
SdoServiceAdmin m_sdoservice
SDO Service Administrator Object.
bool m_created
Created Status Flag.
SDOPackage::NVList m_sdoStatus
SDO Status.
void operator()(ExecutionContextService_ptr ecs)
void preOnRateChanged(UniqueId ec_id)
PreComponentActionListener class.
PortableServer::POA_var m_pPOA
The pointer to the POA.
void operator()(ExecutionContextService_ptr ec)
void postOnAborting(UniqueId ec_id, ReturnCode_t ret)
PreComponentActionListener PreCompActionListener
Adding PreComponentAction type listener.
SDO service administration class.
Functor to copy ExecutionContext.
const char * getTypeName()
[local interface] Get type name
PortConnectListener class.
std::vector< ExecutionContext * > ExecutionContextList
void preOnError(UniqueId ec_id)
SDOPackage::OrganizationList m_sdoOwnedOrganizations
SDO owned organization list.
ExecutionContextActionListenerType ECActionListenerType
Adding ExecutionContextAction type listener.
void onDetachExecutionContext(UniqueId ec_id)
ConfigurationSetNameListener * addConfigurationSetNameListener(ConfigurationSetNameListenerType type, Listener &obj, void(Listener::*memfunc)(const char *))
ExecutionContextHandle_t UniqueId
PortConnectListener * addPortConnectListener(PortConnectListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const char *, ConnectorProfile &))
bool bindParameter(const char *param_name, VarType &var, const char *def_val, bool(*trans)(VarType &, const char *)=coil::stringTo)
Setup for configuration parameters.
PortConnectListeners class.
std::vector< ExecutionContextBase * > m_eclist
List of ExecutionContextBase.
ComponentActionListeners class.
ExecutionContext_var m_ec
bool operator()(const SDOPackage::NameValue &nv)
ExecutionContextServiceList m_ecMine
List of owned ExecutionContextService.
bool m_writeAllCompletion
flag for writeAll()
const char * getDescription()
[local interface] GetDescription
PostComponentActionListener PostCompActionListener
Adding PostComponentAction type listener.
ConfigAdmin m_configsets
Configuration Administrator Object.
void preOnReset(UniqueId ec_id)
Functor to deactivate RTC.
LightweightRTObject_var m_comp
const char * getVersion()
[local interface] Get version information
const char * getInstanceName()
[local interface] Get instance name
prop
Organization::get_organization_property ();.
void postOnFinalize(UniqueId ec_id, ReturnCode_t ret)
RTC::Port implementation for InPort.
PortConnectRetListenerType
The types of PortConnectRetListenerType.
void preOnStateUpdate(UniqueId ec_id)
Class represents a set of properties.
ec_find(ExecutionContext_ptr &ec)
void postOnActivated(UniqueId ec_id, ReturnCode_t ret)
void postOnInitialize(UniqueId ec_id, ReturnCode_t ret)
std::vector< IPortService * > PortServiceList
bool operator()(const SDOPackage::ServiceProfile &prof)
void preOnStartup(UniqueId ec_id)
void push_back(CorbaSequence &seq, SequenceElement elem)
Push the new element back to the CORBA sequence.
PortConnectListeners m_portconnListeners
PortConnectListener holder.
Configuration implementation class.
void preOnActivated(UniqueId ec_id)
void postOnStartup(UniqueId ec_id, ReturnCode_t ret)
coil::Properties m_properties
Alive Status Flag.
ExecutionContextActionListener ECActionListener
ExecutionContextActionListenerType
The types of ExecutionContextActionListener.
PostComponentActionListenerType PostCompActionListenerType
void preOnInitialize(UniqueId ec_id)
bool m_writeAll
flag for writeAll()
ConfigurationSetListenerType
The types of ConfigurationSetListener.
RTObject_var m_objref
Object reference.
PortActionListener class.
PreComponentActionListenerType PreCompActionListenerType
std::vector< OutPortBase * > m_outports
List of OutPortBase*.
Functor to find ExecutionContext.
port's internal action listener classes
ec_copy(ExecutionContextList &eclist)
RTC's Port administration class.
PostComponentActionListener class.
void postOnDeactivated(UniqueId ec_id, ReturnCode_t ret)
void preOnFinalize(UniqueId ec_id)
ConfigurationParamListenerType
The types of ConnectorDataListener.
ExecutionContextActionListener class.
void postOnRateChanged(UniqueId ec_id, ReturnCode_t ret)
void preOnDeactivated(UniqueId ec_id)
void preOnExecute(UniqueId ec_id)