Public メソッド | |
def | __init__ |
コンストラクタ | |
def | get_port_profile |
[CORBA interface] PortProfileを取得する | |
def | get_connector_profiles |
[CORBA interface] ConnectorProfileListを取得する | |
def | get_connector_profile |
[CORBA interface] ConnectorProfile を取得する | |
def | connect |
[CORBA interface] Port の接続を行う | |
def | notify_connect |
[CORBA interface] Port の接続通知を行う | |
def | disconnect |
[CORBA interface] Port の接続を解除する | |
def | notify_disconnect |
[CORBA interface] Port の接続解除通知を行う | |
def | disconnect_all |
[CORBA interface] Port の全接続を解除する | |
def | setName |
Port の名前を設定する | |
def | getProfile |
PortProfileを取得する | |
def | setPortRef |
Port のオブジェクト参照を設定する | |
def | getPortRef |
Port のオブジェクト参照を取得する | |
def | setOwner |
Port の owner の RTObject を指定する | |
def | publishInterfaces |
Interface 情報を公開する(サブクラス実装用) | |
def | connectNext |
次の Port に対して notify_connect() をコールする | |
def | disconnectNext |
次の Port に対して notify_disconnect() をコールする | |
def | subscribeInterfaces |
Interface 情報を取得する(サブクラス実装用) | |
def | unsubscribeInterfaces |
Interface の接続を解除する(サブクラス実装用) | |
def | isEmptyId |
ConnectorProfile の connector_id フィールドが空かどうか判定 | |
def | getUUID |
UUIDを生成する | |
def | setUUID |
UUIDを生成し ConnectorProfile にセットする | |
def | isExistingConnId |
id が既存の ConnectorProfile のものかどうか判定する | |
def | findConnProfile |
id を持つ ConnectorProfile を探す | |
def | findConnProfileIndex |
id を持つ ConnectorProfile を探す | |
def | updateConnectorProfile |
ConnectorProfile の追加もしくは更新 | |
def | eraseConnectorProfile |
ConnectorProfile を削除する | |
def | appendInterface |
PortInterfaceProfile に インターフェースを登録する | |
def | deleteInterface |
PortInterfaceProfile からインターフェース登録を削除する | |
def | addProperty |
PortProfile の properties に NameValue 値を追加する | |
データ構造 | |
class | connect_func |
Port の接続を行う Functor [詳細] | |
class | disconnect_all_func |
Port の全接続解除を行う Functor [詳細] | |
class | disconnect_func |
Port の接続解除を行う Functor [詳細] | |
class | find_conn_id |
id を持つ ConnectorProfile を探す Functor [詳細] | |
class | find_interface |
name と polarity から interface を探す Functor [詳細] | |
class | find_port_ref |
コンストラクタ引数 port_ref と同じオブジェクト参照を探す Functor [詳細] | |
class | if_name |
instance_name を持つ PortInterfaceProfile を探す Functor [詳細] |
RTC::Port の基底となるクラス。 RTC::Port はほぼ UML Port の概念を継承しており、ほぼ同等のものとみなす ことができる。RT コンポーネントのコンセプトにおいては、 Port はコンポーネントに付属し、コンポーネントが他のコンポーネントと相互作用 を行う接点であり、通常幾つかのインターフェースと関連付けられる。 コンポーネントは Port を通して外部に対しインターフェースを提供または要求 することができ、Portはその接続を管理する役割を担う。
Port の具象クラスは、通常 RT コンポーネントインスタンス生成時に同時に 生成され、提供・要求インターフェースを登録した後、RT コンポーネントに 登録され、外部からアクセス可能な Port として機能することを想定している。
RTC::Port は CORBA インターフェースとして以下のオペレーションを提供する。
このクラスでは、これらのオペレーションの実装を提供する。
これらのオペレーションのうち、get_port_profile(), get_connector_profiles(), get_connector_profile(), connect(), disconnect(), disconnect_all() は、 サブクラスにおいて特に振る舞いを変更する必要がないため、オーバーライド することは推奨されない。
notify_connect(), notify_disconnect() については、サブクラスが提供・要求 するインターフェースの種類に応じて、振る舞いを変更する必要が生ずる かもしれないが、これらを直接オーバーライドすることは推奨されず、 後述の notify_connect(), notify_disconnect() の項においても述べられる通り これらの関数に関連した 関数をオーバーライドすることにより振る舞いを変更する ことが推奨される。
PortBase.py の 122 行で定義されています。
def __init__ | ( | self, | ||
name = None | ||||
) |
コンストラクタ
PortBase のコンストラクタは Port 名 name を引数に取り初期化を行う と同時に、自分自身を CORBA Object として活性化し、自身の PortProfile の port_ref に自身のオブジェクトリファレンスを格納する。
self | ||
name | Port の名前(デフォルト値:None) |
PortBase.py の 151 行で定義されています。
def get_port_profile | ( | self | ) |
[CORBA interface] PortProfileを取得する
Portが保持するPortProfileを返す。 PortProfile 構造体は以下のメンバーを持つ。
self |
PortBase.py の 207 行で定義されています。
def get_connector_profiles | ( | self | ) |
[CORBA interface] ConnectorProfileListを取得する
Portが保持する ConnectorProfile の sequence を返す。 ConnectorProfile は Port 間の接続プロファイル情報を保持する構造体であり、 接続時にPort間で情報交換を行い、関連するすべての Port で同一の値が 保持される。 ConnectorProfile は以下のメンバーを保持している。
self |
PortBase.py の 259 行で定義されています。
def get_connector_profile | ( | self, | ||
connector_id | ||||
) |
[CORBA interface] ConnectorProfile を取得する
connector_id で指定された ConnectorProfile を返す。 指定した connector_id を持つ ConnectorProfile を保持していない場合は、 空の ConnectorProfile を返す。
self | ||
connector_id | ConnectorProfile の ID |
PortBase.py の 289 行で定義されています。
def connect | ( | self, | ||
connector_profile | ||||
) |
[CORBA interface] Port の接続を行う
与えられた ConnectoionProfile の情報を基に、Port間の接続を確立する。 アプリケーションプログラム側は、幾つかのコンポーネントが持つ複数の Port を接続したい場合、適切な値をセットした ConnectorProfile を connect() の引数として与えてコールすることにより、関連する Port の 接続を確立する。
connect() に与える ConnectorProfile のメンバーのうち、name, ports, properties メンバーに対してデータをセットしなければならない。
OutPort 側の connect() では以下のシーケンスで処理が行われる。
1. OutPort に関連する connector 情報の生成およびセット
2. InPortに関連する connector 情報の取得
3. PortBase::connect() をコール Portの接続の基本処理が行われる。
4. 上記2.でInPortのリファレンスが取得できなければ、再度InPortに 関連する connector 情報を取得する。
5. ConnectorProfile::properties で与えられた情報から、 OutPort側の初期化処理を行う。
6. 上記の処理のうち一つでもエラーであれば、エラーリターンする。 正常に処理が行われた場合は RTC::RTC_OK でリターンする。
self | ||
connector_profile | ConnectorProfile |
PortBase.py の 385 行で定義されています。
def notify_connect | ( | self, | ||
connector_profile | ||||
) |
[CORBA interface] Port の接続通知を行う
このオペレーションは、Port間の接続が行われる際に、Port間で内部的に 呼ばれるオペレーションである。 ConnectorProfile には接続対象 Port のリスト情報が保持されている。Port は ConnectorProfile を保持するとともに、リスト中の次 Port の notify_connect を呼び出す。そして、ポートをコネクタに追加した後、ConnectorProfile に 呼びだし先の Port を設定し、呼びだし元に返す。このように ConnectorProfile を使用して接続通知が伝達されていく。
self | ||
connector_profile | ConnectorProfile |
PortBase.py の 439 行で定義されています。
def disconnect | ( | self, | ||
connector_id | ||||
) |
[CORBA interface] Port の接続を解除する
このオペレーションは接続確立時に接続に対して与えられる connector_id に 対応するピア Port との接続を解除する。 Port は ConnectorProfile 中のポートリストに含まれる1つのポートの notify_disconnect を呼びだす。接続解除の通知は notify_disconnect によって 実行される。
self | ||
connector_id | ConnectorProfile の ID |
PortBase.py の 501 行で定義されています。
def notify_disconnect | ( | self, | ||
connector_id | ||||
) |
[CORBA interface] Port の接続解除通知を行う
このオペレーションは、Port間の接続解除が行われる際に、Port間で内部的に 呼ばれるオペレーションである。 このオペレーションは、該当する Port と接続されている他の Port に接続解除 を通知する。接続解除対象の Port はIDによって指定される。Port は ConnectorProfile 中のポートリスト内の次 Port の notify_disconnect を呼び 出す。ポートの接続が解除されると ConnectorProfile から該当する Port の 情報が削除される。このように notify_disconnect を使用して接続解除通知が 伝達されていく。
self | ||
connector_id | ConnectorProfile の ID |
PortBase.py の 555 行で定義されています。
def disconnect_all | ( | self | ) |
[CORBA interface] Port の全接続を解除する
このオペレーションはこの Port に関連した全ての接続を解除する。
self |
PortBase.py の 601 行で定義されています。
def setName | ( | self, | ||
name | ||||
) |
Port の名前を設定する
Port の名前を設定する。この名前は Port が保持する PortProfile.name に反映される。
self | ||
name | Port の名前 |
PortBase.py の 634 行で定義されています。
def getProfile | ( | self | ) |
PortProfileを取得する
Portが保持する PortProfile の const 参照を返す。
self |
PortBase.py の 657 行で定義されています。
def setPortRef | ( | self, | ||
port_ref | ||||
) |
Port のオブジェクト参照を設定する
このオペレーションは Port の PortProfile にこの Port 自身の オブジェクト参照を設定する。
self | ||
port_ref | この Port のオブジェクト参照 |
PortBase.py の 683 行で定義されています。
def getPortRef | ( | self | ) |
Port のオブジェクト参照を取得する
このオペレーションは Port の PortProfile が保持している この Port 自身のオブジェクト参照を取得する。
self |
PortBase.py の 710 行で定義されています。
def setOwner | ( | self, | ||
owner | ||||
) |
Port の owner の RTObject を指定する
このオペレーションは Port の PortProfile.owner を設定する。
self | ||
owner | この Port を所有する RTObject の参照 |
PortBase.py の 734 行で定義されています。
def publishInterfaces | ( | self, | ||
connector_profile | ||||
) |
Interface 情報を公開する(サブクラス実装用)
このオペレーションは、notify_connect() 処理シーケンスの始めにコール される関数である。 notify_connect() では、
の順に protected 関数がコールされ接続処理が行われる。
具象 Port ではこのオペレーションをオーバーライドし、引数として 与えられた ConnectorProfile に従い処理を行い、パラメータが不適切 であれば、RteurnCode_t 型のエラーコードを返す。 通常 publishInterafaces() 内においては、この Port に属する インターフェースに関する情報を ConnectorProfile に対して適切に設定し 他の Port に通知しなければならない。
また、この関数がコールされる段階では、他の Port の Interface に関する 情報はすべて含まれていないので、他の Port の Interface を取得する処理 は subscribeInterfaces() 内で行われるべきである。
このオペレーションは、新規の connector_id に対しては接続の生成、 既存の connector_id に対しては更新が適切に行われる必要がある。
※サブクラスでの実装参照用
self | ||
connector_profile | 接続に関するプロファイル情報 |
PortBase.py の 806 行で定義されています。
def connectNext | ( | self, | ||
connector_profile | ||||
) |
次の Port に対して notify_connect() をコールする
ConnectorProfile の port_ref 内に格納されている Port のオブジェクト リファレンスのシーケンスの中から、自身の Port の次の Port に対して notify_connect() をコールする。
self | ||
connector_profile | 接続に関するプロファイル情報 |
PortBase.py の 836 行で定義されています。
def disconnectNext | ( | self, | ||
connector_profile | ||||
) |
次の Port に対して notify_disconnect() をコールする
ConnectorProfile の port_ref 内に格納されている Port のオブジェクト リファレンスのシーケンスの中から、自身の Port の次の Port に対して notify_disconnect() をコールする。
self | ||
connector_profile | 接続に関するプロファイル情報 |
PortBase.py の 876 行で定義されています。
def subscribeInterfaces | ( | self, | ||
connector_profile | ||||
) |
Interface 情報を取得する(サブクラス実装用)
このオペレーションは、notify_connect() 処理シーケンスの中間にコール される関数である。 notify_connect() では、
の順に protected 関数がコールされ接続処理が行われる。
具象 Port ではこのオペレーションをオーバーライドし、引数として 与えられた ConnectorProfile に従い処理を行い、パラメータが不適切 であれば、RteurnCode_t 型のエラーコードを返す。 引数 ConnectorProfile には他の Port の Interface に関する情報が 全て含まれている。 通常 subscribeInterafaces() 内においては、この Port が使用する Interface に関する情報を取得し、要求側のインターフェースに対して 情報を設定しなければならない。
このオペレーションは、新規の connector_id に対しては接続の生成、 既存の connector_id に対しては更新が適切に行われる必要がある。
※サブクラスでの実装参照用
self | ||
connector_profile | 接続に関するプロファイル情報 |
PortBase.py の 957 行で定義されています。
def unsubscribeInterfaces | ( | self, | ||
connector_profile | ||||
) |
Interface の接続を解除する(サブクラス実装用)
このオペレーションは、notify_disconnect() 処理シーケンスの終わりにコール される関数である。 notify_disconnect() では、
self | ||
connector_profile | 接続に関するプロファイル情報 |
PortBase.py の 999 行で定義されています。
def isEmptyId | ( | self, | ||
connector_profile | ||||
) |
ConnectorProfile の connector_id フィールドが空かどうか判定
指定された ConnectorProfile の connector_id が空であるかどうかの判定を 行う。
self | ||
connector_profile | 判定対象コネクタプロファイル |
PortBase.py の 1025 行で定義されています。
def getUUID | ( | self | ) |
def setUUID | ( | self, | ||
connector_profile | ||||
) |
UUIDを生成し ConnectorProfile にセットする
このオペレーションは UUID を生成し、ConnectorProfile にセットする。
self | ||
connector_profile | connector_id をセットする ConnectorProfile |
PortBase.py の 1072 行で定義されています。
def isExistingConnId | ( | self, | ||
id_ | ||||
) |
id が既存の ConnectorProfile のものかどうか判定する
このオペレーションは与えられた ID が既存の ConnectorProfile のリスト中に 存在するかどうか判定する。
self | ||
id_ | 判定する connector_id |
PortBase.py の 1100 行で定義されています。
def findConnProfile | ( | self, | ||
id_ | ||||
) |
id を持つ ConnectorProfile を探す
このオペレーションは与えられた ID を持つ ConnectorProfile を Port が もつ ConnectorProfile のリスト中から探す。 もし、同一の id を持つ ConnectorProfile がなければ、空の ConnectorProfile が返される。
self | ||
id_ | 検索する connector_id |
PortBase.py の 1134 行で定義されています。
def findConnProfileIndex | ( | self, | ||
id_ | ||||
) |
id を持つ ConnectorProfile を探す
このオペレーションは与えられた ID を持つ ConnectorProfile を Port が もつ ConnectorProfile のリスト中から探しインデックスを返す。 もし、同一の id を持つ ConnectorProfile がなければ、-1 を返す。
self | ||
id_ | 検索する connector_id |
PortBase.py の 1171 行で定義されています。
def updateConnectorProfile | ( | self, | ||
connector_profile | ||||
) |
ConnectorProfile の追加もしくは更新
このオペレーションは与えられた与えられた ConnectorProfile を Port に追加もしくは更新保存する。 与えられた ConnectorProfile の connector_id と同じ ID を持つ ConnectorProfile がリストになければ、リストに追加し、 同じ ID が存在すれば ConnectorProfile を上書き保存する。
self | ||
connector_profile | 追加もしくは更新する ConnectorProfile |
PortBase.py の 1203 行で定義されています。
def eraseConnectorProfile | ( | self, | ||
id_ | ||||
) |
ConnectorProfile を削除する
このオペレーションは Port の PortProfile が保持している ConnectorProfileList のうち与えられた id を持つ ConnectorProfile を削除する。
self | ||
id_ | 削除する ConnectorProfile の id |
PortBase.py の 1239 行で定義されています。
def appendInterface | ( | self, | ||
instance_name, | ||||
type_name, | ||||
pol | ||||
) |
PortInterfaceProfile に インターフェースを登録する
このオペレーションは Port が持つ PortProfile の、PortInterfaceProfile にインターフェースの情報を追加する。 この情報は、get_port_profile() 似よって得られる PortProfile のうち PortInterfaceProfile の値を変更するのみであり、実際にインターフェースを 提供したり要求したりする場合には、サブクラスで、 publishInterface() , subscribeInterface() 等の関数を適切にオーバーライドしインターフェースの 提供、要求処理を行わなければならない。
インターフェース(のインスタンス)名は Port 内で一意でなければならない。 同名のインターフェースがすでに登録されている場合、この関数は false を 返す。
self | ||
instance_name | インターフェースのインスタンスの名前 | |
type_name | インターフェースの型の名前 | |
pol | インターフェースの属性 (RTC::PROVIDED もしくは RTC:REQUIRED) |
PortBase.py の 1302 行で定義されています。
def deleteInterface | ( | self, | ||
name, | ||||
pol | ||||
) |
PortInterfaceProfile からインターフェース登録を削除する
このオペレーションは Port が持つ PortProfile の、PortInterfaceProfile からインターフェースの情報を削除する。
self | ||
name | インターフェースのインスタンスの名前 | |
pol | インターフェースの属性 (RTC::PROVIDED もしくは RTC:REQUIRED) |
PortBase.py の 1344 行で定義されています。
def addProperty | ( | self, | ||
key, | ||||
value | ||||
) |
PortProfile の properties に NameValue 値を追加する
PortProfile の properties に NameValue 値を追加する。 追加するデータの型をValueTypeで指定する。
self | ||
key | properties の name | |
value | properties の value |
PortBase.py の 1375 行で定義されています。