Open Lighting Architecture 0.10.9
Loading...
Searching...
No Matches
ola::thread::SchedulerInterface Class Referenceabstract

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::PluginAdaptor ola::io::SelectServer

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

◆ RegisterRepeatingTimeout() [1/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.

◆ RegisterRepeatingTimeout() [2/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.

◆ RegisterSingleTimeout() [1/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.

◆ RegisterSingleTimeout() [2/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.

◆ 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: