Nugget
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eastl::fixed_vector< T, nodeCount, bEnableOverflow, OverflowAllocator > Class Template Reference

#include <fixed_vector.h>

Inheritance diagram for eastl::fixed_vector< T, nodeCount, bEnableOverflow, OverflowAllocator >:
Inheritance graph
[legend]
Collaboration diagram for eastl::fixed_vector< T, nodeCount, bEnableOverflow, OverflowAllocator >:
Collaboration graph
[legend]

Public Types

enum  { kMaxSize = nodeCount }
 
typedef fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, bEnableOverflow, OverflowAllocator > fixed_allocator_type
 
typedef OverflowAllocator overflow_allocator_type
 
typedef vector< T, fixed_allocator_typebase_type
 
typedef fixed_vector< T, nodeCount, bEnableOverflow, OverflowAllocator > this_type
 
typedef base_type::size_type size_type
 
typedef base_type::value_type value_type
 
typedef base_type::reference reference
 
typedef base_type::iterator iterator
 
typedef base_type::const_iterator const_iterator
 
typedef aligned_buffer< nodeCount *sizeof(T), EASTL_ALIGN_OF(T)> aligned_buffer_type
 
- Public Types inherited from eastl::vector< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
typedef T value_type
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef T & reference
 
typedef const T & const_reference
 
typedef T * iterator
 
typedef const T * const_iterator
 
typedef eastl::reverse_iterator< iterator > reverse_iterator
 
typedef eastl::reverse_iterator< const_iterator > const_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::VectorBase< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
typedef fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > allocator_type
 
typedef eastl_size_t size_type
 
typedef ptrdiff_t difference_type
 

Public Member Functions

 fixed_vector (const overflow_allocator_type &overflowAllocator)
 
 fixed_vector (size_type n)
 
 fixed_vector (size_type n, const value_type &value)
 
 fixed_vector (const this_type &x)
 
 fixed_vector (this_type &&x)
 
 fixed_vector (this_type &&x, const overflow_allocator_type &overflowAllocator)
 
 fixed_vector (std::initializer_list< T > ilist, const overflow_allocator_type &overflowAllocator=EASTL_FIXED_VECTOR_DEFAULT_ALLOCATOR)
 
template<typename InputIterator >
 fixed_vector (InputIterator first, InputIterator last)
 
this_typeoperator= (const this_type &x)
 
this_typeoperator= (std::initializer_list< T > ilist)
 
this_typeoperator= (this_type &&x)
 
void swap (this_type &x)
 
void set_capacity (size_type n)
 
void clear (bool freeOverflow)
 
void reset_lose_memory ()
 
size_type max_size () const
 
bool full () const
 
bool has_overflowed () const
 
bool can_overflow () const
 
void * push_back_uninitialized ()
 
void push_back (const value_type &value)
 
reference push_back ()
 
void push_back (value_type &&value)
 
const overflow_allocator_type & get_overflow_allocator () const EA_NOEXCEPT
 
overflow_allocator_type & get_overflow_allocator () EA_NOEXCEPT
 
void set_overflow_allocator (const overflow_allocator_type &allocator)
 
void resize (size_type n, const value_type &value)
 
void resize (size_type n)
 
void clear () EA_NOEXCEPT
 
size_type size () const EA_NOEXCEPT
 
void assign (size_type n, const value_type &value)
 
template<typename InputIterator >
void assign (InputIterator first, InputIterator last)
 
void assign (std::initializer_list< value_type > ilist)
 
template<typename Integer , bool bMove>
void DoAssign (Integer n, Integer value, true_type)
 
template<typename InputIterator , bool bMove>
void DoAssign (InputIterator first, InputIterator last, false_type)
 
template<typename InputIterator , bool bMove>
void DoAssignFromIterator (InputIterator first, InputIterator last, EASTL_ITC_NS::input_iterator_tag)
 
template<typename RandomAccessIterator , bool bMove>
void DoAssignFromIterator (RandomAccessIterator first, RandomAccessIterator last, EASTL_ITC_NS::random_access_iterator_tag)
 
- Public Member Functions inherited from eastl::vector< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
 vector (const allocator_type &allocator) EA_NOEXCEPT
 
 vector (size_type n, const allocator_type &allocator=EASTL_VECTOR_DEFAULT_ALLOCATOR)
 
 vector (size_type n, const value_type &value, const allocator_type &allocator=EASTL_VECTOR_DEFAULT_ALLOCATOR)
 
 vector (const this_type &x)
 
 vector (const this_type &x, const allocator_type &allocator)
 
 vector (this_type &&x) EA_NOEXCEPT
 
 vector (this_type &&x, const allocator_type &allocator)
 
 vector (std::initializer_list< value_type > ilist, const allocator_type &allocator=EASTL_VECTOR_DEFAULT_ALLOCATOR)
 
 vector (InputIterator first, InputIterator last, const allocator_type &allocator=EASTL_VECTOR_DEFAULT_ALLOCATOR)
 
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 (InputIterator first, InputIterator last)
 
void assign (std::initializer_list< value_type > ilist)
 
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
 
size_type capacity () const EA_NOEXCEPT
 
void resize (size_type n, const value_type &value)
 
void resize (size_type n)
 
void reserve (size_type n)
 
void set_capacity (size_type n=base_type::npos)
 
void shrink_to_fit ()
 
pointer data () EA_NOEXCEPT
 
const_pointer data () const EA_NOEXCEPT
 
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_back (const value_type &value)
 
reference push_back ()
 
void push_back (value_type &&value)
 
void * push_back_uninitialized ()
 
void pop_back ()
 
iterator emplace (const_iterator position, Args &&... args)
 
reference emplace_back (Args &&... args)
 
iterator insert (const_iterator position, const value_type &value)
 
iterator insert (const_iterator position, size_type n, const value_type &value)
 
iterator insert (const_iterator position, value_type &&value)
 
iterator insert (const_iterator position, std::initializer_list< value_type > ilist)
 
iterator insert (const_iterator position, InputIterator first, InputIterator last)
 
iterator erase_first (const T &value)
 
iterator erase_first_unsorted (const T &value)
 
reverse_iterator erase_last (const T &value)
 
reverse_iterator erase_last_unsorted (const T &value)
 
iterator erase (const_iterator position)
 
iterator erase (const_iterator first, const_iterator last)
 
reverse_iterator erase (const_reverse_iterator position)
 
reverse_iterator erase (const_reverse_iterator first, const_reverse_iterator last)
 
iterator erase_unsorted (const_iterator position)
 
reverse_iterator erase_unsorted (const_reverse_iterator position)
 
void clear () EA_NOEXCEPT
 
void reset_lose_memory () EA_NOEXCEPT
 
bool validate () const EA_NOEXCEPT
 
int validate_iterator (const_iterator i) const EA_NOEXCEPT
 
size_type GetNewCapacity (size_type currentCapacity)
 
T * DoAllocate (size_type n)
 
void DoFree (T *p, size_type n)
 
T *& internalCapacityPtr () EA_NOEXCEPT
 
T *const & internalCapacityPtr () const EA_NOEXCEPT
 
allocator_typeinternalAllocator () EA_NOEXCEPT
 
const allocator_typeinternalAllocator () const EA_NOEXCEPT
 
- Public Member Functions inherited from eastl::VectorBase< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
 VectorBase (const allocator_type &allocator)
 
 VectorBase (size_type n, const allocator_type &allocator)
 
const allocator_typeget_allocator () const EA_NOEXCEPT
 
allocator_typeget_allocator () EA_NOEXCEPT
 
void set_allocator (const allocator_type &allocator)
 

Protected Member Functions

void * DoPushBackUninitialized (true_type)
 
void * DoPushBackUninitialized (false_type)
 
void DoPushBack (true_type, const value_type &value)
 
void DoPushBack (false_type, const value_type &value)
 
void DoPushBackMove (true_type, value_type &&value)
 
void DoPushBackMove (false_type, value_type &&value)
 
reference DoPushBack (false_type)
 
reference DoPushBack (true_type)
 
- Protected Member Functions inherited from eastl::vector< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
pointer DoRealloc (size_type n, ForwardIterator first, ForwardIterator last, should_copy_tag)
 
pointer DoRealloc (size_type n, ForwardIterator first, ForwardIterator last, should_move_tag)
 
void DoInit (Integer n, Integer value, true_type)
 
void DoInit (InputIterator first, InputIterator last, false_type)
 
void DoInitFromIterator (InputIterator first, InputIterator last, EASTL_ITC_NS::input_iterator_tag)
 
void DoInitFromIterator (ForwardIterator first, ForwardIterator last, EASTL_ITC_NS::forward_iterator_tag)
 
void DoAssign (Integer n, Integer value, true_type)
 
void DoAssign (InputIterator first, InputIterator last, false_type)
 
void DoAssignValues (size_type n, const value_type &value)
 
void DoAssignFromIterator (InputIterator first, InputIterator last, EASTL_ITC_NS::input_iterator_tag)
 
void DoAssignFromIterator (RandomAccessIterator first, RandomAccessIterator last, EASTL_ITC_NS::random_access_iterator_tag)
 
void DoInsert (const_iterator position, Integer n, Integer value, true_type)
 
void DoInsert (const_iterator position, InputIterator first, InputIterator last, false_type)
 
void DoInsertFromIterator (const_iterator position, InputIterator first, InputIterator last, EASTL_ITC_NS::input_iterator_tag)
 
void DoInsertFromIterator (const_iterator position, BidirectionalIterator first, BidirectionalIterator last, EASTL_ITC_NS::bidirectional_iterator_tag)
 
void DoInsertValues (const_iterator position, size_type n, const value_type &value)
 
void DoInsertValuesEnd (size_type n)
 
void DoInsertValuesEnd (size_type n, const value_type &value)
 
void DoInsertValue (const_iterator position, Args &&... args)
 
void DoInsertValueEnd (Args &&... args)
 
void DoClearCapacity ()
 
void DoGrow (size_type n)
 
void DoSwap (this_type &x)
 
- Protected Member Functions inherited from eastl::VectorBase< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
T *& internalCapacityPtr () EA_NOEXCEPT
 
T *const & internalCapacityPtr () const EA_NOEXCEPT
 
allocator_typeinternalAllocator () EA_NOEXCEPT
 
const allocator_typeinternalAllocator () const EA_NOEXCEPT
 
T * DoAllocate (size_type n)
 
void DoFree (T *p, size_type n)
 
size_type GetNewCapacity (size_type currentCapacity)
 

Protected Attributes

aligned_buffer_type mBuffer
 
- Protected Attributes inherited from eastl::VectorBase< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
T * mpBegin
 -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.
 
T * mpEnd
 
eastl::compressed_pair< T *, allocator_typemCapacityAllocator
 

Additional Inherited Members

- Public Attributes inherited from eastl::vector< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
T * mpBegin
 -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.
 
T * mpEnd
 
eastl::compressed_pair< T *, allocator_typemCapacityAllocator
 
- Static Public Attributes inherited from eastl::vector< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
static const size_type npos
 
- Static Public Attributes inherited from eastl::VectorBase< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
static const size_type npos
 
static const size_type kMaxSize
 'npos' means non-valid position or simply non-position.
 
- Protected Types inherited from eastl::vector< T, fixed_vector_allocator< sizeof(T), nodeCount, EASTL_ALIGN_OF(T), 0, true, typename eastl::type_select< true, EASTLAllocatorType, EASTLDummyAllocatorType >::type > >
using should_copy_tag = should_move_or_copy_tag< false >
 
using should_move_tag = should_move_or_copy_tag< true >
 

Detailed Description

template<typename T, size_t nodeCount, bool bEnableOverflow = true, typename OverflowAllocator = typename eastl::type_select<bEnableOverflow, EASTLAllocatorType, EASTLDummyAllocatorType>::type>
class eastl::fixed_vector< T, nodeCount, bEnableOverflow, OverflowAllocator >

fixed_vector

A fixed_vector with bEnableOverflow == true is identical to a regular vector in terms of its behavior. All the expectations of regular vector apply to it and no additional expectations come from it. When bEnableOverflow is false, fixed_vector behaves like regular vector with the exception that its capacity can never increase. All operations you do on such a fixed_vector which require a capacity increase will result in undefined behavior or an C++ allocation exception, depending on the configuration of EASTL.

Template parameters: T The type of object the vector holds. nodeCount The max number of objects to contain. bEnableOverflow Whether or not we should use the overflow heap if our object pool is exhausted. OverflowAllocator Overflow allocator, which is only used if bEnableOverflow == true. Defaults to the global heap.

Note: The nodeCount value must be at least 1.

Example usage: fixed_vector<Widget, 128, true> fixedVector);

fixedVector.push_back(Widget()); fixedVector.resize(200); fixedVector.clear();


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