Open Lighting Architecture  0.10.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
ola::thread::PeriodicThread Class Reference

Detailed Description

A thread which executes a Callback.

Inheritance diagram for ola::thread::PeriodicThread:
Inheritance graph
[legend]
Collaboration diagram for ola::thread::PeriodicThread:
Collaboration graph
[legend]

Public Types

typedef Callback0< bool > PeriodicCallback
 The callback to run. More...
 

Public Member Functions

 PeriodicThread (const TimeInterval &delay, PeriodicCallback *callback, const Options &options=Options())
 
void Stop ()
 Stop the PeriodicThread. More...
 

Protected Member Functions

void * Run ()
 The entry point for the new thread. More...
 

Member Typedef Documentation

The callback to run.

If false is returned, the thread will stop.

Constructor & Destructor Documentation

ola::thread::PeriodicThread::PeriodicThread ( const TimeInterval delay,
PeriodicCallback callback,
const Options options = Options() 
)
explicit

Create a new PeriodicThread.

Parameters
delayThe delay between invoking the callback.
callbackthe callback to run in the new thread.
optionsthe thread's options.

The thread will start running and immediately run the callback. This may happen before the constructor returns.

Member Function Documentation

void * ola::thread::PeriodicThread::Run ( )
protectedvirtual

The entry point for the new thread.

Returns
A value returned to Join().

Sub classes must implement this.

Implements ola::thread::Thread.

void ola::thread::PeriodicThread::Stop ( )

Stop the PeriodicThread.

This blocks until the thread is no longer running.


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