Version: 1.0
Public Types | Public Member Functions | List of all members
thread_pool Class Reference

#include <pool.h>

Public Types

using Proc = std::function< void(void)>
 

Public Member Functions

 thread_pool (unsigned int queueDepth=std::thread::hardware_concurrency(), size_t threads=std::thread::hardware_concurrency())
 
 ~thread_pool () noexcept
 
template<typename F , typename... Args>
void enqueue_work (F &&f, Args &&... args)
 
template<typename F , typename... Args>
auto enqueue_task (F &&f, Args &&... args) -> std::future< typename std::result_of< F(Args...)>::type >
 

Detailed Description

Definition at line 13 of file pool.h.

Member Typedef Documentation

◆ Proc

using thread_pool::Proc = std::function<void(void)>

Definition at line 45 of file pool.h.

Constructor & Destructor Documentation

◆ thread_pool()

thread_pool::thread_pool ( unsigned int  queueDepth = std::thread::hardware_concurrency(),
size_t  threads = std::thread::hardware_concurrency() 
)
inline

Definition at line 16 of file pool.h.

◆ ~thread_pool()

thread_pool::~thread_pool ( )
inlinenoexcept

Definition at line 38 of file pool.h.

Member Function Documentation

◆ enqueue_task()

template<typename F , typename... Args>
auto thread_pool::enqueue_task ( F &&  f,
Args &&...  args 
) -> std::future<typename std::result_of<F(Args...)>::type>
inline

Definition at line 54 of file pool.h.

◆ enqueue_work()

template<typename F , typename... Args>
void thread_pool::enqueue_work ( F &&  f,
Args &&...  args 
)
inline

Definition at line 48 of file pool.h.


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