ezEngine  Milestone 7
ezDeque< T, AllocatorWrapper, Construct > Class Template Reference

#include <Deque.h>

Inheritance diagram for ezDeque< T, AllocatorWrapper, Construct >:

Public Member Functions

 ezDeque (ezAllocatorBase *pAllocator)
 
 ezDeque (const ezDeque< T, AllocatorWrapper, Construct > &other)
 
 ezDeque (const ezDequeBase< T, Construct > &other)
 
 ezDeque (ezDeque< T, AllocatorWrapper, Construct > &&other)
 
 ezDeque (ezDequeBase< T, Construct > &&other)
 
void operator= (const ezDeque< T, AllocatorWrapper, Construct > &rhs)
 
void operator= (const ezDequeBase< T, Construct > &rhs)
 
void operator= (ezDeque< T, AllocatorWrapper, Construct > &&rhs)
 
void operator= (ezDequeBase< T, Construct > &&rhs)
 
- Public Member Functions inherited from ezDequeBase< T, Construct >
void Clear ()
 Destructs all elements and sets the count to zero. Does not deallocate any data.
 
void Reserve (ezUInt32 uiCount)
 Rearranges the internal data structures such that the amount of reserved elements can be appended with as few allocations, as possible. More...
 
void Compact ()
 This function deallocates as much memory as possible to shrink the deque to the bare minimum size that it needs to work. More...
 
void SetCount (ezUInt32 uiCount)
 Sets the number of active elements in the deque. All new elements are default constructed. If the deque is shrunk, elements at the end of the deque are destructed.
 
T & operator[] (ezUInt32 uiIndex)
 Accesses the n-th element in the deque.
 
const T & operator[] (ezUInt32 uiIndex) const
 Accesses the n-th element in the deque.
 
T & ExpandAndGetRef ()
 Grows the deque by one element and returns a reference to the newly created element.
 
void PushBack ()
 Adds one default constructed element to the back of the deque.
 
void PushBack (const T &element)
 Adds one element to the back of the deque.
 
void PopBack (ezUInt32 uiElements=1)
 Removes the last element from the deque.
 
void PushFront (const T &element)
 Adds one element to the front of the deque.
 
void PushFront ()
 Adds one default constructed element to the front of the deque.
 
void PopFront (ezUInt32 uiElements=1)
 Removes the first element from the deque.
 
bool IsEmpty () const
 Checks whether no elements are active in the deque.
 
ezUInt32 GetCount () const
 Returns the number of active elements in the deque.
 
const T & PeekFront () const
 Returns the first element.
 
T & PeekFront ()
 Returns the first element.
 
const T & PeekBack () const
 Returns the last element.
 
T & PeekBack ()
 Returns the last element.
 
bool Contains (const T &value) const
 Checks whether there is any element in the deque with the given value.
 
ezUInt32 IndexOf (const T &value, ezUInt32 uiStartIndex=0) const
 Returns the first index at which an element with the given value could be found or ezInvalidIndex if nothing was found.
 
ezUInt32 LastIndexOf (const T &value, ezUInt32 uiStartIndex=ezInvalidIndex) const
 Returns the last index at which an element with the given value could be found or ezInvalidIndex if nothing was found.
 
void RemoveAtSwap (ezUInt32 uiIndex)
 Removes the element at the given index and fills the gap with the last element in the deque.
 
void RemoveAt (ezUInt32 uiIndex)
 Removes the element at index and fills the gap by shifting all following elements.
 
bool Remove (const T &value)
 Removes the first occurrence of value and fills the gap by shifting all following elements.
 
bool RemoveSwap (const T &value)
 Removes the first occurrence of value and fills the gap with the last element in the deque.
 
void Insert (const T &value, ezUInt32 uiIndex)
 Inserts value at index by shifting all following elements. Valid insert positions are [0; GetCount].
 
template<typename Comparer >
void Sort (const Comparer &comparer)
 Sort with explicit comparer.
 
void Sort ()
 Sort with default comparer.
 
ezAllocatorBaseGetAllocator () const
 Returns the allocator that is used by this instance.
 
ezUInt32 GetContiguousRange (ezUInt32 uiStartIndex) const
 Returns the number of elements after uiStartIndex that are stored in contiguous memory. More...
 
bool operator== (const ezDequeBase< T, Construct > &rhs) const
 Comparison operator.
 
bool operator!= (const ezDequeBase< T, Construct > &rhs) const
 Comparison operator.
 
ezUInt64 GetHeapMemoryUsage () const
 Returns the amount of bytes that are currently allocated on the heap.
 

Additional Inherited Members

- Public Types inherited from ezDequeBase< T, Construct >
typedef const_iterator_base
< ezDequeBase< T, Construct >
, T, false > 
const_iterator
 
typedef const_iterator_base
< ezDequeBase< T, Construct >
, T, true > 
const_reverse_iterator
 
typedef iterator_base
< ezDequeBase< T, Construct >
, T, false > 
iterator
 
typedef iterator_base
< ezDequeBase< T, Construct >
, T, true > 
reverse_iterator
 
- Protected Member Functions inherited from ezDequeBase< T, Construct >
 ezDequeBase (ezAllocatorBase *pAllocator)
 No memory is allocated during construction.
 
 ezDequeBase (const ezDequeBase< T, Construct > &rhs, ezAllocatorBase *pAllocator)
 Constructs this deque by copying from rhs.
 
 ezDequeBase (ezDequeBase< T, Construct > &&rhs, ezAllocatorBase *pAllocator)
 Constructs this deque by moving from rhs.
 
 ~ezDequeBase ()
 Destructor.
 
void operator= (const ezDequeBase< T, Construct > &rhs)
 Assignment operator.
 
void operator= (ezDequeBase< T, Construct > &&rhs)
 Move operator.
 

Detailed Description

template<typename T, typename AllocatorWrapper = ezDefaultAllocatorWrapper, bool Construct = true>
class ezDeque< T, AllocatorWrapper, Construct >

See Also
ezDequeBase

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