mcrl2::utilities::unordered_map

Include file:

#include "mcrl2/utilities/unordered_map.h
class mcrl2::utilities::unordered_map

A class for a map of keys to values in T based using the simple hash table set implementation.

Public types

type mcrl2::utilities::unordered_map::allocator_type

typedef for typename std::allocator_traits< Allocator >::template rebind_alloc< value_type >

type mcrl2::utilities::unordered_map::const_iterator

typedef for typename Set::const_iterator

type mcrl2::utilities::unordered_map::const_local_iterator

typedef for typename Set::const_local_iterator

type mcrl2::utilities::unordered_map::const_pointer

typedef for typename std::allocator_traits< Allocator >::const_pointer

type mcrl2::utilities::unordered_map::const_reference

typedef for const value_type &

type mcrl2::utilities::unordered_map::difference_type

typedef for std::ptrdiff_t

type mcrl2::utilities::unordered_map::hasher

typedef for Hash

type mcrl2::utilities::unordered_map::insert_return_type

typedef for std::pair< unordered_map::iterator, bool >

type mcrl2::utilities::unordered_map::iterator

typedef for typename Set::template unordered_set_iterator< bucket_type, false >

type mcrl2::utilities::unordered_map::key_equal

typedef for KeyEqual

type mcrl2::utilities::unordered_map::key_type

typedef for Key

type mcrl2::utilities::unordered_map::local_iterator

typedef for typename bucket_type::iterator

type mcrl2::utilities::unordered_map::mapped_type

typedef for T

type mcrl2::utilities::unordered_map::node_type

typedef for value_type

type mcrl2::utilities::unordered_map::pointer

typedef for typename std::allocator_traits< Allocator >::pointer

type mcrl2::utilities::unordered_map::reference

typedef for value_type &

type mcrl2::utilities::unordered_map::size_type

typedef for std::size_t

type mcrl2::utilities::unordered_map::value_type

typedef for std::pair< const Key, T >

Private types

type mcrl2::utilities::unordered_map::bucket_type

typedef for typename Set::bucket_type

type mcrl2::utilities::unordered_map::Set

typedef for unordered_set< value_type, PairHash, PairEquals, allocator_type, ThreadSafe, Resize >

Private static attributes

constexpr bool mcrl2::utilities::unordered_map::allow_transparent

True iff the hash and equals functions allow transparent lookup,.

Private attributes

Set mcrl2::utilities::unordered_map::m_set

The underlying set storing <key, value> pairs.

Public member functions

const T &at(const key_type &key) const

Provides access to the value associated with the given key.

iterator begin()
const_iterator begin() const
local_iterator begin(size_type n)

Returns: An iterator to the elements in the given bucket with index n.

const_local_iterator begin(size_type n) const
size_type bucket(const key_type &key) const noexcept
size_type bucket_count() const noexcept

Returns: The number of buckets.

size_type bucket_size(size_type n) const noexcept
size_type capacity()

Number of elements that can be stored before rehash.

Nonstandard.

const_iterator cbegin() const
const_local_iterator cbegin(size_type n) const
const_iterator cend() const
const_local_iterator cend(size_type n) const
void clear()

Clears the content.

size_type count(const key_type &key) const

Returns: The number of elements matching the specified key.

std::pair<iterator, bool> emplace(Args&&... args)
iterator emplace_hint(const_iterator, Args&&... args)
bool empty() const noexcept

Returns: True iff the set is empty.

iterator end()
const_iterator end() const
local_iterator end(size_type n)
const_local_iterator end(size_type n) const
void erase(const key_type &key)

Erases elements.

iterator erase(const_iterator it)
iterator find(const Args&... args)

Returns: Element with the specified key.

const_iterator find(const Args&... args) const
const allocator_type &get_allocator() const noexcept

Returns: A reference to the local node allocator.

allocator_type &get_allocator() noexcept
hasher hash_function() const
std::pair<iterator, bool> insert(const value_type &pair)

Inserts elements.

std::pair<iterator, bool> insert(const_iterator hint, const value_type &pair)
std::pair<iterator, bool> insert_or_assign(const Key &k, M &&obj)
std::pair<iterator, bool> insert_or_assign(const_iterator, const Key &k, M &&obj)
std::pair<iterator, bool> insert_or_assign(const_iterator, Key &&k, M &&obj)
std::pair<iterator, bool> insert_or_assign(Key &&k, M &&obj)
key_equal key_eq() const
float load_factor() const
size_type max_bucket_count() const noexcept
float max_load_factor() const
void max_load_factor(float factor)
size_type max_size() const noexcept
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.

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.

size_type size() const

Returns: The number of elements.

std::pair<iterator, bool> try_emplace(const key_type &key, Args&&... args)
iterator try_emplace(const_iterator, const Key &k, Args&&... args)
iterator try_emplace(const_iterator, Key &&k, Args&&... args)
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.