Pool Class Template Reference
#include <cxxtools/pool.h>
List of all members.
|
Public Member Functions |
|
| Pool (unsigned maxSpare_=0, CreatorType creator_=CreatorType()) |
|
| Pool (CreatorType creator_) |
|
Ptr | get () |
|
void | drop (unsigned keep=0) |
|
unsigned | getMaximumSize () const |
|
unsigned | size () const |
|
unsigned | getCurrentSize () const |
|
void | setMaximumSize (unsigned s) |
|
CreatorType & | getCreator () |
|
const CreatorType & | getCreator () const |
Classes |
| class | Ptr |
Detailed Description
template<typename ObjectType, typename CreatorType = DefaultCreator<ObjectType>, template< class > class OwnershipPolicy = RefLinked, template< class > class DestroyPolicy = DeletePolicy>
class cxxtools::Pool< ObjectType, CreatorType, OwnershipPolicy, DestroyPolicy >
A
Pool is a container for pooled objects.
It maintains a list of object instances, which are not in use. If a program needs a instance, it can request one with the get-method. The pool returns a smart pointer to an instance. When the pointer is released, the instance is put back into the pool or dropped, if the pool has already a maximum number of instances.