Ion
|
This class can be used in place of std::map to allow an Ion Allocator to be used for memory allocation. More...
#include "allocmap.h"
Public Types | |
typedef std::pair< const K, V > | PairType |
typedef StlAllocator< PairType > | AllocType |
typedef std::map< K, V, Compare, AllocType > | MapType |
Public Member Functions | |
AllocMap (const AllocatorPtr &alloc) | |
AllocMap (const Allocatable &owner) | |
template<typename ContainerT > | |
AllocMap (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 > | |
AllocMap (const Allocatable &owner, const ContainerT &from) | |
AllocMap (const AllocatorPtr &alloc, std::initializer_list< PairType > init) | |
These constructors allow AllocMap to be initialized using c++11's list initialization: AllocMap<int, float> map(allocator, { {1, 10.0f}, {2, 20.0f} });. More... | |
AllocMap (const Allocatable &owner, std::initializer_list< PairType > init) | |
Public Attributes | |
K | keys |
STL member. More... | |
T | elements |
STL member. More... | |
This class can be used in place of std::map 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:
AllocMap<int, float> local_map(allocator);
AllocMap 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 map will use the same Allocator as the MyClass instance. MyClass() : member_map_(*this) {} ... private: AllocMap<int, float> member_map_; };
Definition at line 50 of file allocmap.h.
typedef StlAllocator<PairType> ion::base::AllocMap< K, V, Compare >::AllocType |
Definition at line 54 of file allocmap.h.
typedef std::map<K, V, Compare, AllocType> ion::base::AllocMap< K, V, Compare >::MapType |
Definition at line 55 of file allocmap.h.
typedef std::pair<const K, V> ion::base::AllocMap< K, V, Compare >::PairType |
Definition at line 53 of file allocmap.h.
|
inlineexplicit |
Definition at line 56 of file allocmap.h.
|
inlineexplicit |
Definition at line 59 of file allocmap.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 65 of file allocmap.h.
|
inline |
Definition at line 69 of file allocmap.h.
|
inline |
These constructors allow AllocMap to be initialized using c++11's list initialization: AllocMap<int, float> map(allocator, { {1, 10.0f}, {2, 20.0f} });.
Definition at line 76 of file allocmap.h.
|
inline |
Definition at line 79 of file allocmap.h.
|
inherited |
STL member.