Open Lighting Architecture: ola::thread::PeriodicThread Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
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:

## Public Types
typedef Callback0< bool > | PeriodicCallback
| The callback to run.

## Public Member Functions
| PeriodicThread (const TimeInterval &delay, PeriodicCallback *callback, const Options &options=Options())
void | Stop ()
| Stop the PeriodicThread.

## Protected Member Functions
void * | Run ()
| The entry point for the new thread.

## Member Typedef Documentation

## ◆ PeriodicCallback

typedef Callback0<bool> ola::thread::PeriodicThread::PeriodicCallback

The callback to run.

If false is returned, the thread will stop.

## Constructor & Destructor Documentation

## ◆ PeriodicThread()

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

Create a new PeriodicThread.

Parameters

  delay | The delay between invoking the callback.
  callback | the callback to run in the new thread.
  options | the thread's options.

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

## Member Function Documentation

## ◆ Run()

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.

## ◆ Stop()

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:

- include/ola/thread/PeriodicThread.h
- common/thread/PeriodicThread.cpp