BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsl::Deque_BlockCreator< VALUE_TYPE, ALLOCATOR > Class Template Reference

#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 ()
 

Detailed Description

template<class VALUE_TYPE, class ALLOCATOR>
class bsl::Deque_BlockCreator< VALUE_TYPE, ALLOCATOR >

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

Constructor & Destructor Documentation

◆ Deque_BlockCreator()

template<class VALUE_TYPE , class ALLOCATOR >
bsl::Deque_BlockCreator< VALUE_TYPE, ALLOCATOR >::Deque_BlockCreator ( deque< VALUE_TYPE, ALLOCATOR > *  deque)
inlineexplicit

◆ ~Deque_BlockCreator()

template<class VALUE_TYPE , class ALLOCATOR >
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.

Member Function Documentation

◆ insertAtBack()

template<class VALUE_TYPE , class ALLOCATOR >
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.

◆ insertAtFront()

template<class VALUE_TYPE , class ALLOCATOR >
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.

◆ release()

template<class VALUE_TYPE , class ALLOCATOR >
void bsl::Deque_BlockCreator< VALUE_TYPE, ALLOCATOR >::release ( )
inline

Relinquish control over any allocated blocks. The destructor will do nothing following a call to this method.

◆ reserveBlockSlots()

template<class VALUE_TYPE , class ALLOCATOR >
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.


The documentation for this class was generated from the following file: