Set of small utility classes and functions used in the Async part of LLU.
More...
Set of small utility classes and functions used in the Async part of LLU.
- Author
- Rafal Chojna rafal.nosp@m.c@wo.nosp@m.lfram.nosp@m..com
#include <functional>
#include <future>
#include <memory>
#include <thread>
#include <vector>
Go to the source code of this file.
|
| class | LLU::Async::FunctionWrapper |
| | Wraps an arbitrary callable object (possibly binding its arguments) to be evaluated later. The callable object, when called on provided arguments, must return void. More...
|
| |
| class | LLU::Async::ThreadJoiner |
| | A guard for a vector of threads to make sure they are joined before their destruction. The developer must ensure that the lifetime a ThreadJoiner does not exceed the lifetime of the vector it guards. More...
|
| |
| class | LLU::Async::Pausable |
| | Utility class for pausable task queues. More...
|
| |
|
| | LLU |
| | Main namespace of LibraryLink Utilities.
|
| |
|
| template<typename FunctionType , typename... Args> |
| std::packaged_task< std::invoke_result_t< FunctionType, Args... >)> | LLU::Async::getPackagedTask (FunctionType &&f, Args &&... args) |
| | Create a std::packaged_task from a callable object and arguments to it. More...
|
| |
◆ getPackagedTask()
template<typename FunctionType , typename... Args>
| std::packaged_task<std::invoke_result_t<FunctionType, Args...>)> LLU::Async::getPackagedTask |
( |
FunctionType && |
f, |
|
|
Args &&... |
args |
|
) |
| |
Create a std::packaged_task from a callable object and arguments to it.
- Template Parameters
-
| FunctionType | - arbitrary type of a callable object |
| Args | - paramater pack with function argument types |
- Parameters
-
| f | - callable object |
| args | - arguments for a call to f |
- Returns
- a call to
f with arguments args wrapped in a std::packaged_task