IAtari
Genetic algorithm generating AI capable to play Atari2600 games.
Utils::ThreadGroup Class Reference

An implementation of Thread group. More...

#include <ThreadPool.h>

Public Member Functions

 ThreadGroup (ThreadPool &pool)
 Build a ThreadGroup from a ThreadPool. More...
 
void add_task (F &&f, Args &&... args)
 Add a task to the thread. More...
 
void wait_all ()
 Wait until all task results have a valid value. More...
 

Private Attributes

ThreadPoolm_pool
 
std::vector< std::future< void > > m_taskresults
 

Detailed Description

An implementation of Thread group.

Authors
Jakob Progsch, Václav Zeman

Constructor & Destructor Documentation

◆ ThreadGroup()

Utils::ThreadGroup::ThreadGroup ( ThreadPool pool)
inline

Build a ThreadGroup from a ThreadPool.

Parameters
poolReference ThreadPool

Member Function Documentation

◆ add_task()

Utils::ThreadGroup::add_task ( F &&  f,
Args &&...  args 
)
inline

Add a task to the thread.

Parameters
fAn object f
argsA list of arguments

◆ wait_all()

Utils::ThreadGroup::wait_all ( )
inline

Wait until all task results have a valid value.

Member Data Documentation

◆ m_pool

ThreadPool& Utils::ThreadGroup::m_pool
private

ThreadPool corresponding to this ThreadGroup

◆ m_taskresults

std::vector<std::future<void> > Utils::ThreadGroup::m_taskresults
private

A list of task results


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