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

This class provides methods for creating and destroying nodes using the appropriate allocator&hyphen;traits of the (template parameter) type `ALLOCATOR`&period;

== Synopsis

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

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

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/BidirectionalNodePool/AllocatorType.adoc[`AllocatorType`] 
| Alias for the allocator type defined by `SimplePool`&period;
| xref:BloombergLP/bslstl/BidirectionalNodePool/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/BidirectionalNodePool/2constructor-07.adoc[`BidirectionalNodePool`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslstl/BidirectionalNodePool/adopt.adoc[`adopt`] 
| Adopt all outstanding memory allocations associated with the specified node `pool`&period; The behavior is undefined unless this pool uses the same allocator as that associated with `pool`&period; The behavior is also undefined unless this pool is in the default&hyphen;constructed state&period;
| xref:BloombergLP/bslstl/BidirectionalNodePool/allocator-01.adoc[`allocator`] 
| `allocator` overloads
| xref:BloombergLP/bslstl/BidirectionalNodePool/cloneNode.adoc[`cloneNode`] 
| Allocate a node of the type `BidirectionalNode&lt;VALUE&gt;`, and copy&hyphen;construct an object of the (template parameter) type `VALUE` having the same value as the specified `original` at the `value` attribute of the node&period; Return the address of the node&period; Note that the `next` and `prev` attributes of the returned node will be uninitialized&period;
| xref:BloombergLP/bslstl/BidirectionalNodePool/deleteNode.adoc[`deleteNode`] 
| Destroy the `VALUE` attribute of the specified `linkNode` and return the memory footprint of `linkNode` to this pool for potential reuse&period; The behavior is undefined unless `node` refers to a `bslalg&colon;&colon;BidirectionalNode&lt;VALUE&gt;` that was allocated by this pool&period;
| xref:BloombergLP/bslstl/BidirectionalNodePool/emplaceIntoNewNode.adoc[`emplaceIntoNewNode`] 
| Allocate a node of the type `BidirectionalNode&lt;VALUE&gt;`, and construct in&hyphen;place an object of the (template parameter) type `VALUE` with the specified constructor `arguments`&period; Return the address of the node&period; Note that the `next` and `prev` attributes of the returned node will be uninitialized&period;
| xref:BloombergLP/bslstl/BidirectionalNodePool/moveIntoNewNode.adoc[`moveIntoNewNode`] 
| Allocate a node of the type `BidirectionalNode&lt;VALUE&gt;`, and move&hyphen;construct an object of the (template parameter) type `VALUE` with the (explicitly moved) value indicated by the `value` attribute of the specified `original` link&period; Return the address of the node&period; Note that the `next` and `prev` attributes of the returned node will be uninitialized&period; Also note that the `value` attribute of `original` is left in a valid but unspecified state&period;
| xref:BloombergLP/bslstl/BidirectionalNodePool/release.adoc[`release`] 
| Relinquish all memory currently allocated with the memory pool maintained by this object&period;
| xref:BloombergLP/bslstl/BidirectionalNodePool/reserveNodes.adoc[`reserveNodes`] 
| Add to this pool sufficient memory to satisfy memory requests for at least the specified `numNodes` before the pool replenishes&period; The additional memory is added irrespective of the amount of free memory when called&period; The behavior is undefined unless `0 &lt; numNodes`&period;
| xref:BloombergLP/bslstl/BidirectionalNodePool/swapExchangeAllocators.adoc[`swapExchangeAllocators`] 
| Efficiently exchange the nodes and the allocator of this object with those of the specified `other` object&period; This method provides the no&hyphen;throw exception&hyphen;safety guarantee&period;
| xref:BloombergLP/bslstl/BidirectionalNodePool/swapRetainAllocators.adoc[`swapRetainAllocators`] 
| Efficiently exchange the nodes of this object with those of the specified `other` object&period; This method provides the no&hyphen;throw exception&hyphen;safety guarantee&period; The behavior is undefined unless `allocator() &equals;&equals; other&period;allocator()`&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/swap-0ee.adoc[`swap`]
| Efficiently exchange the nodes of the specified `a` object with those of the specified `b` object&period; This method provides the no&hyphen;throw exception&hyphen;safety guarantee&period; The behavior is undefined unless `a&period;allocator() &equals;&equals; b&period;allocator()`&period;
|===


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