Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
coil::PeriodicTask Class Reference

PeriodicTask class. More...

#include <PeriodicTask.h>

Inheritance diagram for coil::PeriodicTask:
Inheritance graph
[legend]

List of all members.

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::MutexGuard

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.
TaskFuncBasem_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.

Detailed Description

PeriodicTask class.

Definition at line 61 of file PeriodicTask.h.


Member Typedef Documentation

Definition at line 65 of file PeriodicTask.h.


Constructor & Destructor Documentation

Constructor.

Constructor

Definition at line 32 of file PeriodicTask.cpp.

Destructor.

Destructor

Definition at line 48 of file PeriodicTask.cpp.


Member Function Documentation

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.

Returns:
true: normal start, false: already started or task is not set

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.

Get a result in task execute time measurement.

Implements coil::PeriodicTaskBase.

Definition at line 247 of file PeriodicTask.cpp.

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.

Parameters:
periodExecution period [sec]

Implements coil::PeriodicTaskBase.

Definition at line 159 of file PeriodicTask.cpp.

void coil::PeriodicTask::setPeriod ( TimeValue period) [virtual]

Setting task execution period.

Parameters:
periodExecution 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.

Parameters:
funcSet int (*)() type function pointer

Implements coil::PeriodicTaskBase.

Definition at line 144 of file PeriodicTask.cpp.

template<class O , class F >
bool coil::PeriodicTask::setTask ( O *  obj,
fun 
) [inline]

Setting task execution function.

Parameters:
funcSet int (*)() type function pointer
Returns:
true: successful, false: failed

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.


Member Data Documentation

Task alive flag.

Definition at line 405 of file PeriodicTask.h.

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.

Task execution time measurement flag.

Definition at line 451 of file PeriodicTask.h.

Task execution time measurement statistics.

Definition at line 478 of file PeriodicTask.h.

Task execution time measurement infomation.

Definition at line 487 of file PeriodicTask.h.

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.

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.

Task periodic time measurement flag.

Definition at line 496 of file PeriodicTask.h.

Task periodic time measurement statistics.

Definition at line 523 of file PeriodicTask.h.

Task periodic time measurement infomation.

Definition at line 532 of file PeriodicTask.h.

Task suspend infomation.

Definition at line 429 of file PeriodicTask.h.


The documentation for this class was generated from the following files:


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sun Mar 26 2017 03:37:18