jp.go.aist.rtm.RTC.port
Class OutPort<DataType>

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by RTC.PortServicePOA
          extended by jp.go.aist.rtm.RTC.port.PortBase
              extended by jp.go.aist.rtm.RTC.port.OutPortBase
                  extended by jp.go.aist.rtm.RTC.port.OutPort<DataType>
Type Parameters:
DataType - The data type is specified
All Implemented Interfaces:
SDOServiceOperations, org.omg.CORBA.portable.InvokeHandler, PortServiceOperations

public class OutPort<DataType>
extends OutPortBase

Implementation of OutPort

This class is used as the base Implementation of a high-ranking output port.


Nested Class Summary
 
Nested classes/interfaces inherited from class jp.go.aist.rtm.RTC.port.OutPortBase
OutPortBase.Publisher
 
Nested classes/interfaces inherited from class jp.go.aist.rtm.RTC.port.PortBase
PortBase.connect_func, PortBase.disconnect_all_func, PortBase.disconnect_func, PortBase.find_conn_id, PortBase.find_interface, PortBase.find_port_ref
 
Field Summary
 
Fields inherited from class jp.go.aist.rtm.RTC.port.OutPortBase
m_connectors, m_consumerTypes, m_listeners, m_properties, m_providerTypes, m_publishers
 
Fields inherited from class jp.go.aist.rtm.RTC.port.PortBase
m_connectionLimit, m_connectorsMutex, m_objref, m_onConnected, m_onConnectionLost, m_onDisconnected, m_onPublishInterfaces, m_onSubscribeInterfaces, m_onUnsubscribeInterfaces, m_ownerInstanceName, m_profile, m_profile_mutex, rtcout
 
Constructor Summary
OutPort(BufferBase<DataType> buffer, java.lang.String name, DataRef<DataType> valueRef)
           Constructor
OutPort(java.lang.String name, DataRef<DataType> valueRef)
           Constructor
OutPort(java.lang.String name, DataRef<DataType> valueRef, int length)
           Constructor
 
Method Summary
static Time get_timestamp()
           {@.en Gets the timestamp.
(package private)  ReturnCode getStatus(int index)
           brief Getting specified connector's writing status
(package private)  java.util.Vector<ReturnCode> getStatusList()
           Getting specified connector's writing status list
 boolean insert(DataType value)
           Write data
 void onConnect(java.lang.String id, PublisherBase publisher)
           onConnect
 void onDisconnect(java.lang.String id)
           onDisconenct
 void setOnConnect(OnConnect on_connect)
           Set OnConnect callback
 void setOnDisconnect(OnDisconnect on_disconnect)
           Set OnDisConnect callback
 void setOnOverflow(OnOverflow<DataType> onOverflow)
           sets the callback interface called when data cannot be written in a full buffer.
 void setOnRead(OnRead<DataType> onRead)
           sets the callback interface called immediately before reading of data.
 void setOnReadConvert(OnReadConvert<DataType> onReadConvert)
           sets the callback interface called when data is read.
 void setOnUnderflow(OnUnderflow<DataType> onUnderflow)
           {@.en sets the callback interface called when there is no data that can be read in an empty buffer more.
 void setOnWrite(OnWrite<DataType> onWrite)
           Sets the callback interface called immediately before writing of data.
 void setOnWriteConvert(OnWriteConvert<DataType> onWriteConvert)
           sets the callback interface called when data is written.
 void setReadBlock(boolean block)
           Specifies the block mode in the data reading.
 void setReadTimeout(long timeout)
           Sets the timeout period of the block mode of reading.
 boolean setStreamable(org.omg.CORBA.portable.Streamable holderStreamable)
           {@.en Sets Streamable.
 void setTimestamp(DataType data)
           Sets timestamp.
 void setWriteBlock(boolean block)
           Specifies the block mode in the data writing.
 void setWriteTimeout(long timeout)
           Sets the timeout period of the block mode of writing.
 void write_stream(DataType data, org.omg.CORBA.portable.OutputStream cdr)
           Marshals to ostream the data.
 boolean write()
           Writes the data
 boolean write(DataType value)
           Write data
 
Methods inherited from class jp.go.aist.rtm.RTC.port.OutPortBase
activateInterfaces, addConnectorDataListener, addConnectorDataListener, addConnectorListener, addConnectorListener, configure, connect, connectors, createConnector, createConnector, createConsumer, createProvider, deactivateInterfaces, getConnectorById, getConnectorByName, getConnectorIds, getConnectorNames, getConnectorProfileById, getConnectorProfileByName, getConnectorProfiles, init, initConsumers, initProviders, isLittleEndian, properties, publishInterfaces, removeConnectorDataListener, removeConnectorListener, subscribeInterfaces, unsubscribeInterfaces
 
Methods inherited from class jp.go.aist.rtm.RTC.port.PortBase
_publishInterfaces, _this, addProperty, appendInterface, appendProperty, checkPorts, connectNext, deleteInterface, disconnect_all, disconnect, disconnectNext, eraseConnectorProfile, findConnProfile, findConnProfileIndex, get_connector_profile, get_connector_profiles, get_port_profile, getName, getPortProfile, getPortRef, getProfile, getUUID, isEmptyId, isExistingConnId, notify_connect, notify_disconnect, setConnectionLimit, setName, setOnConnected, setOnConnectionLost, setOnDisconnected, setOnPublishInterfaces, setOnSubscribeInterfaces, setOnUnsubscribeInterfaces, setOwner, setPortRef, setUUID, updateConnectorProfile, updateConnectors
 
Methods inherited from class RTC.PortServicePOA
_all_interfaces, _invoke, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutPort

public OutPort(java.lang.String name,
               DataRef<DataType> valueRef)
Constructor

Internally creates and allcoates the buffer

Parameters:
name - Name of Port
valueRef - DataRef object

OutPort

public OutPort(java.lang.String name,
               DataRef<DataType> valueRef,
               int length)
Constructor

Internally creates and allocates the buffer by the specified data length

Parameters:
name - the port name
valueRef - DataRef object
length - Buffer length

OutPort

public OutPort(BufferBase<DataType> buffer,
               java.lang.String name,
               DataRef<DataType> valueRef)
Constructor

Allocates the specified buffer.

Parameters:
buffer - buffer
name - Port name
valueRef - DataRef object
Method Detail

write_stream

public void write_stream(DataType data,
                         org.omg.CORBA.portable.OutputStream cdr)
Marshals to ostream the data.

Parameters:
data - data
cdr - OutputStream

setTimestamp

public void setTimestamp(DataType data)
Sets timestamp.

This function sets the timestamp.

Parameters:
data - The target data

get_timestamp

public static Time get_timestamp()
Gets the timestamp.

Returns:
RTC.Time gotten

write

public boolean write(DataType value)
Write data

Write data in the port.

Parameters:
value - The target data for writing
Returns:
Writing result (Successful:true, Failed:false)

write

public boolean write()
Writes the data

Writes the value in the variable to which bind is done.

Specified by:
write in class OutPortBase
Returns:
"True" is returned when succeeding

insert

public boolean insert(DataType value)
Write data

Write data to the port. Write the set value to the port.

Parameters:
value - The target data for writing
Returns:
Writing result (Successful:true, Failed:false)

setReadBlock

public void setReadBlock(boolean block)
Specifies the block mode in the data reading.

When the block mode is specified, the read() method is blocked until data is read or until the time-out.

Parameters:
block - True when block mode is specified

setWriteBlock

public void setWriteBlock(boolean block)
Specifies the block mode in the data writing.

When the block mode is specified, the write() method is blocked.

Parameters:
block - True when block mode is specified

setReadTimeout

public void setReadTimeout(long timeout)
Sets the timeout period of the block mode of reading.

Parameters:
timeout - Timeout[usec]

setWriteTimeout

public void setWriteTimeout(long timeout)
Sets the timeout period of the block mode of writing.

Parameters:
timeout - Timeout[usec]

getStatus

ReturnCode getStatus(int index)
brief Getting specified connector's writing status

An OutPort has Connectors that are virtual data stream channel for each connection. "write()" function write into these Connectors, and each Connector returns writing-status. write() function will return a true value if all Connectors return normal status, and a false value will be returned if at least one Connector failed. This function can be used to inspect each return status

Parameters:
index - Connector index
Returns:
Writing status

getStatusList

java.util.Vector<ReturnCode> getStatusList()
Getting specified connector's writing status list

An OutPort has Connectors that are virtual data stream channel for each connection. "write()" function write into these Connectors, and each Connector returns writing-status. write() function will return a true value if all Connectors return normal status, and a false value will be returned if at least one Connector failed. This function can be used to inspect each return status

Returns:
Writing status list

setOnWrite

public void setOnWrite(OnWrite<DataType> onWrite)
Sets the callback interface called immediately before writing of data.

Parameters:
onWrite - Object with OnWrite callback interface

setOnWriteConvert

public void setOnWriteConvert(OnWriteConvert<DataType> onWriteConvert)
sets the callback interface called when data is written.

Parameters:
onWriteConvert - Object with OutWriteConvert callback interface

setOnOverflow

public void setOnOverflow(OnOverflow<DataType> onOverflow)
sets the callback interface called when data cannot be written in a full buffer.

Parameters:
onOverflow - Object with OutOverflow callback interface

setOnRead

public void setOnRead(OnRead<DataType> onRead)
sets the callback interface called immediately before reading of data.

Parameters:
onRead - Object with OutRead callback interface

setOnReadConvert

public void setOnReadConvert(OnReadConvert<DataType> onReadConvert)
sets the callback interface called when data is read.

Parameters:
onReadConvert - Object with OutReadConvert callback interface

setOnUnderflow

public void setOnUnderflow(OnUnderflow<DataType> onUnderflow)
sets the callback interface called when there is no data that can be read in an empty buffer more.

Parameters:
onUnderflow - Object with OutUnderflow callback interface

setOnConnect

public void setOnConnect(OnConnect on_connect)

Set OnConnect callback


setOnDisconnect

public void setOnDisconnect(OnDisconnect on_disconnect)

Set OnDisConnect callback


onConnect

public void onConnect(java.lang.String id,
                      PublisherBase publisher)
Description copied from class: OutPortBase

onConnect

Overrides:
onConnect in class OutPortBase

onDisconnect

public void onDisconnect(java.lang.String id)
Description copied from class: OutPortBase

onDisconenct

Overrides:
onDisconnect in class OutPortBase

setStreamable

public boolean setStreamable(org.omg.CORBA.portable.Streamable holderStreamable)
Sets Streamable.

This method sets Streamable used when making it to CDR. Moreover, this method acquires the value field from Streamable.

Parameters:
holderStreamable - Streamable of Holder class
Returns:
false Failure