VOX
A little voxel engine
Loading...
Searching...
No Matches
ThreadPoolAccessor Class Reference

#include <ThreadPoolAccessor.hpp>

Collaboration diagram for ThreadPoolAccessor:
Collaboration graph

Public Member Functions

 ThreadPoolAccessor ()
 
 ~ThreadPoolAccessor ()
 
 ThreadPoolAccessor (const ThreadPoolAccessor &)=delete
 
ThreadPoolAccessoroperator= (const ThreadPoolAccessor &)=delete
 
 ThreadPoolAccessor (ThreadPoolAccessor &&)=delete
 
ThreadPoolAccessoroperator= (ThreadPoolAccessor &&)=delete
 
template<typename F >
uint64_t submit (F &&f)
 Submit a task to the threadpool, the task will be executed asynchronously. More...
 
void waitForAll ()
 wait for all tasks to finish More...
 
void waitForFinishedTasks ()
 wait for all finished task More...
 
void waitForTask (uint64_t id)
 wait for a specific task to finish More...
 
void waitForTasks (const std::vector< uint64_t > &ids)
 wait for a list of tasks to finish More...
 

Constructor & Destructor Documentation

◆ ThreadPoolAccessor() [1/3]

ThreadPoolAccessor::ThreadPoolAccessor ( )

◆ ~ThreadPoolAccessor()

ThreadPoolAccessor::~ThreadPoolAccessor ( )

◆ ThreadPoolAccessor() [2/3]

ThreadPoolAccessor::ThreadPoolAccessor ( const ThreadPoolAccessor )
delete

◆ ThreadPoolAccessor() [3/3]

ThreadPoolAccessor::ThreadPoolAccessor ( ThreadPoolAccessor &&  )
delete

Member Function Documentation

◆ operator=() [1/2]

ThreadPoolAccessor & ThreadPoolAccessor::operator= ( const ThreadPoolAccessor )
delete

◆ operator=() [2/2]

ThreadPoolAccessor & ThreadPoolAccessor::operator= ( ThreadPoolAccessor &&  )
delete

◆ submit()

template<typename F >
uint64_t ThreadPoolAccessor::submit ( F &&  f)
inline

Submit a task to the threadpool, the task will be executed asynchronously.

Template Parameters
Freturn type of the function
Parameters
ffunction to execute
Returns
id of the task, you can use this id to wait for the task to finish

◆ waitForAll()

void ThreadPoolAccessor::waitForAll ( )

wait for all tasks to finish

◆ waitForFinishedTasks()

void ThreadPoolAccessor::waitForFinishedTasks ( )

wait for all finished task

◆ waitForTask()

void ThreadPoolAccessor::waitForTask ( uint64_t  id)

wait for a specific task to finish

Parameters
idid of the task to wait for

◆ waitForTasks()

void ThreadPoolAccessor::waitForTasks ( const std::vector< uint64_t > &  ids)

wait for a list of tasks to finish

Parameters
idsstd::vector of ids of the tasks to wait for

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