Open Lighting Architecture  0.9.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
ola::thread::SchedulerInterface Class Reference

Detailed Description

Allows Callbacks to be scheduled to run after a specified interval.

Inheritance diagram for ola::thread::SchedulerInterface:
ola::thread::SchedulingExecutorInterface ola::io::SelectServerInterface ola::io::SelectServer ola::PluginAdaptor

Public Member Functions

virtual timeout_id RegisterRepeatingTimeout (unsigned int period, Callback0< bool > *callback)=0
 Execute a callback periodically.
virtual timeout_id RegisterRepeatingTimeout (const ola::TimeInterval &period, Callback0< bool > *callback)=0
 Execute a callback periodically.
virtual timeout_id RegisterSingleTimeout (unsigned int delay, SingleUseCallback0< void > *callback)=0
 Execute a callback after a certain time interval.
virtual timeout_id RegisterSingleTimeout (const ola::TimeInterval &delay, SingleUseCallback0< void > *callback)=0
 Execute a callback after a certain time interval.
virtual void RemoveTimeout (timeout_id id)=0
 Cancel an existing timeout.

Member Function Documentation

virtual timeout_id ola::thread::SchedulerInterface::RegisterRepeatingTimeout ( unsigned int  period,
Callback0< bool > *  callback 
)
pure virtual

Execute a callback periodically.

Parameters
periodthe number of milliseconds between each execution of the callback.
callbackthe callback to run. Ownership is transferred.
Returns
a timeout_id which can be used later to cancel the timeout.
Deprecated:
Use the version that takes a TimeInterval instead.

Returning false from the callback will cause it to be cancelled.

Implemented in ola::io::SelectServer, ola::io::SelectServerInterface, and ola::PluginAdaptor.

virtual timeout_id ola::thread::SchedulerInterface::RegisterRepeatingTimeout ( const ola::TimeInterval period,
Callback0< bool > *  callback 
)
pure virtual

Execute a callback periodically.

Parameters
periodthe time interval between each execution of the callback.
callbackthe callback to run. Ownership is transferred.
Returns
a timeout_id which can be used later to cancel the timeout.

Returning false from the callback will cause it to be cancelled.

Implemented in ola::io::SelectServer, ola::io::SelectServerInterface, and ola::PluginAdaptor.

virtual timeout_id ola::thread::SchedulerInterface::RegisterSingleTimeout ( unsigned int  delay,
SingleUseCallback0< void > *  callback 
)
pure virtual

Execute a callback after a certain time interval.

Parameters
delaythe number of milliseconds before the callback is executed.
callbackthe callback to run. Ownership is transferred.
Returns
a timeout_id which can be used later to cancel the timeout.
Deprecated:
Use the version that takes a TimeInterval instead.

Implemented in ola::io::SelectServer, ola::io::SelectServerInterface, and ola::PluginAdaptor.

virtual timeout_id ola::thread::SchedulerInterface::RegisterSingleTimeout ( const ola::TimeInterval delay,
SingleUseCallback0< void > *  callback 
)
pure virtual

Execute a callback after a certain time interval.

Parameters
delaythe time interval to wait before the callback is executed.
callbackthe callback to run. Ownership is transferred.
Returns
a timeout_id which can be used later to cancel the timeout.

Implemented in ola::io::SelectServer, ola::io::SelectServerInterface, and ola::PluginAdaptor.

virtual void ola::thread::SchedulerInterface::RemoveTimeout ( timeout_id  id)
pure virtual

Cancel an existing timeout.

Parameters
idthe timeout_id returned by a call to RegisterRepeatingTimeout or RegisterSingleTimeout.

Implemented in ola::io::SelectServer, ola::io::SelectServerInterface, and ola::PluginAdaptor.


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