BDE 4.14.0 Production release
|
#include <bslstl_deque.h>
Public Member Functions | |
Deque_BlockCreator (deque< VALUE_TYPE, ALLOCATOR > *deque) | |
Construct a block allocator for the specified deque . | |
~Deque_BlockCreator () | |
void | insertAtFront (size_type n) |
void | insertAtBack (size_type n) |
BlockPtr * | reserveBlockSlots (size_type numNewBlocks, bool atFront) |
void | release () |
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).
See bslstl_deque
|
inlineexplicit |
bsl::Deque_BlockCreator< VALUE_TYPE, ALLOCATOR >::~Deque_BlockCreator | ( | ) |
Free any blocks that have been allocated by this allocator but have not yet been used by the deque.
void bsl::Deque_BlockCreator< VALUE_TYPE, ALLOCATOR >::insertAtBack | ( | size_type | n | ) |
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
.
void bsl::Deque_BlockCreator< VALUE_TYPE, ALLOCATOR >::insertAtFront | ( | size_type | n | ) |
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
.
|
inline |
Relinquish control over any allocated blocks. The destructor will do nothing following a call to this method.
Deque_BlockCreator< VALUE_TYPE, ALLOCATOR >::BlockPtr * bsl::Deque_BlockCreator< VALUE_TYPE, ALLOCATOR >::reserveBlockSlots | ( | size_type | numNewBlocks, |
bool | atFront | ||
) |
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
.