forpy  2
forpy::ThreadControl Class Reference

#include <ctpl.h>

Public Member Functions

void set_num (size_t n)
 
size_t get_num ()
 
size_t get_idle ()
 
template<typename C , typename F , typename M , typename... Rest>
auto push_move (F &&f, C *c, M &&movable, Rest &&... rest) -> std::future< decltype((c-> *f)(new forpy::Desk(0), movable, rest...))>
 For member functions (with parameters). More...
 
template<typename C , typename F , typename... Rest>
auto push (F &&f, C *c, Rest &&... rest) -> std::future< decltype((c-> *f)(new forpy::Desk(0), rest...))>
 
template<typename F , typename... Rest>
auto push (F &&f, Rest &&... rest) -> std::future< decltype(f(new Desk(0), rest...))>
 
template<typename F >
auto push (F &&f) -> std::future< decltype(f(new Desk(0)))>
 
void stop (const bool &wait=false)
 
 ~ThreadControl ()
 

Static Public Member Functions

static ThreadControlgetInstance ()
 

Private Member Functions

 ThreadControl ()
 
 DISALLOW_COPY_AND_ASSIGN (ThreadControl)
 

Private Attributes

std::unique_ptr< threading::thread_poolttp
 

Detailed Description

Definition at line 300 of file ctpl.h.

Constructor & Destructor Documentation

◆ ThreadControl()

forpy::ThreadControl::ThreadControl ( )
inlineprivate

Definition at line 302 of file ctpl.h.

◆ ~ThreadControl()

forpy::ThreadControl::~ThreadControl ( )
inline

Definition at line 372 of file ctpl.h.

Member Function Documentation

◆ DISALLOW_COPY_AND_ASSIGN()

forpy::ThreadControl::DISALLOW_COPY_AND_ASSIGN ( ThreadControl  )
private

◆ get_idle()

size_t forpy::ThreadControl::get_idle ( )
inline

Definition at line 336 of file ctpl.h.

◆ get_num()

size_t forpy::ThreadControl::get_num ( )
inline

Definition at line 329 of file ctpl.h.

◆ getInstance()

static ThreadControl& forpy::ThreadControl::getInstance ( )
inlinestatic

Definition at line 310 of file ctpl.h.

◆ push() [1/3]

template<typename C , typename F , typename... Rest>
auto forpy::ThreadControl::push ( F &&  f,
C *  c,
Rest &&...  rest 
) -> std::future<decltype((c->*f)(new forpy::Desk(0), rest...))>
inline

Definition at line 351 of file ctpl.h.

◆ push() [2/3]

template<typename F , typename... Rest>
auto forpy::ThreadControl::push ( F &&  f,
Rest &&...  rest 
) -> std::future<decltype(f(new Desk(0), rest...))>
inline

Definition at line 357 of file ctpl.h.

◆ push() [3/3]

template<typename F >
auto forpy::ThreadControl::push ( F &&  f) -> std::future<decltype(f(new Desk(0)))>
inline

Definition at line 363 of file ctpl.h.

◆ push_move()

template<typename C , typename F , typename M , typename... Rest>
auto forpy::ThreadControl::push_move ( F &&  f,
C *  c,
M &&  movable,
Rest &&...  rest 
) -> std::future<decltype((c->*f)(new forpy::Desk(0), movable, rest...))>
inline

For member functions (with parameters).

Definition at line 345 of file ctpl.h.

◆ set_num()

void forpy::ThreadControl::set_num ( size_t  n)
inline

Definition at line 315 of file ctpl.h.

◆ stop()

void forpy::ThreadControl::stop ( const bool &  wait = false)
inline

Definition at line 367 of file ctpl.h.

Member Data Documentation

◆ ttp

std::unique_ptr<threading::thread_pool> forpy::ThreadControl::ttp
private

Definition at line 307 of file ctpl.h.


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