OpenRTM  1.0.0
クラス | 公開メンバ関数 | 限定公開型 | 限定公開変数類 | 全メンバ一覧
RTC::PeriodicExecutionContext クラス

PeriodicExecutionContext クラス [詳解]

#include <PeriodicExecutionContext.h>

RTC::PeriodicExecutionContext の継承関係図
RTC::ExecutionContextBase coil::Task RTC::ExtTrigExecutionContext RTC::OpenHRPExecutionContext

クラス

struct  Comp
 コンポーネント管理用構造体 [詳解]
 
class  DFP
 DFP クラス [詳解]
 
class  DFPBase
 DFPBase クラス [詳解]
 
struct  find_comp
 コンポーネント検索用ファンクタ [詳解]
 
class  find_participant
 
struct  invoke_on_rate_changed
 on_rate_changed 起動用ファンクタ [詳解]
 
struct  invoke_on_shutdown
 on_shutdown 起動用ファンクタ [詳解]
 
struct  invoke_on_startup
 on_startup 起動用ファンクタ [詳解]
 
struct  invoke_worker
 ワーカー実行用ファンクタ [詳解]
 
struct  Worker
 worker 用状態変数クラス [詳解]
 

公開メンバ関数

 PeriodicExecutionContext ()
 デフォルトコンストラクタ [詳解]
 
 PeriodicExecutionContext (OpenRTM::DataFlowComponent_ptr owner, double rate=1000.0)
 コンストラクタ [詳解]
 
virtual ~PeriodicExecutionContext (void)
 デストラクタ [詳解]
 
virtual ExecutionContextService_ptr getObjRef (void)
 CORBA オブジェクト参照の取得 [詳解]
 
virtual int open (void *args)
 ExecutionContext用アクティビティスレッドを生成する [詳解]
 
virtual int svc (void)
 ExecutionContext 用のスレッド実行関数 [詳解]
 
virtual int close (unsigned long flags)
 ExecutionContext 用のスレッド実行関数 [詳解]
 
virtual CORBA::Boolean is_running (void) throw (CORBA::SystemException)
 ExecutionContext 実行状態確認関数 [詳解]
 
virtual ReturnCode_t start (void) throw (CORBA::SystemException)
 ExecutionContext の実行を開始 [詳解]
 
virtual ReturnCode_t stop (void) throw (CORBA::SystemException)
 ExecutionContext の実行を停止 [詳解]
 
virtual CORBA::Double get_rate (void) throw (CORBA::SystemException)
 ExecutionContext の実行周期(Hz)を取得する [詳解]
 
virtual ReturnCode_t set_rate (CORBA::Double rate) throw (CORBA::SystemException)
 ExecutionContext の実行周期(Hz)を設定する [詳解]
 
virtual ReturnCode_t activate_component (LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 RTコンポーネントをアクティブ化する [詳解]
 
virtual ReturnCode_t deactivate_component (LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 RTコンポーネントを非アクティブ化する [詳解]
 
virtual ReturnCode_t reset_component (LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 RTコンポーネントをリセットする [詳解]
 
virtual LifeCycleState get_component_state (LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 RTコンポーネントの状態を取得する [詳解]
 
virtual ExecutionKind get_kind (void) throw (CORBA::SystemException)
 ExecutionKind を取得する [詳解]
 
virtual ReturnCode_t add_component (LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 RTコンポーネントを追加する [詳解]
 
virtual RTC::ReturnCode_t bindComponent (RTObject_impl *rtc)
 コンポーネントをバインドする。 [詳解]
 
virtual ReturnCode_t remove_component (LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 RTコンポーネントを参加者リストから削除する [詳解]
 
virtual ExecutionContextProfile * get_profile (void) throw (CORBA::SystemException)
 ExecutionContextProfile を取得する [詳解]
 
- 基底クラス RTC::ExecutionContextBase に属する継承公開メンバ関数
virtual ~ExecutionContextBase (void)
 仮想デストラクタ [詳解]
 
virtual void tick () throw (CORBA::SystemException)
 ExecutionContextの処理を進める [詳解]
 
- 基底クラス coil::Task に属する継承公開メンバ関数
 Task ()
 コンストラクタ [詳解]
 
virtual ~Task ()
 デストラクタ [詳解]
 
virtual void activate ()
 スレッドを生成する [詳解]
 
virtual int wait (void)
 スレッド終了を待つ [詳解]
 
virtual int suspend (void)
 タスク実行を中断する [詳解]
 
virtual int resume (void)
 中断されているタスクを再開する [詳解]
 
virtual void reset ()
 タスク数リセット [詳解]
 
virtual void finalize ()
 タスク実行を終了する [詳解]
 

限定公開型

typedef LifeCycleState ExecContextState
 
typedef RTC_Utils::StateHolder< ExecContextStateECStates
 
typedef std::vector< Comp >::iterator CompItr
 

限定公開変数類

std::vector< Compm_comps
 コンポーネントの参加者リスト [詳解]
 
Logger rtclog
 ロガーストリーム [詳解]
 
bool m_running
 ExecutionContext の実行状態 true: running, false: stopped [詳解]
 
bool m_svc
 ExecutionContext のスレッド実行フラグ [詳解]
 
Worker m_worker
 svn用の状態変数 [詳解]
 
ExecutionContextProfile m_profile
 ExecutionContextProfile [詳解]
 
coil::Mutex m_profileMutex
 
coil::TimeValue m_period
 ExecutionContext の実行周期 [詳解]
 
ExecutionContextService_var m_ref
 ExecutionContextService オブジェクトへの参照 [詳解]
 
bool m_nowait
 ExecutionContext 即時実行(wait無し実行)フラグ [詳解]
 

その他の継承メンバ

- 基底クラス coil::Task に属する継承静的公開メンバ関数
static void * svc_run (void *args=0)
 スレッド実行を開始する [詳解]
 

詳解

PeriodicExecutionContext クラス

Periodic Sampled Data Processing(周期実行用)ExecutionContextクラス。

から
0.4.0

型定義メンバ詳解

◆ CompItr

typedef std::vector<Comp>::iterator RTC::PeriodicExecutionContext::CompItr
protected

◆ ECStates

◆ ExecContextState

typedef LifeCycleState RTC::PeriodicExecutionContext::ExecContextState
protected

構築子と解体子

◆ PeriodicExecutionContext() [1/2]

RTC::PeriodicExecutionContext::PeriodicExecutionContext ( )

デフォルトコンストラクタ

デフォルトコンストラクタ プロファイルに以下の項目を設定する。

  • kind : PERIODIC
  • rate : 0.0

◆ PeriodicExecutionContext() [2/2]

RTC::PeriodicExecutionContext::PeriodicExecutionContext ( OpenRTM::DataFlowComponent_ptr  owner,
double  rate = 1000.0 
)

コンストラクタ

コンストラクタ 設定された値をプロファイルに設定する。

引数
owner当該 Executioncontext の owner
rate動作周期(Hz)(デフォルト値:1000)

◆ ~PeriodicExecutionContext()

virtual RTC::PeriodicExecutionContext::~PeriodicExecutionContext ( void  )
virtual

デストラクタ

デストラクタ

関数詳解

◆ activate_component()

virtual ReturnCode_t RTC::PeriodicExecutionContext::activate_component ( LightweightRTObject_ptr  comp)
throw (CORBA::SystemException
)
virtual

RTコンポーネントをアクティブ化する

Inactive 状態にあるRTコンポーネントをActive に遷移させ、アクティ ブ化する。この操作が呼ばれた結果、on_activate が呼び出される。指 定したRTコンポーネントが参加者リストに含まれない場合は、 BAD_PARAMETER が返される。指定したRTコンポーネントの状態が Inactive 以外の場合は、PRECONDITION_NOT_MET が返される。

引数
compアクティブ化対象RTコンポーネント
戻り値
ReturnCode_t 型のリターンコード

参照元 getObjRef().

◆ add_component()

virtual ReturnCode_t RTC::PeriodicExecutionContext::add_component ( LightweightRTObject_ptr  comp)
throw (CORBA::SystemException
)
virtual

RTコンポーネントを追加する

指定したRTコンポーネントを参加者リストに追加する。追加されたRTコ ンポーネントは attach_context が呼ばれ、Inactive 状態に遷移する。 指定されたRTコンポーネントがnullの場合は、BAD_PARAMETER が返され る。指定されたRTコンポーネントが DataFlowComponent 以外の場合は、 BAD_PARAMETER が返される。

引数
comp追加対象RTコンポーネント
戻り値
ReturnCode_t 型のリターンコード

参照元 getObjRef().

◆ bindComponent()

virtual RTC::ReturnCode_t RTC::PeriodicExecutionContext::bindComponent ( RTObject_impl rtc)
virtual

コンポーネントをバインドする。

コンポーネントをバインドする。

引数
rtcRTコンポーネント
戻り値
ReturnCode_t 型のリターンコード

RTC::ExecutionContextBaseを実装しています。

参照元 getObjRef().

◆ close()

virtual int RTC::PeriodicExecutionContext::close ( unsigned long  flags)
virtual

ExecutionContext 用のスレッド実行関数

ExecutionContext 用のスレッド終了時に呼ばれる。コンポーネントオ ブジェクトの非アクティブ化、マネージャへの通知を行う。これは coil::Task サービスクラスメソッドのオーバーライド。

引数
flags終了処理フラグ
戻り値
終了処理結果

coil::Taskを再実装しています。

参照元 getObjRef().

◆ deactivate_component()

virtual ReturnCode_t RTC::PeriodicExecutionContext::deactivate_component ( LightweightRTObject_ptr  comp)
throw (CORBA::SystemException
)
virtual

RTコンポーネントを非アクティブ化する

Inactive 状態にあるRTコンポーネントを非アクティブ化し、Inactive に遷移させる。この操作が呼ばれた結果、on_deactivate が呼び出され る。指定したRTコンポーネントが参加者リストに含まれない場合は、 BAD_PARAMETER が返される。指定したRTコンポーネントの状態が Active 以外の場合は、PRECONDITION_NOT_MET が返される。

引数
comp非アクティブ化対象RTコンポーネント
戻り値
ReturnCode_t 型のリターンコード

参照元 getObjRef().

◆ get_component_state()

virtual LifeCycleState RTC::PeriodicExecutionContext::get_component_state ( LightweightRTObject_ptr  comp)
throw (CORBA::SystemException
)
virtual

RTコンポーネントの状態を取得する

指定したRTコンポーネントの状態(LifeCycleState)を取得する。指定し たRTコンポーネントが参加者リストに含まれない場合は、 UNKNOWN_STATE が返される。

引数
comp状態取得対象RTコンポーネント
戻り値
現在の状態(LifeCycleState)

参照元 getObjRef().

◆ get_kind()

virtual ExecutionKind RTC::PeriodicExecutionContext::get_kind ( void  )
throw (CORBA::SystemException
)
virtual

ExecutionKind を取得する

本 ExecutionContext の ExecutionKind を取得する

戻り値
ExecutionKind

参照元 getObjRef().

◆ get_profile()

virtual ExecutionContextProfile* RTC::PeriodicExecutionContext::get_profile ( void  )
throw (CORBA::SystemException
)
virtual

ExecutionContextProfile を取得する

本 ExecutionContext のプロファイルを取得する。

戻り値
ExecutionContextProfile

参照元 getObjRef().

◆ get_rate()

virtual CORBA::Double RTC::PeriodicExecutionContext::get_rate ( void  )
throw (CORBA::SystemException
)
virtual

ExecutionContext の実行周期(Hz)を取得する

Active 状態にてRTコンポーネントが実行される周期(単位:Hz)を取得す る。

戻り値
処理周期(単位:Hz)

参照元 getObjRef().

◆ getObjRef()

virtual ExecutionContextService_ptr RTC::PeriodicExecutionContext::getObjRef ( void  )
inlinevirtual

CORBA オブジェクト参照の取得

本オブジェクトの ExecutioncontextService としての CORBA オブジェ クト参照を取得する。

戻り値
CORBA オブジェクト参照

RTC::ExecutionContextBaseを実装しています。

参照先 activate_component(), add_component(), bindComponent(), close(), deactivate_component(), get_component_state(), get_kind(), get_profile(), get_rate(), is_running(), m_ref, open(), remove_component(), reset_component(), set_rate(), start(), stop(), svc() (計18項目).

◆ is_running()

virtual CORBA::Boolean RTC::PeriodicExecutionContext::is_running ( void  )
throw (CORBA::SystemException
)
virtual

ExecutionContext 実行状態確認関数

この操作は ExecutionContext が Runnning 状態の場合に true を返す。 Executioncontext が Running の間、当該 Executioncontext に参加し ている全てのアクティブRTコンポーネントが、ExecutionContext の実 行種類に応じて実行される。

戻り値
状態確認関数(動作中:true、停止中:false)

参照元 getObjRef().

◆ open()

virtual int RTC::PeriodicExecutionContext::open ( void *  args)
virtual

ExecutionContext用アクティビティスレッドを生成する

Executioncontext 用の内部アクティビティスレッドを生成し起動する。 これは coil::Task サービスクラスメソッドのオーバーライド。

引数
args通常は0
戻り値
生成処理実行結果

coil::Taskを再実装しています。

参照元 getObjRef().

◆ remove_component()

virtual ReturnCode_t RTC::PeriodicExecutionContext::remove_component ( LightweightRTObject_ptr  comp)
throw (CORBA::SystemException
)
virtual

RTコンポーネントを参加者リストから削除する

指定したRTコンポーネントを参加者リストから削除する。削除された RTコンポーネントは detach_context が呼ばれる。指定されたRTコンポー ネントが参加者リストに登録されていない場合は、BAD_PARAMETER が返 される。

引数
comp削除対象RTコンポーネント
戻り値
ReturnCode_t 型のリターンコード

参照元 getObjRef().

◆ reset_component()

virtual ReturnCode_t RTC::PeriodicExecutionContext::reset_component ( LightweightRTObject_ptr  comp)
throw (CORBA::SystemException
)
virtual

RTコンポーネントをリセットする

Error 状態のRTコンポーネントの復帰を試みる。この操作が呼ばれた結 果、on_reset が呼び出される。指定したRTコンポーネントが参加者リ ストに含まれない場合は、BAD_PARAMETER が返される。指定したRTコン ポーネントの状態が Error 以外の場合は、PRECONDITION_NOT_MET が返 される。

引数
compリセット対象RTコンポーネント
戻り値
ReturnCode_t 型のリターンコード

参照元 getObjRef().

◆ set_rate()

virtual ReturnCode_t RTC::PeriodicExecutionContext::set_rate ( CORBA::Double  rate)
throw (CORBA::SystemException
)
virtual

ExecutionContext の実行周期(Hz)を設定する

Active 状態にてRTコンポーネントが実行される周期(単位:Hz)を設定す る。実行周期の変更は、DataFlowComponentAction の on_rate_changed によって各RTコンポーネントに伝達される。

引数
rate処理周期(単位:Hz)
戻り値
ReturnCode_t 型のリターンコード

参照元 getObjRef().

◆ start()

virtual ReturnCode_t RTC::PeriodicExecutionContext::start ( void  )
throw (CORBA::SystemException
)
virtual

ExecutionContext の実行を開始

ExecutionContext の実行状態を Runnning とするためのリクエストを 発行する。ExecutionContext の状態が遷移すると ComponentAction::on_startup が呼び出される。参加しているRTコンポー ネントが、初期化されるまで ExecutionContext を開始することはでき ない。ExecutionContext は複数回開始/停止を繰り返すことができる。

戻り値
ReturnCode_t 型のリターンコード

参照元 getObjRef().

◆ stop()

virtual ReturnCode_t RTC::PeriodicExecutionContext::stop ( void  )
throw (CORBA::SystemException
)
virtual

ExecutionContext の実行を停止

ExecutionContext の状態を Stopped とするためのリクエストを発行す る。遷移が発生した場合は、ComponentAction::on_shutdown が呼び出 される。参加しているRTコンポーネントが終了する前に ExecutionContext を停止する必要がある。ExecutionContext は複数回 開始/停止を繰り返すことができる。

戻り値
ReturnCode_t 型のリターンコード

参照元 getObjRef().

◆ svc()

virtual int RTC::PeriodicExecutionContext::svc ( void  )
virtual

ExecutionContext 用のスレッド実行関数

ExecutionContext 用のスレッド実行関数。登録されたコンポーネント の処理を呼び出す。

戻り値
実行結果

coil::Taskを再実装しています。

RTC::ExtTrigExecutionContext, RTC::OpenHRPExecutionContextで再実装されています。

参照元 getObjRef().

メンバ詳解

◆ m_comps

std::vector<Comp> RTC::PeriodicExecutionContext::m_comps
protected

コンポーネントの参加者リスト

◆ m_nowait

bool RTC::PeriodicExecutionContext::m_nowait
protected

ExecutionContext 即時実行(wait無し実行)フラグ

◆ m_period

coil::TimeValue RTC::PeriodicExecutionContext::m_period
protected

ExecutionContext の実行周期

◆ m_profile

ExecutionContextProfile RTC::PeriodicExecutionContext::m_profile
protected

ExecutionContextProfile

◆ m_profileMutex

coil::Mutex RTC::PeriodicExecutionContext::m_profileMutex
protected

◆ m_ref

ExecutionContextService_var RTC::PeriodicExecutionContext::m_ref
protected

ExecutionContextService オブジェクトへの参照

参照元 getObjRef().

◆ m_running

bool RTC::PeriodicExecutionContext::m_running
protected

ExecutionContext の実行状態 true: running, false: stopped

◆ m_svc

bool RTC::PeriodicExecutionContext::m_svc
protected

ExecutionContext のスレッド実行フラグ

◆ m_worker

Worker RTC::PeriodicExecutionContext::m_worker
protected

svn用の状態変数

◆ rtclog

Logger RTC::PeriodicExecutionContext::rtclog
protected

ロガーストリーム