jp.go.aist.rtm.RTC.port
クラス InPort<DataType>

java.lang.Object
  上位を拡張 org.omg.PortableServer.Servant
      上位を拡張 RTC.PortServicePOA
          上位を拡張 jp.go.aist.rtm.RTC.port.PortBase
              上位を拡張 jp.go.aist.rtm.RTC.port.InPortBase
                  上位を拡張 jp.go.aist.rtm.RTC.port.InPort<DataType>
型パラメータ:
DataType - データ型を指定します。
すべての実装されたインタフェース:
SDOServiceOperations, org.omg.CORBA.portable.InvokeHandler, PortServiceOperations

public class InPort<DataType>
extends InPortBase

入力ポートのためのベース実装クラスです。 外部から送信されてきたデータは順次、コンストラクタで指定されたバッファに格納されます。 バッファ内のデータはフラグによって未読/既読状態が管理され、isNew(), isEmpty()などの メソッドによってハンドリングできます。


入れ子のクラスの概要
 
クラス 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
 
フィールドの概要
 
クラス jp.go.aist.rtm.RTC.port.InPortBase から継承されたフィールド
m_connectors, m_consumerTypes, m_listeners, m_properties, m_providerTypes, m_singlebuffer, m_thebuffer
 
クラス 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
 
コンストラクタの概要
InPort(BufferBase<DataType> superClass, java.lang.String name, DataRef<DataType> value, boolean read_block, boolean write_block, long read_timeout, long write_timeout)
          コンストラクタです。
InPort(java.lang.String name, DataRef<DataType> value)
          コンストラクタです。 読み取り・書き込みともに非ブロックモードとなり、タイムアウト時間は0で設定されます。
 
メソッドの概要
 DataType extract()
           Read the newly value data in InPort to type-T variable
 boolean isEmpty()
           Check whether the data is newest
 boolean isNew()
           Check whether the data is newest
 java.lang.String name()
          ポート名称を取得します。
 boolean read()
           Readout the value from DataPort
 void setOnOverflow(OnOverflow<DataType> onOverflow)
          データ書き込み時に、バッファオーバーフロー検出の際に呼び出される コールバックインタフェースを設定します。
 void setOnRead(OnRead<DataType> onRead)
          ポートが持つバッファからデータが読み込まれる直前に呼び出される コールバックインタフェースを設定します。
 void setOnReadConvert(OnReadConvert<DataType> onReadConvert)
          ポートが持つバッファからデータが読み出される際に呼び出される コールバックインタフェースを設定します。
コールバックインタフェースの戻り値がread()メソッドの読み出し結果として取得されます。
 void setOnUnderflow(OnUnderflow<DataType> onUnderflow)
          データ読み込みときに、バッファアンダーフロー検出の際に呼び出される コールバックインタフェースを設定します。
 void setOnWrite(OnWrite<DataType> onWrite)
          ポートが持つバッファにデータが書き込まれる直前に呼び出される コールバックインタフェースを設定します。
 void setOnWriteConvert(OnWriteConvert<DataType> onWriteConvert)
          ポートが持つバッファにデータが書き込まれる際に呼び出される コールバックインタフェースを設定します。
コールバックインタフェースの戻り値がバッファに書き込まれます。
 boolean setStreamable(org.omg.CORBA.portable.Streamable holderStreamable)
           {@.en Sets Streamable.
 void update()
          バインドされたDataType型のデータに、ポート内バッファの最新値を読み込みます。
ただし、あらかじめコンストラクタで、DataType型の変数がバインドされていなければなりません。
 
クラス jp.go.aist.rtm.RTC.port.InPortBase から継承されたメソッド
activateInterfaces, addConnectorDataListener, addConnectorDataListener, addConnectorListener, addConnectorListener, connect, connectors, createConnector, createConnector, createConsumer, createProvider, deactivateInterfaces, getConnectorById, getConnectorByName, getConnectorIds, getConnectorNames, getConnectorProfileById, getConnectorProfileByName, getConnectorProfiles, init, initConsumers, initProviders, isLittleEndian, properties, publishInterfaces, removeConnectorDataListener, removeConnectorListener, subscribeInterfaces, unsubscribeInterfaces
 
クラス 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
 
クラス RTC.PortServicePOA から継承されたメソッド
_all_interfaces, _invoke, _this
 
クラス 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
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

InPort

public InPort(BufferBase<DataType> superClass,
              java.lang.String name,
              DataRef<DataType> value,
              boolean read_block,
              boolean write_block,
              long read_timeout,
              long write_timeout)

コンストラクタです。

パラメータ:
name - ポート名称
value - このポートにバインドされるDataType型の変数
read_block - データ読み込み時に未読データがない場合に、データ受信までブロックする場合はtrue、さもなくばfalse
write_block - データ書き込み時にバッファがフルであった場合に、バッファに空きができるまでブロック場合はtrue、さもなくばfalse
read_timeout - 非ブロック指定の場合の、データ読み取りのタイムアウト時間 (ミリ秒)
write_timeout - 非ブロック指定の場合の、データ書き込みのタイムアウト時間 (ミリ秒)

InPort

public InPort(java.lang.String name,
              DataRef<DataType> value)

コンストラクタです。 読み取り・書き込みともに非ブロックモードとなり、タイムアウト時間は0で設定されます。

パラメータ:
name - ポート名称
value - このポートにバインドされるDataType型の変数
メソッドの詳細

name

public java.lang.String name()

ポート名称を取得します。

戻り値:
ポート名称

isNew

public boolean isNew()
Check whether the data is newest

Check whether the data stored at a current buffer position is i newest.

戻り値:
Newest data check result ( true:Newest data. Data has not been readout yet. false:Past data.Data has already been readout.)

read

public boolean read()
Readout the value from DataPort

Readout the value from DataPort - When Callback functor OnRead is already set, OnRead will be invoked before reading from the buffer held by DataPort. - When the buffer held by DataPort can detect the underflow, and when it detected the underflow at reading, callback functor OnUnderflow will be invoked. - When callback functor OnReadConvert is already set, the return value of operator() of OnReadConvert will be the return value of read(). - When timeout of reading is already set by setReadTimeout(), it waits for only timeout time until the state of the buffer underflow is reset, and if OnUnderflow is already set, this will be invoked to return.

定義:
クラス InPortBase 内の read
戻り値:
Readout result (Successful:true, Failed:false)

update

public void update()

バインドされたDataType型のデータに、ポート内バッファの最新値を読み込みます。
ただし、あらかじめコンストラクタで、DataType型の変数がバインドされていなければなりません。


extract

public DataType extract()
Read the newly value data in InPort to type-T variable

Read the newly data set in InPort and set to specified data variable.

戻り値:
The type-T variable to read from InPort's buffer

setOnWrite

public void setOnWrite(OnWrite<DataType> onWrite)

ポートが持つバッファにデータが書き込まれる直前に呼び出される コールバックインタフェースを設定します。

パラメータ:
onWrite - OnWrite<DataType>インタフェースを持つオブジェクト

setOnWriteConvert

public void setOnWriteConvert(OnWriteConvert<DataType> onWriteConvert)

ポートが持つバッファにデータが書き込まれる際に呼び出される コールバックインタフェースを設定します。
コールバックインタフェースの戻り値がバッファに書き込まれます。

パラメータ:
onWriteConvert - OnWriteConvert<DataType>インタフェースを持つオブジェクト

setOnRead

public void setOnRead(OnRead<DataType> onRead)

ポートが持つバッファからデータが読み込まれる直前に呼び出される コールバックインタフェースを設定します。

パラメータ:
onRead - OnRead<DataType>インタフェースを持つオブジェクト

setOnReadConvert

public void setOnReadConvert(OnReadConvert<DataType> onReadConvert)

ポートが持つバッファからデータが読み出される際に呼び出される コールバックインタフェースを設定します。
コールバックインタフェースの戻り値がread()メソッドの読み出し結果として取得されます。

パラメータ:
onReadConvert - OnReadConvert<DataType>インタフェースを持つオブジェクト

setOnOverflow

public void setOnOverflow(OnOverflow<DataType> onOverflow)

データ書き込み時に、バッファオーバーフロー検出の際に呼び出される コールバックインタフェースを設定します。

パラメータ:
onOverflow - OnOverflow<DataType>インタフェースを持つオブジェクト

setOnUnderflow

public void setOnUnderflow(OnUnderflow<DataType> onUnderflow)

データ読み込みときに、バッファアンダーフロー検出の際に呼び出される コールバックインタフェースを設定します。

パラメータ:
onUnderflow - OnUnderflow<DataType>インタフェースを持つオブジェクト

isEmpty

public boolean isEmpty()
Check whether the data is newest

Check whether the data stored at a current buffer position is newest.

戻り値:
Newest data check result ( true:Newest data. Data has not been readout yet. false:Past data.Data has already been readout.)

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.

パラメータ:
holderStreamable - Streamable of Holder class
戻り値:
false Failure