Go to the documentation of this file.
20 #ifndef RTC_PORTBASE_H
21 #define RTC_PORTBASE_H
26 #include <rtm/idl/RTCSkel.h>
37 class ConnectionCallback;
130 :
public virtual POA_RTC::PortService,
131 public virtual PortableServer::RefCountServantBase
159 explicit PortBase(
const char* name =
"");
512 ReturnCode_t
connect(ConnectorProfile& connector_profile)
override;
629 ReturnCode_t
notify_connect(ConnectorProfile& connector_profile)
override;
696 ReturnCode_t
disconnect(
const char* connector_id)
override;
867 void setName(
const char* name);
1346 virtual ReturnCode_t
1375 virtual ReturnCode_t
connectNext(ConnectorProfile& connector_profile);
1468 virtual ReturnCode_t
1578 static bool isEmptyId(
const ConnectorProfile& connector_profile) ;
1599 static std::string
getUUID() ;
1620 static void setUUID(ConnectorProfile& connector_profile) ;
1819 bool appendInterface(
const char* instance_name,
const char* type_name,
1820 PortInterfacePolarity pol);
1876 template <
class ValueType>
1957 #ifndef ORB_IS_RTORB
1958 bool checkPorts(::RTC::PortServiceList& ports);
1959 #else // ORB_IS_RTORB
1961 #endif // ORB_IS_RTORB
1965 RTC::ConnectorProfile& profile)
1975 RTC::ConnectorProfile& profile)
1984 RTC::ConnectorProfile& profile)
1994 RTC::ConnectorProfile& profile,
2006 RTC::ConnectorProfile& profile,
2018 RTC::ConnectorProfile& profile,
2030 RTC::ConnectorProfile& profile,
2041 RTC::ConnectorProfile& profile,
2052 RTC::ConnectorProfile& profile,
2256 return m_id == std::string(cprof.connector_id);
2271 #ifdef ORB_IS_ORBEXPRESS
2274 return m_port->_is_equivalent(port_ref.in());
2279 return m_port->_is_equivalent(port_ref);
2300 CORBA::String_var name(CORBA::string_dup(prof.instance_name));
2301 return ((
m_name ==
static_cast<const char *
>(name))
2302 && (
m_pol == prof.polarity));
2310 #endif // RTC_PORTBASE_H
void onSubscribeInterfaces(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
Definition: PortBase.h:2017
void onDisconnectNextport(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
Definition: PortBase.h:2040
void onNotifyConnect(const char *portname, RTC::ConnectorProfile &profile)
Definition: PortBase.h:1964
virtual void deactivateInterfaces()=0
Deactivate all Port interfaces.
void setOnConnectionLost(ConnectionCallback *on_connection_lost)
Setting callback called on connection lost.
void onDisconnected(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
Definition: PortBase.h:2051
void setOnPublishInterfaces(ConnectionCallback *on_publish)
Setting callback called on publish interfaces.
int m_connectionLimit
The maximum number of connections.
Definition: PortBase.h:2133
virtual void setConnectionLimit(int limit_value)
Set the maximum number of connections.
static std::string getUUID()
Generate the UUID.
@ ON_UNSUBSCRIBE_INTERFACES
ConnectionCallback * m_onConnectionLost
Callback functor objects.
Definition: PortBase.h:2222
void setPortConnectListenerHolder(PortConnectListeners *portconnListeners)
Setting PortConnectListener holder.
ConnectionCallback * m_onPublishInterfaces
Callback functor objects.
Definition: PortBase.h:2149
ConnectorProfileList * get_connector_profiles() override
[CORBA interface] Get the ConnectorProfileList of the Port
virtual void unsubscribeInterfaces(const ConnectorProfile &connector_profile)=0
Disconnect interface connection.
bool isExistingConnId(const char *id)
Check whether the given id exists in stored ConnectorProfiles.
PortConnectListeners * m_portconnListeners
PortConnectListener holder.
Definition: PortBase.h:2237
void appendProperty(const char *key, const char *value)
Append NameValue data to PortProfile's properties.
Definition: PortBase.h:1908
bool eraseConnectorProfile(const char *id)
Delete the ConnectorProfile.
PortService_ptr m_port
Definition: PortBase.h:2282
virtual void activateInterfaces()=0
Activate all Port interfaces.
void onNotifyDisconnect(const char *portname, RTC::ConnectorProfile &profile)
Definition: PortBase.h:1974
RTC::PortService_var m_objref
Object Reference of the Port.
Definition: PortBase.h:2106
find_interface(const char *name, PortInterfacePolarity pol)
Definition: PortBase.h:2294
Functor to find interface from name and polarity.
Definition: PortBase.h:2292
DirectPortBase * m_directport
Definition: PortBase.h:2239
void onUnsubscribeInterfaces(const char *portname, RTC::ConnectorProfile &profile)
Definition: PortBase.h:1983
~PortBase() override
Destructor.
find_conn_id(const char *id)
Definition: PortBase.h:2253
std::mutex m_profile_mutex
Mutex of PortProfile.
Definition: PortBase.h:2114
ConnectionCallback * m_onUnsubscribeInterfaces
Callback functor objects.
Definition: PortBase.h:2192
bool operator()(const PortInterfaceProfile &prof)
Definition: PortBase.h:2298
CORBA sequence utility template functions.
ConnectionCallback * m_onDisconnected
Callback functor objects.
Definition: PortBase.h:2206
void push_back(CorbaSequence &seq, SequenceElement elem)
Push the new element back to the CORBA sequence.
Definition: CORBA_SeqUtil.h:175
bool deleteInterface(const char *name, PortInterfacePolarity pol)
Delete the interface registration from the PortInterfaceProfile.
void onPublishInterfaces(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
Definition: PortBase.h:1993
find_port_ref(PortService_ptr port_ref)
Definition: PortBase.h:2270
void setOnDisconnected(ConnectionCallback *on_disconnected)
Setting callback called on disconnected.
Callback functor abstract for connect/notify_connect() funcs.
Definition: PortCallback.h:55
static bool isEmptyId(const ConnectorProfile &connector_profile)
Check whether connector_id of ConnectorProfile is empty.
Definition: DirectPortBase.h:46
PortConnectListeners class.
Definition: PortConnectListener.h:486
bool operator()(PortService_ptr port_ref)
Definition: PortBase.h:2277
SDOPackage::NameValue newNV(const char *name, Value value)
Create NameValue.
Definition: NVUtil.h:80
void updateConnectorProfile(const ConnectorProfile &connector_profile)
Append or update the ConnectorProfile list.
void setOnUnsubscribeInterfaces(ConnectionCallback *on_unsubscribe)
Setting callback called on unsubscribe interfaces.
coil::Properties m_properties
Properties.
Definition: PortBase.h:1919
Functor to find a ConnectorProfile named id.
Definition: PortBase.h:2251
void setOnSubscribeInterfaces(ConnectionCallback *on_subscribe)
Setting callback called on publish interfaces.
const PortProfile & getPortProfile() const
Get the PortProfile of the Port.
Logger class.
Definition: SystemLogger.h:99
bool notify(PortConnectListenerType type, const char *portname, RTC::ConnectorProfile &profile)
Definition: PortConnectListener.h:625
Functor to find the object reference that is identical port_ref.
Definition: PortBase.h:2268
const char * getName() const
Get the name of this Port.
virtual ReturnCode_t connectNext(ConnectorProfile &connector_profile)
Call notify_connect() of the next Port.
virtual ReturnCode_t _publishInterfaces()
Publish interface information.
std::string m_ownerInstanceName
Instance name.
Definition: PortBase.h:2124
void addProperty(const char *key, ValueType value)
Add NameValue data to PortProfile's properties.
Definition: PortBase.h:1877
PortService_ptr getPortRef() const
Get the object reference of this Port.
ReturnCode_t disconnect(const char *connector_id) override
[CORBA interface] Disconnect the Port
bool appendStringValue(SDOPackage::NVList &nv, const char *name, const char *value)
Append the specified string to element of NVList.
port's internal action listener classes
Port base class.
Definition: PortBase.h:129
Logger rtclog
Logger stream.
Definition: PortBase.h:2089
virtual ReturnCode_t subscribeInterfaces(const ConnectorProfile &connector_profile)=0
Publish interface information.
void onConnectNextport(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
Definition: PortBase.h:2005
NameValue and NVList utility functions.
void setPortRef(PortService_ptr port_ref)
Set the object reference of this Port.
void onConnected(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
Definition: PortBase.h:2029
ConnectionCallback * m_onSubscribeInterfaces
Callback functor objects.
Definition: PortBase.h:2163
void updateConnectors()
Disconnect ports that doesn't exist.
PortInterfacePolarity m_pol
Definition: PortBase.h:2305
std::string m_id
Definition: PortBase.h:2258
ConnectionCallback * m_onConnected
Callback functor objects.
Definition: PortBase.h:2178
bool appendInterface(const char *instance_name, const char *type_name, PortInterfacePolarity pol)
Append an interface to the PortInterfaceProfile.
const PortProfile & getProfile() const
Get the PortProfile of the Port.
virtual ReturnCode_t disconnectNext(ConnectorProfile &cprof)
Call notify_disconnect() of the next Port.
virtual ReturnCode_t publishInterfaces(ConnectorProfile &connector_profile)=0
Publish interface information.
virtual DirectPortBase * getDirectPort()
ConnectorProfile findConnProfile(const char *id)
Find ConnectorProfile with id.
ReturnCode_t notify_connect(ConnectorProfile &connector_profile) override
[CORBA interface] Notify the Ports connection
static void setUUID(ConnectorProfile &connector_profile)
Generate and set the UUID to the ConnectorProfile.
bool checkPorts(::RTC::PortServiceList &ports)
Existence of ports.
ConnectorProfile * get_connector_profile(const char *connector_id) override
[CORBA interface] Get the ConnectorProfile
void setName(const char *name)
Set the name of this Port.
std::mutex m_connectorsMutex
Definition: PortBase.h:2115
coil::Properties Properties
Definition: RTC.h:72
bool isExistingMarshalingType(coil::Properties &con_prop)
Whether the specified serializer can be used.
ReturnCode_t connect(ConnectorProfile &connector_profile) override
[CORBA interface] Connect the Port
bool operator()(const ConnectorProfile &cprof)
Definition: PortBase.h:2254
void setOwner(RTObject_ptr owner)
Set the owner RTObject of the Port.
@ ON_SUBSCRIBE_INTERFACES
std::string m_name
Definition: PortBase.h:2304
PortBase(const char *name="")
Constructor.
PortProfile * get_port_profile() override
[CORBA interface] Get the PortProfile of the Port
void setOnConnected(ConnectionCallback *on_connected)
Setting callback called on connection established.
RT component logger class.
CORBA::Long findConnProfileIndex(const char *id)
Find ConnectorProfile with id.
ReturnCode_t disconnect_all() override
[CORBA interface] Disconnect the All Ports
ReturnCode_t notify_disconnect(const char *connector_id) override
[CORBA interface] Notify the Ports disconnection
PortProfile m_profile
PortProfile of the Port.
Definition: PortBase.h:2097