18 #ifndef ION_BASE_STLALLOC_ALLOCUNORDEREDMAP_H_
19 #define ION_BASE_STLALLOC_ALLOCUNORDEREDMAP_H_
21 #include <unordered_map>
49 template <
typename Key,
51 typename Hash = ::std::hash<Key>,
52 typename Pred = ::std::equal_to<Key> >
54 Key, Value, Hash, Pred, StlAllocator<std::pair<const Key, Value> > > {
58 typedef std::unordered_map<Key, Value, Hash, Pred, AllocType>
MapType;
61 :
MapType(kBucketCountHint, Hash(), Pred(),
64 :
MapType(kBucketCountHint, Hash(), Pred(),
65 AllocType(owner.GetNonNullAllocator())) {}
69 template <
typename ContainerT>
71 :
MapType(from.begin(), from.end(), kBucketCountHint, Hash(), Pred(),
73 template <
typename ContainerT>
75 :
MapType(from.begin(), from.end(), kBucketCountHint, Hash(), Pred(),
76 AllocType(owner.GetNonNullAllocator())) {}
82 enum { kBucketCountHint = 10 };
88 #endif // ION_BASE_STLALLOC_ALLOCUNORDEREDMAP_H_
StlAllocator is derived std::allocator class that allows an Ion Allocator to be used for STL containe...
std::unordered_map< Key, Value, Hash, Pred, AllocType > MapType
This class can be used in place of std::unordered_map to allow an Ion Allocator to be used for memory...
StlAllocator< PairType > AllocType
AllocUnorderedMap(const AllocatorPtr &alloc)
AllocationManager is a singleton class that is used to manage Allocators used to allocate Ion objects...
AllocUnorderedMap(const Allocatable &owner, const ContainerT &from)
Allocatable is an abstract base class for classes whose memory is managed by an Allocator.
AllocUnorderedMap(const AllocatorPtr &alloc, const ContainerT &from)
These constructors can be used to copy from "STL iterables": anything that provides a pair of compati...
AllocUnorderedMap(const Allocatable &owner)
std::pair< const Key, Value > PairType