OpenRTM-aist-Python 2.0.0
公開メンバ関数 | 全メンバ一覧
OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerBase クラス

SdoServiceConsumerFactory& factory(SdoServiceConsumerFactory.instance()); [詳解]

OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerBase の継承関係図
OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerFactory

公開メンバ関数

def init (self, rtobj, profile)
 
def reinit (self, profile)
 
def getProfile (self)
 
def finalize (self)
 

詳解

SdoServiceConsumerFactory& factory(SdoServiceConsumerFactory.instance());

factory.addFactory(toRepositoryId<IDL Type>(), Creator< SdoServiceConsumerBase, your_sdo_service_consumer_subclass>);

 

メソッド詳解

◆ finalize()

def OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerBase.finalize (   self)

終了処理

SDOサービスがでタッチされる際に呼び出される終了処理用関数。サー ビスのでタッチに際して、当該オブジェクトが保持するリソースを解放 するなどの処理を行う。

virtual void finalize() = 0;

◆ getProfile()

def OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerBase.getProfile (   self)

ServiceProfile を返す

init()/reinit()で与えられた ServiceProfile は通常オブジェクト内 で保持される。SDO Service 管理フレームワークは管理上このオブジェ クトに対応する ServiceProfile を必要とするので、この関数では保持 されている ServiceProfile を返す。

戻り値
このオブジェクトが保持している ServiceProfile

virtual const SDOPackage::ServiceProfile& getProfile() const = 0;

◆ init()

def OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerBase.init (   self,
  rtobj,
  profile 
)

コンシューマクラスの初期化関数

初期化関数。与えられた RTObject および ServiceProfile から、当該 オブジェクトを初期化します。このサービスが ''sdo.service.provider.enabled_services'' で有効化されていれば、 この関数は対応するRTCがインスタンス化された直後に呼び出されます。

ServiceProfile には以下の情報が入った状態で呼び出されます。

  • ServiceProfile.id: 当該サービスのIFR型
  • ServiceProfile.interface_type: 当該サービスのIFR型
  • ServiceProfile.service: 当該サービスのオブジェクト参照
  • ServiceProfile.properties: rtc.conf や <component>.conf 等で与 えられたSDOサービス固有のオプションが渡される。 confファイル内で は、''<pragma>.<module_name>.<interface_name>'' というプリフィックスをつけたオプションとして与 えることができ、properties 内には、このプリ フィックスを除いたオプションがkey:value形式で 含まれている。

関数内では、主に properties から設定内容を読み込みサービス固有の 設定等を行います。与えられた ServiceProfileの内容が不正、あるい はその他の理由で当該サービスをインスタンス化しない場合は false を返します。その場合、finalize() が呼び出されその後オブジェクト は削除されます。それ以外の場合は true を返すと、サービスオブジェ クトは RTC 内に保持されます。

引数
rtobjこのオブジェクトがインスタンス化された RTC
profile外部から与えられた SDO ServiceProfile
戻り値
与えられた SDO Service や ServiceProfile が不正の場合 false

virtual bool init(RTObject_impl& rtobj, const SDOPackage::ServiceProfile& profile) = 0;

◆ reinit()

def OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerBase.reinit (   self,
  profile 
)

コンシューマクラスの再初期化関数

このオブジェクトの再初期化を行う。ServiceProfile には id フィー ルドにセッション固有の UUID がセットされているが、同一の id の場 合、properties に設定された設定情報の変更や、service フィールド のサービスの参照の変更が行われる。その際に呼ばれるのがこの reinit() 関数である。実装では、service フィールドのオブジェクト リファレンスの同一性を確認し、異なっている場合保持しているリファ レンスを更新する必要がある。また properties には新たな設定が与え られている可能性があるので、内容を読み込み設定を更新する。

引数
profile新たに与えられた SDO ServiceProfile
戻り値
不正な ServiceProfile が与えられた場合は false

virtual bool reinit(const SDOPackage::ServiceProfile& profile) = 0;


このクラス詳解は次のファイルから抽出されました: