mCRL2
|
A class for a map of keys to values in T based using the simple hash table set implementation. More...
#include <unordered_map.h>
Classes | |
struct | PairEquals |
struct | PairHash |
Public Types | |
using | key_type = Key |
using | mapped_type = T |
using | value_type = std::pair< const Key, T > |
typedef value_type | node_type |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
using | hasher = Hash |
using | key_equal = KeyEqual |
using | allocator_type = typename std::allocator_traits< Allocator >::template rebind_alloc< value_type > |
using | reference = value_type & |
using | const_reference = const value_type & |
using | pointer = typename std::allocator_traits< Allocator >::pointer |
using | const_pointer = typename std::allocator_traits< Allocator >::const_pointer |
using | iterator = typename Set::template unordered_set_iterator< bucket_type, false > |
using | const_iterator = typename Set::const_iterator |
using | local_iterator = typename bucket_type::iterator |
using | const_local_iterator = typename Set::const_local_iterator |
typedef std::pair< unordered_map::iterator, bool > | insert_return_type |
Public Member Functions | |
unordered_map () | |
unordered_map (std::size_t initial_size, const hasher &hash=hasher(), const key_equal &equals=key_equal()) | |
Constructs an unordered_map that can store initial_size number of elements before resizing. | |
const allocator_type & | get_allocator () const noexcept |
allocator_type & | get_allocator () noexcept |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
bool | empty () const noexcept |
size_type | size () const |
size_type | max_size () const noexcept |
void | clear () |
Clears the content. | |
std::pair< iterator, bool > | insert (const value_type &pair) |
Inserts elements. | |
std::pair< iterator, bool > | insert (const_iterator hint, const value_type &pair) |
template<typename ... Args> | |
std::pair< iterator, bool > | emplace (Args &&... args) |
template<typename ... Args> | |
iterator | emplace_hint (const_iterator, Args &&... args) |
template<typename ... Args> | |
std::pair< iterator, bool > | try_emplace (const key_type &key, Args &&... args) |
template<class... Args> | |
iterator | try_emplace (const_iterator, const Key &k, Args &&... args) |
template<class... Args> | |
iterator | try_emplace (const_iterator, Key &&k, Args &&... args) |
template<typename M > | |
std::pair< iterator, bool > | insert_or_assign (Key &&k, M &&obj) |
template<typename M > | |
std::pair< iterator, bool > | insert_or_assign (const Key &k, M &&obj) |
template<typename M > | |
std::pair< iterator, bool > | insert_or_assign (const_iterator, const Key &k, M &&obj) |
template<typename M > | |
std::pair< iterator, bool > | insert_or_assign (const_iterator, Key &&k, M &&obj) |
void | erase (const key_type &key) |
Erases elements. | |
iterator | erase (const_iterator it) |
const T & | at (const key_type &key) const |
Provides access to the value associated with the given key. | |
mapped_type & | operator[] (const key_type &key) |
Provides access to the value associated with the given key, constructs a default value whenever the key was undefined. | |
size_type | count (const key_type &key) const |
template<typename ... Args> | |
iterator | find (const Args &... args) |
template<typename ... Args> | |
const_iterator | find (const Args &... args) const |
local_iterator | begin (size_type n) |
local_iterator | end (size_type n) |
const_local_iterator | begin (size_type n) const |
const_local_iterator | end (size_type n) const |
const_local_iterator | cbegin (size_type n) const |
const_local_iterator | cend (size_type n) const |
size_type | bucket_count () const noexcept |
size_type | max_bucket_count () const noexcept |
size_type | bucket_size (size_type n) const noexcept |
size_type | bucket (const key_type &key) const noexcept |
float | load_factor () const |
float | max_load_factor () const |
void | max_load_factor (float factor) |
void | rehash (size_type number_of_buckets) |
Resize the number buckets to at least number_of_buckets. | |
void | reserve (size_type count) |
Resizes the set to the given number of elements. | |
hasher | hash_function () const |
key_equal | key_eq () const |
size_type | capacity () |
Number of elements that can be stored before rehash. | |
Private Types | |
using | Set = unordered_set< value_type, PairHash, PairEquals, allocator_type, ThreadSafe, Resize > |
using | bucket_type = typename Set::bucket_type |
Private Attributes | |
Set | m_set |
The underlying set storing <key, value> pairs. | |
Static Private Attributes | |
static constexpr bool | allow_transparent = detail::is_transparent<Hash>() && detail::is_transparent<KeyEqual>() |
True iff the hash and equals functions allow transparent lookup,. | |
A class for a map of keys to values in T based using the simple hash table set implementation.
Definition at line 28 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::allocator_type = typename std::allocator_traits<Allocator>::template rebind_alloc<value_type> |
Definition at line 40 of file unordered_map.h.
|
private |
Definition at line 102 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::const_iterator = typename Set::const_iterator |
Definition at line 108 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::const_local_iterator = typename Set::const_local_iterator |
Definition at line 110 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::const_pointer = typename std::allocator_traits<Allocator>::const_pointer |
Definition at line 45 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::const_reference = const value_type& |
Definition at line 43 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::difference_type = std::ptrdiff_t |
Definition at line 36 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::hasher = Hash |
Definition at line 38 of file unordered_map.h.
typedef std::pair<unordered_map::iterator, bool> mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::insert_return_type |
Definition at line 111 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::iterator = typename Set::template unordered_set_iterator<bucket_type, false> |
Definition at line 107 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::key_equal = KeyEqual |
Definition at line 39 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::key_type = Key |
Definition at line 31 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::local_iterator = typename bucket_type::iterator |
Definition at line 109 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::mapped_type = T |
Definition at line 32 of file unordered_map.h.
typedef value_type mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::node_type |
Definition at line 34 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::pointer = typename std::allocator_traits<Allocator>::pointer |
Definition at line 44 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::reference = value_type& |
Definition at line 42 of file unordered_map.h.
|
private |
Definition at line 101 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::size_type = std::size_t |
Definition at line 35 of file unordered_map.h.
using mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::value_type = std::pair<const Key, T> |
Definition at line 33 of file unordered_map.h.
|
inline |
Definition at line 113 of file unordered_map.h.
|
inline |
Constructs an unordered_map that can store initial_size number of elements before resizing.
Definition at line 118 of file unordered_map.h.
const T & mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::at | ( | const key_type & | key | ) | const |
Provides access to the value associated with the given key.
|
inline |
Definition at line 128 of file unordered_map.h.
|
inline |
Definition at line 131 of file unordered_map.h.
|
inline |
Definition at line 213 of file unordered_map.h.
|
inline |
Definition at line 216 of file unordered_map.h.
|
inlinenoexcept |
Definition at line 227 of file unordered_map.h.
|
inlinenoexcept |
Definition at line 223 of file unordered_map.h.
|
inlinenoexcept |
Definition at line 226 of file unordered_map.h.
|
inline |
Number of elements that can be stored before rehash.
Nonstandard.
Definition at line 247 of file unordered_map.h.
|
inline |
Definition at line 134 of file unordered_map.h.
|
inline |
Definition at line 219 of file unordered_map.h.
|
inline |
Definition at line 135 of file unordered_map.h.
|
inline |
Definition at line 220 of file unordered_map.h.
|
inline |
Clears the content.
Definition at line 145 of file unordered_map.h.
|
inline |
Definition at line 203 of file unordered_map.h.
|
inline |
Definition at line 153 of file unordered_map.h.
|
inline |
Definition at line 156 of file unordered_map.h.
|
inlinenoexcept |
Definition at line 138 of file unordered_map.h.
|
inline |
Definition at line 129 of file unordered_map.h.
|
inline |
Definition at line 132 of file unordered_map.h.
|
inline |
Definition at line 214 of file unordered_map.h.
|
inline |
Definition at line 217 of file unordered_map.h.
|
inline |
Erases elements.
Definition at line 192 of file unordered_map.h.
|
inline |
Definition at line 193 of file unordered_map.h.
|
inline |
Definition at line 207 of file unordered_map.h.
|
inline |
Definition at line 210 of file unordered_map.h.
|
inlinenoexcept |
Definition at line 125 of file unordered_map.h.
|
inlinenoexcept |
Definition at line 126 of file unordered_map.h.
|
inline |
Definition at line 242 of file unordered_map.h.
|
inline |
Inserts elements.
Definition at line 148 of file unordered_map.h.
|
inline |
Definition at line 150 of file unordered_map.h.
|
inline |
Definition at line 183 of file unordered_map.h.
|
inline |
Definition at line 186 of file unordered_map.h.
|
inline |
Definition at line 189 of file unordered_map.h.
|
inline |
Definition at line 168 of file unordered_map.h.
|
inline |
Definition at line 243 of file unordered_map.h.
|
inline |
Definition at line 229 of file unordered_map.h.
|
inlinenoexcept |
Definition at line 224 of file unordered_map.h.
|
inline |
Definition at line 230 of file unordered_map.h.
|
inline |
Definition at line 231 of file unordered_map.h.
|
inlinenoexcept |
Definition at line 142 of file unordered_map.h.
mapped_type & mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::operator[] | ( | const key_type & | key | ) |
Provides access to the value associated with the given key, constructs a default value whenever the key was undefined.
|
inline |
Resize the number buckets to at least number_of_buckets.
Definition at line 234 of file unordered_map.h.
|
inline |
Resizes the set to the given number of elements.
Definition at line 240 of file unordered_map.h.
|
inline |
Definition at line 141 of file unordered_map.h.
std::pair< iterator, bool > mcrl2::utilities::unordered_map< Key, T, Hash, KeyEqual, Allocator, ThreadSafe, Resize >::try_emplace | ( | const key_type & | key, |
Args &&... | args | ||
) |
|
inline |
Definition at line 162 of file unordered_map.h.
|
inline |
Definition at line 165 of file unordered_map.h.
|
staticconstexprprivate |
True iff the hash and equals functions allow transparent lookup,.
Definition at line 49 of file unordered_map.h.
|
private |
The underlying set storing <key, value> pairs.
Definition at line 104 of file unordered_map.h.