#include <pool.h>
Public Member Functions | |
Factory (size_t max_threads, const std::string &name, unsigned int min_debug_level=0, Debugable *debug_master=0) | |
Create a new factory with assciated pool. | |
virtual | ~Factory () |
Pool & | pool () |
size_t | size () const |
size_t | slack () const |
Protected Member Functions | |
virtual Pool::Thread * | create ()=0 |
Create a new Thread. | |
bool | initialize (time_t millisecs=5000) |
Initialize the pool of this factory. | |
bool | finalize (time_t millisecs=5000) |
Finalize the pool of this factory. | |
Private Attributes | |
Pool | pool_ |
Friends | |
class | Pool |
Dv::Thread::Factory::Factory | ( | size_t | max_threads, | |
const std::string & | name, | |||
unsigned int | min_debug_level = 0 , |
|||
Debugable * | debug_master = 0 | |||
) | [inline] |
Create a new factory with assciated pool.
The constructor of the user's class derived from this class should call Dv::Thread::Factory::initialize, see the comments for Dv::Thread::Pool::initialize.
max_threads | number of threads that will be kept in the pool. | |
name | for the pool's monitor. | |
min_debug_level | if a debug_master is connected, logging info will only be written if the master's level is at least min_debug_level | |
debug_master | from where debug info will be taken |
virtual Dv::Thread::Factory::~Factory | ( | ) | [inline, virtual] |
References FUNCTION_S, and Dv::Debugable::log().
Pool& Dv::Thread::Factory::pool | ( | ) | [inline] |
References pool_.
Referenced by finalize(), and initialize().
size_t Dv::Thread::Factory::size | ( | ) | const [inline] |
References pool_, and Dv::Thread::Pool::size().
size_t Dv::Thread::Factory::slack | ( | ) | const [inline] |
References pool_, and Dv::Thread::Pool::slack().
virtual Pool::Thread* Dv::Thread::Factory::create | ( | ) | [protected, pure virtual] |
Create a new Thread.
bool Dv::Thread::Factory::initialize | ( | time_t | millisecs = 5000 |
) | [inline, protected] |
Initialize the pool of this factory.
References Dv::Thread::Pool::initialize(), and pool().
bool Dv::Thread::Factory::finalize | ( | time_t | millisecs = 5000 |
) | [inline, protected] |
Finalize the pool of this factory.
References Dv::Thread::Pool::finalize(), and pool().
friend class Pool [friend] |
Pool Dv::Thread::Factory::pool_ [private] |
dvthread-0.13.4 | [11 December, 2009] |