Darwin Neuroevolution Framework
Public Member Functions | Public Attributes | List of all members
pp::WorkBatch Struct Reference

A collection of work items to be processed in a fork/join fashion. More...

#include <thread_pool.h>

Public Member Functions

template<class Body >
void pushWork (const Body &body)
 Appends a new WorkItem.
 

Public Attributes

vector< unique_ptr< WorkItem > > work_items
 The set of work items to be processed.
 
size_t work_left = 0
 Used by the work queue to track the progress.
 
atomic< bool > canceled = false
 Cancellation support.
 

Detailed Description

A collection of work items to be processed in a fork/join fashion.

The uses must follow the pattern:

  1. Create an WorkBatch instance
  2. Populate it using pushWork()
  3. Call ThreadPool::processBatch()
See also
WorkItem
ThreadPool

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