![]() |
vkmEngine 1.0.15
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 (const Fn &task) | |
A batch whose every index is a call of task; addBatch says how many. | |
| template<typename Fn> | |
| Batch (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(). Queued again once waited for, a batch is a member made once, never one rebuilt each frame.
|
inlineexplicit |
A batch whose every index is a call of task; addBatch says how many.
| Fn | Callable taking a size_t index. |
| task | Called once per index, on a worker or in waitForBatch; borrowed, not copied. |