![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
A run of tasks addressed by index, queued as one entry. More...
#include <thread_pool.h>
Public Member Functions | |
| template<typename Fn> | |
| Batch (size_t count, const Fn &task) | |
A batch of count tasks, each a call of task with its index. | |
| template<typename Fn> | |
| Batch (size_t count, const Fn &&task)=delete | |
| Refused: a temporary task is gone before a worker reaches it. | |
A run of tasks addressed by index, queued as one entry.
The task is borrowed, not copied, so a batch of any size allocates nothing. The batch and its task must outlive the matching waitForBatch().
|
inline |
A batch of count tasks, each a call of task with its index.
| Fn | Callable taking a size_t index. |
| count | How many indices, counted from 0. |
| task | Called once per index, on a worker or in waitForBatch; borrowed, not copied. |