Main Page | Class List | File List | Class Members

Rha::BoundedThreadPool< Q >::Configurator Class Reference

BoundedThreadPool configurator class. More...

#include <BoundedThreadPool.hpp>

List of all members.

Public Types

enum  { defaultMinThreads = 0, defaultMaxThreads = 5, defaultGracefulTermination = 1 }

Public Member Functions

 Configurator ()
 Constructs Configurator with default values used by BoundedThreadPool.

unsigned int minThreads () const
 Returns current value of minimum threads configuration parameter.

ConfiguratorminThreads (unsigned int minThreads)
 Sets the value of minimum threads configuration parameter.

unsigned int maxThreads () const
 Returns current value of maximum threads configuration parameter.

ConfiguratormaxThreads (unsigned int maxThreads)
 Sets the value of maximum threads configuration parameter.

bool gracefulTermination () const
 Returns current value of graceful termination configuration parameter.

ConfiguratorgracefulTermination (bool gracefulTermination)
 Sets the value of graceful termination configuration parameter.


Detailed Description

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

BoundedThreadPool configurator class.

Use Configurator class to pass configuration parameters when creating objects of type BoundedThreadPool. Instance of Configurator class can directly be passed to Scheduler's constructor to customize the behavior of the Executor. BoundedThreadPool uses the following default values:


Constructor & Destructor Documentation

template<class Q>
Rha::BoundedThreadPool< Q >::Configurator::Configurator  )  [inline]
 

Constructs Configurator with default values used by BoundedThreadPool.

Exceptions:
doesn't throw


Member Function Documentation

template<class Q>
Configurator& Rha::BoundedThreadPool< Q >::Configurator::gracefulTermination bool  gracefulTermination  )  [inline]
 

Sets the value of graceful termination configuration parameter.

graceful termination parameter describes the actions taken when executor is instructed to stop processing and exit. If graceful termination flag is true executor will continue to run until all queued tasks are processed. Otherwise, executor will exit immediately, ignoring queued tasks.

Exceptions:
doesn't throw

template<class Q>
bool Rha::BoundedThreadPool< Q >::Configurator::gracefulTermination  )  const [inline]
 

Returns current value of graceful termination configuration parameter.

Exceptions:
doesn't throw

template<class Q>
Configurator& Rha::BoundedThreadPool< Q >::Configurator::maxThreads unsigned int  maxThreads  )  [inline]
 

Sets the value of maximum threads configuration parameter.

Exceptions:
std::invalid_argument if maximum threads < minimum threads or maximum threads < 1

template<class Q>
unsigned int Rha::BoundedThreadPool< Q >::Configurator::maxThreads  )  const [inline]
 

Returns current value of maximum threads configuration parameter.

Exceptions:
doesn't throw

template<class Q>
Configurator& Rha::BoundedThreadPool< Q >::Configurator::minThreads unsigned int  minThreads  )  [inline]
 

Sets the value of minimum threads configuration parameter.

Exceptions:
std::invalid_argument if maximum threads < minimum threads or maximum threads < 1

template<class Q>
unsigned int Rha::BoundedThreadPool< Q >::Configurator::minThreads  )  const [inline]
 

Returns current value of minimum threads configuration parameter.

Exceptions:
doesn't throw


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