vkmEngine 1.0.15
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::ThreadPool::Batch Class Reference

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ Batch()

template<typename Fn>
Vkm::Engine::ThreadPool::Batch::Batch ( const Fn & task)
inlineexplicit

A batch whose every index is a call of task; addBatch says how many.

Template Parameters
FnCallable taking a size_t index.
Parameters
taskCalled once per index, on a worker or in waitForBatch; borrowed, not copied.

The documentation for this class was generated from the following file: