lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Public Types | Public Member Functions
lean::containers::accumulation_vector< Container, ReallocationPolicy > Class Template Reference

Vector wrapper class providing improved performance on repeated element accumulation. More...

#include <accumulation_vector.h>

List of all members.

Public Types

typedef Container container_type
 Type of the container wrapped by this vector.
typedef ReallocationPolicy reallocation_policy
 Type of the policy used by this vector.
typedef container_type::value_type value_type
 Type of the values stored by this vector.
typedef container_type::size_type size_type
 Type of the size returned by this vector.
typedef
container_type::allocator_type 
allocator_type
 Type of the allocator used by this vector.
typedef
container_type::difference_type 
difference_type
 Type of the difference between the addresses of two elements in this vector.
typedef container_type::pointer pointer
 Type of pointers to the elements contained by this vector.
typedef
container_type::const_pointer 
const_pointer
 Type of constant pointers to the elements contained by this vector.
typedef container_type::reference reference
 Type of references to the elements contained by this vector.
typedef
container_type::const_reference 
const_reference
 Type of constant references to the elements contained by this vector.
typedef container_type::value_type value_type
 Type of the elements contained by this vector.
typedef container_type::iterator iterator
 Type of iterators to the elements contained by this vector.
typedef
container_type::const_iterator 
const_iterator
 Type of constant iterators to the elements contained by this vector.
typedef
Impl::reverse_iterators
< Container >
::reverse_iterator 
reverse_iterator
 Type of reverse iterators to the elements contained by this vector.
typedef
Impl::reverse_iterators
< Container >
::const_reverse_iterator 
const_reverse_iterator
 Type of constant reverse iterators to the elements contained by this vector.

Public Member Functions

 accumulation_vector ()
 Constructs an empty accumulation vector.
 accumulation_vector (const allocator_type &allocator)
 Constructs an empty accumulation vector using the given allocator.
 accumulation_vector (size_type count)
 Constructs an accumulation vector containing the given number of elements.
 accumulation_vector (size_type count, const value_type &value)
 Constructs an accumulation vector containing the given number of given elements.
 accumulation_vector (size_type count, const value_type &value, const allocator_type &allocator)
 Constructs an accumulation vector containing the given number of given elements using the given allocator.
 accumulation_vector (const accumulation_vector &right)
 Copies elements from the given vector to this vector.
template<class Iterator >
 accumulation_vector (Iterator itFirst, Iterator itEnd)
 Constructs an accumulation vector from the given range of elements.
template<class Iterator >
 accumulation_vector (Iterator itFirst, Iterator itEnd, const allocator_type &allocator)
 Constructs an accumulation vector from the given range of elements using the given allocator.
accumulation_vectoroperator= (const accumulation_vector &right)
 Copies all elements from the given vector to this vector.
LEAN_INLINE size_type size (void) const
 Gets the number of elements contained by this vector.
LEAN_INLINE bool empty (void) const
 Checks if this vector is empty.
LEAN_INLINE value_typepush_back (void)
 Appends an element at the back of this vector.
LEAN_INLINE void push_back (const value_type &value)
 Appends an element at the back of this vector. Assumes value outside of vector range, copy manually otherwise.
LEAN_INLINE void pop_back (void)
 Removes one element at the back of this vector.
iterator insert (iterator itWhere)
 Inserts an element into this vector.
iterator insert (iterator itWhere, const value_type &value)
 Inserts an element into this vector. Assumes value outside of vector range, copy manually otherwise.
iterator insert (iterator itWhere, size_type count)
 Inserts the specified number of elements into this vector.
LEAN_INLINE void insert (iterator itWhere, size_type count, const value_type &value)
 Inserts the specified number of elements into this vector. Assumes value outside of vector range, copy manually otherwise.
template<class Iterator >
void insert (iterator itWhere, Iterator itFirst, Iterator itEnd)
 Inserts a range of elements into this vector. Assumes that the given positioning iterator does not split the given range.
LEAN_INLINE iterator erase (iterator itWhere)
 Removes one element by iterator.
LEAN_INLINE void erase (iterator itFirst, iterator itEnd)
 Removes the given range of elements by iterator.
void assign (size_type count, const value_type &value)
 Assigns the given number of elements to this vector. Assumes value outside of vector range, copy manually otherwise.
template<class Iterator >
void assign (Iterator itFirst, Iterator itEnd)
 Assigns the given range of elements to this vector.
LEAN_INLINE void clear (void)
 Removes all elements from this vector.
LEAN_INLINE allocator_type get_allocator () const
 Gets a copy of the allocator used by this vector.
LEAN_INLINE size_type max_size (void) const
 Returns the maximum number of elements this vector could store.
LEAN_INLINE size_type capacity (void) const
 Returns the number of elements this vector could contain without reallocation.
LEAN_INLINE void reserve (size_type count)
 Reserves storage for the specified number of elements.
void resize (size_type count)
 Inserts or erases elements to match the new size specified.
void resize (size_type count, const value_type &value)
 Inserts or erases elements to match the new size specified.
LEAN_INLINE reference at (size_type pos)
 Gets an element by position.
LEAN_INLINE const_reference at (size_type pos) const
 Gets an element by position.
LEAN_INLINE reference front (void)
 Gets the first element in the vector.
LEAN_INLINE const_reference front (void) const
 Gets the first element in the vector.
LEAN_INLINE reference back (void)
 Gets the last element in the vector.
LEAN_INLINE const_reference back (void) const
 Gets the last element in the vector.
LEAN_INLINE reference operator[] (size_type pos)
 Gets an element by position.
LEAN_INLINE const_reference operator[] (size_type pos) const
 Gets an element by position.
LEAN_INLINE iterator begin (void)
 Returns an iterator to the first element contained by this vector.
LEAN_INLINE const_iterator begin (void) const
 Returns a constant iterator to the first element contained by this vector.
LEAN_INLINE iterator end (void)
 Returns an iterator beyond the last element contained by this vector.
LEAN_INLINE const_iterator end (void) const
 Returns a constant iterator beyond the last element contained by this vector.
LEAN_INLINE reverse_iterator rbegin (void)
 Returns a reverse iterator to the last element contained by this vector.
LEAN_INLINE const_reverse_iterator rbegin (void) const
 Returns a constant reverse iterator to the last element contained by this vector.
LEAN_INLINE reverse_iterator rend (void)
 Returns a reverse iterator beyond the first element contained by this vector.
LEAN_INLINE const_reverse_iterator rend (void) const
 Returns a constant reverse iterator beyond the first element contained by this vector.
LEAN_INLINE void swap (accumulation_vector &right)

Detailed Description

template<class Container, class ReallocationPolicy = default_reallocation_policy<Container>>
class lean::containers::accumulation_vector< Container, ReallocationPolicy >

Vector wrapper class providing improved performance on repeated element accumulation.

This class stores elements of the given type without destructing them on remove or clear, thus eliminating the overhead incurred by destruction and re-construction of frequently removed elements.

See also:
lean::containers::accumulation_map

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