#include <task.h>
Public Member Functions | |
Task () | |
Task (TaskFunction &&f) | |
Constructs a Task that calls f when executed on a Dispatcher . | |
Task (const Task &)=delete | |
Task & | operator= (const Task &)=delete |
Task (Task &&)=delete | |
Task & | operator= (Task &&)=delete |
void | set_function (TaskFunction &&f) |
void | operator() (Context &ctx, Status status) |
Executes this task. | |
backend::NativeTask & | native_type () |
const backend::NativeTask & | native_type () const |
A Task
represents a unit of work (TaskFunction
) that can be executed on a Dispatcher
. To support various Dispatcher
backends, it wraps a backend::NativeTask
, which contains backend-specific state and methods.
|
inline |
The default constructor creates a Task
without a function. set_function()
must be called before posting the Task
.
|
inline |
Returns the inner NativeTask
containing backend-specific state. Only Dispatcher
backends or non-portable code should call these methods!
|
inline |
Configure the TaskFunction
after construction. This MUST NOT be called while this Task
is pending in a Dispatcher
.