Ion
|
This class can be used in place of std::vector to allow an Ion Allocator to be used for memory allocation. More...
#include "allocvector.h"
Public Types | |
typedef StlAllocator< T > | AllocType |
typedef std::vector< T, AllocType > | VectorType |
Public Member Functions | |
AllocVector (const AllocatorPtr &alloc) | |
AllocVector (const Allocatable &owner) | |
AllocVector (const AllocatorPtr &alloc, size_t n, const T &val) | |
AllocVector (const Allocatable &owner, size_t n, const T &val) | |
template<class IteratorT > | |
AllocVector (const AllocatorPtr &alloc, IteratorT first, IteratorT last) | |
template<class IteratorT > | |
AllocVector (const Allocatable &owner, IteratorT first, IteratorT last) | |
template<typename ContainerT > | |
AllocVector (const AllocatorPtr &alloc, const ContainerT &from) | |
These constructors can be used to copy from "STL iterables": anything that provides a pair of compatible iterators via begin() and end(). More... | |
template<typename ContainerT > | |
AllocVector (const Allocatable &owner, const ContainerT &from) | |
AllocVector (const AllocatorPtr &alloc, std::initializer_list< T > init) | |
These constructors allow AllocVector to be initialized using c++11's list initialization: AllocVector<int> vector(allocator, {1, 2, 3, 4});. More... | |
AllocVector (const Allocatable &owner, std::initializer_list< T > init) | |
Public Attributes | |
T | elements |
STL member. More... | |
This class can be used in place of std::vector to allow an Ion Allocator to be used for memory allocation.
There is a constructor that takes the Allocator to be used as an argument. For example:
AllocVector<int> vec(allocator);
AllocVector also provides a convenience constructor to declare class members of a derived Allocatable class. It uses the same Allocator that was used for the Allocatable. For example:
class MyClass : public Allocatable { public: ///< The vector will use the same Allocator as the MyClass instance. MyClass() : member_vec_(*this) {} ... private: AllocVector<int> member_vec_; };
Definition at line 50 of file allocvector.h.
typedef StlAllocator<T> ion::base::AllocVector< T >::AllocType |
Definition at line 52 of file allocvector.h.
typedef std::vector<T, AllocType> ion::base::AllocVector< T >::VectorType |
Definition at line 53 of file allocvector.h.
|
inlineexplicit |
Definition at line 54 of file allocvector.h.
|
inlineexplicit |
Definition at line 56 of file allocvector.h.
|
inline |
Definition at line 59 of file allocvector.h.
|
inline |
Definition at line 62 of file allocvector.h.
|
inline |
Definition at line 66 of file allocvector.h.
|
inline |
Definition at line 70 of file allocvector.h.
|
inline |
These constructors can be used to copy from "STL iterables": anything that provides a pair of compatible iterators via begin() and end().
Definition at line 77 of file allocvector.h.
|
inline |
Definition at line 81 of file allocvector.h.
|
inline |
These constructors allow AllocVector to be initialized using c++11's list initialization: AllocVector<int> vector(allocator, {1, 2, 3, 4});.
Definition at line 88 of file allocvector.h.
|
inline |
Definition at line 91 of file allocvector.h.