24#ifndef LELY_EV_EXEC_HPP_
25#define LELY_EV_EXEC_HPP_
42 operator ev_exec_t*()
const noexcept {
return exec_; }
63 template <
class F,
class... Args>
64 typename ::std::enable_if<
65 !::std::is_base_of<ev_task, typename ::std::decay<F>::type>::value,
69 ::std::forward<Args>(args)...);
80 template <
class F,
class... Args>
81 typename ::std::enable_if<
82 !::std::is_base_of<ev_task, typename ::std::decay<F>::type>::value>::type
83 post(F&& f, Args&&... args) {
85 ::std::forward<Args>(args)...);
96 template <
class F,
class... Args>
97 typename ::std::enable_if<
98 !::std::is_base_of<ev_task, typename ::std::decay<F>::type>::value>::type
101 ::std::forward<Args>(args)...);
An abstract task executor. This class is a wrapper around #ev_exec_t*.
void on_task_fini() noexcept
typename::std::enable_if<!::std::is_base_of< ev_task, typename::std::decay< F >::type >::value, bool >::type dispatch(F &&f, Args &&... args)
typename::std::enable_if<!::std::is_base_of< ev_task, typename::std::decay< F >::type >::value >::type post(F &&f, Args &&... args)
void on_task_init() noexcept
void defer(ev_task &task) noexcept
bool abort(ev_task &task) noexcept
void run(ev_task &task) noexcept
typename::std::enable_if<!::std::is_base_of< ev_task, typename::std::decay< F >::type >::value >::type defer(F &&f, Args &&... args)
::std::size_t abort_all() noexcept
void post(ev_task &task) noexcept
bool dispatch(ev_task &task) noexcept
Executor get_executor() const noexcept
Returns the executor to which the task is (to be) submitted.
This header file is part of the event library; it contains the abstract task executor interface.
size_t ev_exec_abort(ev_exec_t *exec, struct ev_task *task)
Aborts the specified task submitted to *exec, if it has not yet begun executing, or all pending tasks...
void ev_exec_run(ev_exec_t *exec, struct ev_task *task)
Invokes the task function in *task as if the task is being executed by *exec.
void ev_exec_post(ev_exec_t *exec, struct ev_task *task)
Submits *task to *exec for execution.
void ev_exec_on_task_fini(ev_exec_t *exec)
Undoes the effect of a previous call to ev_exec_on_task_init().
void ev_exec_on_task_init(ev_exec_t *exec)
Indicates to the specified executor that a task will be submitted for execution in the future.
void ev_exec_defer(ev_exec_t *exec, struct ev_task *task)
Submits *task to *exec for execution.
int ev_exec_dispatch(ev_exec_t *exec, struct ev_task *task)
Submits *task to *exec for execution.
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
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 basic C++ task interface.
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).