Ion
|
This class can be used in place of std::unordered_map to allow an Ion Allocator to be used for memory allocation. More...
#include "allocunorderedmap.h"
Public Types | |
typedef std::pair< const Key, Value > | PairType |
typedef StlAllocator< PairType > | AllocType |
typedef std::unordered_map < Key, Value, Hash, Pred, AllocType > | MapType |
Public Member Functions | |
AllocUnorderedMap (const AllocatorPtr &alloc) | |
AllocUnorderedMap (const Allocatable &owner) | |
template<typename ContainerT > | |
AllocUnorderedMap (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 > | |
AllocUnorderedMap (const Allocatable &owner, const ContainerT &from) | |
Public Attributes | |
K | keys |
STL member. More... | |
T | elements |
STL member. More... | |
This class can be used in place of std::unordered_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:
AllocUnorderedMap<int, float> local_map(allocator);
AllocUnorderedMap 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: AllocUnorderedMap<int, float> member_map_; };
Definition at line 53 of file allocunorderedmap.h.
typedef StlAllocator<PairType> ion::base::AllocUnorderedMap< Key, Value, Hash, Pred >::AllocType |
Definition at line 57 of file allocunorderedmap.h.
typedef std::unordered_map<Key, Value, Hash, Pred, AllocType> ion::base::AllocUnorderedMap< Key, Value, Hash, Pred >::MapType |
Definition at line 58 of file allocunorderedmap.h.
typedef std::pair<const Key, Value> ion::base::AllocUnorderedMap< Key, Value, Hash, Pred >::PairType |
Definition at line 56 of file allocunorderedmap.h.
|
inlineexplicit |
Definition at line 60 of file allocunorderedmap.h.
|
inlineexplicit |
Definition at line 63 of file allocunorderedmap.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 70 of file allocunorderedmap.h.
|
inline |
Definition at line 74 of file allocunorderedmap.h.
|
inherited |
STL member.