#include <PeriodicThread.h>
Public Member Functions | |
icl_core::TimeSpan | period () const |
PeriodicThread (const icl_core::String &description, const icl_core::TimeSpan &period, ThreadPriority priority=0) | |
bool | setPeriod (const icl_core::TimeSpan &period) |
virtual | ~PeriodicThread () |
Protected Member Functions | |
void | waitPeriod () |
Private Member Functions | |
virtual void | makePeriodic () |
Private Attributes | |
PeriodicThreadImpl * | m_impl |
Implements a periodic thread.
The thread's main loop can wait until the configured period has elapsed by calling waitPeriod().
Definition at line 55 of file PeriodicThread.h.
icl_core::thread::PeriodicThread::PeriodicThread | ( | const icl_core::String & | description, |
const icl_core::TimeSpan & | period, | ||
ThreadPriority | priority = 0 |
||
) |
Initializes a periodic thread.
description | The thread's description. |
period | The relative period after which the thread is cyclically woken up. |
priority | The thread's priority. |
Definition at line 50 of file PeriodicThread.cpp.
icl_core::thread::PeriodicThread::~PeriodicThread | ( | ) | [virtual] |
Deletes a periodic thread.
Definition at line 106 of file PeriodicThread.cpp.
void icl_core::thread::PeriodicThread::makePeriodic | ( | ) | [private, virtual] |
Makes the thread periodic.
This function is overridden in PeriodicThread.
Reimplemented from icl_core::thread::Thread.
Definition at line 181 of file PeriodicThread.cpp.
Returns the thread's period.
Definition at line 111 of file PeriodicThread.cpp.
bool icl_core::thread::PeriodicThread::setPeriod | ( | const icl_core::TimeSpan & | period | ) |
Changes the thread's period.
true
on success, false
if the period could not be changed. Definition at line 116 of file PeriodicThread.cpp.
void icl_core::thread::PeriodicThread::waitPeriod | ( | ) | [protected] |
Sleep until the end of the current period.
Definition at line 143 of file PeriodicThread.cpp.
Reimplemented from icl_core::thread::Thread.
Definition at line 121 of file PeriodicThread.h.