|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectorg.omg.PortableServer.Servant
RTC.PortServicePOA
jp.go.aist.rtm.RTC.port.PortBase
jp.go.aist.rtm.RTC.port.OutPortBase
public abstract class OutPortBase
出力ポートのベース実装クラスです。 Publisherの登録やPublisherへのデータ更新通知などの実装を提供します。
入れ子のクラスの概要 | |
---|---|
protected class |
OutPortBase.Publisher
ポート名です。 |
クラス 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 |
フィールドの概要 | |
---|---|
protected java.util.Vector<OutPortConnector> |
m_connectors
|
protected java.util.Vector<java.lang.String> |
m_consumerTypes
|
protected ConnectorListeners |
m_listeners
|
protected Properties |
m_properties
|
protected java.util.Vector<java.lang.String> |
m_providerTypes
|
protected java.util.List<OutPortBase.Publisher> |
m_publishers
|
クラス 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 |
コンストラクタの概要 | |
---|---|
OutPortBase(java.lang.String name,
java.lang.String data_type)
コンストラクタです。 |
メソッドの概要 | |
---|---|
void |
activateInterfaces()
Activate all Port interfaces This operation activate all interfaces that is registered in the ports. |
void |
addConnectorDataListener(int type,
ConnectorDataListenerT listener)
|
void |
addConnectorDataListener(int type,
ConnectorDataListenerT listener,
boolean autoclean)
ConnectorDataListener リスナを追加する バッファ書き込みまたは読み出しイベントに関連する各種リスナを設定する。 |
void |
addConnectorListener(int type,
ConnectorListener listener)
|
void |
addConnectorListener(int type,
ConnectorListener listener,
boolean autoclean)
ConnectorListener リスナを追加する {@.ja バッファ書き込みまたは読み出しイベントに関連する各種リスナを 設定する。 |
protected void |
configure()
Configureing outport This operation configures the outport based on the properties. |
ReturnCode_t |
connect(ConnectorProfileHolder connector_profile)
Connect the Port This operation establishes connection according to the given ConnectionProfile inforamtion. |
java.util.Vector<OutPortConnector> |
connectors()
Connector list This operation returns connector list |
protected OutPortConnector |
createConnector(ConnectorProfileHolder cprof,
Properties prop,
InPortConsumer consumer)
OutPortPushConnector creation |
protected OutPortConnector |
createConnector(ConnectorProfileHolder cprof,
Properties prop,
OutPortProvider provider)
OutPortPullConnector creation |
protected InPortConsumer |
createConsumer(ConnectorProfileHolder cprof,
Properties prop)
InPort consumer creation |
protected OutPortProvider |
createProvider(ConnectorProfileHolder cprof,
Properties prop)
OutPort provider creation |
void |
deactivateInterfaces()
Deactivate all Port interfaces This operation deactivate all interfaces that is registered in the ports. |
OutPortConnector |
getConnectorById(java.lang.String id)
Getting ConnectorProfile by ID This operation returns Connector specified by ID. |
(package private) OutPortConnector |
getConnectorByName(java.lang.String name)
Getting Connector by name This operation returns Connector specified by name. |
java.util.Vector<java.lang.String> |
getConnectorIds()
ConnectorId list This operation returns ConnectorId list |
java.util.Vector<java.lang.String> |
getConnectorNames()
Connector name list This operation returns Connector name list |
boolean |
getConnectorProfileById(java.lang.String id,
ConnectorBase.ConnectorInfoHolder profh)
Getting ConnectorProfile by name This operation returns ConnectorProfile specified by name |
boolean |
getConnectorProfileByName(java.lang.String name,
ConnectorBase.ConnectorInfoHolder profh)
Getting ConnectorProfile by name This operation returns ConnectorProfile specified by name |
java.util.Vector<ConnectorBase.ConnectorInfo> |
getConnectorProfiles()
ConnectorProfile list This operation returns ConnectorProfile list |
void |
init(Properties prop)
Initializing properties This operation initializes outport's properties |
protected void |
initConsumers()
InPort consumer initialization |
protected void |
initProviders()
OutPort provider initialization |
boolean |
isLittleEndian()
|
void |
onConnect(java.lang.String id,
PublisherBase publisher)
onConnect |
void |
onDisconnect(java.lang.String id)
onDisconenct |
Properties |
properties()
プロパティを取得する |
protected ReturnCode_t |
publishInterfaces(ConnectorProfileHolder cprof)
Interface 情報を公開する {@.ja このオペレーションは、notify_connect() 処理シーケンスの始めにコール される純粋仮想関数である。 |
void |
removeConnectorDataListener(int type,
ConnectorDataListenerT listener)
ConnectorDataListener リスナを削除する 設定した各種リスナを削除する。 |
void |
removeConnectorListener(int type,
ConnectorListener listener)
@brief ConnectorDataListener リスナを削除する 設定した各種リスナを削除する。 |
protected ReturnCode_t |
subscribeInterfaces(ConnectorProfileHolder cprof)
Interface に接続する {@.ja このオペレーションは、notify_connect() 処理シーケンスの中間にコール される純粋仮想関数である。 |
protected void |
unsubscribeInterfaces(ConnectorProfile connector_profile)
Interfaceの接続を解除します。 |
abstract boolean |
write()
データ書き込み {@.ja ポートへデータを書き込む。 |
クラス 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 |
フィールドの詳細 |
---|
protected java.util.List<OutPortBase.Publisher> m_publishers
protected Properties m_properties
protected java.util.Vector<OutPortConnector> m_connectors
protected java.util.Vector<java.lang.String> m_providerTypes
protected java.util.Vector<java.lang.String> m_consumerTypes
protected ConnectorListeners m_listeners
コンストラクタの詳細 |
---|
public OutPortBase(java.lang.String name, java.lang.String data_type)
コンストラクタです。
name
- ポート名data_type
- メソッドの詳細 |
---|
public void init(Properties prop)
Initializing properties
This operation initializes outport's properties
prop
- Property for setting portspublic abstract boolean write()
ポートへデータを書き込む。 バインドされた変数に設定された値をポートに書き込む。
public Properties properties()
プロパティを取得する
public final java.util.Vector<OutPortConnector> connectors()
Connector list
This operation returns connector list
public java.util.Vector<ConnectorBase.ConnectorInfo> getConnectorProfiles()
ConnectorProfile list
This operation returns ConnectorProfile list
public java.util.Vector<java.lang.String> getConnectorIds()
ConnectorId list
This operation returns ConnectorId list
public java.util.Vector<java.lang.String> getConnectorNames()
Connector name list
This operation returns Connector name list
public OutPortConnector getConnectorById(java.lang.String id)
Getting ConnectorProfile by ID
This operation returns Connector specified by ID.
id
- Connector ID
OutPortConnector getConnectorByName(java.lang.String name)
Getting Connector by name
This operation returns Connector specified by name.
name
- Connector ID
public boolean getConnectorProfileById(java.lang.String id, ConnectorBase.ConnectorInfoHolder profh)
Getting ConnectorProfile by name
This operation returns ConnectorProfile specified by name
id
- Connector IDprofh
- ConnectorProfileHolder
public boolean getConnectorProfileByName(java.lang.String name, ConnectorBase.ConnectorInfoHolder profh)
Getting ConnectorProfile by name
This operation returns ConnectorProfile specified by name
name
- profh
- ConnectorProfileHodler
public void onConnect(java.lang.String id, PublisherBase publisher)
onConnect
public void onDisconnect(java.lang.String id)
onDisconenct
public ReturnCode_t connect(ConnectorProfileHolder connector_profile)
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.
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 interfacesconnect() 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}.
PortServiceOperations
内の connect
PortBase
内の connect
connector_profile
- The ConnectorProfile.
protected ReturnCode_t publishInterfaces(ConnectorProfileHolder cprof)
このオペレーションは、notify_connect() 処理シーケンスの始めにコール される純粋仮想関数である。 notify_connect() では、
PortBase
内の publishInterfaces
cprof
- 接続に関するプロファイル情報
protected ReturnCode_t subscribeInterfaces(ConnectorProfileHolder cprof)
このオペレーションは、notify_connect() 処理シーケンスの中間にコール される純粋仮想関数である。 notify_connect() では、
PortBase
内の subscribeInterfaces
cprof
- 接続に関するプロファイル情報
protected void unsubscribeInterfaces(ConnectorProfile connector_profile)
PortBase
の記述: Interfaceの接続を解除します。
このメソッドは、notify_disconnect()処理シーケンスの終わりに呼び出されるテンプレートメソッドです。 notify_disconnect()では、
具象クラスでは、このメソッドをオーバーライドし、引数として 与えられた ConnectorProfile に従い接続解除処理を行います。
PortBase
内の unsubscribeInterfaces
connector_profile
- 接続プロファイル情報public void activateInterfaces()
Activate all Port interfaces
This operation activate all interfaces that is registered in the ports.
PortBase
内の activateInterfaces
public void deactivateInterfaces()
Deactivate all Port interfaces
This operation deactivate all interfaces that is registered in the ports.
PortBase
内の deactivateInterfaces
public void addConnectorDataListener(int type, ConnectorDataListenerT listener, boolean autoclean)
バッファ書き込みまたは読み出しイベントに関連する各種リスナを設定する。 設定できるリスナのタイプとコールバックイベントは以下の通り
ConnectorDataListener::
operator()(const ConnectorProfile&, const cdrStream&)
デフォルトでは、この関数に与えたリスナオブジェクトの所有権は
OutPortに移り、OutPort解体時もしくは、
removeConnectorDataListener() により削除時に自動的に解体される。
リスナオブジェクトの所有権を呼び出し側で維持したい場合は、第3引
数に false を指定し、自動的な解体を抑制することができる。}
type
- リスナタイプ
listener
- リスナオブジェクトへのポインタ
autoclean
- リスナオブジェクトの自動的解体を行うかどうかのフラグ
public void addConnectorDataListener(int type, ConnectorDataListenerT listener)
public void removeConnectorDataListener(int type, ConnectorDataListenerT listener)
設定した各種リスナを削除する。
type
- リスナタイプ
listener
- リスナオブジェクトへのポインタ
public void addConnectorListener(int type, ConnectorListener listener, boolean autoclean)
バッファ書き込みまたは読み出しイベントに関連する各種リスナを 設定する。 設定できるリスナのタイプは
ConnectorListener::operator()(const ConnectorProfile&)
デフォルトでは、この関数に与えたリスナオブジェクトの所有権は
OutPortに移り、OutPort解体時もしくは、
removeConnectorListener() により削除時に自動的に解体される。
リスナオブジェクトの所有権を呼び出し側で維持したい場合は、第3引
数に false を指定し、自動的な解体を抑制することができる。
type
- リスナタイプ
listener
- リスナオブジェクトへのポインタ
autoclean
- リスナオブジェクトの自動的解体を行うかどうかのフラグ
public void addConnectorListener(int type, ConnectorListener listener)
public void removeConnectorListener(int type, ConnectorListener listener)
設定した各種リスナを削除する。
type
- リスナタイプ
listener
- リスナオブジェクトへのポインタ
protected void configure()
Configureing outport
This operation configures the outport based on the properties.
protected void initProviders()
OutPort provider initialization
protected void initConsumers()
InPort consumer initialization
protected OutPortProvider createProvider(ConnectorProfileHolder cprof, Properties prop)
OutPort provider creation
protected InPortConsumer createConsumer(ConnectorProfileHolder cprof, Properties prop)
InPort consumer creation
protected OutPortConnector createConnector(ConnectorProfileHolder cprof, Properties prop, InPortConsumer consumer)
OutPortPushConnector creation
protected OutPortConnector createConnector(ConnectorProfileHolder cprof, Properties prop, OutPortProvider provider)
OutPortPullConnector creation
public boolean isLittleEndian()
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |