20 #ifndef RTC_PORTBASE_H 21 #define RTC_PORTBASE_H 27 #include <coil/Guard.h> 28 #include <coil/Mutex.h> 29 #include <rtm/idl/RTCSkel.h> 37 #pragma warning( disable : 4290 ) 42 class ConnectionCallback;
135 :
public virtual POA_RTC::PortService,
136 public virtual PortableServer::RefCountServantBase
237 throw (CORBA::SystemException);
319 throw (CORBA::SystemException);
361 throw (CORBA::SystemException);
521 throw (CORBA::SystemException);
639 throw (CORBA::SystemException);
707 throw (CORBA::SystemException);
798 throw (CORBA::SystemException);
820 throw (CORBA::SystemException);
880 void setName(
const char* name);
1577 bool isEmptyId(
const ConnectorProfile& connector_profile)
const;
1598 const std::string
getUUID()
const;
1619 void setUUID(ConnectorProfile& connector_profile)
const;
1875 template <
class ValueType>
1949 #ifndef ORB_IS_RTORB 1951 #else // ORB_IS_RTORB 1953 #endif // ORB_IS_RTORB 1957 RTC::ConnectorProfile& profile)
1967 RTC::ConnectorProfile& profile)
1976 RTC::ConnectorProfile& profile)
1986 RTC::ConnectorProfile& profile,
1998 RTC::ConnectorProfile& profile,
2010 RTC::ConnectorProfile& profile,
2022 RTC::ConnectorProfile& profile,
2028 portconnret_[
ON_CONNECTED].notify(portname, profile, ret);
2033 RTC::ConnectorProfile& profile,
2044 RTC::ConnectorProfile& profile,
2228 return m_id == std::string(cprof.connector_id);
2245 return m_port->_is_equivalent(port_ref);
2260 : m_name(name), m_pol(pol)
2265 CORBA::String_var name(CORBA::string_dup(prof.instance_name));
2266 return ((m_name == (
const char *)name) && (m_pol == prof.polarity));
2275 #pragma warning( default : 4290 ) 2278 #endif // RTC_PORTBASE_H SDOPackage::NameValue newNV(const char *name, Value value)
Create NameValue.
virtual ReturnCode_t connectNext(ConnectorProfile &connector_profile)
Call notify_connect() of the next Port.
void setOnSubscribeInterfaces(ConnectionCallback *on_subscribe)
Setting callback called on publish interfaces.
void onPublishInterfaces(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
coil::Guard< coil::Mutex > Guard
virtual ConnectorProfileList * get_connector_profiles()
[CORBA interface] Get the ConnectorProfileList of the Port
PortInterfacePolarity m_pol
virtual ReturnCode_t notify_connect(ConnectorProfile &connector_profile)
[CORBA interface] Notify the Ports connection
std::string m_ownerInstanceName
Instance name.
bool operator()(const PortInterfaceProfile &prof)
const PortProfile & getProfile() const
Get the PortProfile of the Port.
ConnectionCallback * m_onSubscribeInterfaces
Callback functor objects.
ConnectionCallback * m_onUnsubscribeInterfaces
Callback functor objects.
void onNotifyConnect(const char *portname, RTC::ConnectorProfile &profile)
RT component logger class.
void onDisconnectNextport(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
find_interface(const char *name, PortInterfacePolarity pol)
PortService_ptr getPortRef()
Get the object reference of this Port.
coil::Mutex m_connectorsMutex
coil::Mutex m_profile_mutex
Mutex of PortProfile.
Functor to find a ConnectorProfile named id.
bool appendStringValue(SDOPackage::NVList &nv, const char *name, const char *value)
Append the specified string to element of NVList.
void setOnPublishInterfaces(ConnectionCallback *on_publish)
Setting callback called on publish interfaces.
ConnectionCallback * m_onDisconnected
Callback functor objects.
void onDisconnected(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
void setOnConnected(ConnectionCallback *on_connected)
Setting callback called on connection established.
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
virtual ReturnCode_t connect(ConnectorProfile &connector_profile)
[CORBA interface] Connect the Port
void setOwner(RTObject_ptr owner)
Set the owner RTObject of the Port.
bool deleteInterface(const char *name, PortInterfacePolarity pol)
Delete the interface registration from the PortInterfaceProfile.
bool isEmptyId(const ConnectorProfile &connector_profile) const
Check whether connector_id of ConnectorProfile is empty.
bool operator()(PortService_ptr port_ref)
void setOnUnsubscribeInterfaces(ConnectionCallback *on_subscribe)
Setting callback called on unsubscribe interfaces.
virtual ~PortBase(void)
Destructor.
Functor to find interface from name and polarity.
virtual void activateInterfaces()=0
Activate all Port interfaces.
void setPortRef(PortService_ptr port_ref)
Set the object reference of this Port.
bool operator()(const ConnectorProfile &cprof)
void onConnectNextport(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
virtual ReturnCode_t disconnect(const char *connector_id)
[CORBA interface] Disconnect the Port
std::vector< ConnectorProfile * > ConnectorProfileList
void appendProperty(const char *key, const char *value)
Append NameValue data to PortProfile's properties.
ConnectionCallback * m_onConnected
Callback functor objects.
void setPortConnectListenerHolder(PortConnectListeners *portconnListeners)
Setting PortConnectListener holder.
PortConnectListeners class.
virtual ReturnCode_t notify_disconnect(const char *connector_id)
[CORBA interface] Notify the Ports disconnection
NameValue and NVList utility functions.
PortBase(const char *name="")
Constructor.
CORBA sequence utility template functions.
void onConnected(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
virtual ConnectorProfile * get_connector_profile(const char *connector_id)
[CORBA interface] Get the ConnectorProfile
CORBA::Long findConnProfileIndex(const char *id)
Find ConnectorProfile with id.
void setOnConnectionLost(ConnectionCallback *on_connection_lost)
Setting callback called on connection lost.
virtual void unsubscribeInterfaces(const ConnectorProfile &connector_profile)=0
Disconnect interface connection.
void updateConnectors()
Disconnect ports that doesn't exist.
virtual PortProfile * get_port_profile()
[CORBA interface] Get the PortProfile of the Port
PortProfile m_profile
PortProfile of the Port.
virtual ReturnCode_t publishInterfaces(ConnectorProfile &connector_profile)=0
Publish interface information.
PortConnectListeners * m_portconnListeners
PortConnectListener holder.
bool eraseConnectorProfile(const char *id)
Delete the ConnectorProfile.
find_conn_id(const char *id)
std::vector< IPortService * > PortServiceList
void onUnsubscribeInterfaces(const char *portname, RTC::ConnectorProfile &profile)
bool isExistingConnId(const char *id)
Check whether the given id exists in stored ConnectorProfiles.
virtual void deactivateInterfaces()=0
Deactivate all Port interfaces.
bool appendInterface(const char *name, const char *type_name, PortInterfacePolarity pol)
Append an interface to the PortInterfaceProfile.
virtual ReturnCode_t subscribeInterfaces(const ConnectorProfile &connector_profile)=0
Publish interface information.
void onSubscribeInterfaces(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
void onNotifyDisconnect(const char *portname, RTC::ConnectorProfile &profile)
int m_connectionLimit
The maximum number of connections.
RTC::PortService_var m_objref
Object Reference of the Port.
void push_back(CorbaSequence &seq, SequenceElement elem)
Push the new element back to the CORBA sequence.
void setUUID(ConnectorProfile &connector_profile) const
Generate and set the UUID to the ConnectorProfile.
ConnectionCallback * m_onConnectionLost
Callback functor objects.
find_port_ref(PortService_ptr port_ref)
virtual ReturnCode_t disconnect_all()
[CORBA interface] Disconnect the All Ports
void addProperty(const char *key, ValueType value)
Add NameValue data to PortProfile's properties.
ConnectionCallback * m_onPublishInterfaces
Callback functor objects.
virtual ReturnCode_t disconnectNext(ConnectorProfile &connector_profile)
Call notify_disconnect() of the next Port.
bool checkPorts(::RTC::PortServiceList &ports)
Existence of ports.
Functor to find the object reference that is identical port_ref.
void updateConnectorProfile(const ConnectorProfile &connector_profile)
Append or update the ConnectorProfile list.
Callback functor abstract for connect/notify_connect() funcs.
void setName(const char *name)
Set the name of this Port.
const std::string getUUID() const
Generate the UUID.
ConnectorProfile findConnProfile(const char *id)
Find ConnectorProfile with id.
port's internal action listener classes
virtual ReturnCode_t _publishInterfaces(void)
Publish interface information.
void setOnDisconnected(ConnectionCallback *on_disconnected)
Setting callback called on disconnected.
virtual void setConnectionLimit(int limit_value)
Set the maximum number of connections.
Logger rtclog
Logger stream.
const char * getName() const
Get the name of this Port.
const PortProfile & getPortProfile() const
Get the PortProfile of the Port.