Open Lighting Architecture  Latest Git
Public Member Functions | List of all members
ola::thread::SchedulerInterface Class Referenceabstract

Detailed Description

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

Inheritance diagram for ola::thread::SchedulerInterface:
Inheritance graph
[legend]

Public Member Functions

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

Member Function Documentation

◆ RegisterRepeatingTimeout() [1/2]

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.

◆ RegisterRepeatingTimeout() [2/2]

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.

◆ RegisterSingleTimeout() [1/2]

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.

◆ RegisterSingleTimeout() [2/2]

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.

◆ RemoveTimeout()

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: