[#BloombergLP-bslstl-TreeNodePool]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::TreeNodePool
:relfileprefix: ../../
:mrdocs:

Memory manager that creates and deletes nodes for tree&hyphen;based containers&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;treenodepool&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE,
    class ALLOCATOR&gt;
class TreeNodePool;
----

== Description

This class provides methods for creating and deleting nodes using the appropriate allocator traits of the (template parameter) type `ALLOCATOR`&period; This type is intended to be used as a private base&hyphen;class for a node&hyphen;based container, in order to take advantage of the empty&hyphen;base&hyphen;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&colon;&colon;Allocator`)&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/TreeNodePool/AllocatorType.adoc[`AllocatorType`] 
| Alias for the allocator type defined by `SimplePool`&period;
| xref:BloombergLP/bslstl/TreeNodePool/size_type.adoc[`size&lowbar;type`] 
| Alias for the `size&lowbar;type` of the allocator defined by `SimplePool`&period;
|===


== 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`&period;
| xref:BloombergLP/bslstl/TreeNodePool/allocator-06.adoc[`allocator`] 
| `allocator` overloads
| xref:BloombergLP/bslstl/TreeNodePool/cloneNode.adoc[`cloneNode`] 
| Allocate a node and copy&hyphen;construct its value from `original`&period;
| xref:BloombergLP/bslstl/TreeNodePool/deleteNode.adoc[`deleteNode`] 
| Destroy the value of `node` and return its memory to this pool&period;
| xref:BloombergLP/bslstl/TreeNodePool/emplaceIntoNewNode.adoc[`emplaceIntoNewNode`] 
| Allocate a node and emplace&hyphen;construct its value from `args`&period;
| xref:BloombergLP/bslstl/TreeNodePool/hasFreeNodes.adoc[`hasFreeNodes`] 
| Return `true` if this object holds free (currently unused) nodes, and `false` otherwise&period;
| xref:BloombergLP/bslstl/TreeNodePool/moveIntoNewNode.adoc[`moveIntoNewNode`] 
| Allocate a node and move&hyphen;construct its value from `original`&period;
| xref:BloombergLP/bslstl/TreeNodePool/reserveNodes.adoc[`reserveNodes`] 
| Reserve memory for at least the specified `numNodes`&period;
| xref:BloombergLP/bslstl/TreeNodePool/swap.adoc[`swap`] 
| Exchange this pool&apos;s nodes with those of `other`&period;
| xref:BloombergLP/bslstl/TreeNodePool/swapExchangeAllocators.adoc[`swapExchangeAllocators`] 
| Exchange this pool&apos;s nodes and allocator with those of `other`&period;
| xref:BloombergLP/bslstl/TreeNodePool/swapRetainAllocators.adoc[`swapRetainAllocators`] 
| Exchange this pool&apos;s nodes with those of `other`&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
