RTC::ExtTrigExecutionContext Class Reference

ExecutionContext class that enables one step execution. More...

#include <ExtTrigExecutionContext.h>

Inheritance diagram for RTC::ExtTrigExecutionContext:
RTC::ExecutionContextBase coil::Task

List of all members.

Classes

struct  Worker
 Condition variable class for worker.

Public Member Functions

 ExtTrigExecutionContext ()
 Constructor.
virtual ~ExtTrigExecutionContext (void)
 Destructor.
virtual int open (void *args)
 Generate internal activity thread for ExecutionContext.
virtual int svc (void)
 Invoke each component's operation.
virtual int close (unsigned long flags)
 Thread execution function for ExecutionContext.
virtual void tick () throw (CORBA::SystemException)
 Move forward one step of ExecutionContext.
virtual CORBA::Boolean is_running (void) throw (CORBA::SystemException)
 Check for ExecutionContext running state.
virtual RTC::ReturnCode_t start (void) throw (CORBA::SystemException)
 Start the ExecutionContext.
virtual RTC::ReturnCode_t stop (void) throw (CORBA::SystemException)
 Stop the ExecutionContext.
virtual CORBA::Double get_rate (void) throw (CORBA::SystemException)
 Get execution rate(Hz) of ExecutionContext.
virtual RTC::ReturnCode_t set_rate (CORBA::Double rate) throw (CORBA::SystemException)
 Set execution rate(Hz) of ExecutionContext.
virtual RTC::ReturnCode_t activate_component (RTC::LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 Activate an RT-component.
virtual RTC::ReturnCode_t deactivate_component (RTC::LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 Deactivate an RT-component.
virtual RTC::ReturnCode_t reset_component (RTC::LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 Reset the RT-component.
virtual RTC::LifeCycleState get_component_state (RTC::LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 Get RT-component's state.
virtual RTC::ExecutionKind get_kind (void) throw (CORBA::SystemException)
 Get the ExecutionKind.
virtual RTC::ReturnCode_t add_component (RTC::LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 Add an RT-component.
virtual RTC::ReturnCode_t remove_component (RTC::LightweightRTObject_ptr comp) throw (CORBA::SystemException)
 Remove the RT-Component from participant list.
virtual
RTC::ExecutionContextProfile * 
get_profile (void) throw (CORBA::SystemException)
 Get the ExecutionContextProfile.

Protected Member Functions

virtual RTC::ReturnCode_t onStarted ()
 onStarted() template function
virtual RTC::ReturnCode_t onWaitingActivated (RTC_impl::RTObjectStateMachine *comp, long int count)
 onWaitingActivated() template function
virtual RTC::ReturnCode_t onWaitingDeactivated (RTC_impl::RTObjectStateMachine *comp, long int count)
 onWaitingDeactivated() template function
virtual RTC::ReturnCode_t onWaitingReset (RTC_impl::RTObjectStateMachine *comp, long int count)
 onWaitingReset() template function

Detailed Description

ExecutionContext class that enables one step execution.

ExecutionContext class that can execute every one cycle for Periodic Sampled Data Processing. Time(Tick) advances one cycle by invoking method externally.

Since:
0.4.0

Constructor & Destructor Documentation

RTC::ExtTrigExecutionContext::ExtTrigExecutionContext (  ) 

Constructor.

Constructor

virtual RTC::ExtTrigExecutionContext::~ExtTrigExecutionContext ( void   )  [virtual]

Destructor.

Destructor


Member Function Documentation

virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::activate_component ( RTC::LightweightRTObject_ptr  comp  )  throw (CORBA::SystemException) [virtual]

Activate an RT-component.

The given participant RTC is Inactive and is therefore not being invoked according to the execution context’s execution kind. This operation shall cause the RTC to transition to the Active state such that it may subsequently be invoked in this execution context. The callback on_activate shall be called as a result of calling this operation. This operation shall not return until the callback has returned, and shall result in an error if the callback does.

Parameters:
comp The target RT-Component for activation
Returns:
The return code of ReturnCode_t type
virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::add_component ( RTC::LightweightRTObject_ptr  comp  )  throw (CORBA::SystemException) [virtual]

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
virtual int RTC::ExtTrigExecutionContext::close ( unsigned long  flags  )  [virtual]

Thread execution function for ExecutionContext.

This function is invoked when activity thread for ExecutionContext exits. Deactivate the component object and notify it to manager. This is coil::Task class method's override.

Parameters:
flags Flag of the close
Returns:
The close result

Reimplemented from coil::Task.

virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::deactivate_component ( RTC::LightweightRTObject_ptr  comp  )  throw (CORBA::SystemException) [virtual]

Deactivate an RT-component.

The given RTC is Active in the execution context. Cause it to transition to the Inactive state such that it will not be subsequently invoked from the context unless and until it is activated again. The callback on_deactivate shall be called as a result of calling this operation. This operation shall not return until the callback has returned, and shall result in an error if the callback does.

Parameters:
comp The target RT-Component for deactivate
Returns:
The return code of ReturnCode_t type
virtual RTC::LifeCycleState RTC::ExtTrigExecutionContext::get_component_state ( RTC::LightweightRTObject_ptr  comp  )  throw (CORBA::SystemException) [virtual]

Get RT-component's state.

This operation shall report the LifeCycleState of the given participant RTC. UNKNOWN_STATE will be returned, if the given RT-Component is not inclued in the participant list.

Parameters:
comp The target RT-Component to get the state
Returns:
The current state of the target RT-Component(LifeCycleState)
virtual RTC::ExecutionKind RTC::ExtTrigExecutionContext::get_kind ( void   )  throw (CORBA::SystemException) [virtual]

Get the ExecutionKind.

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

Returns:
ExecutionKind
virtual RTC::ExecutionContextProfile* RTC::ExtTrigExecutionContext::get_profile ( void   )  throw (CORBA::SystemException) [virtual]

Get the ExecutionContextProfile.

This operation provides a profile “descriptor” for the execution context.

Returns:
ExecutionContextProfile
virtual CORBA::Double RTC::ExtTrigExecutionContext::get_rate ( void   )  throw (CORBA::SystemException) [virtual]

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)
virtual CORBA::Boolean RTC::ExtTrigExecutionContext::is_running ( void   )  throw (CORBA::SystemException) [virtual]

Check for ExecutionContext running state.

This operation shall return true if the context is in the Running state. While the context is Running, all Active RTCs participating in the context shall be executed according to the context’s execution kind.

Returns:
Check state function (Running:true、Stopping:false)
virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::onStarted (  )  [protected, virtual]

onStarted() template function

Reimplemented from RTC::ExecutionContextBase.

virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::onWaitingActivated ( RTC_impl::RTObjectStateMachine comp,
long int  count 
) [protected, virtual]

onWaitingActivated() template function

Reimplemented from RTC::ExecutionContextBase.

virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::onWaitingDeactivated ( RTC_impl::RTObjectStateMachine comp,
long int  count 
) [protected, virtual]

onWaitingDeactivated() template function

Reimplemented from RTC::ExecutionContextBase.

virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::onWaitingReset ( RTC_impl::RTObjectStateMachine comp,
long int  count 
) [protected, virtual]

onWaitingReset() template function

Reimplemented from RTC::ExecutionContextBase.

virtual int RTC::ExtTrigExecutionContext::open ( void *  args  )  [virtual]

Generate internal activity thread for ExecutionContext.

Generate internal activity thread and run. This is coil::Task class method's override.

Parameters:
args Usually give 0
Returns:
The generation result

Reimplemented from coil::Task.

virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::remove_component ( RTC::LightweightRTObject_ptr  comp  )  throw (CORBA::SystemException) [virtual]

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
virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::reset_component ( RTC::LightweightRTObject_ptr  comp  )  throw (CORBA::SystemException) [virtual]

Reset the RT-component.

Attempt to recover the RTC when it is in Error. The ComponentAction::on_reset callback shall be invoked. This operation shall not return until the callback has returned, and shall result in an error if the callback does. If possible, the RTC developer should implement that callback such that the RTC may be returned to a valid state.

Parameters:
comp The target RT-Component for reset
Returns:
The return code of ReturnCode_t type
virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::set_rate ( CORBA::Double  rate  )  throw (CORBA::SystemException) [virtual]

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
virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::start ( void   )  throw (CORBA::SystemException) [virtual]

Start the ExecutionContext.

Request that the context enter the Running state. Once the state transition occurs, the ComponentAction::on_startup operation will be invoked. An execution context may not be started until the RT-Components that participate in it have been initialized. An execution context may be started and stopped multiple times.

Returns:
The return code of ReturnCode_t type

Reimplemented from RTC::ExecutionContextBase.

virtual RTC::ReturnCode_t RTC::ExtTrigExecutionContext::stop ( void   )  throw (CORBA::SystemException) [virtual]

Stop the ExecutionContext.

Request that the context enter the Stopped state. Once the transition occurs, the ComponentAction::on_shutdown operation will be invoked. An execution context must be stopped before the RT components that participate in it are finalized. An execution context may be started and stopped multiple times.

Returns:
The return code of ReturnCode_t type

Reimplemented from RTC::ExecutionContextBase.

virtual int RTC::ExtTrigExecutionContext::svc ( void   )  [virtual]

Invoke each component's operation.

Invoke each component's operation which is attached this ExecutionContext. Stop until the next operation is invoked after all component operations are invoked.

Returns:
Operation result

Reimplemented from coil::Task.

virtual void RTC::ExtTrigExecutionContext::tick (  )  throw (CORBA::SystemException) [virtual]

Move forward one step of ExecutionContext.

Move forward one step of the ExecutionContext processing.

Generated on Sat Apr 19 14:45:47 2014 for OpenRTM by  doxygen 1.6.3