|
OpenRTM-aist 2.1.0
|
SdoServiceConsumer 基底クラス [詳解]
#include <SdoServiceConsumerBase.h>
公開メンバ関数 | |
| virtual | ~SdoServiceConsumerBase ()=default |
| 仮想デストラクタ | |
| virtual bool | init (RTObject_impl &rtobj, const SDOPackage::ServiceProfile &profile)=0 |
| コンシューマクラスの初期化関数 | |
| virtual bool | reinit (const SDOPackage::ServiceProfile &profile)=0 |
| コンシューマクラスの再初期化関数 | |
| virtual const SDOPackage::ServiceProfile & | getProfile () const =0 |
| ServiceProfile を返す | |
| virtual void | finalize ()=0 |
| 終了処理 | |
SdoServiceConsumer 基底クラス
SDOで定義されているSDOサービスのコンシューマを実装するための基底ク ラス。SDOサービスには、外部から提供サービスをRTC(SDO)側で利用する SDOサービスコンシューマと、RTC(SDO)自身がSDOサービスを提供するSDO サービスプロバイダがある。すべてのSDOサービスコンシューマはこの基 底クラスを継承して実装される。
このオブジェクトのライフサイクルは以下の通り。
[RTC] [SDO consumer] [Configuration] [SDO service] [Other] | : | | | | : get_configuration() | | |<---------:-------------------------------|------------| | : | | | | : | add_service_profile(prof) | | : create() |<----------------|------------| | |<------------| | | | | call_sdo_service() | | | |-------------|---------------->| | | | call_sdo_service2() | | | |-------------|---------------->| | | | | : | | | | | | | | | | remove_service_profile(id) | | | delete() |<----------------|------------| | x<------------| | | | | x x
このクラスの実装に当たっては、少なくとも以下の純粋仮想関数を実装す る必要がある。
SdoServiceConsumer は通常共有オブジェクトとしてコンパイル・リンク される。共有オブジェクトのエントリポイントは通常コンパイルされたファ イル名の basename + "Init" にしておく。以下に、クラス名、ファイル 名、エントリポイント関数名の推奨例を示す。
エントリポイント関数は通常以下のように、SdoServiceConsumerFactory に当該コンシューマのファクトリ (と解体ファンクタ) を登録する以下の ような関数になる。
extern "C"
{
void MySdoServiceConsumerInit()
{
RTC::SdoServiceConsumerFactory& factory
= RTC::SdoServiceConsumerFactory::instance();
factory.addFactory(CORBA_Util::toRepositoryId<OpenRTM::MySdoService>(),
::coil::Creator< ::RTC::SdoServiceConsumerBase,
::RTC::MySdoServiceConsumer>,
::coil::Destructor< ::RTC::SdoServiceConsumerBase,
::RTC::MySdoServiceConsumer>);
}
};
|
virtualdefault |
仮想デストラクタ
|
pure virtual |
終了処理
|
pure virtual |
ServiceProfile を返す
|
pure virtual |
コンシューマクラスの初期化関数
|
pure virtual |
コンシューマクラスの再初期化関数