Go to the documentation of this file.
19 #ifndef RTC_PERIODICEXECUTIONCONTEXT2_H
20 #define RTC_PERIODICEXECUTIONCONTEXT2_H
22 #include <coil/Task.h>
23 #include <condition_variable>
24 #include <coil/Affinity.h>
31 #define NUM_OF_LIFECYCLESTATE 4
56 :
public virtual POA_RTC::ExecutionContextService,
57 public virtual PortableServer::RefCountServantBase,
137 int open(
void *args)
override;
187 int close(
unsigned long flags)
override;
245 RTC::ReturnCode_t
start()
override;
273 RTC::ReturnCode_t
stop()
override;
326 RTC::ReturnCode_t
set_rate(CORBA::Double rate)
override;
481 RTC::ExecutionKind
get_kind()
override;
568 RTC::ExecutionContextProfile*
get_profile()
override;
574 if (prop.findNode(key) !=
nullptr)
577 if (coil::stringTo(tmp, prop[key].c_str()))
641 std::lock_guard<std::mutex> guard(
m_svcmutex);
719 #endif // RTC_PERIODICEXECUTIONCONTEXT_H
RTC::ReturnCode_t onDeactivated(RTC_impl::RTObjectStateMachine *comp, long int count) override
onDeactivated() template function
RTC::Logger rtclog
Logger stream.
Definition: PeriodicExecutionContext.h:652
coil::CpuMask m_cpu
CPU affinity mask list.
Definition: PeriodicExecutionContext.h:701
RTC::ReturnCode_t onWaitingDeactivated(RTC_impl::RTObjectStateMachine *comp, long int count) override
onWaitingDeactivated() template function
std::condition_variable cond_
Definition: PeriodicExecutionContext.h:675
Definition: MultilayerCompositeEC.h:27
A base class for ExecutionContext.
Definition: ExecutionContextBase.h:365
RTC::ReturnCode_t deactivate_component(RTC::LightweightRTObject_ptr comp) override
Deactivate an RT-component.
RTC::ReturnCode_t add_component(RTC::LightweightRTObject_ptr comp) override
Add an RT-component.
Condition variable class for worker.
Definition: PeriodicExecutionContext.h:671
void PeriodicExecutionContextInit(RTC::Manager *manager)
Initialization function to register to ECFactory.
bool running_
Definition: PeriodicExecutionContext.h:676
RTC::ReturnCode_t onWaitingActivated(RTC_impl::RTObjectStateMachine *comp, long int count) override
onWaitingActivated() template function
RTC::ReturnCode_t onWaitingReset(RTC_impl::RTObjectStateMachine *comp, long int count) override
onWaitingReset() template function
PeriodicExecutionContext class.
Definition: PeriodicExecutionContext.h:55
PeriodicExecutionContext()
Default Constructor.
RTC::ReturnCode_t start() override
Start the ExecutionContext.
RTC::ReturnCode_t onReset(RTC_impl::RTObjectStateMachine *comp, long int count) override
onReset() template function
bool m_nowait
Flag of ExecutionContext to run immediately (to run without waiting)
Definition: PeriodicExecutionContext.h:696
bool threadRunning()
Definition: PeriodicExecutionContext.h:639
RTC::ReturnCode_t reset_component(RTC::LightweightRTObject_ptr comp) override
Reset the RT-component.
RTC::LifeCycleState get_component_state(RTC::LightweightRTObject_ptr comp) override
Get RT-component's state.
~PeriodicExecutionContext() override
Destructor.
bool m_svc
The thread running flag of ExecutionContext.
Definition: PeriodicExecutionContext.h:661
virtual void setCpuAffinity(coil::Properties &props)
setting CPU affinity from given properties
RTC::ReturnCode_t onRemovedComponent(RTC::LightweightRTObject_ptr rtobj) override
onRemovedComponent() template function
RTC::ReturnCode_t onStarted() override
onStarted() template function
int open(void *args) override
Generate internal activity thread for ExecutionContext.
void getProperty(coil::Properties &prop, const char *key, T &value)
Definition: PeriodicExecutionContext.h:572
int svc() override
Thread execution function for ExecutionContext.
ExecutionContext base class.
Logger class.
Definition: SystemLogger.h:99
std::mutex mutex_
Definition: PeriodicExecutionContext.h:674
RTC::ReturnCode_t onAddedComponent(RTC::LightweightRTObject_ptr rtobj) override
onAddedComponent() template function
RTC::ExecutionContextProfile * get_profile() override
Get the ExecutionContextProfile.
int close(unsigned long flags) override
Thread execution function for ExecutionContext.
WorkerThreadCtrl()
Definition: PeriodicExecutionContext.h:673
CORBA::Boolean is_running() override
Check for ExecutionContext running state.
CORBA::Double get_rate() override
Get execution rate(Hz) of ExecutionContext.
RTC::ReturnCode_t stop() override
Stop the ExecutionContext.
RTC::ReturnCode_t set_rate(CORBA::Double rate) override
Set execution rate(Hz) of ExecutionContext.
RTC::ReturnCode_t onActivated(RTC_impl::RTObjectStateMachine *comp, long int count) override
onActivated() template function
void init(coil::Properties &props) override
Initialize the ExecutionContext.
RTC::ReturnCode_t onStopping() override
onStopping() template function
Manager class.
Definition: Manager.h:90
Definition: RTObjectStateMachine.h:42
RTC::ExecutionKind get_kind() override
Get the ExecutionKind.
coil::Properties Properties
Definition: RTC.h:72
RTC::LightweightRTObject_ptr LightweightRTObject_ptr
Definition: ExecutionContextWorker.h:37
RTC::ReturnCode_t activate_component(RTC::LightweightRTObject_ptr comp) override
Activate an RT-component.
RTC::ReturnCode_t remove_component(RTC::LightweightRTObject_ptr comp) override
Remove the RT-Component from participant list.
WorkerThreadCtrl m_workerthread
A condition variable for external triggered worker.
Definition: PeriodicExecutionContext.h:686
std::mutex m_svcmutex
Definition: PeriodicExecutionContext.h:662