LuciadCPillar 2023.1.04
|
Interface for a class that can schedule tasks. More...
#include <luciad/concurrent/ITaskScheduler.h>
Public Member Functions | |
virtual | ~ITaskScheduler ()=default |
virtual void | schedule (const std::shared_ptr< ITask > &task)=0 |
Implement this method to execute the given ITask with the desired context. More... | |
Static Public Member Functions | |
static std::shared_ptr< ITaskScheduler > | create (std::function< void(const std::shared_ptr< ITask > &)> function) |
Creates a default ITaskScheduler instance that delegates the ITask handling to the given function. More... | |
Interface for a class that can schedule tasks.
Tasks must implement the ITask
interface. This allows a task consumer to run tasks on a specific thread if needed.
|
virtualdefault |
|
static |
Creates a default ITaskScheduler instance that delegates the ITask handling to the given function.
This is a convenience method that allows to reduce boiler plate code, and use lambdas.
function | the function that is called to execute the ITask. |