[#BloombergLP-bslstl-SimplePool] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::SimplePool :relfileprefix: ../../ :mrdocs: Memory pool that allocates blocks of a fixed value type. == Synopsis Declared in `<bslstl_simplepool.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE, class ALLOCATOR> class SimplePool : public SimplePool_Type<ALLOCATOR>::AllocatorType ---- == Description This class provides methods for creating and deleting nodes using the appropriate allocator‐traits of the parameterized `ALLOCATOR`. This type is intended to be used as a private base‐class for a node‐based container, in order to take advantage of the empty‐base‐class optimization in the case where the base‐class has 0 size (as may the case if the parameterized `ALLOCATOR` is not a `bslma::Allocator`). == Base Classes [cols="1,4"] |=== | Name| Description | `SimplePool_Type<ALLOCATOR>::AllocatorType` | |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/SimplePool/AllocatorTraits.adoc[`AllocatorTraits`] | Alias for the allocator traits for the parameterized `ALLOCATOR`. | xref:BloombergLP/bslstl/SimplePool/AllocatorType.adoc[`AllocatorType`] | Alias for the allocator type for a `bsls::AlignmentUtil::MaxAlignedType`. | xref:BloombergLP/bslstl/SimplePool/ValueType.adoc[`ValueType`] | Alias for the parameterized type `VALUE`. | xref:BloombergLP/bslstl/SimplePool/size_type.adoc[`size_type`] | Unsigned integer type measuring pool size. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/SimplePool/2constructor-01.adoc[`SimplePool`] [.small]#[constructor]# | Create a memory pool that adopts the allocations of `original`. | xref:BloombergLP/bslstl/SimplePool/2constructor-0d.adoc[`SimplePool`] [.small]#[constructor]# | Create a memory pool that uses the specified `allocator`. | xref:BloombergLP/bslstl/SimplePool/2destructor.adoc[`~SimplePool`] [.small]#[destructor]# | Destroy this pool, releasing all associated memory back to the underlying allocator. | xref:BloombergLP/bslstl/SimplePool/adopt.adoc[`adopt`] | Adopt all outstanding allocations from the specified `pool`. | xref:BloombergLP/bslstl/SimplePool/allocate.adoc[`allocate`] | Return the address of a block of memory of at least the size of `VALUE`. Note that the memory is _not_ initialized. | xref:BloombergLP/bslstl/SimplePool/allocator-01.adoc[`allocator`] | Return a modifiable reference to this pool's rebound allocator. | xref:BloombergLP/bslstl/SimplePool/allocator-0d.adoc[`allocator`] | Return a non‐modifiable reference to this pool's rebound allocator. | xref:BloombergLP/bslstl/SimplePool/deallocate.adoc[`deallocate`] | Relinquish the memory block at `address` back to this pool. | xref:BloombergLP/bslstl/SimplePool/hasFreeBlocks.adoc[`hasFreeBlocks`] | Return `true` if this object holds free (currently unused) blocks, and `false` otherwise. | xref:BloombergLP/bslstl/SimplePool/quickSwapExchangeAllocators.adoc[`quickSwapExchangeAllocators`] | Exchange this pool's memory blocks and allocator with those of `other`. | xref:BloombergLP/bslstl/SimplePool/quickSwapRetainAllocators.adoc[`quickSwapRetainAllocators`] | Exchange this pool's memory blocks with those of `other`. | xref:BloombergLP/bslstl/SimplePool/release.adoc[`release`] | Relinquish all memory currently allocated via this pool object. | xref:BloombergLP/bslstl/SimplePool/reserve.adoc[`reserve`] | Reserve memory for at least the specified `numBlocks`. | xref:BloombergLP/bslstl/SimplePool/swap.adoc[`swap`] | Exchange this pool's memory blocks with those of `other`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#