OpenRTM-aist-Python 2.0.0
|
SdoServiceConsumerFactory& factory(SdoServiceConsumerFactory.instance()); [詳解]
公開メンバ関数 | |
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>);
def OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerBase.finalize | ( | self | ) |
終了処理
SDOサービスがでタッチされる際に呼び出される終了処理用関数。サー ビスのでタッチに際して、当該オブジェクトが保持するリソースを解放 するなどの処理を行う。
virtual void finalize() = 0;
def OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerBase.getProfile | ( | self | ) |
ServiceProfile を返す
init()/reinit()で与えられた ServiceProfile は通常オブジェクト内 で保持される。SDO Service 管理フレームワークは管理上このオブジェ クトに対応する ServiceProfile を必要とするので、この関数では保持 されている ServiceProfile を返す。
virtual const SDOPackage::ServiceProfile& getProfile() const = 0;
def OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerBase.init | ( | self, | |
rtobj, | |||
profile | |||
) |
コンシューマクラスの初期化関数
初期化関数。与えられた RTObject および ServiceProfile から、当該 オブジェクトを初期化します。このサービスが ''sdo.service.provider.enabled_services'' で有効化されていれば、 この関数は対応するRTCがインスタンス化された直後に呼び出されます。
ServiceProfile には以下の情報が入った状態で呼び出されます。
関数内では、主に properties から設定内容を読み込みサービス固有の 設定等を行います。与えられた ServiceProfileの内容が不正、あるい はその他の理由で当該サービスをインスタンス化しない場合は false を返します。その場合、finalize() が呼び出されその後オブジェクト は削除されます。それ以外の場合は true を返すと、サービスオブジェ クトは RTC 内に保持されます。
virtual bool init(RTObject_impl& rtobj, const SDOPackage::ServiceProfile& profile) = 0;
def OpenRTM_aist.SdoServiceConsumerBase.SdoServiceConsumerBase.reinit | ( | self, | |
profile | |||
) |
コンシューマクラスの再初期化関数
このオブジェクトの再初期化を行う。ServiceProfile には id フィー ルドにセッション固有の UUID がセットされているが、同一の id の場 合、properties に設定された設定情報の変更や、service フィールド のサービスの参照の変更が行われる。その際に呼ばれるのがこの reinit() 関数である。実装では、service フィールドのオブジェクト リファレンスの同一性を確認し、異なっている場合保持しているリファ レンスを更新する必要がある。また properties には新たな設定が与え られている可能性があるので、内容を読み込み設定を更新する。
profile | 新たに与えられた SDO ServiceProfile |
virtual bool reinit(const SDOPackage::ServiceProfile& profile) = 0;