Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
icl_core::thread::PeriodicThread Class Reference

#include <PeriodicThread.h>

Inheritance diagram for icl_core::thread::PeriodicThread:
Inheritance graph
[legend]

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 ()
 
- Public Member Functions inherited from icl_core::thread::Thread
void cancel ()
 
bool checkHardRealtime ()
 
bool execute () const
 
bool executesHardRealtime () const
 
icl_core::String getDescription () const
 
bool isHardRealtime () const
 
void join ()
 
virtual void onStop ()
 
icl_core::ThreadPriority priority () const
 
virtual void run ()=0
 
bool running () const
 
void setDescription (const icl_core::String &description)
 
bool setHardRealtime (bool hard_realtime=true)
 
bool setPriority (icl_core::ThreadPriority priority)
 
bool start ()
 
void stop ()
 
 Thread (const icl_core::String &description, icl_core::ThreadPriority priority=0)
 
icl_core::ThreadId threadId () const
 
const char * threadInfo () const
 
bool threadSelf () const
 
bool wait ()
 
bool wait (const icl_core::TimeStamp &timeout)
 
bool wait (const icl_core::TimeSpan &timeout)
 
virtual ~Thread ()
 

Protected Member Functions

void waitPeriod ()
 
- Protected Member Functions inherited from icl_core::Noncopyable
 Noncopyable ()
 
virtual ~Noncopyable ()
 

Private Member Functions

virtual void makePeriodic ()
 

Private Attributes

PeriodicThreadImplm_impl
 

Additional Inherited Members

- Static Public Member Functions inherited from icl_core::thread::Thread
static icl_core::ThreadId selfId ()
 

Detailed Description

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.

Constructor & Destructor Documentation

icl_core::thread::PeriodicThread::PeriodicThread ( const icl_core::String description,
const icl_core::TimeSpan period,
ThreadPriority  priority = 0 
)

Initializes a periodic thread.

Parameters
descriptionThe thread's description.
periodThe relative period after which the thread is cyclically woken up.
priorityThe 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.

Member Function Documentation

void icl_core::thread::PeriodicThread::makePeriodic ( )
privatevirtual

Makes the thread periodic.

This function is overridden in PeriodicThread.

Reimplemented from icl_core::thread::Thread.

Definition at line 181 of file PeriodicThread.cpp.

icl_core::TimeSpan icl_core::thread::PeriodicThread::period ( ) const

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.

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

Member Data Documentation

PeriodicThreadImpl* icl_core::thread::PeriodicThread::m_impl
private

Definition at line 121 of file PeriodicThread.h.


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


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:59