jp.go.aist.rtm.RTC.port
Class OutPortPullConnector

java.lang.Object
  extended by jp.go.aist.rtm.RTC.port.ConnectorBase
      extended by jp.go.aist.rtm.RTC.port.OutPortConnector
          extended by jp.go.aist.rtm.RTC.port.OutPortPullConnector

public class OutPortPullConnector
extends OutPortConnector

OutPortPullConnector class

Connector class of OutPort for pull type dataflow. When "pull" is specified as dataflow_type at the time of establishing connection, this object is generated and owned by the OutPort. This connector and InPortPullConnector make a pair and realize pull type dataflow of data ports. One connector corresponds to one connection which provides a data stream. Connector is distinguished by ID of the UUID that is generated at establishing connection. OutPortPullConnector owns and manages the following objects.

Data written into the OutPort is passed to OutPortPullConnector::write(), and it is written into the buffer. By reading data from OutPortPullConnector to InPortPullConnector, data transfer is realized.


Nested Class Summary
 
Nested classes/interfaces inherited from class jp.go.aist.rtm.RTC.port.ConnectorBase
ConnectorBase.ConnectorInfo, ConnectorBase.ConnectorInfoHolder
 
Field Summary
protected  BufferBase<org.omg.CORBA.portable.OutputStream> m_buffer
           the pointer to the buffer
protected  OutPortProvider m_provider
           the pointer to the OutPortProvider
 
Fields inherited from class jp.go.aist.rtm.RTC.port.OutPortConnector
m_isLittleEndian, m_profile, rtcout
 
Constructor Summary
OutPortPullConnector(ConnectorBase.ConnectorInfo profile, OutPortProvider provider, ConnectorListeners listeners)
           Constructor
OutPortPullConnector(ConnectorBase.ConnectorInfo profile, OutPortProvider provider, ConnectorListeners listeners, BufferBase<org.omg.CORBA.portable.OutputStream> buffer)
           Constructor
 
Method Summary
 void activate()
           Connector activation
protected  BufferBase<org.omg.CORBA.portable.OutputStream> createBuffer(ConnectorBase.ConnectorInfo profile)
           create buffer
 void deactivate()
           Connector deactivation
 ReturnCode disconnect()
           disconnect
 BufferBase<org.omg.CORBA.portable.OutputStream> getBuffer()
           Getting Buffer
protected  void onConnect()
           Invoke callback when connection is established
protected  void onDisconnect()
           Invoke callback when connection is destroied
 void setOutPortBase(OutPortBase outportbase)
           Stores OutPortBase.
<DataType> ReturnCode
write(DataType data)
           Writing data
 
Methods inherited from class jp.go.aist.rtm.RTC.port.OutPortConnector
id, isLittleEndian, name, profile, setEndian
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_provider

protected OutPortProvider m_provider

the pointer to the OutPortProvider


m_buffer

protected BufferBase<org.omg.CORBA.portable.OutputStream> m_buffer

the pointer to the buffer

Constructor Detail

OutPortPullConnector

public OutPortPullConnector(ConnectorBase.ConnectorInfo profile,
                            OutPortProvider provider,
                            ConnectorListeners listeners,
                            BufferBase<org.omg.CORBA.portable.OutputStream> buffer)
                     throws java.lang.Exception
Constructor

OutPortPullConnector's constructor is given the following arguments. According to ConnectorInfo which includes connection information, a buffer is created. It is also given a pointer to the provider object for the OutPort interface. The owner-ship of the pointer is owned by this OutPortPullConnector, it has responsibility to destruct the OutPortProvider. OutPortPullConnector also has ConnectorListeners to provide event callback mechanisms, and they would be called at the proper timing. If data buffer is given by OutPortBase, the pointer to the buffer is also given as arguments.

Parameters:
profile - ConnectorInfo
provider - OutPortProvider
listeners - ConnectorListeners type lsitener object list
buffer - CdrBufferBase type buffer
Throws:
java.lang.Exception

OutPortPullConnector

public OutPortPullConnector(ConnectorBase.ConnectorInfo profile,
                            OutPortProvider provider,
                            ConnectorListeners listeners)
                     throws java.lang.Exception
Constructor

OutPortPullConnector's constructor is given the following arguments. According to ConnectorInfo which includes connection information, a buffer is created. It is also given a pointer to the provider object for the OutPort interface. The owner-ship of the pointer is owned by this OutPortPullConnector, it has responsibility to destruct the OutPortProvider. OutPortPullConnector also has ConnectorListeners to provide event callback mechanisms, and they would be called at the proper timing.

Parameters:
profile - ConnectorInfo
provider - OutPortProvider
listeners - ConnectorListeners type lsitener object list
Throws:
java.lang.Exception
Method Detail

write

public <DataType> ReturnCode write(DataType data)
Writing data

This operation writes data into publisher and then the data will be transferred to correspondent InPort.

Specified by:
write in class OutPortConnector

disconnect

public ReturnCode disconnect()
disconnect

This operation destruct and delete the consumer, the publisher and the buffer.

Specified by:
disconnect in class OutPortConnector
Returns:
ReturnCode

getBuffer

public BufferBase<org.omg.CORBA.portable.OutputStream> getBuffer()
Getting Buffer

This operation returns this connector's buffer

Specified by:
getBuffer in class OutPortConnector
Returns:
This connector's buffer

createBuffer

protected BufferBase<org.omg.CORBA.portable.OutputStream> createBuffer(ConnectorBase.ConnectorInfo profile)
create buffer

Parameters:
profile - specify the buffer kind
Returns:
Buffer created

onConnect

protected void onConnect()
Invoke callback when connection is established


onDisconnect

protected void onDisconnect()
Invoke callback when connection is destroied


activate

public void activate()
Connector activation

This operation activates this connector

Specified by:
activate in class ConnectorBase

deactivate

public void deactivate()
Connector deactivation

This operation deactivates this connector

Specified by:
deactivate in class ConnectorBase

setOutPortBase

public void setOutPortBase(OutPortBase outportbase)
Stores OutPortBase.

Specified by:
setOutPortBase in class OutPortConnector
Parameters:
outportbase - OutPortBase