Simple pool class template with the following features:
* Get and recycle items. Recycled items will be re-used before creating
new items.
* Fill the free list with a specific number of idle items.
* The number of idle items in the free list can be queried.
A free list does not manage busy items, it only stores a reference to any
idle / free items, making them available for re-use.
TODO:
- Free lists could support limiting, simply by counting the number of
allocated (i.e. busy) items. A count of allocated items would also allow a
length() method (with the same meaning as the method in IPool) to be
implemented.
- Add idle items iterators (safe & unsafe). These could probably share
code with the aggregate pool.
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).
Simple pool class template with the following features: * Get and recycle items. Recycled items will be re-used before creating new items. * Fill the free list with a specific number of idle items. * The number of idle items in the free list can be queried.
A free list does not manage busy items, it only stores a reference to any idle / free items, making them available for re-use.
TODO: - Free lists could support limiting, simply by counting the number of allocated (i.e. busy) items. A count of allocated items would also allow a length() method (with the same meaning as the method in IPool) to be implemented. - Add idle items iterators (safe & unsafe). These could probably share code with the aggregate pool.