[#BloombergLP-bslstl-TreeNodePool] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::TreeNodePool :relfileprefix: ../../ :mrdocs: Memory manager that creates and deletes nodes for tree‐based containers. == Synopsis Declared in `<bslstl_treenodepool.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE, class ALLOCATOR> class TreeNodePool; ---- == Description This class provides methods for creating and deleting nodes using the appropriate allocator traits of the (template parameter) type `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 be the case if the (template parameter) type `ALLOCATOR` is not a `bslma::Allocator`). == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/TreeNodePool/AllocatorType.adoc[`AllocatorType`] | Alias for the allocator type defined by `SimplePool`. | xref:BloombergLP/bslstl/TreeNodePool/size_type.adoc[`size_type`] | Alias for the `size_type` of the allocator defined by `SimplePool`. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/TreeNodePool/2constructor-0d.adoc[`TreeNodePool`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bslstl/TreeNodePool/adopt.adoc[`adopt`] | Adopt all outstanding allocations from the specified `pool`. | xref:BloombergLP/bslstl/TreeNodePool/allocator-06.adoc[`allocator`] | `allocator` overloads | xref:BloombergLP/bslstl/TreeNodePool/cloneNode.adoc[`cloneNode`] | Allocate a node and copy‐construct its value from `original`. | xref:BloombergLP/bslstl/TreeNodePool/deleteNode.adoc[`deleteNode`] | Destroy the value of `node` and return its memory to this pool. | xref:BloombergLP/bslstl/TreeNodePool/emplaceIntoNewNode.adoc[`emplaceIntoNewNode`] | Allocate a node and emplace‐construct its value from `args`. | xref:BloombergLP/bslstl/TreeNodePool/hasFreeNodes.adoc[`hasFreeNodes`] | Return `true` if this object holds free (currently unused) nodes, and `false` otherwise. | xref:BloombergLP/bslstl/TreeNodePool/moveIntoNewNode.adoc[`moveIntoNewNode`] | Allocate a node and move‐construct its value from `original`. | xref:BloombergLP/bslstl/TreeNodePool/reserveNodes.adoc[`reserveNodes`] | Reserve memory for at least the specified `numNodes`. | xref:BloombergLP/bslstl/TreeNodePool/swap.adoc[`swap`] | Exchange this pool's nodes with those of `other`. | xref:BloombergLP/bslstl/TreeNodePool/swapExchangeAllocators.adoc[`swapExchangeAllocators`] | Exchange this pool's nodes and allocator with those of `other`. | xref:BloombergLP/bslstl/TreeNodePool/swapRetainAllocators.adoc[`swapRetainAllocators`] | Exchange this pool's nodes with those of `other`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#