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

java.lang.Object
  extended by jp.go.aist.rtm.RTC.executionContext.ExecutionContextProfile

public class ExecutionContextProfile
extends java.lang.Object

ExecutionContextProfile class

Periodic Sampled Data Processing (for the execution cycles) ExecutionContext class


Field Summary
static double DEEFAULT_PERIOD
           
 
Constructor Summary
ExecutionContextProfile()
           
ExecutionContextProfile(ExecutionKind kind)
           Default Constructor
 
Method Summary
 ReturnCode_t addComponent(LightweightRTObject comp)
           Add an RT-component
 RTObject[] getComponentList()
           Getting participant RTC list
 ExecutionKind getKind()
           Get the ExecutionKind
 java.lang.String getKindString()
           
 java.lang.String getKindString(ExecutionKind kind)
           Converting ExecutionKind enum to string
 ExecutionContextService getObjRef()
           Get the reference to the CORBA object
 RTObject getOwner()
           Getting a reference of the owner component
 TimeValue getPeriod()
           
 ExecutionContextProfile getProfile()
           Getting Profile
 Properties getProperties()
           Setting Properties
 double getRate()
           Get execution rate(Hz) of ExecutionContext
 void lock()
           Getting a lock of RTC::ExecutionContextProfile
 ReturnCode_t removeComponent(LightweightRTObject comp)
           Remove the RT-Component from participant list
 ReturnCode_t setKind(ExecutionKind kind)
           Set the ExecutionKind
 void setObjRef(ExecutionContextService ec_ptr)
           Sets the reference to the CORBA object
 ReturnCode_t setOwner(LightweightRTObject comp)
           Setting owner component of the execution context
 ReturnCode_t setPeriod(double period)
           
 ReturnCode_t setPeriod(TimeValue period)
           
 void setProperties(Properties props)
           Setting Properties
 ReturnCode_t setRate(double rate)
           Set execution rate(Hz) of ExecutionContext
 void unlock()
           Release a lock of the RTC::ExecutionContextProfile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEEFAULT_PERIOD

public static final double DEEFAULT_PERIOD
See Also:
Constant Field Values
Constructor Detail

ExecutionContextProfile

public ExecutionContextProfile(ExecutionKind kind)
Default Constructor

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


ExecutionContextProfile

public ExecutionContextProfile()
Method Detail

setObjRef

public void setObjRef(ExecutionContextService ec_ptr)
Sets the reference to the CORBA object

This operation sets a object reference to ExecutionContextService. After setting a new object reference, old reference is released. The object reference have to be valid reference.

Parameters:
ec_ptr - A CORBA object reference of ExecutionContextService

getObjRef

public ExecutionContextService getObjRef()
Get the reference to the CORBA object

Get the reference to the CORBA object as ExecutioncontextService of this object.

Returns:
The reference to CORBA object

setRate

public ReturnCode_t setRate(double rate)
Set execution rate(Hz) of ExecutionContext

This operation shall set the rate (in hertz) at which this context’s Active participating RTCs are being called. If the execution kind of the context is PERIODIC, a rate change shall result in the invocation of on_rate_changed on any RTCs realizing DataFlowComponentAction that are registered with any RTCs participating in the context.

Parameters:
rate - Execution cycle(Unit:Hz)
Returns:
The return code of ReturnCode_t type RTC_OK: Succeed BAD_PARAMETER: Invalid value. The value might be negative.

setPeriod

public ReturnCode_t setPeriod(double period)

setPeriod

public ReturnCode_t setPeriod(TimeValue period)

getRate

public double getRate()
Get execution rate(Hz) of ExecutionContext

This operation shall return the rate (in hertz) at which its Active participating RTCs are being invoked.

Returns:
Execution cycle(Unit:Hz)

getPeriod

public TimeValue getPeriod()

getKindString

public final java.lang.String getKindString(ExecutionKind kind)
Converting ExecutionKind enum to string

This function converts enumeration (PERIODIC, EVENT_DRIVEN, OTHER) defined in RTC::ExecutionKind to string.

Parameters:
kind - ExecutionKind
Returns:
文字列化されたExecutionKind String of ExecutionKind

getKindString

public final java.lang.String getKindString()

setKind

public ReturnCode_t setKind(ExecutionKind kind)
Set the ExecutionKind

This operation sets the kind of the execution context.

Parameters:
kind - ExecutionKind

getKind

public ExecutionKind getKind()
Get the ExecutionKind

This operation shall report the execution kind of the execution context.

Returns:
ExecutionKind

setOwner

public ReturnCode_t setOwner(LightweightRTObject comp)
Setting owner component of the execution context

This function sets an RT-Component to be owner of the execution context.

Parameters:
comp - an owner RT-Component of this execution context
Returns:
The return code of ReturnCode_t type

getOwner

public final RTObject getOwner()
Getting a reference of the owner component

This function returns a reference of the owner RT-Component of this execution context

Returns:
a reference of the owner RT-Component

addComponent

public ReturnCode_t addComponent(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.

Parameters:
comp - The target RT-Component for add
Returns:
The return code of ReturnCode_t type

removeComponent

public ReturnCode_t removeComponent(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.

Parameters:
comp - The target RT-Component for delete
Returns:
The return code of ReturnCode_t type

getComponentList

public final RTObject[] getComponentList()
Getting participant RTC list

This function returns a list of participant RTC of the execution context. Since the function returns a reference to the member variable of component list, user have to lock by ExecutionContextProfile::lock() before using the list, and user also have to release the unlock by ExecutionContextProfile::unlock().

Returns:
Participants RTC list

setProperties

public void setProperties(Properties props)
Setting Properties

This function sets ExecutionContextProfile::properties by Properties.

Parameters:
props - Properties to be set to ExecutionContextProfile::properties.

getProperties

public final Properties getProperties()
Setting Properties

Returns:
This function sets ExecutionContextProfile::properties by Properties.

getProfile

public ExecutionContextProfile getProfile()
Getting Profile

This function gets RTC::ExecutionContextProfile. The ownership of the obtained ExecutionContextProfile is given to caller. The caller should release obtained object when it is unneccessary anymore.

Returns:
RTC::ExecutionContextProfile

lock

public void lock()
Getting a lock of RTC::ExecutionContextProfile

This function locks RTC::ExecutionContextProfile in the object. The lock should be released when the lock is unneccessary.


unlock

public void unlock()
Release a lock of the RTC::ExecutionContextProfile

This function release the lock of RTC::ExecutionContextProfile in the object.