WSF
WsfThreadPool< Worker, WorkerFactory > Class Template Reference

#include <WsfThreadPool.hpp>

Public Types

typedef std::vector< Worker * > WorkerThreads

Public Member Functions

 WsfThreadPool (const WorkerFactory &aFactory=WorkerFactory())
 ~WsfThreadPool ()
void Start (unsigned int aNumThreads)
void Stop ()
bool AssignWork (size_t aNumTasks=0u)
Worker * FindAvailableThread (double aSleepTime=0.001)
bool AllWorkDone ()
void WaitUntilAllWorkDone ()
bool TryWaitUntilAllWorkDone (double aSecsToWait)

Member Typedef Documentation

◆ WorkerThreads

template<class Worker, class WorkerFactory = WsfThreadPool_DefaultWorkerFactor<Worker>>
typedef std::vector<Worker*> WsfThreadPool< Worker, WorkerFactory >::WorkerThreads

Constructor & Destructor Documentation

◆ WsfThreadPool()

template<class Worker, class WorkerFactory>
WsfThreadPool< Worker, WorkerFactory >::WsfThreadPool ( const WorkerFactory & aFactory = WorkerFactory())

◆ ~WsfThreadPool()

template<class Worker, class WorkerFactory>
WsfThreadPool< Worker, WorkerFactory >::~WsfThreadPool ( )

References Stop().

Member Function Documentation

◆ AllWorkDone()

template<class Worker, class WorkerFactory>
bool WsfThreadPool< Worker, WorkerFactory >::AllWorkDone ( )

References WsfThread::AVAILABLE.

◆ AssignWork()

template<class Worker, class WorkerFactory>
bool WsfThreadPool< Worker, WorkerFactory >::AssignWork ( size_t aNumTasks = 0u)
Parameters
aNumTasksthe number of threads to wake up. use zero to wake up all threads.

◆ FindAvailableThread()

template<class Worker, class WorkerFactory>
Worker * WsfThreadPool< Worker, WorkerFactory >::FindAvailableThread ( double aSleepTime = 0.001)

References WsfThread::AVAILABLE.

◆ Start()

template<class Worker, class WorkerFactory>
void WsfThreadPool< Worker, WorkerFactory >::Start ( unsigned int aNumThreads)

◆ Stop()

template<class Worker, class WorkerFactory>
void WsfThreadPool< Worker, WorkerFactory >::Stop ( )

Referenced by ~WsfThreadPool().

◆ TryWaitUntilAllWorkDone()

template<class Worker, class WorkerFactory>
bool WsfThreadPool< Worker, WorkerFactory >::TryWaitUntilAllWorkDone ( double aSecsToWait)

◆ WaitUntilAllWorkDone()

template<class Worker, class WorkerFactory>
void WsfThreadPool< Worker, WorkerFactory >::WaitUntilAllWorkDone ( )

The documentation for this class was generated from the following file:
Copyrights Multiple, All Rights Reserved