Lely core libraries  2.3.4
task.hpp File Reference

This header file is part of the event library; it contains the basic C++ task interface. More...

#include <lely/ev/task.h>
#include <lely/util/invoker.hpp>
#include <functional>
#include <utility>
Include dependency graph for task.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  lely::ev::detail::TaskWrapper< Invoker >
 
class  lely::ev::Task
 A basic task. More...
 

Typedefs

template<class F , class... Args>
using lely::ev::TaskWrapper = detail::TaskWrapper< util::invoker_t< F, Args... > >
 A helper alias template for the result of lely::ev::make_task_wrapper<F, Args...>().
 

Functions

template<class F , class... Args>
TaskWrapper< F, Args... > * lely::ev::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). More...
 

Detailed Description

This header file is part of the event library; it contains the basic C++ task interface.

See also
lely/ev/task.h
Author
J. S. Seldenthuis jseld.nosp@m.enth.nosp@m.uis@l.nosp@m.ely..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file task.hpp.

Function Documentation

◆ make_task_wrapper()

template<class F , class... Args>
TaskWrapper<F, Args...>* lely::ev::make_task_wrapper ( ev_exec_t exec,
F &&  f,
Args &&...  args 
)
inline

Creates a temporary task from a callable object with an associated executor (can be nullptr).

The task deletes itself after it is run, so it MUST NOT be deleted once it is submitted to an executor.

Definition at line 77 of file task.hpp.