Borrowed type-erased description of a synchronous lightweight task batch.
More...
#include <scheduler.hpp>
|
| void | operator() (std::size_t index) const |
| | Execute one work item.
|
| |
| auto | size () const noexcept -> std::size_t |
| | Return the number of independent work items.
|
| |
|
template<class Function >
requires std::invocable<Function&, std::size_t> |
| static auto | bind (std::size_t size, Function &function) -> LightweightTaskBatch |
| | Bind a callable for the duration of one synchronous batch call.
|
| |
Borrowed type-erased description of a synchronous lightweight task batch.
The callable and its arguments remain owned by the caller. Scheduler implementations may invoke distinct indices concurrently, but this object is valid only until IAsyncScheduler::execute_batch returns.
◆ bind()
template<class Function >
requires std::invocable<Function&, std::size_t>
| static auto uni20::async::LightweightTaskBatch::bind |
( |
std::size_t |
size, |
|
|
Function & |
function |
|
) |
| -> LightweightTaskBatch
|
|
inlinestatic |
Bind a callable for the duration of one synchronous batch call.
- Template Parameters
-
| Function | Callable accepting one std::size_t index. |
- Parameters
-
| size | Number of work items. |
| function | Callable borrowed by the returned descriptor. |
◆ operator()()
| void uni20::async::LightweightTaskBatch::operator() |
( |
std::size_t |
index | ) |
const |
|
inline |
Execute one work item.
- Parameters
-
| index | Work-item index in [0, size()). |
◆ size()
| auto uni20::async::LightweightTaskBatch::size |
( |
| ) |
const -> std::size_t |
|
inlinenoexcept |
Return the number of independent work items.
The documentation for this class was generated from the following file: