OpenRTM-aist
1.2.1
|
#include <OutPortBase.h>
公開メンバ関数 | |
OutPortBase (const char *name, const char *data_type) | |
コンストラクタ [詳解] | |
virtual | ~OutPortBase (void) |
デストラクタ [詳解] | |
void | init (coil::Properties &prop) |
プロパティの初期化 [詳解] | |
virtual bool | write ()=0 |
データ書き込み [詳解] | |
coil::Properties & | properties () |
プロパティを取得する [詳解] | |
const std::vector< OutPortConnector * > & | connectors () |
Connector を取得 [詳解] | |
ConnectorInfoList | getConnectorProfiles () |
ConnectorProfile を取得 [詳解] | |
coil::vstring | getConnectorIds () |
ConnectorId を取得 [詳解] | |
coil::vstring | getConnectorNames () |
Connectorの名前を取得 [詳解] | |
OutPortConnector * | getConnectorById (const char *id) |
ConnectorProfileをIDで取得 [詳解] | |
OutPortConnector * | getConnectorByName (const char *name) |
ConnectorProfileを名前で取得 [詳解] | |
bool | getConnectorProfileById (const char *id, ConnectorInfo &prof) |
ConnectorProfileをIDで取得 [詳解] | |
bool | getConnectorProfileByName (const char *name, ConnectorInfo &prof) |
ConnectorProfileを名前で取得 [詳解] | |
virtual void | activateInterfaces () |
全ての Port のインターフェースを activate する [詳解] | |
virtual void | deactivateInterfaces () |
全ての Port のインターフェースを deactivate する [詳解] | |
void | addConnectorDataListener (ConnectorDataListenerType listener_type, ConnectorDataListener *listener, bool autoclean=true) |
ConnectorDataListener リスナを追加する [詳解] | |
void | removeConnectorDataListener (ConnectorDataListenerType listener_type, ConnectorDataListener *listener) |
ConnectorDataListener リスナを削除する [詳解] | |
void | addConnectorListener (ConnectorListenerType callback_type, ConnectorListener *listener, bool autoclean=true) |
ConnectorListener リスナを追加する [詳解] | |
void | removeConnectorListener (ConnectorListenerType callback_type, ConnectorListener *listener) |
ConnectorDataListener リスナを削除する [詳解] | |
bool | isLittleEndian () |
endian 設定を返す [詳解] | |
virtual ReturnCode_t | connect (ConnectorProfile &connector_profile) throw (CORBA::SystemException) |
[CORBA interface] Port の接続を行う [詳解] | |
virtual ConnectorListeners & | getListeners () |
リスナホルダを取得する [詳解] | |
![]() | |
PortBase (const char *name="") | |
コンストラクタ [詳解] | |
virtual | ~PortBase (void) |
デストラクタ [詳解] | |
virtual PortProfile * | get_port_profile () throw (CORBA::SystemException) |
[CORBA interface] PortProfileを取得する [詳解] | |
const PortProfile & | getPortProfile () const |
PortProfile を取得する。 [詳解] | |
virtual ConnectorProfileList * | get_connector_profiles () throw (CORBA::SystemException) |
[CORBA interface] ConnectorProfileListを取得する [詳解] | |
virtual ConnectorProfile * | get_connector_profile (const char *connector_id) throw (CORBA::SystemException) |
[CORBA interface] ConnectorProfile を取得する [詳解] | |
virtual ReturnCode_t | disconnect (const char *connector_id) throw (CORBA::SystemException) |
[CORBA interface] Port の接続を解除する [詳解] | |
virtual ReturnCode_t | notify_disconnect (const char *connector_id) throw (CORBA::SystemException) |
[CORBA interface] Port の接続解除通知を行う [詳解] | |
virtual ReturnCode_t | disconnect_all () throw (CORBA::SystemException) |
[CORBA interface] Port の全接続を解除する [詳解] | |
void | setName (const char *name) |
Port の名前を設定する [詳解] | |
const char * | getName () const |
Port の名前を取得する [詳解] | |
const PortProfile & | getProfile () const |
PortProfileを取得する [詳解] | |
void | setPortRef (PortService_ptr port_ref) |
Port のオブジェクト参照を設定する [詳解] | |
PortService_ptr | getPortRef () const |
Port のオブジェクト参照を取得する [詳解] | |
void | setOwner (RTObject_ptr owner) |
Port の owner の RTObject を指定する [詳解] | |
void | setOnPublishInterfaces (ConnectionCallback *on_publish) |
インターフェースを公開する際に呼ばれるコールバックをセットする [詳解] | |
void | setOnSubscribeInterfaces (ConnectionCallback *on_subscribe) |
インターフェースを取得する際に呼ばれるコールバックをセットする [詳解] | |
void | setOnConnected (ConnectionCallback *on_connected) |
接続完了時に呼ばれるコールバックをセットする [詳解] | |
void | setOnUnsubscribeInterfaces (ConnectionCallback *on_subscribe) |
インターフェースを解放する際に呼ばれるコールバックをセットする [詳解] | |
void | setOnDisconnected (ConnectionCallback *on_disconnected) |
接続解除に呼ばれるコールバックをセットする [詳解] | |
void | setOnConnectionLost (ConnectionCallback *on_connection_lost) |
ポートの接続がロストした場合に呼び出されるコールバックをセットする [詳解] | |
void | setPortConnectListenerHolder (PortConnectListeners *portconnListeners) |
PortConnectListeners のホルダをセットする [詳解] | |
virtual DirectPortBase * | getDirectPort () |
direct通信用ポートオブジェクト取得 [詳解] | |
公開変数類 | |
DATAPORTSTATUS_ENUM typedef std::vector< OutPortConnector * > | ConnectorList |
限定公開メンバ関数 | |
void | configure () |
OutPortの設定を行う [詳解] | |
virtual ReturnCode_t | publishInterfaces (ConnectorProfile &connector_profile) |
Interface 情報を公開する [詳解] | |
virtual ReturnCode_t | subscribeInterfaces (const ConnectorProfile &connector_profile) |
Interface に接続する [詳解] | |
virtual void | unsubscribeInterfaces (const ConnectorProfile &connector_profile) |
Interface の接続を解除する [詳解] | |
void | initProviders () |
OutPort provider の初期化 [詳解] | |
void | initConsumers () |
InPort consumer の初期化 [詳解] | |
bool | checkEndian (const coil::Properties &prop, bool &littleEndian) |
シリアライザのエンディアンをチェックする [詳解] | |
OutPortProvider * | createProvider (ConnectorProfile &cprof, coil::Properties &prop) |
OutPort provider の生成 [詳解] | |
InPortConsumer * | createConsumer (const ConnectorProfile &cprof, coil::Properties &prop) |
InPort consumer の生成 [詳解] | |
OutPortConnector * | createConnector (const ConnectorProfile &cprof, coil::Properties &prop, InPortConsumer *consumer) |
OutPortPushConnector の生成 [詳解] | |
OutPortConnector * | createConnector (const ConnectorProfile &cprof, coil::Properties &prop, OutPortProvider *provider) |
OutPortPullConnector の生成 [詳解] | |
virtual ReturnCode_t | notify_connect (ConnectorProfile &connector_profile) throw (CORBA::SystemException) |
[CORBA interface] Port の接続通知を行う [詳解] | |
InPortBase * | getLocalInPort (const ConnectorInfo &profile) |
ローカルのピアInPortを取得 [詳解] | |
![]() | |
virtual ReturnCode_t | connectNext (ConnectorProfile &connector_profile) |
次の Port に対して notify_connect() をコールする [詳解] | |
virtual ReturnCode_t | disconnectNext (ConnectorProfile &connector_profile) |
次の Port に対して notify_disconnect() をコールする [詳解] | |
virtual void | setConnectionLimit (int limit_value) |
接続の最大数を設定する。 [詳解] | |
virtual ReturnCode_t | _publishInterfaces (void) |
Interface情報を公開する [詳解] | |
bool | isEmptyId (const ConnectorProfile &connector_profile) const |
ConnectorProfile の connector_id フィールドが空かどうか判定 [詳解] | |
const std::string | getUUID () const |
UUIDを生成する [詳解] | |
void | setUUID (ConnectorProfile &connector_profile) const |
UUIDを生成し ConnectorProfile にセットする [詳解] | |
bool | isExistingConnId (const char *id) |
id が既存の ConnectorProfile のものかどうか判定する [詳解] | |
ConnectorProfile | findConnProfile (const char *id) |
id を持つ ConnectorProfile を探す [詳解] | |
CORBA::Long | findConnProfileIndex (const char *id) |
id を持つ ConnectorProfile を探す [詳解] | |
void | updateConnectorProfile (const ConnectorProfile &connector_profile) |
ConnectorProfile の追加もしくは更新 [詳解] | |
bool | eraseConnectorProfile (const char *id) |
ConnectorProfile を削除する [詳解] | |
bool | appendInterface (const char *name, const char *type_name, PortInterfacePolarity pol) |
PortInterfaceProfile に インターフェースを登録する [詳解] | |
bool | deleteInterface (const char *name, PortInterfacePolarity pol) |
PortInterfaceProfile からインターフェース登録を削除する [詳解] | |
template<class ValueType > | |
void | addProperty (const char *key, ValueType value) |
PortProfile の properties に NameValue 値を追加する [詳解] | |
void | appendProperty (const char *key, const char *value) |
PortProfile の properties に NameValue 値を要素に追加する [詳解] | |
void | updateConnectors () |
存在しないポートをdisconnectする。 [詳解] | |
bool | checkPorts (::RTC::PortServiceList &ports) |
ポートの存在を確認する。 [詳解] | |
void | onNotifyConnect (const char *portname, RTC::ConnectorProfile &profile) |
void | onNotifyDisconnect (const char *portname, RTC::ConnectorProfile &profile) |
void | onUnsubscribeInterfaces (const char *portname, RTC::ConnectorProfile &profile) |
void | onPublishInterfaces (const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret) |
void | onConnectNextport (const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret) |
void | onSubscribeInterfaces (const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret) |
void | onConnected (const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret) |
void | onDisconnectNextport (const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret) |
void | onDisconnected (const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret) |
その他の継承メンバ | |
![]() | |
enum | Enum { PORT_OK = 0, PORT_ERROR, BUFFER_ERROR, BUFFER_FULL, BUFFER_EMPTY, BUFFER_TIMEOUT, SEND_FULL, SEND_TIMEOUT, RECV_EMPTY, RECV_TIMEOUT, INVALID_ARGS, PRECONDITION_NOT_MET, CONNECTION_LOST, UNKNOWN_ERROR } |
![]() | |
static const char * | toString (DataPortStatus::Enum status) |
DataPortStatus リターンコードを文字列に変換 [詳解] | |
![]() | |
typedef coil::Guard< coil::Mutex > | Guard |
OutPort 基底クラス
OutPort の基底クラス。
Properties: port.outport プロパティは
ConnectorProfile.properties の場合は
以下に指定したものが渡される。 (port.outport.[name]が優先される) さらに、一部のプロパティは接続時に ConnectorProfile により 渡される場合があり、その場合は ConnectorProfile が優先される。
dataport.dataflow_type
dataport.interface_type
dataport.subscription_type
[buffer]
[publihser]
[interface]
OutPort 側の connect() では以下のシーケンスで処理が行われる。
RTC::OutPortBase::OutPortBase | ( | const char * | name, |
const char * | data_type | ||
) |
コンストラクタ
コンストラクタ。
name | ポート名 |
data_type | データタイプ |
|
virtual |
デストラクタ
デストラクタ。 登録された全ての Publisher を削除する。
|
virtual |
void RTC::OutPortBase::addConnectorDataListener | ( | ConnectorDataListenerType | listener_type, |
ConnectorDataListener * | listener, | ||
bool | autoclean = true |
||
) |
ConnectorDataListener リスナを追加する
バッファ書き込みまたは読み出しイベントに関連する各種リスナを設定する。
設定できるリスナのタイプとコールバックイベントは以下の通り
リスナは ConnectorDataListener を継承し、以下のシグニチャを持つ operator() を実装している必要がある。
ConnectorDataListener:: operator()(const ConnectorProfile&, const cdrStream&)
デフォルトでは、この関数に与えたリスナオブジェクトの所有権は OutPortに移り、OutPort解体時もしくは、 removeConnectorDataListener() により削除時に自動的に解体される。 リスナオブジェクトの所有権を呼び出し側で維持したい場合は、第3引 数に false を指定し、自動的な解体を抑制することができる。
listener_type | リスナタイプ |
listener | リスナオブジェクトへのポインタ |
autoclean | リスナオブジェクトの自動的解体を行うかどうかのフラグ |
void RTC::OutPortBase::addConnectorListener | ( | ConnectorListenerType | callback_type, |
ConnectorListener * | listener, | ||
bool | autoclean = true |
||
) |
ConnectorListener リスナを追加する
バッファ書き込みまたは読み出しイベントに関連する各種リスナを設定する。
設定できるリスナのタイプは
リスナは以下のシグニチャを持つ operator() を実装している必要がある。
ConnectorListener::operator()(const ConnectorProfile&)
デフォルトでは、この関数に与えたリスナオブジェクトの所有権は OutPortに移り、OutPort解体時もしくは、 removeConnectorListener() により削除時に自動的に解体される。 リスナオブジェクトの所有権を呼び出し側で維持したい場合は、第3引 数に false を指定し、自動的な解体を抑制することができる。
listener_type | リスナタイプ |
listener | リスナオブジェクトへのポインタ |
autoclean | リスナオブジェクトの自動的解体を行うかどうかのフラグ |
|
protected |
シリアライザのエンディアンをチェックする
与えられたプロパティに設定されている、データのシリアライザのエン ディアン指定をチェックする。正しいエンディアン指定がなされていれ ば、true を返し、引数 littleEndian に、設定値がリトルエンディア ンであれば true が、ビッグエンディアンであれば false が返される。
prop | チェックするプロパティ |
littleEndian | エンディアン情報(true:little,false:big) |
|
protected |
OutPortの設定を行う
propertiesの情報に基づきOutPortの各種設定を行う
|
virtual |
[CORBA interface] Port の接続を行う
与えられた ConnectoionProfile の情報に基づき、Port間の接続を確立 する。この関数は主にアプリケーションプログラムやツールから呼び出 すことを前提としている。
connector_profile | ConnectorProfile |
RTC::PortBaseを再実装しています。
const std::vector<OutPortConnector*>& RTC::OutPortBase::connectors | ( | ) |
Connector を取得
現在所有しているコネクタを取得する。
|
protected |
|
protected |
|
protected |
InPort consumer の生成
|
protected |
OutPort provider の生成
|
virtual |
OutPortConnector* RTC::OutPortBase::getConnectorById | ( | const char * | id | ) |
ConnectorProfileをIDで取得
現在所有しているコネクタをIDで取得する。
id | Connector ID |
OutPortConnector* RTC::OutPortBase::getConnectorByName | ( | const char * | name | ) |
ConnectorProfileを名前で取得
現在所有しているコネクタを名前で取得する。
name | Connector name |
coil::vstring RTC::OutPortBase::getConnectorIds | ( | ) |
ConnectorId を取得
現在所有しているコネクタのIDを取得する。
coil::vstring RTC::OutPortBase::getConnectorNames | ( | ) |
Connectorの名前を取得
現在所有しているコネクタの名前を取得する。
bool RTC::OutPortBase::getConnectorProfileById | ( | const char * | id, |
ConnectorInfo & | prof | ||
) |
ConnectorProfileをIDで取得
現在所有しているコネクタをIDで取得する。
id | Connector ID |
prof | ConnectorProfile |
bool RTC::OutPortBase::getConnectorProfileByName | ( | const char * | name, |
ConnectorInfo & | prof | ||
) |
ConnectorProfileを名前で取得
現在所有しているコネクタを名前で取得する。
name | Connector name |
prof | ConnectorProfile |
ConnectorInfoList RTC::OutPortBase::getConnectorProfiles | ( | ) |
ConnectorProfile を取得
現在所有しているコネクタのProfileを取得する。
|
virtual |
|
protected |
ローカルのピアInPortを取得
void RTC::OutPortBase::init | ( | coil::Properties & | prop | ) |
プロパティの初期化
OutPortのプロパティを初期化する
prop | 設定するプロパティ |
|
protected |
InPort consumer の初期化
|
protected |
OutPort provider の初期化
bool RTC::OutPortBase::isLittleEndian | ( | ) |
endian 設定を返す
endian 設定のbool値を返す。
|
protectedvirtual |
[CORBA interface] Port の接続通知を行う
このオペレーションは、Port間の接続が行われる際に、Port間で内部的 に呼ばれるオペレーションであって、通常アプリケーションプログラム や、Port以外のRTC関連オブジェクト等から呼び出されることは想定さ れていない。
notify_connect() 自体はテンプレートメソッドパターンとして、サブ クラスで実装されることが前提の publishInterfaces(), subscribeInterfaces() の2つの関数を内部で呼び出す。処理の手順は 以下の通りである。
notify_connect() は ConnectorProfile::ports に格納されている Port の順序に従って、カスケード状に呼び出しを行うことにより、イ ンターフェース情報の公開と取得を関連すすべてのポートに対して行う。 このカスケード呼び出しは途中で中断されることはなく、必ず ConnectorProfile::ports に格納されている全ポートに対して行われる。
connector_profile | ConnectorProfile |
RTC::PortBaseを再実装しています。
coil::Properties& RTC::OutPortBase::properties | ( | ) |
プロパティを取得する
OutPortのプロパティを取得する。
|
protectedvirtual |
Interface 情報を公開する
このオペレーションは、notify_connect() 処理シーケンスの始めにコール される純粋仮想関数である。 notify_connect() では、
の順に protected 関数がコールされ接続処理が行われる。
このオペレーションは、新規の connector_id に対しては接続の生成、 既存の connector_id に対しては更新が適切に行われる必要がある。
connector_profile | 接続に関するプロファイル情報 |
RTC::PortBaseを実装しています。
void RTC::OutPortBase::removeConnectorDataListener | ( | ConnectorDataListenerType | listener_type, |
ConnectorDataListener * | listener | ||
) |
void RTC::OutPortBase::removeConnectorListener | ( | ConnectorListenerType | callback_type, |
ConnectorListener * | listener | ||
) |
|
protectedvirtual |
Interface に接続する
このオペレーションは、notify_connect() 処理シーケンスの中間にコール される純粋仮想関数である。 notify_connect() では、
の順に protected 関数がコールされ接続処理が行われる。
connector_profile | 接続に関するプロファイル情報 |
RTC::PortBaseを実装しています。
|
protectedvirtual |
Interface の接続を解除する
このオペレーションは、notify_disconnect() 処理シーケンスの終わりにコール される純粋仮想関数である。 notify_disconnect() では、
connector_profile | 接続に関するプロファイル情報 |
RTC::PortBaseを実装しています。
|
pure virtual |
データ書き込み
ポートへデータを書き込む。 バインドされた変数に設定された値をポートに書き込む。
RTC::OutPort< DataType >で実装されています。
DATAPORTSTATUS_ENUM typedef std::vector<OutPortConnector*> RTC::OutPortBase::ConnectorList |
|
protected |
接続リスト
|
protected |
利用可能consumer
|
protected |
|
protected |
接続エンディアン
|
protected |
利用可能provider