Project

General

Profile

機能 #2266

コンフィギュレーションパラメータ変更時に個別のパラメータごとにコールバックが呼ばれるようにする

Added by n-ando about 12 years ago. Updated almost 12 years ago.

Status:
終了
Priority:
通常
Assignee:
Target version:
-
Start date:
10/10/2011
Due date:
% Done:

100%

Estimated time:

Description

現在の実装では、onUpdateParamコールバックが呼ばれないが、これを個々のパラメータが変更された際に呼ばれるようにする。
C++ではr2231/2232にてこの変更を行った。
C++における実装方法は以下のとおり。

  • unbindParameter() の実装 (コールバックとは直接関係ない)
  • changedParameters() の追加
  • RTObject::getConfigService() の追加
  • ConfigBaseにConfigAdminのポインタとメンバー関数ポインタを渡すsetCallback関数を実装
  • ConfigBaseクラスメンバ変数としてConfigAdminのポインタとメンバー関数ポインタを追加
  • bindParameter関数内でsetCallbackにてConfigAdminとメンバ関数onUpdateParamを渡す
  • 実際にコールバックを呼ぶConfigBase::nofityUpdateを実装
  • Configクラスでは、update()関数内で変数の値の変更があった場合にnotifyUpdateを呼ぶ

なお、ConfigAdmin::update() が呼ばれて初めて変数の値が変更されるため、特に意図的にコールしなければこのコールバックはRTCがactive状態の時にのみコールされる。

Associated revisions

Revision 499 (diff)
Added by kurihara almost 12 years ago

Now onUpdateParam() callback is called when parameter is updated.
ConfigAdmin::changedParameters() has been added.
RTObject::getConfigService() has been added. refs #2266

History

#1 Updated by n-ando about 12 years ago

  • Assignee set to kurihara

#2 Updated by n-ando about 12 years ago

  • Description updated (diff)

#3 Updated by kurihara about 12 years ago

  • Status changed from 新規 to 担当

#4 Updated by kurihara almost 12 years ago

  • Status changed from 担当 to 解決
  • % Done changed from 0 to 100

r499 にて対応。
examples/ConfigSampleにコールバックを使用するサンプルを追加。 r498

#5 Updated by kurihara almost 12 years ago

  • Status changed from 解決 to 終了

Also available in: Atom PDF