20 #include <coil/PeriodicTask.h> 21 #include <coil/Time.h> 33 : m_period(0.0), m_nowait(false),
34 m_func(0), m_deleteInDtor(true),
35 m_alive(false), m_suspend(false),
36 m_execCount(0), m_execCountMax(10),
37 m_periodCount(0), m_periodCountMax(10)
68 if (
m_func == 0) {
return; }
146 if (func == 0) {
return false; }
PeriodicTask()
Constructor.
bool m_deleteInDtor
Task execution function delete flag.
coil::TimeMeasure m_periodTime
Task periodic time measurement infomation.
unsigned int m_execCountMax
Task execution time measurement max count.
bool getStatistics(double &max_interval, double &min_interval, double &mean_interval, double &stddev)
Get total statistics.
Structure for time statistics.
long int sec() const
Get value of second time scale.
virtual void periodicMeasure(bool value)
Validate a Task period time measurement.
unsigned int sleep(unsigned int seconds)
Stop a processing at specified second time.
coil::TimeValue & interval()
Get a interval time.
virtual void updateExecStat()
Update for execute state.
virtual void executionMeasure(bool value)
Validate a Task execute time measurement.
virtual int resume(void)
Resuming the suspended task.
coil::Condition< coil::Mutex > cond
virtual void activate()
Starting the task.
virtual int svc()
Thread execution for PeriodicTask.
unsigned int m_execCount
Task execution time measurement count.
virtual void periodicMeasureCount(int n)
Task period time measurement count.
bool m_nowait
Thread sleep flag.
virtual void sleep()
Thread sleep.
virtual void signal()
Executing the suspended task one tick.
virtual TimeMeasure::Statistics getExecStat()
Get a result in task execute time measurement.
virtual int wait(void)
Waiting for the thread terminate.
void tack()
Finish time measurement for time statistics.
statistics_t m_execStat
Task execution time measurement statistics.
coil::TimeMeasure::Statistics stat
unsigned int m_periodCount
Task periodic time measurement count.
coil::TimeValue m_period
Task execution period.
virtual bool setTask(TaskFuncBase *func, bool delete_in_dtor=true)
Setting task execution function.
unsigned int m_periodCountMax
Task periodic time measurement max count.
void reset()
Initialize for statistics related data.
statistics_t m_periodStat
Task periodic time measurement statistics.
virtual ~PeriodicTask()
Destructor.
bool m_execMeasure
Task execution time measurement flag.
virtual void setPeriod(double period)
Setting task execution period.
virtual void executionMeasureCount(int n)
Task execute time measurement period.
coil::TimeMeasure m_execTime
Task execution time measurement infomation.
TaskFuncBase * m_func
Task execution function.
suspend_t m_suspend
Task suspend infomation.
virtual void updatePeriodStat()
Update for period state.
virtual void finalize()
Finalizing the task.
bool m_periodMeasure
Task periodic time measurement flag.
long int usec() const
Get value of micro second time scale.
void tick()
Begin time measurement for time statistics.
virtual TimeMeasure::Statistics getPeriodStat()
Get a result in task period time measurement.
alive_t m_alive
Task alive flag.
virtual int suspend(void)
Suspending the task.
virtual void activate()
Create a thread.
Common Object Interface Layer.