HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual > Class Template Reference

#include <UT_ArrayMap.h>

+ Inheritance diagram for UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >:

Classes

struct  deref_pair_first
 
struct  deref_pair_second
 
class  ordered_iterator_t
 
class  partial_iterator_base
 

Public Types

typedef ArraySet< std::pair
< Key, T >, MULTI,
MAX_LOAD_FACTOR_256, Clearer,
MapKeyHash< Hash, Key, T >
, MapKeyEqual< KeyEqual, Key,
T > > 
set_type
 
typedef ArrayMap< Key, T,
MULTI, MAX_LOAD_FACTOR_256,
Clearer, Hash, KeyEqual > 
map_type
 
typedef Key key_type
 
typedef T mapped_type
 
typedef Hash hasher
 
typedef KeyEqual key_equal
 
using pointer = typename set_type::pointer
 
using const_pointer = typename set_type::const_pointer
 
using value_type = typename set_type::value_type
 
using size_type = typename set_type::size_type
 
using iterator = typename set_type::iterator
 Inherit iterator and const_iterator. More...
 
template<bool constant_type>
using iterator_t = typename set_type::template iterator_t< constant_type >
 
using const_iterator = typename set_type::const_iterator
 
using const_key_iterator = partial_iterator_base< const_iterator, const key_type, deref_pair_first< const_iterator, const key_type >>
 
using mapped_iterator = partial_iterator_base< iterator, mapped_type, deref_pair_second< iterator, mapped_type >>
 
using const_mapped_iterator = partial_iterator_base< const_iterator, const mapped_type, deref_pair_second< const_iterator, const mapped_type >>
 
typedef ArraySet< Key, MULTI,
MAX_LOAD_FACTOR_256, Clearer,
Hash, KeyEqual > 
set_type
 Inherit the constructors from ArraySet. More...
 
- Public Types inherited from UT::ArraySet< std::pair< Key, T >, MULTI, MAX_LOAD_FACTOR_256, Clearer, MapKeyHash< Hash, Key, T >, MapKeyEqual< KeyEqual, Key, T > >
typedef ArraySet< std::pair
< Key, T >, MULTI,
MAX_LOAD_FACTOR_256, Clearer,
MapKeyHash< Hash, Key, T >
, MapKeyEqual< KeyEqual, Key,
T > > 
set_type
 
typedef std::pair< Key, Tkey_type
 
typedef std::pair< Key, Tvalue_type
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef MapKeyHash< Hash, Key, Thasher
 
typedef MapKeyEqual< KeyEqual,
Key, T
key_equal
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef Clearer clearer_type
 
typedef iterator_t< false > iterator
 Iterator type for iterating over non-constant elements. More...
 

Public Member Functions

std::pair< iterator, bool > insert (const Key &key, const T &val)
 
std::pair< iterator, bool > insert (Key &&key, T &&val)
 
bool operator== (const map_type &that) const
 
bool operator!= (const map_type &that) const
 
size_type count (const Key &key) const
 
bool contains (const Key &key) const
 
T & operator[] (const Key &key)
 
T & operator[] (Key &&key)
 
size_type erase (const Key &key)
 
template<typename FUNCTOR >
SYS_FORCE_INLINE void forEachKey (FUNCTOR &&functor) const
 
template<typename FUNCTOR >
SYS_FORCE_INLINE void forEachValue (FUNCTOR &&functor) const
 
template<typename COMPARATOR >
ordered_iterator_t< true > ordered_begin (const COMPARATOR &comparator) const
 
template<typename COMPARATOR >
ordered_iterator_t< true > ordered_cbegin (const COMPARATOR &comparator) const
 
template<typename COMPARATOR >
ordered_iterator_t< false > ordered_begin (const COMPARATOR &comparator)
 
UT_IteratorRange
< const_key_iterator
key_range () const
 
UT_IteratorRange< mapped_iteratormapped_range ()
 
UT_IteratorRange
< const_mapped_iterator
mapped_range () const
 
iterator find (const Key &key)
 
const_iterator find (const Key &key) const
 
T & at (const Key &key)
 
const T & at (const Key &key) const
 
std::pair< const_iterator,
const_iterator
equal_range (const Key &key) const
 
std::pair< iterator, iteratorequal_range (const Key &key)
 
- Public Member Functions inherited from UT::ArraySet< std::pair< Key, T >, MULTI, MAX_LOAD_FACTOR_256, Clearer, MapKeyHash< Hash, Key, T >, MapKeyEqual< KeyEqual, Key, T > >
 ArraySet ()
 
 ArraySet (size_type init_bucket_count)
 
 ArraySet (set_type &&that)
 Move constructor, destroying the source. More...
 
 ArraySet (const set_type &that)
 
 ArraySet (INPUT_ITERATOR start_input, INPUT_ITERATOR end_input, size_type init_bucket_count=0)
 Inserts all of the items in the range [start_input,end_input). More...
 
 ArraySet (std::initializer_list< value_type > init, size_type init_bucket_count=0)
 
set_typeoperator= (const set_type &that)
 
set_typeoperator= (std::initializer_list< value_type > init)
 
set_typeoperator= (set_type &&that)
 
bool operator== (const set_type &that) const
 
bool operator!= (const set_type &that) const
 
void swap (set_type &that)
 Swaps another set with this one. More...
 
 ~ArraySet ()
 
bool empty () const
 Returns true iff there are no items in the set. More...
 
size_type size () const
 Returns the number of items in the set. More...
 
void clear ()
 
void destroy ()
 Removes all items from the set and frees all the memory. More...
 
size_type bucket_count () const
 Returns the current number of buckets. More...
 
size_type bucket_size (size_type i) const
 
float load_factor () const
 Returns the current portion of buckets that are occupied. More...
 
void rehash (size_type new_num_buckets)
 
void reserve (size_type num_items)
 
void setNumBuckets (size_type new_num_buckets)
 
void bumpNumBuckets (size_type new_num_items)
 
iterator begin ()
 Returns a non-const iterator for the beginning of the set. More...
 
const_iterator begin () const
 Returns a const iterator for the beginning of the set. More...
 
const_iterator cbegin () const
 Returns a const iterator for the beginning of the set. More...
 
iterator end ()
 Returns a non-const end iterator for the set. More...
 
const_iterator end () const
 Returns a const end iterator for the set. More...
 
const_iterator cend () const
 Returns a const end iterator for the set. More...
 
size_type count (const std::pair< Key, T > &key) const
 
bool contains (const std::pair< Key, T > &key) const
 
bool containsAll (const S &src) const
 
void insert (INPUT_ITERATOR start_input, INPUT_ITERATOR end_input)
 Inserts all of the items in the range [start_input,end_input). More...
 
void insert (std::initializer_list< value_type > list)
 Inserts all of the items from the initializer_list. More...
 
std::pair< iterator, bool > emplace (Args &&...args)
 
iterator erase (iterator iter)
 
size_type erase (const std::pair< Key, T > &key)
 
int64 getMemoryUsage (bool inclusive) const
 
SYS_FORCE_INLINE void forEach (FUNCTOR &&functor) const
 
iterator find (const std::pair< Key, T > &key)
 
const_iterator find (const std::pair< Key, T > &key) const
 
std::pair< const_iterator,
const_iterator > 
equal_range (const std::pair< Key, T > &key) const
 
std::pair< iterator, iteratorequal_range (const std::pair< Key, T > &key)
 
std::pair< iterator, bool > insert (const value_type &value)
 
std::pair< iterator, bool > insert (value_type &&value)
 

Additional Inherited Members

- Static Public Member Functions inherited from UT::ArraySet< std::pair< Key, T >, MULTI, MAX_LOAD_FACTOR_256, Clearer, MapKeyHash< Hash, Key, T >, MapKeyEqual< KeyEqual, Key, T > >
static size_type max_size ()
 
static size_type max_bucket_count ()
 
static float max_load_factor ()
 
static hasher hash_function ()
 
static key_equal key_eq ()
 
- Protected Member Functions inherited from UT::ArraySet< std::pair< Key, T >, MULTI, MAX_LOAD_FACTOR_256, Clearer, MapKeyHash< Hash, Key, T >, MapKeyEqual< KeyEqual, Key, T > >
pointer searchStart (const std::pair< Key, T > &key)
 
const_pointer searchStart (const std::pair< Key, T > &key) const
 
bool insertHelper (pointer pstart, size_type nbuckets, const value_type &value, pointer &destp)
 
- Static Protected Member Functions inherited from UT::ArraySet< std::pair< Key, T >, MULTI, MAX_LOAD_FACTOR_256, Clearer, MapKeyHash< Hash, Key, T >, MapKeyEqual< KeyEqual, Key, T > >
static size_type minBuckets (size_type size)
 
- Protected Attributes inherited from UT::ArraySet< std::pair< Key, T >, MULTI, MAX_LOAD_FACTOR_256, Clearer, MapKeyHash< Hash, Key, T >, MapKeyEqual< KeyEqual, Key, T > >
pointer myBuckets
 
size_type myNumBuckets
 

Detailed Description

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
class UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >

This is close to a drop-in replacement for std::unordered_map, except that it uses a single array of items and empty spaces marked with a dedicated "clear" value. It also has a fixed maximum load factor, and doesn't store a hasher, comparator, or allocator object as member data, avoiding unnecessary overhead, but these differences introduce some interface incompatibilities.

See the comment on UT::ArraySet for specifics on these interface incompatibilities. Most functions are inherited from UT::ArraySet.

Definition at line 85 of file UT_ArrayMap.h.

Member Typedef Documentation

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
using UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::const_iterator = typename set_type::const_iterator

Definition at line 106 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
using UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::const_key_iterator = partial_iterator_base<const_iterator, const key_type, deref_pair_first<const_iterator, const key_type>>

Definition at line 730 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
using UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::const_mapped_iterator = partial_iterator_base<const_iterator, const mapped_type, deref_pair_second<const_iterator, const mapped_type>>

Definition at line 734 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
using UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::const_pointer = typename set_type::const_pointer

Definition at line 98 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef Hash UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::hasher

Definition at line 92 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
using UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::iterator = typename set_type::iterator

Inherit iterator and const_iterator.

Definition at line 103 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
template<bool constant_type>
using UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::iterator_t = typename set_type::template iterator_t<constant_type>

Definition at line 105 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef KeyEqual UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::key_equal

Definition at line 93 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef Key UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::key_type

Definition at line 90 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef ArrayMap<Key,T,MULTI,MAX_LOAD_FACTOR_256,Clearer,Hash,KeyEqual> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::map_type

Definition at line 89 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
using UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::mapped_iterator = partial_iterator_base<iterator, mapped_type, deref_pair_second<iterator, mapped_type>>

Definition at line 732 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef T UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::mapped_type

Definition at line 91 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
using UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::pointer = typename set_type::pointer

GCC and Clang can't find base class members in templated code, so we need to declare explicitly that we're inheriting them.

Definition at line 97 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef ArraySet<std::pair<Key,T>,MULTI,MAX_LOAD_FACTOR_256,Clearer,MapKeyHash<Hash,Key,T>,MapKeyEqual<KeyEqual,Key,T> > UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::set_type

Definition at line 88 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
typedef ArraySet<Key,MULTI,MAX_LOAD_FACTOR_256,Clearer,Hash,KeyEqual> UT::ArraySet< Key, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::set_type

Inherit the constructors from ArraySet.

Definition at line 170 of file UT_ArraySet.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
using UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::size_type = typename set_type::size_type

Definition at line 100 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
using UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::value_type = typename set_type::value_type

Definition at line 99 of file UT_ArrayMap.h.

Member Function Documentation

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
T& UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::at ( const Key &  key)
inline

Returns a reference to the value of the first item matching key. WARNING: This throws an exception if nothing matches key!

Definition at line 219 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
const T& UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::at ( const Key &  key) const
inline

Returns a reference to the value of the first item matching key. WARNING: This throws an exception if nothing matches key!

Definition at line 256 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
bool UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::contains ( const Key &  key) const
inline

Returns true iff the set contains the given key. This should be faster than count() if MULTI is true.

Definition at line 334 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
size_type UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::count ( const Key &  key) const
inline

Returns the number of entries matching key. If MULTI is false, this will only return either 0 or 1.

Definition at line 295 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
std::pair<const_iterator,const_iterator> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::equal_range ( const Key &  key) const
inline

Returns a pair of iterators representing the range of values matching key, as [first,second).

Definition at line 413 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
std::pair<iterator,iterator> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::equal_range ( const Key &  key)
inline

Returns a pair of iterators representing the range of values matching key, as [first,second).

Definition at line 478 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
size_type UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::erase ( const Key &  key)
inline

Removes all items matching key and returns the number of items removed.

Definition at line 550 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
iterator UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::find ( const Key &  key)
inline

Returns an iterator to the first item matching key, or an end iterator if no items match key.

Definition at line 158 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
const_iterator UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::find ( const Key &  key) const
inline

Returns an iterator to the first item matching key, or an end iterator if no items match key.

Definition at line 186 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
template<typename FUNCTOR >
SYS_FORCE_INLINE void UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::forEachKey ( FUNCTOR &&  functor) const
inline

Definition at line 578 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
template<typename FUNCTOR >
SYS_FORCE_INLINE void UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::forEachValue ( FUNCTOR &&  functor) const
inline

Definition at line 591 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
std::pair<iterator, bool> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::insert ( const Key &  key,
const T &  val 
)
inline

Definition at line 117 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
std::pair<iterator, bool> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::insert ( Key &&  key,
T &&  val 
)
inline

Definition at line 121 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
UT_IteratorRange<const_key_iterator> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::key_range ( ) const
inline

Returns a const range object that iterates over the map but returns only the key values. Example:

UT::ArrayMap<int, const char *> foo = {{1, "one"}, {2, "two"}};
for (int key : foo.key_range())
std::cout << key << "\n";

Definition at line 744 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
UT_IteratorRange<mapped_iterator> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::mapped_range ( )
inline

Returns a range object that iterates over the map but returns only the mapped values.

Definition at line 750 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
UT_IteratorRange<const_mapped_iterator> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::mapped_range ( ) const
inline

Returns a const range object that iterates over the map but returns only the mapped values.

Definition at line 756 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
bool UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::operator!= ( const map_type that) const
inline

Definition at line 150 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
bool UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::operator== ( const map_type that) const
inline

Definition at line 127 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
T& UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::operator[] ( const Key &  key)
inline

Returns a reference to the first value that is mapped-to from a key matching key, inserting if none exist. NOTE: If you use this, key cannot match the key of a pair cleared by Clearer, else insertHelper will assert.

Definition at line 366 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
T& UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::operator[] ( Key &&  key)
inline

Returns a reference to the first value that is mapped-to from a key matching key, inserting if none exist. NOTE: If you use this, key cannot match the key of a pair cleared by Clearer, else insertHelper will assert.

Definition at line 390 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
template<typename COMPARATOR >
ordered_iterator_t<true> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::ordered_begin ( const COMPARATOR &  comparator) const
inline

Definition at line 660 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
template<typename COMPARATOR >
ordered_iterator_t<false> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::ordered_begin ( const COMPARATOR &  comparator)
inline

Definition at line 672 of file UT_ArrayMap.h.

template<typename Key, typename T, bool MULTI = false, std::size_t MAX_LOAD_FACTOR_256 = 128, typename Clearer = MapKeyClearer<Key,T>, class Hash = hboost::hash<Key>, class KeyEqual = std::equal_to<Key>>
template<typename COMPARATOR >
ordered_iterator_t<true> UT::ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual >::ordered_cbegin ( const COMPARATOR &  comparator) const
inline

Definition at line 666 of file UT_ArrayMap.h.


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