Nugget
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
eastl::deque< T, Allocator, kDequeSubarraySize > Class Template Reference

#include <deque.h>

Inheritance diagram for eastl::deque< T, Allocator, kDequeSubarraySize >:
Inheritance graph
[legend]
Collaboration diagram for eastl::deque< T, Allocator, kDequeSubarraySize >:
Collaboration graph
[legend]

Public Types

typedef DequeBase< T, Allocator, kDequeSubarraySize > base_type
 
typedef deque< T, Allocator, kDequeSubarraySize > this_type
 
typedef T value_type
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef T & reference
 
typedef const T & const_reference
 
typedef DequeIterator< T, T *, T &, kDequeSubarraySize > iterator
 
typedef DequeIterator< T, const T *, const T &, kDequeSubarraySize > const_iterator
 
typedef eastl::reverse_iterator< iteratorreverse_iterator
 
typedef eastl::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef base_type::size_type size_type
 
typedef base_type::difference_type difference_type
 
typedef base_type::allocator_type allocator_type
 
- Public Types inherited from eastl::DequeBase< T, EASTLAllocatorType, DEQUE_DEFAULT_SUBARRAY_SIZE(T) >
enum  
 -1 is reserved for 'npos'. It also happens to be slightly beneficial that kMaxSize is a value less than -1, as it helps us deal with potential integer wraparound issues.
 
enum  Side
 Defines the side of the deque: front or back.
 
typedef T value_type
 
typedef EASTLAllocatorType allocator_type
 
typedef eastl_size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef DequeIterator< T, T *, T &, kDequeSubarraySize > iterator
 
typedef DequeIterator< T, const T *, const T &, kDequeSubarraySize > const_iterator
 

Public Member Functions

 deque (const allocator_type &allocator)
 
 deque (size_type n, const allocator_type &allocator=EASTL_DEQUE_DEFAULT_ALLOCATOR)
 
 deque (size_type n, const value_type &value, const allocator_type &allocator=EASTL_DEQUE_DEFAULT_ALLOCATOR)
 
 deque (const this_type &x)
 
 deque (this_type &&x)
 
 deque (this_type &&x, const allocator_type &allocator)
 
 deque (std::initializer_list< value_type > ilist, const allocator_type &allocator=EASTL_DEQUE_DEFAULT_ALLOCATOR)
 
template<typename InputIterator >
 deque (InputIterator first, InputIterator last)
 
this_typeoperator= (const this_type &x)
 
this_typeoperator= (std::initializer_list< value_type > ilist)
 
this_typeoperator= (this_type &&x)
 
void swap (this_type &x)
 
void assign (size_type n, const value_type &value)
 
void assign (std::initializer_list< value_type > ilist)
 
template<typename InputIterator >
void assign (InputIterator first, InputIterator last)
 
iterator begin () EA_NOEXCEPT
 
const_iterator begin () const EA_NOEXCEPT
 
const_iterator cbegin () const EA_NOEXCEPT
 
iterator end () EA_NOEXCEPT
 
const_iterator end () const EA_NOEXCEPT
 
const_iterator cend () const EA_NOEXCEPT
 
reverse_iterator rbegin () EA_NOEXCEPT
 
const_reverse_iterator rbegin () const EA_NOEXCEPT
 
const_reverse_iterator crbegin () const EA_NOEXCEPT
 
reverse_iterator rend () EA_NOEXCEPT
 
const_reverse_iterator rend () const EA_NOEXCEPT
 
const_reverse_iterator crend () const EA_NOEXCEPT
 
bool empty () const EA_NOEXCEPT
 
size_type size () const EA_NOEXCEPT
 
void resize (size_type n, const value_type &value)
 
void resize (size_type n)
 
void shrink_to_fit ()
 
void set_capacity (size_type n=base_type::npos)
 
reference operator[] (size_type n)
 
const_reference operator[] (size_type n) const
 
reference at (size_type n)
 
const_reference at (size_type n) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
void push_front (const value_type &value)
 
reference push_front ()
 
void push_front (value_type &&value)
 
void push_back (const value_type &value)
 
reference push_back ()
 
void push_back (value_type &&value)
 
void pop_front ()
 
void pop_back ()
 
template<class... Args>
iterator emplace (const_iterator position, Args &&... args)
 
template<class... Args>
void emplace_front (Args &&... args)
 
template<class... Args>
void emplace_back (Args &&... args)
 
iterator insert (const_iterator position, const value_type &value)
 
iterator insert (const_iterator position, value_type &&value)
 
void insert (const_iterator position, size_type n, const value_type &value)
 
iterator insert (const_iterator position, std::initializer_list< value_type > ilist)
 
template<typename InputIterator >
void insert (const_iterator position, InputIterator first, InputIterator last)
 
iterator erase (const_iterator position)
 
iterator erase (const_iterator first, const_iterator last)
 
reverse_iterator erase (reverse_iterator position)
 
reverse_iterator erase (reverse_iterator first, reverse_iterator last)
 
void clear ()
 
bool validate () const
 
int validate_iterator (const_iterator i) const
 
T * DoAllocateSubarray ()
 
void DoFreeSubarray (T *p)
 
void DoFreeSubarrays (T **pBegin, T **pEnd)
 
T ** DoAllocatePtrArray (size_type n)
 
void DoFreePtrArray (T **p, size_t n)
 
iterator DoReallocSubarray (size_type nAdditionalCapacity, Side allocationSide)
 
void DoReallocPtrArray (size_type nAdditionalCapacity, Side allocationSide)
 
- Public Member Functions inherited from eastl::DequeBase< T, EASTLAllocatorType, DEQUE_DEFAULT_SUBARRAY_SIZE(T) >
 DequeBase (const allocator_type &allocator)
 
 DequeBase (size_type n)
 
 DequeBase (size_type n, const allocator_type &allocator)
 
const allocator_type & get_allocator () const EA_NOEXCEPT
 
allocator_type & get_allocator () EA_NOEXCEPT
 
void set_allocator (const allocator_type &allocator)
 

Public Attributes

T ** mpPtrArray
 
size_type mnPtrArraySize
 
iterator mItBegin
 
iterator mItEnd
 
allocator_type mAllocator
 

Static Public Attributes

static const size_type npos
 
- Static Public Attributes inherited from eastl::DequeBase< T, EASTLAllocatorType, DEQUE_DEFAULT_SUBARRAY_SIZE(T) >
static const size_type npos
 
static const size_type kMaxSize
 'npos' means non-valid position or simply non-position.
 

Protected Member Functions

template<typename Integer >
void DoInit (Integer n, Integer value, true_type)
 
template<typename InputIterator >
void DoInit (InputIterator first, InputIterator last, false_type)
 
template<typename InputIterator >
void DoInitFromIterator (InputIterator first, InputIterator last, EASTL_ITC_NS::input_iterator_tag)
 
template<typename ForwardIterator >
void DoInitFromIterator (ForwardIterator first, ForwardIterator last, EASTL_ITC_NS::forward_iterator_tag)
 
void DoFillInit (const value_type &value)
 
template<typename Integer >
void DoAssign (Integer n, Integer value, true_type)
 
template<typename InputIterator >
void DoAssign (InputIterator first, InputIterator last, false_type)
 
void DoAssignValues (size_type n, const value_type &value)
 
template<typename Integer >
void DoInsert (const const_iterator &position, Integer n, Integer value, true_type)
 
template<typename InputIterator >
void DoInsert (const const_iterator &position, const InputIterator &first, const InputIterator &last, false_type)
 
template<typename InputIterator >
void DoInsertFromIterator (const_iterator position, const InputIterator &first, const InputIterator &last, EASTL_ITC_NS::forward_iterator_tag)
 
void DoInsertValues (const_iterator position, size_type n, const value_type &value)
 
void DoSwap (this_type &x)
 
- Protected Member Functions inherited from eastl::DequeBase< T, EASTLAllocatorType, DEQUE_DEFAULT_SUBARRAY_SIZE(T) >
T * DoAllocateSubarray ()
 
void DoFreeSubarray (T *p)
 
void DoFreeSubarrays (T **pBegin, T **pEnd)
 
T ** DoAllocatePtrArray (size_type n)
 
void DoFreePtrArray (T **p, size_t n)
 
iterator DoReallocSubarray (size_type nAdditionalCapacity, Side allocationSide)
 
void DoReallocPtrArray (size_type nAdditionalCapacity, Side allocationSide)
 
void DoInit (size_type n)
 

Additional Inherited Members

- Protected Attributes inherited from eastl::DequeBase< T, EASTLAllocatorType, DEQUE_DEFAULT_SUBARRAY_SIZE(T) >
T ** mpPtrArray
 
size_type mnPtrArraySize
 
iterator mItBegin
 
iterator mItEnd
 
allocator_type mAllocator
 

Detailed Description

template<typename T, typename Allocator = EASTLAllocatorType, unsigned kDequeSubarraySize = DEQUE_DEFAULT_SUBARRAY_SIZE(T)>
class eastl::deque< T, Allocator, kDequeSubarraySize >

deque

Implements a conventional C++ double-ended queue. The implementation used here is very much like any other deque implementations you may have seen, as it follows the standard algorithm for deque design.

Note: As of this writing, deque does not support zero-allocation initial emptiness. A newly created deque with zero elements will still allocate a subarray pointer set. We are looking for efficient and clean ways to get around this, but current efforts have resulted in less efficient and more fragile code. The logic of this class doesn't lend itself to a clean implementation. It turns out that deques are one of the least likely classes you'd want this behaviour in, so until this functionality becomes very important to somebody, we will leave it as-is. It can probably be solved by adding some extra code to the Do* functions and adding good comments explaining the situation.


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