#include <ExecutionContextWorker.h>
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. | |
RTObjectStateMachine * | findComponent (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 |
typedef std::vector<RTC_impl::RTObjectStateMachine*>::iterator RTC_impl::ExecutionContextWorker::CompItr [protected] |
RTC_impl::ExecutionContextWorker::ExecutionContextWorker | ( | ) |
Default Constructor.
Default Constructor Set the following items to profile.
virtual RTC_impl::ExecutionContextWorker::~ExecutionContextWorker | ( | void | ) | [virtual] |
Destructor.
Destructor
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.
comp | The target RT-Component for activation |
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.
comp | The target RT-Component for add |
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::bindComponent | ( | RTC::RTObject_impl * | rtc | ) |
Bind the component.
Bind the component.
rtc | RT-Component's instances |
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.
comp | The target RT-Component for deactivate |
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.
comp | The target RT-Component to get the state |
RTC::ExecutionContextService_ptr RTC_impl::ExecutionContextWorker::getECRef | ( | ) |
const char* RTC_impl::ExecutionContextWorker::getStateString | ( | RTC::LifeCycleState | state | ) | [inline] |
void RTC_impl::ExecutionContextWorker::invokeWorker | ( | ) |
Referenced by RTC::ExecutionContextBase::invokeWorker().
void RTC_impl::ExecutionContextWorker::invokeWorkerDo | ( | ) |
Referenced by RTC::ExecutionContextBase::invokeWorkerDo().
void RTC_impl::ExecutionContextWorker::invokeWorkerPostDo | ( | ) |
Referenced by RTC::ExecutionContextBase::invokeWorkerPostDo().
void RTC_impl::ExecutionContextWorker::invokeWorkerPreDo | ( | ) |
Referenced by RTC::ExecutionContextBase::invokeWorkerPreDo().
bool RTC_impl::ExecutionContextWorker::isAllCurrentState | ( | RTC::LifeCycleState | state | ) |
Referenced by RTC::ExecutionContextBase::isAllCurrentState().
bool RTC_impl::ExecutionContextWorker::isAllNextState | ( | RTC::LifeCycleState | state | ) |
Referenced by RTC::ExecutionContextBase::isAllNextState().
bool RTC_impl::ExecutionContextWorker::isOneOfCurrentState | ( | RTC::LifeCycleState | state | ) |
Referenced by RTC::ExecutionContextBase::isOneOfCurrentState().
bool RTC_impl::ExecutionContextWorker::isOneOfNextState | ( | RTC::LifeCycleState | state | ) |
Referenced by RTC::ExecutionContextBase::isOneOfNextState().
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.
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.
comp | The target RT-Component for delete |
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.
comp | The target RT-Component for reset |
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.
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.
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 | |||
) |
std::vector<RTC_impl::RTObjectStateMachine*> RTC_impl::ExecutionContextWorker::m_addedComps [protected] |
coil::Mutex RTC_impl::ExecutionContextWorker::m_addedMutex [mutable, protected] |
std::vector<RTC_impl::RTObjectStateMachine*> RTC_impl::ExecutionContextWorker::m_comps [protected] |
List of the participating component.
coil::Mutex RTC_impl::ExecutionContextWorker::m_mutex [mutable, protected] |
RTC::ExecutionContextService_var RTC_impl::ExecutionContextWorker::m_ref [protected] |
std::vector<RTC_impl::RTObjectStateMachine*> RTC_impl::ExecutionContextWorker::m_removedComps [protected] |
coil::Mutex RTC_impl::ExecutionContextWorker::m_removedMutex [mutable, protected] |
bool RTC_impl::ExecutionContextWorker::m_running [protected] |
The running state of ExecutionContext true: running, false: stopped.
RTC::Logger RTC_impl::ExecutionContextWorker::rtclog [protected] |
Functor to find the component.
Logger stream