cpp-mate  0.7
Helpful library for C++.
CppMate::ThreadPool< R >::State Class Referencefinal

#include <ThreadPool.hpp>

Public Types

using CreateWorker = std::function< std::thread()>
 

Public Member Functions

 State (unsigned maxThreads, CreateWorker createWorker)
 
unsigned getMaxThreads () const
 
unsigned getWorkersCount () const
 
unsigned getPendingTasksCount () const
 
bool hasTasks () const
 
unsigned getWaitingCount () const
 
bool isFinished () const
 
template<typename F , typename... A>
std::future< R > addTask (F &&task, A &&... args)
 
void waitingBegin ()
 
void waitingFinish ()
 
std::packaged_task< R()> takeTask ()
 
std::vector< std::thread > finish ()
 

Member Typedef Documentation

◆ CreateWorker

template<typename R = int>
using CppMate::ThreadPool< R >::State::CreateWorker = std::function<std::thread()>

Constructor & Destructor Documentation

◆ State()

template<typename R = int>
CppMate::ThreadPool< R >::State::State ( unsigned  maxThreads,
CreateWorker  createWorker 
)
inline

Member Function Documentation

◆ addTask()

template<typename R = int>
template<typename F , typename... A>
std::future<R> CppMate::ThreadPool< R >::State::addTask ( F &&  task,
A &&...  args 
)
inline

◆ finish()

template<typename R = int>
std::vector<std::thread> CppMate::ThreadPool< R >::State::finish ( )
inline

◆ getMaxThreads()

template<typename R = int>
unsigned CppMate::ThreadPool< R >::State::getMaxThreads ( ) const
inline

◆ getPendingTasksCount()

template<typename R = int>
unsigned CppMate::ThreadPool< R >::State::getPendingTasksCount ( ) const
inline

◆ getWaitingCount()

template<typename R = int>
unsigned CppMate::ThreadPool< R >::State::getWaitingCount ( ) const
inline

◆ getWorkersCount()

template<typename R = int>
unsigned CppMate::ThreadPool< R >::State::getWorkersCount ( ) const
inline

◆ hasTasks()

template<typename R = int>
bool CppMate::ThreadPool< R >::State::hasTasks ( ) const
inline

◆ isFinished()

template<typename R = int>
bool CppMate::ThreadPool< R >::State::isFinished ( ) const
inline

◆ takeTask()

template<typename R = int>
std::packaged_task<R()> CppMate::ThreadPool< R >::State::takeTask ( )
inline

◆ waitingBegin()

template<typename R = int>
void CppMate::ThreadPool< R >::State::waitingBegin ( )
inline

◆ waitingFinish()

template<typename R = int>
void CppMate::ThreadPool< R >::State::waitingFinish ( )
inline

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