Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
coil::PeriodicTask Class Reference

PeriodicTask class. More...

#include <PeriodicTask.h>

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

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. More...
 
virtual void executionMeasure (bool value)
 Validate a Task execute time measurement. More...
 
virtual void executionMeasureCount (int n)
 Task execute time measurement period. More...
 
virtual void finalize ()
 Finalizing the task. More...
 
virtual TimeMeasure::Statistics getExecStat ()
 Get a result in task execute time measurement. More...
 
virtual TimeMeasure::Statistics getPeriodStat ()
 Get a result in task period time measurement. More...
 
virtual void periodicMeasure (bool value)
 Validate a Task period time measurement. More...
 
virtual void periodicMeasureCount (int n)
 Task period time measurement count. More...
 
 PeriodicTask ()
 Constructor. More...
 
virtual int resume (void)
 Resuming the suspended task. More...
 
virtual void setPeriod (double period)
 Setting task execution period. More...
 
virtual void setPeriod (TimeValue &period)
 Setting task execution period. More...
 
virtual bool setTask (TaskFuncBase *func, bool delete_in_dtor=true)
 Setting task execution function. More...
 
template<class O , class F >
bool setTask (O *obj, F fun)
 Setting task execution function. More...
 
virtual void signal ()
 Executing the suspended task one tick. More...
 
virtual int suspend (void)
 Suspending the task. More...
 
virtual ~PeriodicTask ()
 Destructor. More...
 
- Public Member Functions inherited from coil::PeriodicTaskBase
template<class O , class F >
bool setTask (O *obj, F fun)
 Setting task execution function. More...
 
virtual ~PeriodicTaskBase ()
 Destructor. More...
 
- Public Member Functions inherited from coil::Task
virtual int close (unsigned long flags=0)
 Task close. More...
 
virtual int close (unsigned long flags=0)
 Task close. More...
 
virtual int open (void *args=0)
 Task open. More...
 
virtual int open (void *args=0)
 Task open. More...
 
virtual void reset ()
 Reset of task count. More...
 
virtual void reset ()
 Reset of task count. More...
 
 Task ()
 Constructor. More...
 
 Task ()
 Constructor. More...
 
virtual int wait (void)
 Waiting for the thread terminate. More...
 
virtual int wait (void)
 Waiting for the thread terminate. More...
 
virtual ~Task ()
 Destructor. More...
 
virtual ~Task ()
 Destructor. More...
 

Protected Member Functions

virtual void sleep ()
 Thread sleep. More...
 
virtual int svc ()
 Thread execution for PeriodicTask. More...
 
virtual void updateExecStat ()
 Update for execute state. More...
 
virtual void updatePeriodStat ()
 Update for period state. More...
 

Protected Attributes

alive_t m_alive
 Task alive flag. More...
 
bool m_deleteInDtor
 Task execution function delete flag. More...
 
unsigned int m_execCount
 Task execution time measurement count. More...
 
unsigned int m_execCountMax
 Task execution time measurement max count. More...
 
bool m_execMeasure
 Task execution time measurement flag. More...
 
statistics_t m_execStat
 Task execution time measurement statistics. More...
 
coil::TimeMeasure m_execTime
 Task execution time measurement infomation. More...
 
TaskFuncBasem_func
 Task execution function. More...
 
bool m_nowait
 Thread sleep flag. More...
 
coil::TimeValue m_period
 Task execution period. More...
 
unsigned int m_periodCount
 Task periodic time measurement count. More...
 
unsigned int m_periodCountMax
 Task periodic time measurement max count. More...
 
bool m_periodMeasure
 Task periodic time measurement flag. More...
 
statistics_t m_periodStat
 Task periodic time measurement statistics. More...
 
coil::TimeMeasure m_periodTime
 Task periodic time measurement infomation. More...
 
suspend_t m_suspend
 Task suspend infomation. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from coil::Task
static void * svc_run (void *args=0)
 Start thread Execution. More...
 
static unsigned int WINAPI svc_run (void *args=0)
 Start thread Execution. More...
 

Detailed Description

PeriodicTask class.

Definition at line 61 of file PeriodicTask.h.

Member Typedef Documentation

◆ Guard

Definition at line 65 of file PeriodicTask.h.

Constructor & Destructor Documentation

◆ PeriodicTask()

coil::PeriodicTask::PeriodicTask ( )

Constructor.

Constructor

Definition at line 32 of file PeriodicTask.cpp.

◆ ~PeriodicTask()

coil::PeriodicTask::~PeriodicTask ( )
virtual

Destructor.

Destructor

Definition at line 48 of file PeriodicTask.cpp.

Member Function Documentation

◆ activate()

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.

◆ executionMeasure()

void coil::PeriodicTask::executionMeasure ( bool  value)
virtual

Validate a Task execute time measurement.

Implements coil::PeriodicTaskBase.

Definition at line 199 of file PeriodicTask.cpp.

◆ executionMeasureCount()

void coil::PeriodicTask::executionMeasureCount ( int  n)
virtual

Task execute time measurement period.

Implements coil::PeriodicTaskBase.

Definition at line 211 of file PeriodicTask.cpp.

◆ finalize()

void coil::PeriodicTask::finalize ( )
virtual

Finalizing the task.

Finalizing the task running.

Implements coil::PeriodicTaskBase.

Definition at line 82 of file PeriodicTask.cpp.

◆ getExecStat()

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.

◆ getPeriodStat()

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.

◆ periodicMeasure()

void coil::PeriodicTask::periodicMeasure ( bool  value)
virtual

Validate a Task period time measurement.

Implements coil::PeriodicTaskBase.

Definition at line 223 of file PeriodicTask.cpp.

◆ periodicMeasureCount()

void coil::PeriodicTask::periodicMeasureCount ( int  n)
virtual

Task period time measurement count.

Implements coil::PeriodicTaskBase.

Definition at line 235 of file PeriodicTask.cpp.

◆ resume()

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.

◆ setPeriod() [1/2]

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.

◆ setPeriod() [2/2]

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.

◆ setTask() [1/2]

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.

◆ setTask() [2/2]

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

Definition at line 218 of file PeriodicTask.h.

◆ signal()

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.

◆ sleep()

void coil::PeriodicTask::sleep ( )
protectedvirtual

Thread sleep.

Definition at line 319 of file PeriodicTask.cpp.

◆ suspend()

int coil::PeriodicTask::suspend ( void  )
virtual

Suspending the task.

Suspending the task running.

Implements coil::PeriodicTaskBase.

Definition at line 99 of file PeriodicTask.cpp.

◆ svc()

int coil::PeriodicTask::svc ( void  )
protectedvirtual

Thread execution for PeriodicTask.

Reimplemented from coil::Task.

Definition at line 276 of file PeriodicTask.cpp.

◆ updateExecStat()

void coil::PeriodicTask::updateExecStat ( )
protectedvirtual

Update for execute state.

Definition at line 335 of file PeriodicTask.cpp.

◆ updatePeriodStat()

void coil::PeriodicTask::updatePeriodStat ( )
protectedvirtual

Update for period state.

Definition at line 353 of file PeriodicTask.cpp.

Member Data Documentation

◆ m_alive

alive_t coil::PeriodicTask::m_alive
protected

Task alive flag.

Definition at line 405 of file PeriodicTask.h.

◆ m_deleteInDtor

bool coil::PeriodicTask::m_deleteInDtor
protected

Task execution function delete flag.

Definition at line 379 of file PeriodicTask.h.

◆ m_execCount

unsigned int coil::PeriodicTask::m_execCount
protected

Task execution time measurement count.

Definition at line 460 of file PeriodicTask.h.

◆ m_execCountMax

unsigned int coil::PeriodicTask::m_execCountMax
protected

Task execution time measurement max count.

Definition at line 469 of file PeriodicTask.h.

◆ m_execMeasure

bool coil::PeriodicTask::m_execMeasure
protected

Task execution time measurement flag.

Definition at line 451 of file PeriodicTask.h.

◆ m_execStat

statistics_t coil::PeriodicTask::m_execStat
protected

Task execution time measurement statistics.

Definition at line 478 of file PeriodicTask.h.

◆ m_execTime

coil::TimeMeasure coil::PeriodicTask::m_execTime
protected

Task execution time measurement infomation.

Definition at line 487 of file PeriodicTask.h.

◆ m_func

TaskFuncBase* coil::PeriodicTask::m_func
protected

Task execution function.

Definition at line 370 of file PeriodicTask.h.

◆ m_nowait

bool coil::PeriodicTask::m_nowait
protected

Thread sleep flag.

Definition at line 361 of file PeriodicTask.h.

◆ m_period

coil::TimeValue coil::PeriodicTask::m_period
protected

Task execution period.

Definition at line 352 of file PeriodicTask.h.

◆ m_periodCount

unsigned int coil::PeriodicTask::m_periodCount
protected

Task periodic time measurement count.

Definition at line 505 of file PeriodicTask.h.

◆ m_periodCountMax

unsigned int coil::PeriodicTask::m_periodCountMax
protected

Task periodic time measurement max count.

Definition at line 514 of file PeriodicTask.h.

◆ m_periodMeasure

bool coil::PeriodicTask::m_periodMeasure
protected

Task periodic time measurement flag.

Definition at line 496 of file PeriodicTask.h.

◆ m_periodStat

statistics_t coil::PeriodicTask::m_periodStat
protected

Task periodic time measurement statistics.

Definition at line 523 of file PeriodicTask.h.

◆ m_periodTime

coil::TimeMeasure coil::PeriodicTask::m_periodTime
protected

Task periodic time measurement infomation.

Definition at line 532 of file PeriodicTask.h.

◆ m_suspend

suspend_t coil::PeriodicTask::m_suspend
protected

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 Mon Feb 28 2022 23:00:46