Main Page | Class List | File List | Class Members

Rha::BoundedThreadPool< Q > Class Template Reference

Bounded thread pool executor implementation. More...

#include <BoundedThreadPool.hpp>

List of all members.

Public Types

typedef BoundedThreadPool< Q > OfType
typedef Q::Task Task
typedef Q Queue

Public Member Functions

 BoundedThreadPool ()
 Constructs BoundedThreadPool with default configurator.

 BoundedThreadPool (const OfType &exec)
 Constructs BoundedThreadPool using configuration from passed BoundedThreadPool object.

 BoundedThreadPool (const Configurator &config)
 Constructs BoundedThreadPool using supplied configuration object.

 ~BoundedThreadPool ()
 Destructs instance of BoundedThreadPool object.

void setUp (Queue *queuePtr)
 Initializes execution environemnt.

void operator() (const Task &task)
 Pass-through for tasks that will be put on the Queue.


Detailed Description

template<class Q>
class Rha::BoundedThreadPool< Q >

Bounded thread pool executor implementation.

Use BoundedThreadPool class to create objects that will serve as bounded task executors. Executor communicates with the Queue to pick up pending tasks and assigns threads for tasks execution. Additionally, it manages a pool of threads to further minimize system resources needed for executing multiple tasks.


Constructor & Destructor Documentation

template<class Q>
BoundedThreadPool::BoundedThreadPool const OfType &  exec  ) 
 

Constructs BoundedThreadPool using configuration from passed BoundedThreadPool object.

Parameters:
exec instance of BoundedThreadPool object from which configuration will be read to initialize this.

template<class Q>
BoundedThreadPool::BoundedThreadPool const Configurator config  ) 
 

Constructs BoundedThreadPool using supplied configuration object.

Parameters:
config instance of Configurator object from which configuration will be read to initialize this.

template<class Q>
BoundedThreadPool::~BoundedThreadPool  ) 
 

Destructs instance of BoundedThreadPool object.

It waits for each worker thread to exit before returning.

Attention:
Declared as non-virtual.


Member Function Documentation

template<class Q>
void BoundedThreadPool::operator() const Task &  task  ) 
 

Pass-through for tasks that will be put on the Queue.

Parameters:
task scheduled task.

template<class Q>
void BoundedThreadPool::setUp Queue *  queuePtr  ) 
 

Initializes execution environemnt.

Called just before Scheduler begins queing tasks. It may create warm threads if minimum threads parameter is non-zero.

Parameters:
queuePtr pointer to queue on which tasks will be scheduled.


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