Apollo  6.0
Open source self driving car software
Public Member Functions | List of all members
ctpl::thread_pool Class Reference

#include <ctpl.h>

Collaboration diagram for ctpl::thread_pool:
Collaboration graph

Public Member Functions

 thread_pool ()
 
 thread_pool (int nThreads, int queueSize=_ctplThreadPoolLength_)
 
 ~thread_pool ()
 
void start (int nThreads)
 
int size ()
 
int n_idle ()
 
std::thread & get_thread (int i)
 
void resize (int nThreads)
 
void clear_queue ()
 
std::function< void(int)> pop ()
 
void stop (bool isWait=false)
 
template<typename F , typename... Rest>
auto push (F &&f, Rest &&... rest) -> std::future< decltype(f(0, rest...))>
 
template<typename F >
auto push (F &&f) -> std::future< decltype(f(0))>
 
 thread_pool ()
 
 thread_pool (int nThreads)
 
 ~thread_pool ()
 
int size ()
 
int n_idle ()
 
std::thread & get_thread (int i)
 
void resize (int nThreads)
 
void clear_queue ()
 
std::function< void(int)> pop ()
 
void stop (bool isWait=false)
 
template<typename F , typename... Rest>
auto push (F &&f, Rest &&... rest) -> std::future< decltype(f(0, rest...))>
 
template<typename F >
auto push (F &&f) -> std::future< decltype(f(0))>
 

Constructor & Destructor Documentation

◆ thread_pool() [1/4]

ctpl::thread_pool::thread_pool ( )
inline

◆ thread_pool() [2/4]

ctpl::thread_pool::thread_pool ( int  nThreads,
int  queueSize = _ctplThreadPoolLength_ 
)
inlineexplicit

◆ ~thread_pool() [1/2]

ctpl::thread_pool::~thread_pool ( )
inline

◆ thread_pool() [3/4]

ctpl::thread_pool::thread_pool ( )
inline

◆ thread_pool() [4/4]

ctpl::thread_pool::thread_pool ( int  nThreads)
inlineexplicit

◆ ~thread_pool() [2/2]

ctpl::thread_pool::~thread_pool ( )
inline

Member Function Documentation

◆ clear_queue() [1/2]

void ctpl::thread_pool::clear_queue ( )
inline

◆ clear_queue() [2/2]

void ctpl::thread_pool::clear_queue ( )
inline

◆ get_thread() [1/2]

std::thread& ctpl::thread_pool::get_thread ( int  i)
inline

◆ get_thread() [2/2]

std::thread& ctpl::thread_pool::get_thread ( int  i)
inline

◆ n_idle() [1/2]

int ctpl::thread_pool::n_idle ( )
inline

◆ n_idle() [2/2]

int ctpl::thread_pool::n_idle ( )
inline

◆ pop() [1/2]

std::function<void(int)> ctpl::thread_pool::pop ( )
inline

◆ pop() [2/2]

std::function<void(int)> ctpl::thread_pool::pop ( )
inline

◆ push() [1/4]

template<typename F , typename... Rest>
auto ctpl::thread_pool::push ( F &&  f,
Rest &&...  rest 
) -> std::future<decltype(f(0, rest...))>
inline

◆ push() [2/4]

template<typename F >
auto ctpl::thread_pool::push ( F &&  f) -> std::future<decltype(f(0))>
inline

◆ push() [3/4]

template<typename F , typename... Rest>
auto ctpl::thread_pool::push ( F &&  f,
Rest &&...  rest 
) -> std::future<decltype(f(0, rest...))>
inline

◆ push() [4/4]

template<typename F >
auto ctpl::thread_pool::push ( F &&  f) -> std::future<decltype(f(0))>
inline

◆ resize() [1/2]

void ctpl::thread_pool::resize ( int  nThreads)
inline

◆ resize() [2/2]

void ctpl::thread_pool::resize ( int  nThreads)
inline

◆ size() [1/2]

int ctpl::thread_pool::size ( )
inline

◆ size() [2/2]

int ctpl::thread_pool::size ( )
inline

◆ start()

void ctpl::thread_pool::start ( int  nThreads)
inline

◆ stop() [1/2]

void ctpl::thread_pool::stop ( bool  isWait = false)
inline

◆ stop() [2/2]

void ctpl::thread_pool::stop ( bool  isWait = false)
inline

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