ocean.util.container.pool.ObjectPool

Pool class template which stores class instances, has the following features: * Get and recycle items. Recycled items will be re-used before creating new items. * The total number of items, as well as the number of idle or busy items in the pool can be queried. * A limit can be applied to the pool, which prevents more than the specified number of items from being created. * A specified number of items can be pre-allocated in the pool using the fill() method. * The entire pool can be emptied, returning all items to the idle state, with clear(). * Iteration over all items in the pool, or all busy or idle items. (See further notes in the super class.) * For classes with a default (parameterless) constructor, get() and fill() methods exist which automatically create new pool items, without requiring them to be passed via a lazy argument.

An additional class template exists, the AutoCtorPool, which automatically creates new instances of the specified class by calling the constructor with a fixed set of parameters.

Also see: ocean.util.container.pool.model.IAggregatePool, for more detailed documentation and usage examples.

Members

Aliases

MyPool
alias MyPool = ObjectPool!(Class)
Undocumented in source.

Classes

AutoCtorPool
class AutoCtorPool(T, Args...)

Extends ObjectPool by creating items (instances of T) automatically with "new T(Args)".

Class
class Class
Undocumented in source.
ObjectPool
class ObjectPool(T)

Manages a pool of class instances of type T.

ObjectPoolTester
class ObjectPoolTester
Undocumented in source.

Meta

License

Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. Alternatively, this file may be distributed under the terms of the Tango 3-Clause BSD License (see LICENSE_BSD.txt for details).