RTC_impl::ExecutionContextWorker Class Reference

#include <ExecutionContextWorker.h>

List of all members.

Public Member Functions

 ExecutionContextWorker ()
 Default Constructor.
virtual ~ExecutionContextWorker (void)
 Destructor.
void setECRef (RTC::ExecutionContextService_ptr ref)
RTC::ExecutionContextService_ptr getECRef ()
CORBA::Boolean isRunning (void)
 Check for ExecutionContext running state.
RTC::ReturnCode_t start (void)
 Start the ExecutionContext.
RTC::ReturnCode_t stop (void)
 Stop the ExecutionContext.
RTC::ReturnCode_t activateComponent (RTC::LightweightRTObject_ptr comp, RTObjectStateMachine *&rtobj)
 Activate an RT-component.
RTC::ReturnCode_t waitActivateComplete (RTObjectStateMachine *&rtobj, coil::TimeValue timeout=1.0, long int cycle=1000)
RTC::ReturnCode_t deactivateComponent (RTC::LightweightRTObject_ptr comp, RTObjectStateMachine *&rtobj)
 Deactivate an RT-component.
RTC::ReturnCode_t waitDeactivateComplete (RTObjectStateMachine *&rtobj, coil::TimeValue timeout=1.0, long int cycle=1000)
RTC::ReturnCode_t resetComponent (RTC::LightweightRTObject_ptr com, RTObjectStateMachine *&rtobj)
 Reset the RT-component.
RTC::ReturnCode_t waitResetComplete (RTObjectStateMachine *&rtobj, coil::TimeValue timeout=1.0, long int cycle=1000)
RTC::LifeCycleState getComponentState (RTC::LightweightRTObject_ptr comp)
 Get RT-component's state.
const char * getStateString (RTC::LifeCycleState state)
RTC::ReturnCode_t addComponent (RTC::LightweightRTObject_ptr comp)
 Add an RT-component.
RTC::ReturnCode_t bindComponent (RTC::RTObject_impl *rtc)
 Bind the component.
RTC::ReturnCode_t removeComponent (RTC::LightweightRTObject_ptr comp)
 Remove the RT-Component from participant list.
RTObjectStateMachinefindComponent (RTC::LightweightRTObject_ptr comp)
bool isAllCurrentState (RTC::LifeCycleState state)
bool isAllNextState (RTC::LifeCycleState state)
bool isOneOfCurrentState (RTC::LifeCycleState state)
bool isOneOfNextState (RTC::LifeCycleState state)
void invokeWorker ()
void invokeWorkerPreDo ()
void invokeWorkerDo ()
void invokeWorkerPostDo ()

Protected Types

typedef std::vector
< RTC_impl::RTObjectStateMachine * >
::iterator 
CompItr

Protected Member Functions

void updateComponentList ()

Protected Attributes

RTC::Logger rtclog
 Functor to find the component.
RTC::ExecutionContextService_var m_ref
bool m_running
 The running state of ExecutionContext true: running, false: stopped.
std::vector
< RTC_impl::RTObjectStateMachine * > 
m_comps
 List of the participating component.
coil::Mutex m_mutex
std::vector
< RTC_impl::RTObjectStateMachine * > 
m_addedComps
coil::Mutex m_addedMutex
std::vector
< RTC_impl::RTObjectStateMachine * > 
m_removedComps
coil::Mutex m_removedMutex

Member Typedef Documentation


Constructor & Destructor Documentation

RTC_impl::ExecutionContextWorker::ExecutionContextWorker (  ) 

Default Constructor.

Default Constructor Set the following items to profile.

  • kind : PERIODIC
  • rate : 0.0
virtual RTC_impl::ExecutionContextWorker::~ExecutionContextWorker ( void   )  [virtual]

Destructor.

Destructor


Member Function Documentation

RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::activateComponent ( RTC::LightweightRTObject_ptr  comp,
RTObjectStateMachine *&  rtobj 
)

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
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::addComponent ( RTC::LightweightRTObject_ptr  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
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::bindComponent ( RTC::RTObject_impl rtc  ) 

Bind the component.

Bind the component.

Parameters:
rtc RT-Component's instances
Returns:
The return code of ReturnCode_t type
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::deactivateComponent ( RTC::LightweightRTObject_ptr  comp,
RTObjectStateMachine *&  rtobj 
)

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
RTObjectStateMachine* RTC_impl::ExecutionContextWorker::findComponent ( RTC::LightweightRTObject_ptr  comp  ) 
RTC::LifeCycleState RTC_impl::ExecutionContextWorker::getComponentState ( RTC::LightweightRTObject_ptr  comp  ) 

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)
RTC::ExecutionContextService_ptr RTC_impl::ExecutionContextWorker::getECRef (  ) 
const char* RTC_impl::ExecutionContextWorker::getStateString ( RTC::LifeCycleState  state  )  [inline]
void RTC_impl::ExecutionContextWorker::invokeWorker (  ) 
void RTC_impl::ExecutionContextWorker::invokeWorkerDo (  ) 
void RTC_impl::ExecutionContextWorker::invokeWorkerPostDo (  ) 
void RTC_impl::ExecutionContextWorker::invokeWorkerPreDo (  ) 
bool RTC_impl::ExecutionContextWorker::isAllCurrentState ( RTC::LifeCycleState  state  ) 
bool RTC_impl::ExecutionContextWorker::isAllNextState ( RTC::LifeCycleState  state  ) 
bool RTC_impl::ExecutionContextWorker::isOneOfCurrentState ( RTC::LifeCycleState  state  ) 
bool RTC_impl::ExecutionContextWorker::isOneOfNextState ( RTC::LifeCycleState  state  ) 
CORBA::Boolean RTC_impl::ExecutionContextWorker::isRunning ( void   ) 

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)
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::removeComponent ( RTC::LightweightRTObject_ptr  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
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::resetComponent ( RTC::LightweightRTObject_ptr  com,
RTObjectStateMachine *&  rtobj 
)

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
void RTC_impl::ExecutionContextWorker::setECRef ( RTC::ExecutionContextService_ptr  ref  ) 
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::start ( void   ) 

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
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::stop ( void   ) 

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
void RTC_impl::ExecutionContextWorker::updateComponentList (  )  [protected]
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::waitActivateComplete ( RTObjectStateMachine *&  rtobj,
coil::TimeValue  timeout = 1.0,
long int  cycle = 1000 
)
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::waitDeactivateComplete ( RTObjectStateMachine *&  rtobj,
coil::TimeValue  timeout = 1.0,
long int  cycle = 1000 
)
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::waitResetComplete ( RTObjectStateMachine *&  rtobj,
coil::TimeValue  timeout = 1.0,
long int  cycle = 1000 
)

Member Data Documentation

List of the participating component.

RTC::ExecutionContextService_var RTC_impl::ExecutionContextWorker::m_ref [protected]

The running state of ExecutionContext true: running, false: stopped.

Functor to find the component.

Logger stream

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