HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_Map< K, V, H, P > Class Template Reference

Unsorted map container. More...

#include <UT_Map.h>

+ Inheritance diagram for UT_Map< K, V, H, P >:

Classes

struct  deref_pair_first
 
struct  deref_pair_second
 
class  partial_iterator_base
 

Public Types

typedef hboost::unordered_map
< K, V, H, P
Base
 
typedef Base::key_type key_type
 
typedef Base::mapped_type mapped_type
 
typedef Base::value_type value_type
 
typedef Base::hasher hasher
 
typedef Base::key_equal key_equal
 
typedef Base::iterator iterator
 
typedef Base::const_iterator const_iterator
 
typedef H Hasher
 
typedef P Equal
 
using key_iterator = partial_iterator_base< iterator, key_type, deref_pair_first< iterator, key_type >>
 
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 >>
 

Public Member Functions

 UT_Map (const Hasher &hf=Hasher(), const Equal &eql=Equal())
 
template<typename InputIt >
 UT_Map (InputIt first, InputIt last)
 Initialize the map from an iterator pair. More...
 
template<typename InputIt >
 UT_Map (InputIt first, InputIt last, const Hasher &hf=Hasher(), const Equal &eql=Equal())
 
 UT_Map (std::initializer_list< value_type > init_list)
 
 UT_Map (UT_Map const &other)
 
int64 getMemoryUsage (bool inclusive) const
 
bool contains (const key_type &key) const
 Returns true if a value with the key is contained in the map. More...
 
UT_IteratorRange< key_iteratorkey_range ()
 
UT_IteratorRange
< const_key_iterator
key_range () const
 
UT_IteratorRange< mapped_iteratormapped_range ()
 
UT_IteratorRange
< const_mapped_iterator
mapped_range () const
 

Detailed Description

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
class UT_Map< K, V, H, P >

Unsorted map container.

Examples:
DM/DM_OverdrawHook.C, SIM/SNOW_Solver.C, and SOP/SOP_CustomBrush.C.

Definition at line 83 of file UT_Map.h.

Member Typedef Documentation

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef hboost::unordered_map<K, V, H, P> UT_Map< K, V, H, P >::Base

Definition at line 87 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::const_iterator UT_Map< K, V, H, P >::const_iterator

Definition at line 94 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
using UT_Map< K, V, H, P >::const_key_iterator = partial_iterator_base<const_iterator, const key_type, deref_pair_first<const_iterator, const key_type>>

Definition at line 204 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
using UT_Map< K, V, H, P >::const_mapped_iterator = partial_iterator_base<const_iterator, const mapped_type, deref_pair_second<const_iterator, const mapped_type>>

Definition at line 208 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef P UT_Map< K, V, H, P >::Equal

Definition at line 96 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::hasher UT_Map< K, V, H, P >::hasher

Definition at line 91 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef H UT_Map< K, V, H, P >::Hasher

Definition at line 95 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::iterator UT_Map< K, V, H, P >::iterator

Definition at line 93 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::key_equal UT_Map< K, V, H, P >::key_equal

Definition at line 92 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
using UT_Map< K, V, H, P >::key_iterator = partial_iterator_base<iterator, key_type, deref_pair_first<iterator, key_type>>

Definition at line 202 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::key_type UT_Map< K, V, H, P >::key_type

Definition at line 88 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
using UT_Map< K, V, H, P >::mapped_iterator = partial_iterator_base<iterator, mapped_type, deref_pair_second<iterator, mapped_type>>

Definition at line 206 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::mapped_type UT_Map< K, V, H, P >::mapped_type

Definition at line 89 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::value_type UT_Map< K, V, H, P >::value_type

Definition at line 90 of file UT_Map.h.

Constructor & Destructor Documentation

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_Map< K, V, H, P >::UT_Map ( const Hasher hf = Hasher(),
const Equal eql = Equal() 
)
inlineexplicit

Initialize an empty map, and optionally a custom hasher and equal compare functions.

Definition at line 100 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
template<typename InputIt >
UT_Map< K, V, H, P >::UT_Map ( InputIt  first,
InputIt  last 
)
inline

Initialize the map from an iterator pair.

Definition at line 106 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
template<typename InputIt >
UT_Map< K, V, H, P >::UT_Map ( InputIt  first,
InputIt  last,
const Hasher hf = Hasher(),
const Equal eql = Equal() 
)
inline

Initialize the map from an iterator pair, and optionally a custom hasher and equal compare functions.

Definition at line 111 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_Map< K, V, H, P >::UT_Map ( std::initializer_list< value_type init_list)
inline

Initialize the map using an initializer list. The initializer list is a list of pairs of items to add to the map. E.g:

UT_Map<int, const char *> foo = {{1, "one"}, {2, "two"}};

Definition at line 122 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_Map< K, V, H, P >::UT_Map ( UT_Map< K, V, H, P > const other)
inline

Definition at line 129 of file UT_Map.h.

Member Function Documentation

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
bool UT_Map< K, V, H, P >::contains ( const key_type key) const
inline

Returns true if a value with the key is contained in the map.

Definition at line 141 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
int64 UT_Map< K, V, H, P >::getMemoryUsage ( bool  inclusive) const
inline

Returns the approximate size, in bytes, of the memory consumed by this map or, optionally, only the data contained within.

Definition at line 133 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_IteratorRange<key_iterator> UT_Map< K, V, H, P >::key_range ( )
inline

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

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

Definition at line 219 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_IteratorRange<const_key_iterator> UT_Map< K, V, H, P >::key_range ( ) const
inline

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

Definition at line 225 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_IteratorRange<mapped_iterator> UT_Map< K, V, H, P >::mapped_range ( )
inline

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

Definition at line 231 of file UT_Map.h.

template<typename K, typename V, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_IteratorRange<const_mapped_iterator> UT_Map< K, V, H, P >::mapped_range ( ) const
inline

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

Definition at line 237 of file UT_Map.h.


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