ExecutionContextWorker class.
More...
#include <ExecutionContextWorker.h>
ExecutionContextWorker class.
Periodic Sampled Data Processing (for the execution cycles) ExecutionContext class
- Since
- 0.4.0
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 |
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.
When right after this operation is called, since other RTCs might being called their callbacks of the StateMachine, at first the RTC is added into the "Participants: m_addedComps." After RTCs callbacks are called, updateComponentList() function is invoked and RTCs are officially a member of the worker.
- 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.
This operation bind a RT-Component into owned context. Given argument RTObject_impl is the owner of the EC, and internally RTObject's bindContext() member function is called and obtain ec_id. The ec_id must be smaller than ECOTHER_OFFSET. After that proxy of RTObject RTObjectStateMachine is created, and it is added to the component list.
- 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::rateChanged |
( |
| ) |
|
Execution rate of ExecutionContext chnaged.
A call back for execution rate chang when ExecutionContext's execution rate. If set_rate() operation is called, ExecutionContextProfile::setRate() will be called, execution rate in the profile will be updated, and RTObjectStateMachine::onRateChagned() will be called with this member function.
- Returns
- The return code of ReturnCode_t type
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::startThread |
( |
void |
| ) |
|
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
RTC::ReturnCode_t RTC_impl::ExecutionContextWorker::stopThread |
( |
void |
| ) |
|
void RTC_impl::ExecutionContextWorker::updateComponentList |
( |
| ) |
|
coil::Mutex RTC_impl::ExecutionContextWorker::m_addedMutex |
|
mutableprotected |
List of the participating component.
RTC::ExecutionContextService_var RTC_impl::ExecutionContextWorker::m_ref |
|
protected |
coil::Mutex RTC_impl::ExecutionContextWorker::m_removedMutex |
|
mutableprotected |
bool RTC_impl::ExecutionContextWorker::m_running |
|
protected |
The running state of ExecutionContext true: running, false: stopped.
The documentation for this class was generated from the following file: