PeriodicTask class. More...
#include <PeriodicTask.h>
Classes | |
class | alive_t |
alive_t class More... | |
struct | statistics_t |
Structure for task execution time measurement management. More... | |
struct | suspend_t |
Structure for task suspend management. More... | |
Public Types | |
typedef coil::Guard< coil::Mutex > | Guard |
Public Member Functions | |
virtual void | activate () |
Starting the task. | |
virtual void | executionMeasure (bool value) |
Validate a Task execute time measurement. | |
virtual void | executionMeasureCount (int n) |
Task execute time measurement period. | |
virtual void | finalize () |
Finalizing the task. | |
virtual TimeMeasure::Statistics | getExecStat () |
Get a result in task execute time measurement. | |
virtual TimeMeasure::Statistics | getPeriodStat () |
Get a result in task period time measurement. | |
virtual void | periodicMeasure (bool value) |
Validate a Task period time measurement. | |
virtual void | periodicMeasureCount (int n) |
Task period time measurement count. | |
PeriodicTask () | |
Constructor. | |
virtual int | resume (void) |
Resuming the suspended task. | |
virtual void | setPeriod (double period) |
Setting task execution period. | |
virtual void | setPeriod (TimeValue &period) |
Setting task execution period. | |
virtual bool | setTask (TaskFuncBase *func, bool delete_in_dtor=true) |
Setting task execution function. | |
template<class O , class F > | |
bool | setTask (O *obj, F fun) |
Setting task execution function. | |
virtual void | signal () |
Executing the suspended task one tick. | |
virtual int | suspend (void) |
Suspending the task. | |
virtual | ~PeriodicTask () |
Destructor. | |
Protected Member Functions | |
virtual void | sleep () |
Thread sleep. | |
virtual int | svc () |
Thread execution for PeriodicTask. | |
virtual void | updateExecStat () |
Update for execute state. | |
virtual void | updatePeriodStat () |
Update for period state. | |
Protected Attributes | |
alive_t | m_alive |
Task alive flag. | |
bool | m_deleteInDtor |
Task execution function delete flag. | |
unsigned int | m_execCount |
Task execution time measurement count. | |
unsigned int | m_execCountMax |
Task execution time measurement max count. | |
bool | m_execMeasure |
Task execution time measurement flag. | |
statistics_t | m_execStat |
Task execution time measurement statistics. | |
coil::TimeMeasure | m_execTime |
Task execution time measurement infomation. | |
TaskFuncBase * | m_func |
Task execution function. | |
bool | m_nowait |
Thread sleep flag. | |
coil::TimeValue | m_period |
Task execution period. | |
unsigned int | m_periodCount |
Task periodic time measurement count. | |
unsigned int | m_periodCountMax |
Task periodic time measurement max count. | |
bool | m_periodMeasure |
Task periodic time measurement flag. | |
statistics_t | m_periodStat |
Task periodic time measurement statistics. | |
coil::TimeMeasure | m_periodTime |
Task periodic time measurement infomation. | |
suspend_t | m_suspend |
Task suspend infomation. |
PeriodicTask class.
Definition at line 61 of file PeriodicTask.h.
Definition at line 65 of file PeriodicTask.h.
coil::PeriodicTask::~PeriodicTask | ( | ) | [virtual] |
void coil::PeriodicTask::activate | ( | ) | [virtual] |
Starting the task.
Starting a thread to execute a task. If the task/thread is started properly, it will return 'TRUE'. if the task/thread are already started or task function object is not set, 'FALSE' will be returned.
Implements coil::PeriodicTaskBase.
Definition at line 65 of file PeriodicTask.cpp.
void coil::PeriodicTask::executionMeasure | ( | bool | value | ) | [virtual] |
Validate a Task execute time measurement.
Implements coil::PeriodicTaskBase.
Definition at line 199 of file PeriodicTask.cpp.
void coil::PeriodicTask::executionMeasureCount | ( | int | n | ) | [virtual] |
Task execute time measurement period.
Implements coil::PeriodicTaskBase.
Definition at line 211 of file PeriodicTask.cpp.
void coil::PeriodicTask::finalize | ( | ) | [virtual] |
Finalizing the task.
Finalizing the task running.
Implements coil::PeriodicTaskBase.
Definition at line 82 of file PeriodicTask.cpp.
TimeMeasure::Statistics coil::PeriodicTask::getExecStat | ( | ) | [virtual] |
Get a result in task execute time measurement.
Implements coil::PeriodicTaskBase.
Definition at line 247 of file PeriodicTask.cpp.
TimeMeasure::Statistics coil::PeriodicTask::getPeriodStat | ( | ) | [virtual] |
Get a result in task period time measurement.
Implements coil::PeriodicTaskBase.
Definition at line 260 of file PeriodicTask.cpp.
void coil::PeriodicTask::periodicMeasure | ( | bool | value | ) | [virtual] |
Validate a Task period time measurement.
Implements coil::PeriodicTaskBase.
Definition at line 223 of file PeriodicTask.cpp.
void coil::PeriodicTask::periodicMeasureCount | ( | int | n | ) | [virtual] |
Task period time measurement count.
Implements coil::PeriodicTaskBase.
Definition at line 235 of file PeriodicTask.cpp.
int coil::PeriodicTask::resume | ( | void | ) | [virtual] |
Resuming the suspended task.
Resuming the suspended task
Implements coil::PeriodicTaskBase.
Definition at line 113 of file PeriodicTask.cpp.
void coil::PeriodicTask::setPeriod | ( | double | period | ) | [virtual] |
Setting task execution period.
period | Execution period [sec] |
Implements coil::PeriodicTaskBase.
Definition at line 159 of file PeriodicTask.cpp.
void coil::PeriodicTask::setPeriod | ( | TimeValue & | period | ) | [virtual] |
Setting task execution period.
period | Execution period |
Implements coil::PeriodicTaskBase.
Definition at line 179 of file PeriodicTask.cpp.
bool coil::PeriodicTask::setTask | ( | TaskFuncBase * | func, |
bool | delete_in_dtor = true |
||
) | [virtual] |
Setting task execution function.
func | Set int (*)() type function pointer |
Implements coil::PeriodicTaskBase.
Definition at line 144 of file PeriodicTask.cpp.
bool coil::PeriodicTask::setTask | ( | O * | obj, |
F | fun | ||
) | [inline] |
Setting task execution function.
func | Set int (*)() type function pointer |
Reimplemented from coil::PeriodicTaskBase.
Definition at line 218 of file PeriodicTask.h.
void coil::PeriodicTask::signal | ( | void | ) | [virtual] |
Executing the suspended task one tick.
Executing the suspended task one tick
Implements coil::PeriodicTaskBase.
Definition at line 131 of file PeriodicTask.cpp.
void coil::PeriodicTask::sleep | ( | ) | [protected, virtual] |
Thread sleep.
Definition at line 319 of file PeriodicTask.cpp.
int coil::PeriodicTask::suspend | ( | void | ) | [virtual] |
Suspending the task.
Suspending the task running.
Implements coil::PeriodicTaskBase.
Definition at line 99 of file PeriodicTask.cpp.
int coil::PeriodicTask::svc | ( | void | ) | [protected, virtual] |
Thread execution for PeriodicTask.
Reimplemented from coil::Task.
Definition at line 276 of file PeriodicTask.cpp.
void coil::PeriodicTask::updateExecStat | ( | ) | [protected, virtual] |
Update for execute state.
Definition at line 335 of file PeriodicTask.cpp.
void coil::PeriodicTask::updatePeriodStat | ( | ) | [protected, virtual] |
Update for period state.
Definition at line 353 of file PeriodicTask.cpp.
alive_t coil::PeriodicTask::m_alive [protected] |
Task alive flag.
Definition at line 405 of file PeriodicTask.h.
bool coil::PeriodicTask::m_deleteInDtor [protected] |
Task execution function delete flag.
Definition at line 379 of file PeriodicTask.h.
unsigned int coil::PeriodicTask::m_execCount [protected] |
Task execution time measurement count.
Definition at line 460 of file PeriodicTask.h.
unsigned int coil::PeriodicTask::m_execCountMax [protected] |
Task execution time measurement max count.
Definition at line 469 of file PeriodicTask.h.
bool coil::PeriodicTask::m_execMeasure [protected] |
Task execution time measurement flag.
Definition at line 451 of file PeriodicTask.h.
statistics_t coil::PeriodicTask::m_execStat [protected] |
Task execution time measurement statistics.
Definition at line 478 of file PeriodicTask.h.
coil::TimeMeasure coil::PeriodicTask::m_execTime [protected] |
Task execution time measurement infomation.
Definition at line 487 of file PeriodicTask.h.
TaskFuncBase* coil::PeriodicTask::m_func [protected] |
Task execution function.
Definition at line 370 of file PeriodicTask.h.
bool coil::PeriodicTask::m_nowait [protected] |
Thread sleep flag.
Definition at line 361 of file PeriodicTask.h.
coil::TimeValue coil::PeriodicTask::m_period [protected] |
Task execution period.
Definition at line 352 of file PeriodicTask.h.
unsigned int coil::PeriodicTask::m_periodCount [protected] |
Task periodic time measurement count.
Definition at line 505 of file PeriodicTask.h.
unsigned int coil::PeriodicTask::m_periodCountMax [protected] |
Task periodic time measurement max count.
Definition at line 514 of file PeriodicTask.h.
bool coil::PeriodicTask::m_periodMeasure [protected] |
Task periodic time measurement flag.
Definition at line 496 of file PeriodicTask.h.
statistics_t coil::PeriodicTask::m_periodStat [protected] |
Task periodic time measurement statistics.
Definition at line 523 of file PeriodicTask.h.
coil::TimeMeasure coil::PeriodicTask::m_periodTime [protected] |
Task periodic time measurement infomation.
Definition at line 532 of file PeriodicTask.h.
suspend_t coil::PeriodicTask::m_suspend [protected] |
Task suspend infomation.
Definition at line 429 of file PeriodicTask.h.