Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
OpenRTM_aist.PortBase.PortBase Class Reference

Port base class. More...

Inheritance diagram for OpenRTM_aist.PortBase.PortBase:
Inheritance graph
[legend]

Classes

class  connect_func
 A functor to connect Ports. More...
 
class  disconnect_all_func
 A functor to disconnect all Ports. More...
 
class  disconnect_func
 A functor to disconnect Ports. More...
 
class  find_conn_id
 A functor to find a ConnectorProfile named id. More...
 
class  find_interface
 A functor to find interface from name and polarity. More...
 
class  find_port_ref
 A functor to find the object reference that is identical port_ref. More...
 
class  if_name
 A functor to find a PortInterfaceProfile named instance_name. More...
 

Public Member Functions

def __del__ (self)
 Destructor. More...
 
def __init__ (self, name=None)
 Constructor. More...
 
def addProperty (self, key, value)
 Add NameValue data to PortProfile's properties. More...
 
def appendInterface (self, instance_name, type_name, pol)
 Append an interface to the PortInterfaceProfile. More...
 
def appendProperty (self, key, value)
 Append NameValue data to PortProfile's properties. More...
 
def checkPorts (self, ports)
 Existence of ports. More...
 
def connect (self, connector_profile)
 [CORBA interface] Connect the Port More...
 
def connectNext (self, connector_profile)
 Call notify_connect() of the next Port. More...
 
def deleteInterface (self, name, pol)
 Delete an interface from the PortInterfaceProfile. More...
 
def disconnect (self, connector_id)
 [CORBA interface] Disconnect the Port More...
 
def disconnect_all (self)
 [CORBA interface] Connect the Port More...
 
def disconnectNext (self, connector_profile)
 Call notify_disconnect() of the next Port. More...
 
def eraseConnectorProfile (self, id_)
 Delete the ConnectorProfile. More...
 
def findConnProfile (self, id_)
 Find ConnectorProfile with id. More...
 
def findConnProfileIndex (self, id_)
 Find ConnectorProfile with id. More...
 
def get_connector_profile (self, connector_id)
 [CORBA interface] Get the ConnectorProfile More...
 
def get_connector_profiles (self)
 [CORBA interface] Get the ConnectorProfileList of the Port More...
 
def get_port_profile (self)
 [CORBA interface] Get the PortProfile of the Port More...
 
def getName (self)
 Get the name of this Port. More...
 
def getPortProfile (self)
 Get the PortProfile of the Port. More...
 
def getPortRef (self)
 Get the object reference of this Port. More...
 
def getProfile (self)
 Get the PortProfile of the Port. More...
 
def getUUID (self)
 Get the UUID. More...
 
def isEmptyId (self, connector_profile)
 Whether connector_id of ConnectorProfile is empty. More...
 
def isExistingConnId (self, id_)
 Whether the given id exists in stored ConnectorProfiles. More...
 
def notify_connect (self, connector_profile)
 [CORBA interface] Notify the Ports connection More...
 
def notify_disconnect (self, connector_id)
 [CORBA interface] Notify the Ports disconnection More...
 
def onConnected (self, portname, profile, ret)
 
def onConnectNextport (self, portname, profile, ret)
 
def onDisconnected (self, portname, profile, ret)
 
def onDisconnectNextport (self, portname, profile, ret)
 
def onNotifyConnect (self, portname, profile)
 
def onNotifyDisconnect (self, portname, profile)
 
def onPublishInterfaces (self, portname, profile, ret)
 
def onSubscribeInterfaces (self, portname, profile, ret)
 
def onUnsubscribeInterfaces (self, portname, profile)
 
def publishInterfaces (self, connector_profile)
 Publish interface information. More...
 
def setConnectionLimit (self, limit_value)
 Set the maximum number of connections. More...
 
def setName (self, name)
 Set the name of this Port. More...
 
def setOnConnected (self, on_connected)
 Setting callback called on connection established. More...
 
def setOnConnectionLost (self, on_connection_lost)
 
def setOnDisconnected (self, on_disconnected)
 Setting callback called on disconnected. More...
 
def setOnPublishInterfaces (self, on_publish)
 Setting callback called on publish interfaces. More...
 
def setOnSubscribeInterfaces (self, on_subscribe)
 Setting callback called on publish interfaces. More...
 
def setOnUnsubscribeInterfaces (self, on_subscribe)
 Setting callback called on unsubscribe interfaces. More...
 
def setOwner (self, owner)
 Set the owner RTObject of the Port. More...
 
def setPortConnectListenerHolder (self, portconnListeners)
 Setting PortConnectListener holder. More...
 
def setPortRef (self, port_ref)
 Set the object reference of this Port. More...
 
def setUUID (self, connector_profile)
 Create and set the UUID to the ConnectorProfile. More...
 
def subscribeInterfaces (self, connector_profile)
 Publish interface information. More...
 
def unsubscribeInterfaces (self, connector_profile)
 Disconnect interface connection. More...
 
def updateConnectorProfile (self, connector_profile)
 Append or update the ConnectorProfile list. More...
 
def updateConnectors (self)
 Disconnect ports that doesn't exist. More...
 

Private Member Functions

def _publishInterfaces (self)
 Publish interface information. More...
 

Private Attributes

 _connection_mutex
 
 _connectionLimit
 
 _objref
 
 _onConnected
 
 _onConnectionLost
 
 _onDisconnected
 
 _onPublishInterfaces
 
 _onSubscribeInterfaces
 
 _onUnsubscribeInterfaces
 
 _ownerInstanceName
 
 _portconnListeners
 
 _profile
 
 _profile_mutex
 
 _rtcout
 

Detailed Description

Port base class.

This class is a base class of RTC::Port. RTC::Port inherits a concept of RT-Component, and can be regarded as almost the same as it. In the concept of RT-Component, Port is attached to the component, can mediate interaction between other components and usually is associated with some interfaces. Component can provide or require interface for outside via Port, and the Port plays a role to manage the connection.

Concrete class of Port assumes to be usually created at the same time that RT-Component's instance is created, be registerd to RT-Component after provided and required interfaces are registerd, and function as accessible Port from outside.

RTC::Port provides the following operations as CORBA interface:

This class provides implementations of these operations.

In these operations, as for get_port_profile(), get_connector_profiles(), get_connector_profile(), connect(), disconnect() and disconnect_all(), since their behaviors especially need not to be change in subclass, overriding is not recommended.

As for notify_connect() and notify_disconnect(), you may have to modify behavior according to the kind of interfaces that subclass provides and requires, however it is not recommended these are overriden directly. In the section of notify_connect() and notify_disconnect() as described below, it is recommended that you modify behavior by overriding the protected function related to these functions.

Since
0.4.0

Definition at line 115 of file PortBase.py.

Constructor & Destructor Documentation

def OpenRTM_aist.PortBase.PortBase.__init__ (   self,
  name = None 
)

Constructor.

The constructor of the ProtBase class is given the name of this Port and initialized. At the same time, the PortBase activates itself as CORBA object and stores its object reference to the PortProfile's port_ref member. Characters except "." can be used for the name of the port.

Parameters
nameThe name of Port

Definition at line 146 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.__del__ (   self)

Destructor.

In the destructor, PortService CORBA object is deactivated. This function never throws exception.

Definition at line 190 of file PortBase.py.

Member Function Documentation

def OpenRTM_aist.PortBase.PortBase._publishInterfaces (   self)
private

Publish interface information.

Publish interface information.

Returns
The return code of ReturnCode_t type

virtual ReturnCode_t _publishInterfaces(void);

Definition at line 1786 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.addProperty (   self,
  key,
  value 
)

Add NameValue data to PortProfile's properties.

Parameters
keyThe name of properties
valueThe value of properties

template <class valuetype>=""> void addProperty(const char* key, ValueType value)

Definition at line 2184 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.appendInterface (   self,
  instance_name,
  type_name,
  pol 
)

Append an interface to the PortInterfaceProfile.

This operation appends interface information to the PortInterfaceProfile that is owned by the Port. The given interfaces information only updates PortInterfaceProfile of PortProfile that is obtained through get_port_profile(). In order to provide and require interfaces, proper functions (for example publishInterface(), subscribeInterface() and so on) should be overridden in subclasses, and these functions provide concrete interface connection and disconnection functionality.

The interface (instance) name have to be unique in the Port. If the given interface name is identical with stored interface name, this function returns false.

Parameters
nameThe instance name of the interface.
type_nameThe type name of the interface.
polThe interface's polarity (RTC::PROVIDED or RTC:REQUIRED)
Returns
false would be returned if the same name is already registered.

bool appendInterface(const char* name, const char* type_name, PortInterfacePolarity pol);

Definition at line 2108 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.appendProperty (   self,
  key,
  value 
)

Append NameValue data to PortProfile's properties.

Append NameValue data to PortProfile's properties.

Parameters
keyThe name of properties
valueThe value of properties

void appendProperty(const char* key, const char* value)

Definition at line 2209 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.checkPorts (   self,
  ports 
)

Existence of ports.

Parameters
portsChecked ports
Returns
true:existent,false:non existent

bool checkPorts(::RTC::PortServiceList& ports)

Definition at line 2259 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.connect (   self,
  connector_profile 
)

[CORBA interface] Connect the Port

This operation establishes connection according to the given ConnectionProfile inforamtion. This function is premised on calling from mainly application program or tools.

Precondition
To establish the connection among Ports of RT-Components, application programs must call this operation giving ConnectorProfile with valid values as an argument.
Out of ConnectorProfile member variables, "name", "ports" and "properties" members shall be set valid data. "connector_id" shall be set as empty string value or valid string UUID value.
ConnectorProfile::name that is connection identifier shall be any valid CORBA::string.
ConnectorProfile::connector_id shall be set unique identifier (usually UUID is used) for all connections. Since UUID string value is usually set in the connect() function, caller should just set empty string. If the connect() is called with the same UUID as existing connection, this function returns PRECONDITION_NOT_MET error. However, in order to update the existing connection profile, the "connect()" operation with existing connector ID might be used as valid method by future extension
ConnectorProfile::ports, which is sequence of RTC::PortService references, shall store usually two or more ports' references. As exceptions, the "connect()" operation might be called with only one reference in ConnectorProfile, in case of just getting interfaces information from the port, or connecting a special port (i.e. the peer port except RTC::PortService on CORBA).
ConnectorProfile::properties might be used to give certain properties to the service interfaces associated with the port. The properties is a sequence variable with a pair of key string and Any type value. Although the A variable can store any type of values, it is not recommended except string.
The following is the summary of the ConnectorProfile member to be set when this operation is called.
  • ConnectorProfile::name: The any name of connection
  • ConnectorProfile::connector_id: Empty string
  • ConnectorProfile::ports: One or more port references
  • ConnectorProfile::properties: Properties for the interfaces
Postcondition
connect() operation will call the first port in the sequence of the ConnectorProfile.
"noify_connect()"s perform cascaded call to the ports stored in the ConnectorProfile::ports by order. Even if errors are raised by intermediate notify_connect() operation, as long as ports' object references are valid, it is guaranteed that this cascaded call is completed in all the ports. If invalid or dead ports exist in the port's sequence, the ports are skipped and notify_connect() is called for the next valid port.
connect() function returns RTC_OK if all the notify_connect() return RTC_OK. At this time the connection is completed. If notify_connect()s return except RTC_OK, connect() calls disconnect() operation with the connector_id to destruct the connection, and then it returns error code from notify_connect().
The ConnectorProfile argument of the connect() operation returns ConnectorProfile::connector_id and various information about service interfaces that is published by publishInterfaces() in the halfway ports. The connect() and halfway notify_connect() functions never change ConnectorProfile::{name, ports}.
Parameters
connector_profileThe ConnectorProfile.
Returns
ReturnCode_t The return code of ReturnCode_t type.

virtual ReturnCode_t connect(ConnectorProfile& connector_profile)

Definition at line 543 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.connectNext (   self,
  connector_profile 
)

Call notify_connect() of the next Port.

This operation calls the notify_connect() of the next Port's that stored in ConnectorProfile's port_ref sequence.

Parameters
connector_profileThe connection profile information
Returns
The return code of ReturnCode_t type.

virtual ReturnCode_t connectNext(ConnectorProfile& connector_profile);

Definition at line 1568 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.deleteInterface (   self,
  name,
  pol 
)

Delete an interface from the PortInterfaceProfile.

This operation deletes interface information from the PortInterfaceProfile that is owned by the Port.

Parameters
nameThe instance name of the interface.
polThe interface's polarity (RTC::PROVIDED or RTC:REQUIRED)
Returns
false would be returned if the given name is not registered.

bool deleteInterface(const char* name, PortInterfacePolarity pol);

Definition at line 2151 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.disconnect (   self,
  connector_id 
)

[CORBA interface] Disconnect the Port

This operation destroys connection between this port and the peer port according to given connector_id. Usually connector_id should be a UUID string that is unique in the system. And the connection, which is established by connect()/notify_connect() functions, is identified by the ConnectorProfile::connector_id.

Precondition
connector_id shall be a character string which is same with ID of at least one of the ConnectorProfiles stored in this port. If ConnectorProfile that has same ID with the given connector_id does not exist in the list of ConnectorProfile, this operation returns BAD_PARAMTER error.
ConnectorProfile::ports that is same ID with given connector_id shall store the valid ports' references.
Postcondition
disconnect() function invokes the notify_disconnect() for the port that is stored in the first of the ConnectorProfile::ports. If notify_disconnect() call fails for the first port, It tries on calling "notify_disconnect()" in order for ports stored in ConnectorProfile::ports until the operation call is succeeded. If notify_disconnect() succeeded for at least one port, it returns return code from notify_disconnect(). If none of notify_connect() call succeeded, it returns RTC_ERROR error.
Parameters
connector_idThe ID of the ConnectorProfile.
Returns
ReturnCode_t The return code of ReturnCode_t type.

virtual ReturnCode_t disconnect(const char* connector_id)

Definition at line 815 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.disconnect_all (   self)

[CORBA interface] Connect the Port

This operation destroys all connection channels owned by the Port.

Returns
ReturnCode_t The return code of this operation.

virtual ReturnCode_t disconnect_all()

Definition at line 996 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.disconnectNext (   self,
  connector_profile 
)

Call notify_disconnect() of the next Port.

This operation calls the notify_disconnect() of the next Port's that stored in ConnectorProfile's port_ref sequence.

Parameters
connector_profileThe connection profile information
Returns
The return code of ReturnCode_t type.

virtual ReturnCode_t disconnectNext(ConnectorProfile& connector_profile);

Definition at line 1609 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.eraseConnectorProfile (   self,
  id_ 
)

Delete the ConnectorProfile.

This operation deletes a ConnectorProfile specified by id from ConnectorProfileList owned by PortProfile of this Port.

Parameters
idThe id of the ConnectorProfile to be deleted.

bool eraseConnectorProfile(const char* id);

Definition at line 2043 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.findConnProfile (   self,
  id_ 
)

Find ConnectorProfile with id.

This operation returns ConnectorProfile with the given id from Port's ConnectorProfiles' list. If the ConnectorProfile with connector id that is identical with the given id does not exist, empty ConnectorProfile is returned.

Parameters
idthe connector_id to be searched in Port's ConnectorProfiles
Returns
CoonectorProfile with connector_id

ConnectorProfile findConnProfile(const char* id);

Definition at line 1935 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.findConnProfileIndex (   self,
  id_ 
)

Find ConnectorProfile with id.

This operation returns ConnectorProfile with the given id from Port's ConnectorProfiles' list. If the ConnectorProfile with connector id that is identical with the given id does not exist, empty ConnectorProfile is returned.

Parameters
idthe connector_id to be searched in Port's ConnectorProfiles
Returns
The index of ConnectorProfile of the Port

CORBA::Long findConnProfileIndex(const char* id);

Definition at line 1973 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.get_connector_profile (   self,
  connector_id 
)

[CORBA interface] Get the ConnectorProfile

This operation returns the ConnectorProfiles specified connector_id.

Parameters
connector_idID of the ConnectorProfile
Returns
the ConnectorProfile identified by the connector_id

ConnectorProfile* get_connector_profile(const char* connector_id)

Definition at line 366 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.get_connector_profiles (   self)

[CORBA interface] Get the ConnectorProfileList of the Port

This operation returns a list of the ConnectorProfiles of the Port. ConnectorProfile includes the connection information that describes relation between (among) Ports, and Ports exchange the ConnectionProfile on connection process and hold the same information in each Port. ConnectionProfile has the following members,

  • name [string] The name of the connection.
  • connector_id [string] Unique identifier.
  • ports [Port sequnce] The sequence of Port's object reference that are related the connection.
  • properties [NVList] The other properties.
Returns
the ConnectorProfileList of the Port

virtual ConnectorProfileList* get_connector_profiles()

Definition at line 331 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.get_port_profile (   self)

[CORBA interface] Get the PortProfile of the Port

This operation returns the PortProfile of the Port. PortProfile struct has the following members,

  • name [string ] The name of the Port.
  • interfaces [PortInterfaceProfileList] The sequence of PortInterfaceProfile owned by the Port
  • port_ref [Port Object] The object reference of the Port.
  • connector_profile [ConnectorProfileList] The sequence of ConnectorProfile owned by the Port.
  • owner [RTObject Object] The object reference of RTObject that is owner of the Port.
  • properties [NVList] The other properties.
Returns
the PortProfile of the Port

PortProfile* get_port_profile()

Definition at line 243 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.getName (   self)

Get the name of this Port.

Returns
The name of this Port.

const char* PortBase::getName() const

Definition at line 1055 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.getPortProfile (   self)

Get the PortProfile of the Port.

This function is a const function that returns a const reference of the PortProfile stored in this Port.

Postcondition
This function never changes the state of the object.
Returns
PortProfile

PortProfile& getPortProfile() const;

Definition at line 285 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.getPortRef (   self)

Get the object reference of this Port.

This operation returns the object reference that is stored in the Port's PortProfile.

Returns
The object reference of this Port.

PortService_ptr getPortRef();

Definition at line 1136 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.getProfile (   self)

Get the PortProfile of the Port.

This operation returns const reference of the PortProfile.

Returns
the PortProfile of the Port

const PortProfile& getProfile() const;

Definition at line 1079 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.getUUID (   self)

Get the UUID.

This operation generates UUID.

Returns
uuid

const std::string getUUID() const;

Definition at line 1847 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.isEmptyId (   self,
  connector_profile 
)

Whether connector_id of ConnectorProfile is empty.

Returns
If the given ConnectorProfile's connector_id is empty string, it returns true.

bool isEmptyId(const ConnectorProfile& connector_profile) const;

Definition at line 1822 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.isExistingConnId (   self,
  id_ 
)

Whether the given id exists in stored ConnectorProfiles.

This operation returns boolean whether the given id exists in the Port's ConnectorProfiles.

Parameters
idconnector_id to be find in Port's ConnectorProfiles

bool isExistingConnId(const char* id);

Definition at line 1900 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.notify_connect (   self,
  connector_profile 
)

[CORBA interface] Notify the Ports connection

This operation is usually called from other ports' connect() or notify_connect() operations when connection between ports is established. This function is not premised on calling from other functions or application programs.

According to the template method pattern, the notify_connect() calls "publishInterfaces()" and "subsctiveInterfaces()" functions, which are premised on implementing in the subclasses. The processing sequence is as follows.

According to the order of port's references stored in the ConnectorProfile::ports, publishing interface information to all the ports and subscription interface information from all the ports is performed by "notify_connect()"s. This cascaded call never aborts in the halfway operations, and calling sequence shall be completed for all the ports.

Precondition
notify_connect() calls notify_connect() for the port's reference that is stored in next of this port's reference in the sequence of the ConnectorProfile::ports. Therefore the reference of this port shall be stored in the ConnectorProfile::ports. If this port's reference is not stored in the sequence, BAD_PARAMETER error will be returned, except the return code is overwritten by other operations.
UUID shall be set to ConnectorProfile::connector_id as a unique identifier when this operation is called. Usually, connector_id is given by a connect() function and, the behavior is undefined in the case of a null character.
Postcondition
ConnectorProfile::name, ConnectorProfile::connector_id, ConnectorProfile::ports are invariant, and they are never rewritten by notify_connect() operations.
In order to transfer interface information to other ports, interface property information is stored into the ConnectorProfile::properties.
At the end of notify_connect() operation for the first port stored in the ConnectorProfile::ports sequence, the related ports' notify_connect() invocations complete. Even if errors are raised at the halfway of publishInterfaces(), connectNext(), subscribeInterfaces() and storing process of ConnectorProfile, error codes are saved and the first error is returned.
Parameters
connector_profileThe ConnectorProfile.
Returns
ReturnCode_t The return code of ReturnCode_t type.

virtual ReturnCode_t notify_connect(ConnectorProfile& connector_profile)

Definition at line 688 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.notify_disconnect (   self,
  connector_id 
)

[CORBA interface] Notify the Ports disconnection

This operation is invoked between Ports internally when the connection is destroied. Generally it is not premised on calling from application programs or RTC objects except Port object.

According to the template method pattern, the notify_disconnect() calls unsubsctiveInterfaces() function, which are premised on implementing in the subclasses. The processing sequence is as follows.

  • Searching ConnectorProfile
  • Calling notify_disconnect() for the next port
  • Unsubscribing interfaces
  • Deleting ConnectorProfile

notify_disconnect() notifies disconnection to all the ports by cascaded call to the stored ports in the ConnectorProfile::ports in order.

Precondition
The port shall store the ConnectorProfile having same id with connector_id.
Postcondition
If ConnectorProfile of same ID with connector_id does not exist, it returns BAD_PARAMETER error.
For the cascaded call, this operation calls noify_disconnect() for the port that is stored in the next of this port in the ConnectorProfile::ports. If the operation call raises exception for some failure, it tries to call notify_disconnect() and skips until the operation succeeded. If none of operation call succeeded, it returns RTC_ERROR.
At the end of notify_disconnect() operation for the first port stored in the ConnectorProfile::ports sequence, the related ports' notify_disconnect() invocations complete.
Parameters
connector_idThe ID of the ConnectorProfile.
Returns
ReturnCode_t The return code of ReturnCode_t type.

virtual ReturnCode_t notify_disconnect(const char* connector_id)

Definition at line 934 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.onConnected (   self,
  portname,
  profile,
  ret 
)

Definition at line 2332 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.onConnectNextport (   self,
  portname,
  profile,
  ret 
)

Definition at line 2312 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.onDisconnected (   self,
  portname,
  profile,
  ret 
)

Definition at line 2352 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.onDisconnectNextport (   self,
  portname,
  profile,
  ret 
)

Definition at line 2342 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.onNotifyConnect (   self,
  portname,
  profile 
)

Definition at line 2274 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.onNotifyDisconnect (   self,
  portname,
  profile 
)

Definition at line 2283 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.onPublishInterfaces (   self,
  portname,
  profile,
  ret 
)

Definition at line 2302 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.onSubscribeInterfaces (   self,
  portname,
  profile,
  ret 
)

Definition at line 2322 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.onUnsubscribeInterfaces (   self,
  portname,
  profile 
)

Definition at line 2292 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.publishInterfaces (   self,
  connector_profile 
)

Publish interface information.

This operation is pure virutal method that would be called at the beginning of the notify_connect() process sequence. In the notify_connect(), the following methods would be called in order.

In the concrete Port, this method should be overridden. This method processes the given ConnectorProfile argument and if the given parameter is invalid, it would return error code of ReturnCode_t. Usually, publishInterfaces() method should set interfaces information owned by this Port, and publish it to the other Ports.
When this method is called, other Ports' interfaces information may not be completed. Therefore, the process to obtain other Port's interfaces information should be done in the subscribeInterfaces() method.
This operation should create the new connection for the new connector_id, and should update the connection for the existing connection_id.

Parameters
connector_profileThe connection profile information
Returns
The return code of ReturnCode_t type.

Definition at line 1537 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setConnectionLimit (   self,
  limit_value 
)

Set the maximum number of connections.

Parameters
limit_valueThe maximum number of connections

virtual void setConnectionLimit(int limit_value);

Definition at line 1760 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setName (   self,
  name 
)

Set the name of this Port.

This operation sets the name of this Port. The given Port's name is applied to Port's PortProfile.name.

Parameters
nameThe name of this Port.

void setName(const char* name);

Definition at line 1040 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setOnConnected (   self,
  on_connected 
)

Setting callback called on connection established.

This operation sets a functor that is called when connection between ports established.

Since the ownership of the callback functor object is owned by the caller, it has the responsibility of object destruction.

The callback functor is called only when notify_connect() function successfully returns. In case of error, the functor will not be called.

Since this functor is called with ConnectorProfile argument that is same as out-parameter of notify_connect() function, you can get all the information of published interfaces of related ports in the connection. Although by using this functor, you can modify ConnectorProfile argument for out-paramter of notify_connect(), the modification should be done carefully for fear of causing connection inconsistency.

Parameters
on_subscribea pointer to ConnectionCallback's subclasses

void setOnConnected(ConnectionCallback* on_connected);

Definition at line 1334 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setOnConnectionLost (   self,
  on_connection_lost 
)

Definition at line 1439 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setOnDisconnected (   self,
  on_disconnected 
)

Setting callback called on disconnected.

This operation sets a functor that is called when connection between ports is destructed.

Since the ownership of the callback functor object is owned by the caller, it has the responsibility of object destruction.

The callback functor is called just before notify_disconnect() that is disconnection execution function returns.

This functor is called with argument of corresponding ConnectorProfile. Since this ConnectorProfile will be destructed after calling this functor, modifications never affect others.

Parameters
on_disconnecteda pointer to ConnectionCallback's subclasses

void setOnDisconnected(ConnectionCallback* on_disconnected);

Definition at line 1434 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setOnPublishInterfaces (   self,
  on_publish 
)

Setting callback called on publish interfaces.

This operation sets a functor that is called after publishing interfaces process when connecting between ports.

Since the ownership of the callback functor object is owned by the caller, it has the responsibility of object destruction.

The callback functor is called after calling publishInterfaces() that is virtual member function of the PortBase class with an argument of ConnectorProfile type that is same as the argument of publishInterfaces() function. Although by using this functor, you can modify the ConnectorProfile published by publishInterfaces() function, the modification should be done carefully for fear of causing connection inconsistency.

Parameters
on_publisha pointer to ConnectionCallback's subclasses

void setOnPublishInterfaces(ConnectionCallback* on_publish);

Definition at line 1227 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setOnSubscribeInterfaces (   self,
  on_subscribe 
)

Setting callback called on publish interfaces.

This operation sets a functor that is called before subscribing interfaces process when connecting between ports.

Since the ownership of the callback functor object is owned by the caller, it has the responsibility of object destruction.

The callback functor is called before calling subscribeInterfaces() that is virtual member function of the PortBase class with an argument of ConnectorProfile type that is same as the argument of subscribeInterfaces() function. Although by using this functor, you can modify ConnectorProfile argument for subscribeInterfaces() function, the modification should be done carefully for fear of causing connection inconsistency.

Parameters
on_subscribea pointer to ConnectionCallback's subclasses

void setOnSubscribeInterfaces(ConnectionCallback* on_subscribe);

Definition at line 1277 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setOnUnsubscribeInterfaces (   self,
  on_subscribe 
)

Setting callback called on unsubscribe interfaces.

This operation sets a functor that is called before unsubscribing interfaces process when disconnecting between ports.

Since the ownership of the callback functor object is owned by the caller, it has the responsibility of object destruction.

The callback functor is called before calling unsubscribeInterfaces() that is virtual member function of the PortBase class with an argument of ConnectorProfile type that is same as the argument of unsubscribeInterfaces() function. Although by using this functor, you can modify ConnectorProfile argument for unsubscribeInterfaces() function, the modification should be done carefully for fear of causing connection inconsistency.

Parameters
on_unsubscribea pointer to ConnectionCallback's subclasses

void setOnUnsubscribeInterfaces(ConnectionCallback* on_subscribe);

Definition at line 1385 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setOwner (   self,
  owner 
)

Set the owner RTObject of the Port.

This operation sets the owner RTObject of this Port.

Parameters
ownerThe owner RTObject's reference of this Port

void setOwner(RTObject_ptr owner);

Definition at line 1162 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setPortConnectListenerHolder (   self,
  portconnListeners 
)

Setting PortConnectListener holder.

This operation sets a functor that is called when connection of this port does lost.

Parameters
on_connection_losta pointer to ConnectionCallback's subclasses

void setPortConnectListenerHolder(PortConnectListeners* portconnListeners);

Definition at line 1465 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setPortRef (   self,
  port_ref 
)

Set the object reference of this Port.

This operation sets the object reference itself to the Port's PortProfile.

Parameters
Theobject reference of this Port.

void setPortRef(PortService_ptr port_ref);

Definition at line 1107 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.setUUID (   self,
  connector_profile 
)

Create and set the UUID to the ConnectorProfile.

This operation generates and set UUID to the ConnectorProfile.

Parameters
connector_profileConnectorProfile to be set connector_id

void setUUID(ConnectorProfile& connector_profile) const;

Definition at line 1871 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.subscribeInterfaces (   self,
  connector_profile 
)

Publish interface information.

This operation is pure virutal method that would be called at the mid-flow of the notify_connect() process sequence. In the notify_connect(), the following methods would be called in order.

In the concrete Port, this method should be overridden. This method processes the given ConnectorProfile argument and if the given parameter is invalid, it would return error code of ReturnCode_t. The given argument ConnectorProfile includes all the interfaces information in it. Usually, subscribeInterafaces() method obtains information of interfaces from ConnectorProfile, and should set it to the interfaces that require them.
This operation should create the new connection for the new connector_id, and should update the connection for the existing connection_id.

Parameters
connector_profileThe connection profile information
Returns
The return code of ReturnCode_t type.

Definition at line 1697 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.unsubscribeInterfaces (   self,
  connector_profile 
)

Disconnect interface connection.

This operation is pure virutal method that would be called at the end of the notify_disconnect() process sequence. In the notify_disconnect(), the following methods would be called.

Parameters
connector_profileThe connection profile information

Definition at line 1739 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.updateConnectorProfile (   self,
  connector_profile 
)

Append or update the ConnectorProfile list.

This operation appends or updates ConnectorProfile of the Port by the given ConnectorProfile. If the connector_id of the given ConnectorProfile does not exist in the Port's ConnectorProfile list, the given ConnectorProfile would be append to the list. If the same id exists, the list would be updated.

Parameters
connector_profilethe ConnectorProfile to be appended or updated

void updateConnectorProfile(const ConnectorProfile& connector_profile);

Definition at line 2006 of file PortBase.py.

def OpenRTM_aist.PortBase.PortBase.updateConnectors (   self)

Disconnect ports that doesn't exist.

void updateConnectors()

Definition at line 2225 of file PortBase.py.

Member Data Documentation

OpenRTM_aist.PortBase.PortBase._connection_mutex
private

Definition at line 160 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._connectionLimit
private

Definition at line 168 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._objref
private

Definition at line 148 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._onConnected
private

Definition at line 164 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._onConnectionLost
private

Definition at line 167 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._onDisconnected
private

Definition at line 166 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._onPublishInterfaces
private

Definition at line 162 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._onSubscribeInterfaces
private

Definition at line 163 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._onUnsubscribeInterfaces
private

Definition at line 165 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._ownerInstanceName
private

Definition at line 147 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._portconnListeners
private

Definition at line 169 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._profile
private

Definition at line 150 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._profile_mutex
private

Definition at line 159 of file PortBase.py.

OpenRTM_aist.PortBase.PortBase._rtcout
private

Definition at line 161 of file PortBase.py.


The documentation for this class was generated from the following file:


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:37