整備 #2323
ExecutionContextBaseの見直し
100%
説明
ExecutionContextBaseとこれを継承しているPeriodicExecutionContextなどの見直しを行う。
- ECをGlobalFactoryで生成するように変更する。(C++, r2268)
- ExecutionContextBaseはExecutionContextProfileをメンバとして持ち、すべての関数をdelegateする。
- ECのプロファイルを管理するRTC_impl::ExecutionContextProfileクラス(≠RTC::ExecutionContextProfile)の導入 (C++, r2268)
- 実装クラス内でRTC_impl::ExecutionContextProfileを利用するように変更する。 (C++, r2268)
- ExecutionContextBaseの親クラス ExtTrigEC, RefCountServantBaseを実装クラス(PeriodicExecutionContext)へ移動。 (C++, r2268)
- RTCのStateMachine管理クラスを導入し、ExecutionContextBaseにメンバとして持たせる。
- 各実装クラスで上記のSM管理クラスを利用するように変更。
関連するチケット
関係しているリビジョン
[incompatible] ExecutionContextBase's super classes have been moved to PeriodicExecutionContext class. refs #2323
[incomaptible API] Now ExecutionContextProfile management has been moved to ExecutionContextBase. getObjRef() is also moved to ExecutionContextBase.
[incompatible behavior] Now onExecute and onStateUpdate execution behavior has been changed when two or more RTCs attached to the EC. refs #2320
Old: A::onExecute, A::onStateUpdate, B::onExecute, B::onStateUpdate
New: A::onExecute, B::onExecute, A::onStateUpdate, B::onStateUpdate
- DEEFAULT_PERIOD variable has been added.
- Log messages have been corrected. refs #2323
履歴
#3 n-ando が約12年前に更新
ExecutionContextBaseの実装について¶
ExecutionContextBase はテンプレートメソッドパターンで実装する。
- あるpublic関数 XXX に対して、実際に操作を行う関数 XXX を内部で呼び出す
- xxx() を呼び出す前に onXxxing()関数を呼び出す
- xxx() を呼び出したあとに onXxxed() 関数を呼び出す。
- activate/deactivate/resetComponent() 関数については、状態遷移待ちを行いその際に onWaitingXxxed()関数を呼び出す。
ExecutionContextBaseでのECオプションの扱いについて¶
ExecutionContextBase::init() 関数でオプションを取得するようにする。
取得するオプションは以下のとおり。
- rate: 実行レート
- sync_transition: 同期遷移
- sync_activation: 同期アクティブ化
- sync_deactivation: 同期非アクティブ化
- sync_reset: 同期リセット
- transition_timeout: 同期遷移時のタイムアウト
- activation_timeout: 同期アクティブ化時のタイムアウト
- deactivation_timeout: 同期非アクティブ化時のタイムアウト
- reset_timeout: 同期リセット時のタイムアウト
EC実装について¶
従来通り PeriodicExecutionContext, ExtTrigExecutionContext, OpenHRPExecutionContext を ExecutionContextBase を使用して実装すること。
[incompatible] ExecutionContextBase's super classes have been moved to PeriodicExecutionContext class. Delegation to ExecutionContextProfile has been added. refs #2323
[incompatible behavior] Now onExecute and onStateUpdate execution behavior has been changed when two or more RTCs attached to the EC.
Old: A::onExecute, A::onStateUpdate, B::onExecute, B::onStateUpdate
New: A::onExecute, B::onExecute, A::onStateUpdate, B::onStateUpdate