[#bsl-Deque_BlockCreator] = xref:bsl.adoc[bsl]::Deque_BlockCreator :relfileprefix: ../ :mrdocs: This class allocates blocks at the front or back of a deque and tentatively adds them to the deque. It also keeps track of how many of the newly allocated blocks have actually been used by the deque. The destructor automatically frees any unused blocks (e.g., in case an exception is thrown). == Synopsis Declared in `<bslstl_deque.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE_TYPE, class ALLOCATOR> class Deque_BlockCreator; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/Deque_BlockCreator/2constructor.adoc[`Deque_BlockCreator`] [.small]#[constructor]# | Construct a block allocator for the specified `deque`. | xref:bsl/Deque_BlockCreator/2destructor.adoc[`~Deque_BlockCreator`] [.small]#[destructor]# | Free any blocks that have been allocated by this allocator but have not yet been used by the deque. | xref:bsl/Deque_BlockCreator/insertAtBack.adoc[`insertAtBack`] | Allocate the specified `n` blocks at the back of the block array. This method invalidates all iterators except `d_deque_p‐>d_start` and `d_deque_p‐>d_finish`. | xref:bsl/Deque_BlockCreator/insertAtFront.adoc[`insertAtFront`] | Allocate the specified `n` blocks at the front of the block array. This method invalidates all iterators except `d_deque_p‐>d_start` and `d_deque_p‐>d_finish`. | xref:bsl/Deque_BlockCreator/release.adoc[`release`] | Relinquish control over any allocated blocks. The destructor will do nothing following a call to this method. | xref:bsl/Deque_BlockCreator/reserveBlockSlots.adoc[`reserveBlockSlots`] | Make room for the specified `numNewBlocks` pointers in the blocks array. If the specified `atFront` is `true`, then make room at the front of the array, else make room at the back of the array. Return a pointer to the insertion point, i.e., the point where new blocks can be stored into the array, working backwards if `atFront` is `true`, or working forwards if `atFront` is `false`. This method invalidates all iterators and updates `d_deque_p‐>d_start` and `d_deque_p‐>d_finish`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#