jp.go.aist.rtm.RTC.executionContext
Class PeriodicExecutionContext

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by OpenRTM.ExtTrigExecutionContextServicePOA
          extended by jp.go.aist.rtm.RTC.executionContext.ExecutionContextBase
              extended by jp.go.aist.rtm.RTC.executionContext.PeriodicExecutionContext
All Implemented Interfaces:
SDOServiceOperations, java.lang.Runnable, ECNewDeleteFunc, ExtTrigExecutionContextServiceOperations, org.omg.CORBA.portable.InvokeHandler, ExecutionContextOperations, ExecutionContextServiceOperations
Direct Known Subclasses:
ExtTrigExecutionContext, OpenHRPExecutionContext

public class PeriodicExecutionContext
extends ExecutionContextBase
implements java.lang.Runnable

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


Nested Class Summary
protected  class PeriodicExecutionContext.Comp
          ExecutionContextにattachされたコンポーネントのメソッド呼出用クラスです。
protected  class PeriodicExecutionContext.DFP
          DataFlowComponentのAction定義用抽象クラスです。
protected  class PeriodicExecutionContext.DFPBase
          DataFlowComponentのAction定義用抽象クラスです。
protected  class PeriodicExecutionContext.find_comp
          管理対象コンポーネント検索用ヘルパークラスです。
protected  class PeriodicExecutionContext.Worker
           
 
Field Summary
protected  java.util.Vector<PeriodicExecutionContext.Comp> m_comps
          ExecutionContextにatttachされているコンポーネントのリストです。
protected  boolean m_nowait
           
protected  ExecutionContextProfile m_profile
          ExecutionContextProfileです。
protected  ExecutionContextService m_ref
          ExecutionContextServiceとしてのCORBAオブジェクト参照です。
protected  boolean m_running
          ExecutionContextの実行状態です。
protected  java.lang.Thread m_thread
           
protected  long m_usec
          ExecutionContextの動作周期です。
protected  Logbuf rtcout
          Logging用フォーマットオブジェクト
 
Constructor Summary
PeriodicExecutionContext()
           Default Constructor
PeriodicExecutionContext(DataFlowComponent owner)
           Constructor
PeriodicExecutionContext(DataFlowComponent owner, double rate)
           Constructor
 
Method Summary
 ExecutionContextService __this()
           __this()
 ReturnCode_t activate_component(LightweightRTObject comp)
          コンポーネントをアクティブ化します。
 ReturnCode_t add_component(LightweightRTObject comp)
           Add an RT-component
 ReturnCode_t bindComponent(RTObject_impl rtc)
           Bind the component.
 int close(long flags)
          スレッド終了関数です。
 ReturnCode_t deactivate_component(LightweightRTObject comp)
          コンポーネントを非アクティブ化します。
 java.lang.Object ECDeleteFunc(ExecutionContextBase comp)
          ExecutionContextのインスタンスを破棄します。
 ExecutionContextBase ECNewFunc()
          ExecutionContextのインスタンスを取得します。
 boolean finalizeExecutionContext()
          終了処理用関数
 LifeCycleState get_component_state(LightweightRTObject comp)
          コンポーネントの状態を取得します。
 ExecutionKind get_kind()
          ExecutionKindを取得します。
 ExecutionContextProfile get_profile()
          ExecutionContextProfile を取得します。
 double get_rate()
          ExecutionContextの実行周期(Hz)を取得します。
 ExecutionContextService getObjRef()
           getObjRef
 ExecutionContextService getRef()
          本オブジェクトのExecutionContextServiceとしてのCORBAオブジェクト参照を設定します。
 boolean is_running()
          ExecutionContextが実行中かどうかを取得します。
 int open()
          ExecutionContext用のスレッドを生成します。
static void PeriodicExecutionContextInit(Manager manager)
          このExecutionContextを生成するFactoryクラスを ExecutionContext用ObjectManagerに登録します。
 ReturnCode_t remove_component(LightweightRTObject comp)
           Remove the RT-Component from participant list
 ReturnCode_t reset_component(LightweightRTObject comp)
          コンポーネントをリセットします。
 void run()
          スレッド実行関数です。
 ReturnCode_t set_rate(double rate)
          ExecutionContextの実行周期(Hz)を設定します。
 void setObjRef(ExecutionContextService ref)
          本オブジェクトのExecutionContextServiceとしてのCORBAオブジェクト参照を設定します。
 ReturnCode_t start()
          ExecutionContext をスタートします。
 ReturnCode_t stop()
          ExecutionContext をストップします。
 int svc()
          ExecutionContext用のスレッドの実行関数です。 登録されたコンポーネントの処理を呼び出します。
 
Methods inherited from class jp.go.aist.rtm.RTC.executionContext.ExecutionContextBase
tick
 
Methods inherited from class OpenRTM.ExtTrigExecutionContextServicePOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_comps

protected java.util.Vector<PeriodicExecutionContext.Comp> m_comps

ExecutionContextにatttachされているコンポーネントのリストです。


m_running

protected boolean m_running

ExecutionContextの実行状態です。


m_profile

protected ExecutionContextProfile m_profile

ExecutionContextProfileです。


m_usec

protected long m_usec

ExecutionContextの動作周期です。


m_ref

protected ExecutionContextService m_ref

ExecutionContextServiceとしてのCORBAオブジェクト参照です。


m_nowait

protected boolean m_nowait

m_thread

protected java.lang.Thread m_thread

rtcout

protected Logbuf rtcout

Logging用フォーマットオブジェクト

Constructor Detail

PeriodicExecutionContext

public PeriodicExecutionContext()
Default Constructor

Default Constructor Set the following items to profile. - kind : PERIODIC - rate : 0.0


PeriodicExecutionContext

public PeriodicExecutionContext(DataFlowComponent owner)
Constructor

Set the configuration value to profile.

Parameters:
owner - The owner of this Executioncontext

PeriodicExecutionContext

public PeriodicExecutionContext(DataFlowComponent owner,
                                double rate)
Constructor

Set the configuration value to profile.

Parameters:
owner - The owner of this Executioncontext
rate - Execution cycle(Hz)
Method Detail

finalizeExecutionContext

public boolean finalizeExecutionContext()

終了処理用関数

Specified by:
finalizeExecutionContext in class ExecutionContextBase

__this

public ExecutionContextService __this()

__this()

Returns:
ExecutionContextService

setObjRef

public void setObjRef(ExecutionContextService ref)

本オブジェクトのExecutionContextServiceとしてのCORBAオブジェクト参照を設定します。

Overrides:
setObjRef in class ExecutionContextBase
Parameters:
ref - CORBAオブジェクト参照

getObjRef

public ExecutionContextService getObjRef()

getObjRef

Specified by:
getObjRef in class ExecutionContextBase
Returns:
ExecutionContextService

getRef

public ExecutionContextService getRef()

本オブジェクトのExecutionContextServiceとしてのCORBAオブジェクト参照を設定します。

Returns:
CORBAオブジェクト参照

open

public int open()

ExecutionContext用のスレッドを生成します。


svc

public int svc()

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


run

public void run()

スレッド実行関数です。

Specified by:
run in interface java.lang.Runnable

close

public int close(long flags)

スレッド終了関数です。


is_running

public boolean is_running()

ExecutionContextが実行中かどうかを取得します。

Specified by:
is_running in interface ExecutionContextOperations
Returns:
実行判定結果

start

public ReturnCode_t start()

ExecutionContext をスタートします。

Specified by:
start in interface ExecutionContextOperations
Returns:
実行結果

stop

public ReturnCode_t stop()

ExecutionContext をストップします。

Specified by:
stop in interface ExecutionContextOperations
Returns:
実行結果

get_rate

public double get_rate()

ExecutionContextの実行周期(Hz)を取得します。

Specified by:
get_rate in interface ExecutionContextOperations
Returns:
実行周期(Hz)

set_rate

public ReturnCode_t set_rate(double rate)

ExecutionContextの実行周期(Hz)を設定します。

Specified by:
set_rate in interface ExecutionContextOperations
Parameters:
rate - 実行周期(Hz)

activate_component

public ReturnCode_t activate_component(LightweightRTObject comp)

コンポーネントをアクティブ化します。

Specified by:
activate_component in interface ExecutionContextOperations
Parameters:
comp - アクティブ化対象コンポーネント
Returns:
実行結果

deactivate_component

public ReturnCode_t deactivate_component(LightweightRTObject comp)

コンポーネントを非アクティブ化します。

Specified by:
deactivate_component in interface ExecutionContextOperations
Parameters:
comp - 非アクティブ化対象コンポーネント
Returns:
実行結果

reset_component

public ReturnCode_t reset_component(LightweightRTObject comp)

コンポーネントをリセットします。

Specified by:
reset_component in interface ExecutionContextOperations
Parameters:
comp - リセット対象コンポーネント
Returns:
実行結果

get_component_state

public LifeCycleState get_component_state(LightweightRTObject comp)

コンポーネントの状態を取得します。

Specified by:
get_component_state in interface ExecutionContextOperations
Parameters:
comp - 状態取得対象コンポーネント
Returns:
コンポーネント状態

get_kind

public ExecutionKind get_kind()

ExecutionKindを取得します。

Specified by:
get_kind in interface ExecutionContextOperations
Returns:
ExecutionKind

add_component

public ReturnCode_t add_component(LightweightRTObject comp)
Add an RT-component

The operation causes the given RTC to begin participating in the execution context. The newly added RTC will receive a call to LightweightRTComponent::attach_context and then enter the Inactive state. BAD_PARAMETER will be invoked, if the given RT-Component is null or if the given RT-Component is other than DataFlowComponent.

Specified by:
add_component in interface ExecutionContextOperations
Parameters:
comp - The target RT-Component for add
Returns:
The return code of ReturnCode_t type

bindComponent

public ReturnCode_t bindComponent(RTObject_impl rtc)
Bind the component.

Bind the component.

Specified by:
bindComponent in class ExecutionContextBase
Parameters:
rtc - RT-Component's instances
Returns:
The return code of ReturnCode_t type

remove_component

public ReturnCode_t remove_component(LightweightRTObject comp)
Remove the RT-Component from participant list

This operation causes a participant RTC to stop participating in the execution context. The removed RTC will receive a call to LightweightRTComponent::detach_context. BAD_PARAMETER will be returned, if the given RT-Component is not participating in the participant list.

Specified by:
remove_component in interface ExecutionContextOperations
Parameters:
comp - The target RT-Component for delete
Returns:
The return code of ReturnCode_t type

get_profile

public ExecutionContextProfile get_profile()

ExecutionContextProfile を取得します。

Specified by:
get_profile in interface ExecutionContextServiceOperations
Returns:
ExecutionContextProfile

PeriodicExecutionContextInit

public static void PeriodicExecutionContextInit(Manager manager)

このExecutionContextを生成するFactoryクラスを ExecutionContext用ObjectManagerに登録します。

Parameters:
manager - Managerオブジェクト

ECNewFunc

public ExecutionContextBase ECNewFunc()

ExecutionContextのインスタンスを取得します。

Specified by:
ECNewFunc in interface ECNewDeleteFunc
Returns:
ExecutionContextインスタンス

ECDeleteFunc

public java.lang.Object ECDeleteFunc(ExecutionContextBase comp)

ExecutionContextのインスタンスを破棄します。

Specified by:
ECDeleteFunc in interface ECNewDeleteFunc
Parameters:
comp - 破棄対象ExecutionContextインスタンス