24#ifndef LELY_EV_TASK_HPP_
25#define LELY_EV_TASK_HPP_
40template <
class Invoker>
43 template <
class F,
class...
Args>
51 invoker_(::std::forward<F>(f), ::std::forward<Args>(
args)...) {}
67template <
class F,
class...
Args>
75template <
class F,
class...
Args>
79 ::std::forward<Args>(
args)...);
88 using Signature =
void();
99 if (self->func_) self->func_();
101 func_(::std::forward<F>(f)) {}
109 Task& operator=(
const Task&) =
delete;
115 ::
std::function<Signature> func_;
An abstract task executor. This class is a wrapper around #ev_exec_t*.
Task(ev_exec_t *exec, F &&f)
Constructs a task from a callable object with an associated executor (can be nullptr).
Task(F &&f)
Constructs a task from a callable object.
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
This header file is part of the utilities library; it contains a function object that can be used to ...
ev_exec_t * exec
A pointer to the executor to which the task is (to be) submitted.
This header file is part of the event library; it contains the task declarations.
#define EV_TASK_INIT(exec, func)
The static initializer for ev_task.
TaskWrapper< F, Args... > * make_task_wrapper(ev_exec_t *exec, F &&f, Args &&... args)
Creates a temporary task from a callable object with an associated executor (can be nullptr).