Utility scheduler task using lambda functions to work.
More...
Utility scheduler task using lambda functions to work.
◆ LambdaSchedulerTask() [1/2]
nkTasks::LambdaSchedulerTask::LambdaSchedulerTask |
( |
| ) |
|
|
noexcept |
◆ LambdaSchedulerTask() [2/2]
nkTasks::LambdaSchedulerTask::LambdaSchedulerTask |
( |
std::function< void()> |
asyncWorkFunction, |
|
|
std::function< void()> |
syncFunction |
|
) |
| |
|
noexcept |
Callback constructor.
- Parameters
-
asyncWorkFunction | The callback to call during work. |
syncFunction | The callback to call during synchronization. |
◆ ~LambdaSchedulerTask()
virtual nkTasks::LambdaSchedulerTask::~LambdaSchedulerTask |
( |
| ) |
|
|
virtual |
◆ setAsyncWorkFunction()
void nkTasks::LambdaSchedulerTask::setAsyncWorkFunction |
( |
std::function< void()> |
value | ) |
|
Sets the callback method to be called during the task work.
- Parameters
-
value | The function to call. |
◆ setSyncFunction()
void nkTasks::LambdaSchedulerTask::setSyncFunction |
( |
std::function< void()> |
value | ) |
|
Sets the callback method to be called during the task synchronization.
- Parameters
-
value | The function to call. |
◆ onAsyncWork()
virtual void nkTasks::LambdaSchedulerTask::onAsyncWork |
( |
| ) |
|
|
overridevirtual |
Callback for the work that the task needs to do. This will be called in the thread the task has been assigned to.
Implements nkTasks::Task.
◆ onSync()
virtual void nkTasks::LambdaSchedulerTask::onSync |
( |
| ) |
|
|
overridevirtual |
Method called during synchronization, after the task's asynchronous work has been done. The call happens during the call to Scheduler::tick when a task is marked as ready.
Implements nkTasks::SchedulerTask.
The documentation for this class was generated from the following file: