STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | List of all members
Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type > Class Template Reference

The concurrent_unordered_map class is a concurrency-safe container that controls a varying-length sequence of elements of type std::pair<const _Key_type, _Element_type>. The sequence is represented in a way that enables concurrency-safe append, element access, iterator access, and iterator traversal operations. More...

#include <concurrent_unordered_map.h>

Inheritance diagram for Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >:
Concurrency::details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false > > Concurrency::details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >

Public Types

typedef concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type > _Mytype
 
typedef details::_Hash_compare< _Key_type, _Hasher, _Key_equality > _Key_compare
 
typedef details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, _Key_compare, _Allocator_type, false > > _Mybase
 
typedef _Key_type key_type
 The type of an ordering key. More...
 
typedef _Mybase::value_type value_type
 The type of an element. More...
 
typedef _Element_type mapped_type
 The type of a mapped value associated with each key. More...
 
typedef _Hasher hasher
 The type of the hash function. More...
 
typedef _Key_equality key_equal
 The type of the comparison function. More...
 
typedef _Mybase::allocator_type allocator_type
 The type of an allocator for managing storage. More...
 
typedef _Mybase::pointer pointer
 The type of a pointer to an element. More...
 
typedef _Mybase::const_pointer const_pointer
 The type of a constant pointer to an element. More...
 
typedef _Mybase::reference reference
 The type of a reference to an element. More...
 
typedef _Mybase::const_reference const_reference
 The type of a constant reference to an element. More...
 
typedef _Mybase::size_type size_type
 The type of an unsigned distance between two elements. More...
 
typedef _Mybase::difference_type difference_type
 The type of a signed distance between two elements. More...
 
typedef _Mybase::iterator iterator
 The type of an iterator for the controlled sequence. More...
 
typedef _Mybase::const_iterator const_iterator
 The type of a constant iterator for the controlled sequence. More...
 
typedef _Mybase::iterator local_iterator
 The type of a bucket iterator for the controlled sequence. More...
 
typedef _Mybase::const_iterator const_local_iterator
 The type of a constant bucket iterator for the controlled sequence. More...
 
- Public Types inherited from Concurrency::details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false > >
typedef _Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false > > _Mytype
 
typedef _Split_ordered_list< typename details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >::value_type, typename details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >::allocator_type_Mylist
 
typedef details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >::_Key_compare _Key_compare
 
typedef details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >::_Value_compare _Value_compare
 
typedef details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >::value_type value_type
 
typedef details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >::key_type key_type
 
typedef details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >::allocator_type allocator_type
 
typedef allocator_type::pointer pointer
 
typedef allocator_type::const_pointer const_pointer
 
typedef allocator_type::reference reference
 
typedef allocator_type::const_reference const_reference
 
typedef allocator_type::size_type size_type
 
typedef allocator_type::difference_type difference_type
 
typedef std::conditional< std::is_same< key_type, value_type >::value, typename _Mylist::const_iterator, typename _Mylist::iterator >::type iterator
 
typedef _Mylist::const_iterator const_iterator
 
typedef iterator local_iterator
 
typedef const_iterator const_local_iterator
 
typedef _Mylist::_Nodeptr _Nodeptr
 
typedef _Mylist::_Full_iterator _Full_iterator
 
typedef _Mylist::_Full_const_iterator _Full_const_iterator
 
- Public Types inherited from Concurrency::details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >
enum  
 
typedef std::pair< const _Key_type, _Element_type > value_type
 
typedef _Key_type key_type
 
typedef details::_Hash_compare< _Key_type, _Hasher, _Key_equality > _Key_compare
 
typedef _Allocator_type::template rebind< value_type >::other allocator_type
 

Public Member Functions

 concurrent_unordered_map (size_type _Number_of_buckets=8, const hasher &_Hasher=hasher(), const key_equal &_Key_equality=key_equal(), const allocator_type &_Allocator=allocator_type())
 Constructs a concurrent unordered map. More...
 
 concurrent_unordered_map (const allocator_type &_Allocator)
 Constructs a concurrent unordered map. More...
 
template<typename _Iterator >
 concurrent_unordered_map (_Iterator _Begin, _Iterator _End, size_type _Number_of_buckets=8, const hasher &_Hasher=hasher(), const key_equal &_Key_equality=key_equal(), const allocator_type &_Allocator=allocator_type())
 Constructs a concurrent unordered map. More...
 
 concurrent_unordered_map (const concurrent_unordered_map &_Umap)
 Constructs a concurrent unordered map. More...
 
 concurrent_unordered_map (const concurrent_unordered_map &_Umap, const allocator_type &_Allocator)
 Constructs a concurrent unordered map. More...
 
 concurrent_unordered_map (concurrent_unordered_map &&_Umap)
 Constructs a concurrent unordered map. More...
 
concurrent_unordered_mapoperator= (const concurrent_unordered_map &_Umap)
 Assigns the contents of another concurrent_unordered_map object to this one. This method is not concurrency-safe. More...
 
concurrent_unordered_mapoperator= (concurrent_unordered_map &&_Umap)
 Assigns the contents of another concurrent_unordered_map object to this one. This method is not concurrency-safe. More...
 
std::pair< iterator, boolinsert (const value_type &_Value)
 Adds elements to the concurrent_unordered_map object. More...
 
iterator insert (const_iterator _Where, const value_type &_Value)
 Adds elements to the concurrent_unordered_map object. More...
 
template<class _Iterator >
void insert (_Iterator _First, _Iterator _Last)
 Adds elements to the concurrent_unordered_map object. More...
 
template<class _Valty >
std::pair< iterator, boolinsert (_Valty &&_Value)
 Adds elements to the concurrent_unordered_map object. More...
 
template<class _Valty >
std::enable_if<!std::is_same< const_iterator, typename std::remove_reference< _Valty >::type >::value, iterator >::type insert (const_iterator _Where, _Valty &&_Value)
 Adds elements to the concurrent_unordered_map object. More...
 
iterator unsafe_erase (const_iterator _Where)
 Removes elements from the concurrent_unordered_map at specified positions. This method is not concurrency-safe. More...
 
iterator unsafe_erase (const_iterator _Begin, const_iterator _End)
 Removes elements from the concurrent_unordered_map at specified positions. This method is not concurrency-safe. More...
 
size_type unsafe_erase (const key_type &_Keyval)
 Removes elements from the concurrent_unordered_map at specified positions. This method is not concurrency-safe. More...
 
void swap (concurrent_unordered_map &_Umap)
 Swaps the contents of two concurrent_unordered_map objects. This method is not concurrency-safe. More...
 
hasher hash_function () const
 Gets the stored hash function object. More...
 
key_equal key_eq () const
 Gets the stored equality comparison function object. More...
 
mapped_typeoperator[] (const key_type &_Keyval)
 Finds or inserts an element with the specified key. This method is concurrency-safe. More...
 
mapped_typeoperator[] (key_type &&_Keyval)
 Finds or inserts an element with the specified key. This method is concurrency-safe. More...
 
mapped_typeat (const key_type &_Keyval)
 Finds an element in a concurrent_unordered_map with a specified key value.. This method is concurrency-safe. More...
 
const mapped_typeat (const key_type &_Keyval) const
 Finds an element in a concurrent_unordered_map with a specified key value.. This method is concurrency-safe. More...
 
- Public Member Functions inherited from Concurrency::details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false > >
 _Concurrent_hash (size_type _Number_of_buckets=_Initial_bucket_number, const _Key_compare &_Parg=_Key_compare(), const allocator_type &_Allocator=allocator_type())
 
 _Concurrent_hash (const _Concurrent_hash &_Right, const allocator_type &_Allocator)
 
 _Concurrent_hash (const _Concurrent_hash &_Right)
 
 _Concurrent_hash (_Concurrent_hash &&_Right)
 
_Concurrent_hashoperator= (const _Concurrent_hash &_Right)
 
_Concurrent_hashoperator= (_Concurrent_hash &&_Right)
 
 ~_Concurrent_hash ()
 
allocator_type get_allocator () const
 Returns the stored allocator object for this concurrent container. This method is concurrency safe. More...
 
bool empty () const
 Tests whether no elements are present. This method is concurrency safe. More...
 
size_type size () const
 Returns the number of elements in this concurrent container. This method is concurrency safe. More...
 
size_type max_size () const
 Returns the maximum size of the concurrent container, determined by the allocator. This method is concurrency safe. More...
 
iterator begin ()
 Returns an iterator pointing to the first element in the concurrent container. This method is concurrency safe. More...
 
const_iterator begin () const
 Returns an iterator pointing to the first element in the concurrent container. This method is concurrency safe. More...
 
iterator end ()
 Returns an iterator pointing to the location succeeding the last element in the concurrent container. This method is concurrency safe. More...
 
const_iterator end () const
 Returns a const_iterator pointing to the location succeeding the last element in the concurrent container. This method is concurrency safe. More...
 
const_iterator cbegin () const
 Returns a const iterator pointing to the first element in the concurrent container. This method is concurrency safe. More...
 
const_iterator cend () const
 Returns a const iterator pointing to the location succeeding the last element in the concurrent container. This method is concurrency safe. More...
 
iterator unsafe_erase (const_iterator _Where)
 Removes elements from the container at specified positions. This method is not concurrency-safe. More...
 
iterator unsafe_erase (const_iterator _First, const_iterator _Last)
 Removes elements from the container at specified positions. This method is not concurrency-safe. More...
 
size_type unsafe_erase (const key_type &_Keyval)
 Removes elements from the container at specified positions. This method is not concurrency-safe. More...
 
void swap (_Concurrent_hash &_Right)
 Swaps the contents of two concurrent containers. This function is not concurrency safe. More...
 
void clear ()
 Erases all the elements in the concurrent container. This function is not concurrency safe. More...
 
iterator find (const key_type &_Keyval)
 Finds an element that matches a specified key. This function is concurrency safe. More...
 
const_iterator find (const key_type &_Keyval) const
 Finds an element that matches a specified key. This function is concurrency safe. More...
 
size_type count (const key_type &_Keyval) const
 Counts the number of elements matching a specified key. This function is concurrency safe. More...
 
std::pair< iterator, iteratorequal_range (const key_type &_Keyval)
 Finds a range that matches a specified key. This function is concurrency safe. More...
 
std::pair< const_iterator, const_iteratorequal_range (const key_type &_Keyval) const
 Finds a range that matches a specified key. This function is concurrency safe. More...
 
size_type unsafe_bucket_count () const
 Returns the current number of buckets in this container. More...
 
size_type unsafe_max_bucket_count () const
 Returns the maximum number of buckets in this container. More...
 
size_type unsafe_bucket_size (size_type _Bucket)
 Returns the number of items in a specific bucket of this container. More...
 
size_type unsafe_bucket (const key_type &_Keyval) const
 Returns the bucket index that a specific key maps to in this container. More...
 
local_iterator unsafe_begin (size_type _Bucket)
 Returns an iterator to the first element in this container for a specific bucket. More...
 
const_local_iterator unsafe_begin (size_type _Bucket) const
 Returns an iterator to the first element in this container for a specific bucket. More...
 
local_iterator unsafe_end (size_type _Bucket)
 Returns an iterator to the last element in this container for a specific bucket. More...
 
const_local_iterator unsafe_end (size_type _Bucket) const
 Returns an iterator to the last element in this container for a specific bucket. More...
 
const_local_iterator unsafe_cbegin (size_type) const
 Returns an iterator to the first element in this container for a specific bucket. More...
 
const_local_iterator unsafe_cend (size_type) const
 Returns an iterator to the first element in this container for a specific bucket. More...
 
float load_factor () const
 Computes and returns the current load factor of the container. The load factor is the number of elements in the container divided by the number of buckets. More...
 
float max_load_factor () const
 Gets or sets the maximum load factor of the container. The maximum load factor is the largest number of elements than can be in any bucket before the container grows its internal table. More...
 
void max_load_factor (float _Newmax)
 Gets or sets the maximum load factor of the container. The maximum load factor is the largest number of elements than can be in any bucket before the container grows its internal table. More...
 
void rehash (size_type _Buckets)
 Rebuilds the hash table. More...
 
- Public Member Functions inherited from Concurrency::details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >
 _Concurrent_unordered_map_traits ()
 
 _Concurrent_unordered_map_traits (const _Key_compare &_Traits)
 

Additional Inherited Members

- Static Public Member Functions inherited from Concurrency::details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false > >
static size_type __cdecl _Segment_index_of (size_type _Index)
 
static size_type _Segment_base (size_type _K)
 
static size_type _Segment_size (size_type _K)
 
- Static Public Member Functions inherited from Concurrency::details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >
static const _Type1 & _Key_function (const std::pair< _Type1, _Type2 > &_Value)
 
- Public Attributes inherited from Concurrency::details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false >
_Key_compare _M_comparator
 
- Static Public Attributes inherited from Concurrency::details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false > >
static const size_type _Initial_bucket_number
 
static const size_type _Initial_bucket_load
 
static size_type const _Pointers_per_table
 
- Protected Member Functions inherited from Concurrency::details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, details::_Hash_compare< _Key_type, _Hasher, _Key_equality >, _Allocator_type, false > >
std::pair< iterator, bool_Insert (_ValTy &&_Value)
 
void _Insert (_Iterator _First, _Iterator _Last)
 

Detailed Description

template<typename _Key_type, typename _Element_type, typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
class Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >

The concurrent_unordered_map class is a concurrency-safe container that controls a varying-length sequence of elements of type std::pair<const _Key_type, _Element_type>. The sequence is represented in a way that enables concurrency-safe append, element access, iterator access, and iterator traversal operations.

Template Parameters
_Key_typeThe key type.
_Element_typeThe mapped type.
_HasherThe hash function object type. This argument is optional and the default value is std::hash<_Key_type >.
_Key_equalityThe equality comparison function object type. This argument is optional and the default value is std::equal_to<_Key_type >.
_Allocator_typeThe type that represents the stored allocator object that encapsulates details about the allocation and deallocation of memory for the concurrent unordered map. This argument is optional and the default value is std::allocator<std::pair<_Key_type , _Element_type >>.

For detailed information on the concurrent_unordered_map class, see Parallel Containers and Objects.

See also
Parallel Containers and Objects

Member Typedef Documentation

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef details::_Hash_compare<_Key_type, _Hasher, _Key_equality> Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::_Key_compare
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef details::_Concurrent_hash< details::_Concurrent_unordered_map_traits<_Key_type, _Element_type, _Key_compare, _Allocator_type, false> > Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::_Mybase
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef concurrent_unordered_map<_Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type> Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::_Mytype
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::allocator_type Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::allocator_type

The type of an allocator for managing storage.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::const_iterator Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::const_iterator

The type of a constant iterator for the controlled sequence.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::const_iterator Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::const_local_iterator

The type of a constant bucket iterator for the controlled sequence.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::const_pointer Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::const_pointer

The type of a constant pointer to an element.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::const_reference Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::const_reference

The type of a constant reference to an element.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::difference_type Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::difference_type

The type of a signed distance between two elements.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Hasher Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::hasher

The type of the hash function.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::iterator Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::iterator

The type of an iterator for the controlled sequence.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Key_equality Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::key_equal

The type of the comparison function.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Key_type Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::key_type

The type of an ordering key.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::iterator Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::local_iterator

The type of a bucket iterator for the controlled sequence.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Element_type Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::mapped_type

The type of a mapped value associated with each key.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::pointer Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::pointer

The type of a pointer to an element.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::reference Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::reference

The type of a reference to an element.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::size_type Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::size_type

The type of an unsigned distance between two elements.

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
typedef _Mybase::value_type Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::value_type

The type of an element.

Constructor & Destructor Documentation

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::concurrent_unordered_map ( size_type  _Number_of_buckets = 8,
const hasher _Hasher = hasher(),
const key_equal _Key_equality = key_equal(),
const allocator_type _Allocator = allocator_type() 
)
inlineexplicit

Constructs a concurrent unordered map.

Parameters
_Number_of_bucketsThe initial number of buckets for this unordered map.
_HasherThe hash function for this unordered map.
_Key_equalityThe equality comparison function for this unordered map.
_AllocatorThe allocator for this unordered map.

All constructors store an allocator object _Allocator and initialize the unordered map.

The first constructor specifies an empty initial map and explicitly specifies the number of buckets, hash function, equality function and allocator type to be used.

The second constructor specifies an allocator for the unordered map.

The third constructor specifies values supplied by the iterator range [_Begin , _End ).

The fourth and fifth constructors specify a copy of the concurrent unordered map _Umap .

The last constructor specifies a move of the concurrent unordered map _Umap .

248  : _Mybase(_Number_of_buckets, _Key_compare(_Hasher, _Key_equality), _Allocator)
249  {
250  this->rehash(_Number_of_buckets);
251  }
details::_Hash_compare< _Key_type, _Hasher, _Key_equality > _Key_compare
Definition: concurrent_unordered_map.h:122
details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, _Key_compare, _Allocator_type, false > > _Mybase
Definition: concurrent_unordered_map.h:123
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::concurrent_unordered_map ( const allocator_type _Allocator)
inline

Constructs a concurrent unordered map.

Parameters
_AllocatorThe allocator for this unordered map.

All constructors store an allocator object _Allocator and initialize the unordered map.

The first constructor specifies an empty initial map and explicitly specifies the number of buckets, hash function, equality function and allocator type to be used.

The second constructor specifies an allocator for the unordered map.

The third constructor specifies values supplied by the iterator range [_Begin , _End ).

The fourth and fifth constructors specify a copy of the concurrent unordered map _Umap .

The last constructor specifies a move of the concurrent unordered map _Umap .

269  : _Mybase(8, _Key_compare(), _Allocator)
270  {
271  }
details::_Hash_compare< _Key_type, _Hasher, _Key_equality > _Key_compare
Definition: concurrent_unordered_map.h:122
details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, _Key_compare, _Allocator_type, false > > _Mybase
Definition: concurrent_unordered_map.h:123
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
template<typename _Iterator >
Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::concurrent_unordered_map ( _Iterator  _Begin,
_Iterator  _End,
size_type  _Number_of_buckets = 8,
const hasher _Hasher = hasher(),
const key_equal _Key_equality = key_equal(),
const allocator_type _Allocator = allocator_type() 
)
inline

Constructs a concurrent unordered map.

Template Parameters
_IteratorThe type of the input iterator.
Parameters
_BeginThe position of the first element in the range of elements to be copied.
_EndThe position of the first element beyond the range of elements to be copied.
_Number_of_bucketsThe initial number of buckets for this unordered map.
_HasherThe hash function for this unordered map.
_Key_equalityThe equality comparison function for this unordered map.
_AllocatorThe allocator for this unordered map.

All constructors store an allocator object _Allocator and initialize the unordered map.

The first constructor specifies an empty initial map and explicitly specifies the number of buckets, hash function, equality function and allocator type to be used.

The second constructor specifies an allocator for the unordered map.

The third constructor specifies values supplied by the iterator range [_Begin , _End ).

The fourth and fifth constructors specify a copy of the concurrent unordered map _Umap .

The last constructor specifies a move of the concurrent unordered map _Umap .

310  : _Mybase(_Number_of_buckets, _Key_compare(), allocator_type())
311  {
312  this->rehash(_Number_of_buckets);
313  for (; _Begin != _End; ++_Begin)
314  {
315  this->_Insert(*_Begin);
316  }
317  }
details::_Hash_compare< _Key_type, _Hasher, _Key_equality > _Key_compare
Definition: concurrent_unordered_map.h:122
details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, _Key_compare, _Allocator_type, false > > _Mybase
Definition: concurrent_unordered_map.h:123
_Mybase::allocator_type allocator_type
The type of an allocator for managing storage.
Definition: concurrent_unordered_map.h:159
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::concurrent_unordered_map ( const concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type > &  _Umap)
inline

Constructs a concurrent unordered map.

Parameters
_UmapThe source concurrent_unordered_map object to copy or move elements from.

All constructors store an allocator object _Allocator and initialize the unordered map.

The first constructor specifies an empty initial map and explicitly specifies the number of buckets, hash function, equality function and allocator type to be used.

The second constructor specifies an allocator for the unordered map.

The third constructor specifies values supplied by the iterator range [_Begin , _End ).

The fourth and fifth constructors specify a copy of the concurrent unordered map _Umap .

The last constructor specifies a move of the concurrent unordered map _Umap .

335  : _Mybase(_Umap)
336  {
337  }
details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, _Key_compare, _Allocator_type, false > > _Mybase
Definition: concurrent_unordered_map.h:123
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::concurrent_unordered_map ( const concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type > &  _Umap,
const allocator_type _Allocator 
)
inline

Constructs a concurrent unordered map.

Parameters
_UmapThe source concurrent_unordered_map object to copy or move elements from.
_AllocatorThe allocator for this unordered map.

All constructors store an allocator object _Allocator and initialize the unordered map.

The first constructor specifies an empty initial map and explicitly specifies the number of buckets, hash function, equality function and allocator type to be used.

The second constructor specifies an allocator for the unordered map.

The third constructor specifies values supplied by the iterator range [_Begin , _End ).

The fourth and fifth constructors specify a copy of the concurrent unordered map _Umap .

The last constructor specifies a move of the concurrent unordered map _Umap .

358  : _Mybase(_Umap, _Allocator)
359  {
360  }
details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, _Key_compare, _Allocator_type, false > > _Mybase
Definition: concurrent_unordered_map.h:123
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::concurrent_unordered_map ( concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type > &&  _Umap)
inline

Constructs a concurrent unordered map.

Parameters
_UmapThe source concurrent_unordered_map object to copy or move elements from.

All constructors store an allocator object _Allocator and initialize the unordered map.

The first constructor specifies an empty initial map and explicitly specifies the number of buckets, hash function, equality function and allocator type to be used.

The second constructor specifies an allocator for the unordered map.

The third constructor specifies values supplied by the iterator range [_Begin , _End ).

The fourth and fifth constructors specify a copy of the concurrent unordered map _Umap .

The last constructor specifies a move of the concurrent unordered map _Umap .

378  : _Mybase(std::move(_Umap))
379  {
380  }
details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, _Key_compare, _Allocator_type, false > > _Mybase
Definition: concurrent_unordered_map.h:123
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290

Member Function Documentation

template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
mapped_type& Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::at ( const key_type _Keyval)
inline

Finds an element in a concurrent_unordered_map with a specified key value.. This method is concurrency-safe.

Parameters
_KeyvalThe key value to find.
Returns
A reference to the data value of the element found.

If the argument key value is not found, the function throws an object of class out_of_range.

765  {
766  iterator _Where = this->find(_Keyval);
767 
768  if (_Where == this->end())
769  {
770  throw std::out_of_range("invalid concurrent_unordered_map<K, T> key");
771  }
772 
773  return ((*_Where).second);
774  }
Definition: xutility:563
iterator end()
Returns an iterator pointing to the location succeeding the last element in the concurrent container...
Definition: internal_concurrent_hash.h:292
iterator find(const key_type &_Keyval)
Finds an element that matches a specified key. This function is concurrency safe. ...
Definition: internal_concurrent_hash.h:474
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
const mapped_type& Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::at ( const key_type _Keyval) const
inline

Finds an element in a concurrent_unordered_map with a specified key value.. This method is concurrency-safe.

Parameters
_KeyvalThe key value to find.
Returns
A reference to the data value of the element found.

If the argument key value is not found, the function throws an object of class out_of_range.

790  {
791  const_iterator _Where = this->find(_Keyval);
792 
793  if (_Where == this->end())
794  {
795  throw std::out_of_range("invalid concurrent_unordered_map<K, T> key");
796  }
797 
798  return ((*_Where).second);
799  }
_Mybase::const_iterator const_iterator
The type of a constant iterator for the controlled sequence.
Definition: concurrent_unordered_map.h:207
iterator end()
Returns an iterator pointing to the location succeeding the last element in the concurrent container...
Definition: internal_concurrent_hash.h:292
iterator find(const key_type &_Keyval)
Finds an element that matches a specified key. This function is concurrency safe. ...
Definition: internal_concurrent_hash.h:474
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
hasher Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::hash_function ( ) const
inline

Gets the stored hash function object.

Returns
The stored hash function object.
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
std::pair<iterator, bool> Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::insert ( const value_type _Value)
inline

Adds elements to the concurrent_unordered_map object.

Parameters
_ValueThe value to be inserted.
Returns
A pair that contains an iterator and a boolean value. See the Remarks section for more details.

The first member function determines whether an element X exists in the sequence whose key has equivalent ordering to that of _Value . If not, it creates such an element X and initializes it with _Value . The function then determines the iterator where that designates X. If an insertion occurred, the function returns std::pair(where, true). Otherwise, it returns std::pair(where, false).

The second member function returns insert(_Value ), using _Where as a starting place within the controlled sequence to search for the insertion point.

The third member function inserts the sequence of element values from the range [_First , _Last ).

The last two member functions behave the same as the first two, except that _Value is used to construct the inserted value.

445  {
446  return this->_Insert(_Value);
447  }
_In_ int _Value
Definition: setjmp.h:173
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
iterator Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::insert ( const_iterator  _Where,
const value_type _Value 
)
inline

Adds elements to the concurrent_unordered_map object.

Parameters
_WhereThe starting location to search for an insertion point.
_ValueThe value to be inserted.
Returns
An iterator pointing to the insertion location of the object. If the key already exists in the container an iterator pointing to the duplicate key location in the map is returned.

The first member function determines whether an element X exists in the sequence whose key has equivalent ordering to that of _Value . If not, it creates such an element X and initializes it with _Value . The function then determines the iterator where that designates X. If an insertion occurred, the function returns std::pair(where, true). Otherwise, it returns std::pair(where, false).

The second member function returns insert(_Value ), using _Where as a starting place within the controlled sequence to search for the insertion point.

The third member function inserts the sequence of element values from the range [_First , _Last ).

The last two member functions behave the same as the first two, except that _Value is used to construct the inserted value.

476  {
477  // Current implementation ignores the hint. The method is provided for compatibility with unordered_map.
478  return this->_Insert(_Value).first;
479  }
_In_ int _Value
Definition: setjmp.h:173
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
template<class _Iterator >
void Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::insert ( _Iterator  _First,
_Iterator  _Last 
)
inline

Adds elements to the concurrent_unordered_map object.

Template Parameters
_IteratorThe iterator type used for insertion.
Parameters
_FirstThe beginning of the range to insert.
_LastThe end of the range to insert.

The first member function determines whether an element X exists in the sequence whose key has equivalent ordering to that of _Value . If not, it creates such an element X and initializes it with _Value . The function then determines the iterator where that designates X. If an insertion occurred, the function returns std::pair(where, true). Otherwise, it returns std::pair(where, false).

The second member function returns insert(_Value ), using _Where as a starting place within the controlled sequence to search for the insertion point.

The third member function inserts the sequence of element values from the range [_First , _Last ).

The last two member functions behave the same as the first two, except that _Value is used to construct the inserted value.

508  {
509  this->_Insert(_First, _Last);
510  }
_FwdIt _Last
Definition: algorithm:1936
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
template<class _Valty >
std::pair<iterator, bool> Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::insert ( _Valty &&  _Value)
inline

Adds elements to the concurrent_unordered_map object.

Template Parameters
_ValtyThe type of the value inserted into the map.
Parameters
_ValueThe value to be inserted.
Returns
A pair that contains an iterator and a boolean value. See the Remarks section for more details.

The first member function determines whether an element X exists in the sequence whose key has equivalent ordering to that of _Value . If not, it creates such an element X and initializes it with _Value . The function then determines the iterator where that designates X. If an insertion occurred, the function returns std::pair(where, true). Otherwise, it returns std::pair(where, false).

The second member function returns insert(_Value ), using _Where as a starting place within the controlled sequence to search for the insertion point.

The third member function inserts the sequence of element values from the range [_First , _Last ).

The last two member functions behave the same as the first two, except that _Value is used to construct the inserted value.

539  {
540  return this->_Insert(std::forward<_Valty>(_Value));
541  }
_In_ int _Value
Definition: setjmp.h:173
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
template<class _Valty >
std::enable_if<!std::is_same<const_iterator, typename std::remove_reference<_Valty>::type>::value, iterator>::type Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::insert ( const_iterator  _Where,
_Valty &&  _Value 
)
inline

Adds elements to the concurrent_unordered_map object.

Template Parameters
_ValtyThe type of the value inserted into the map.
Parameters
_WhereThe starting location to search for an insertion point.
_ValueThe value to be inserted.
Returns
An iterator pointing to the insertion location of the object. If the key already exists in the container an iterator pointing to the duplicate key location in the map is returned.

The first member function determines whether an element X exists in the sequence whose key has equivalent ordering to that of _Value . If not, it creates such an element X and initializes it with _Value . The function then determines the iterator where that designates X. If an insertion occurred, the function returns std::pair(where, true). Otherwise, it returns std::pair(where, false).

The second member function returns insert(_Value ), using _Where as a starting place within the controlled sequence to search for the insertion point.

The third member function inserts the sequence of element values from the range [_First , _Last ).

The last two member functions behave the same as the first two, except that _Value is used to construct the inserted value.

576  {
577  // Current implementation ignores the hint. The method is provided for compatibility with unordered_map.
578  return this->_Insert(std::forward<_Valty>(_Value)).first;
579  }
_In_ int _Value
Definition: setjmp.h:173
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
key_equal Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::key_eq ( ) const
inline

Gets the stored equality comparison function object.

Returns
The stored equality comparison function object.
685  {
687  }
_Key_equality _M_key_compare_object
Definition: internal_concurrent_hash.h:55
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
concurrent_unordered_map& Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::operator= ( const concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type > &  _Umap)
inline

Assigns the contents of another concurrent_unordered_map object to this one. This method is not concurrency-safe.

Parameters
_UmapThe source concurrent_unordered_map object.
Returns
A reference to this concurrent_unordered_map object.

After erasing any existing elements a concurrent vector, operator= either copies or moves the contents of _Umap into the concurrent vector.

397  {
398  _Mybase::operator=(_Umap);
399  return (*this);
400  }
_Concurrent_hash & operator=(const _Concurrent_hash &_Right)
Definition: internal_concurrent_hash.h:148
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
concurrent_unordered_map& Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::operator= ( concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type > &&  _Umap)
inline

Assigns the contents of another concurrent_unordered_map object to this one. This method is not concurrency-safe.

Parameters
_UmapThe source concurrent_unordered_map object.
Returns
A reference to this concurrent_unordered_map object.

After erasing any existing elements in a concurrent vector, operator= either copies or moves the contents of _Umap into the concurrent vector.

417  {
419  return (*this);
420  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Concurrent_hash & operator=(const _Concurrent_hash &_Right)
Definition: internal_concurrent_hash.h:148
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
mapped_type& Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::operator[] ( const key_type _Keyval)
inline

Finds or inserts an element with the specified key. This method is concurrency-safe.

Parameters
_KeyvalThe key value to find or insert.
Returns
A reference to the data value of the found or inserted element.

If the argument key value is not found, then it is inserted along with the default value of the data type.

operator[] may be used to insert elements into a map m using m[_Key] = DataValue;, where DataValue is the value of the mapped_type of the element with a key value of _Key.

When using operator[] to insert elements, the returned reference does not indicate whether an insertion is changing a pre-existing element or creating a new one. The member functions find and insert can be used to determine whether an element with a specified key is already present before an insertion.

709  {
710  iterator _Where = this->find(_Keyval);
711 
712  if (_Where == this->end())
713  {
714  _Where = this->_Insert(std::make_pair(_Keyval, mapped_type())).first;
715  }
716 
717  return ((*_Where).second);
718  }
Definition: xutility:563
iterator end()
Returns an iterator pointing to the location succeeding the last element in the concurrent container...
Definition: internal_concurrent_hash.h:292
constexpr pair< typename _Unrefwrap< _Ty1 >::type, typename _Unrefwrap< _Ty2 >::type > make_pair(_Ty1 &&_Val1, _Ty2 &&_Val2)
Definition: utility:323
iterator find(const key_type &_Keyval)
Finds an element that matches a specified key. This function is concurrency safe. ...
Definition: internal_concurrent_hash.h:474
_Element_type mapped_type
The type of a mapped value associated with each key.
Definition: concurrent_unordered_map.h:141
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
mapped_type& Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::operator[] ( key_type &&  _Keyval)
inline

Finds or inserts an element with the specified key. This method is concurrency-safe.

Parameters
_KeyvalThe key value to find or insert.
Returns
A reference to the data value of the found or inserted element.

If the argument key value is not found, then it is inserted along with the default value of the data type.

operator[] may be used to insert elements into a map m using m[_Key] = DataValue;, where DataValue is the value of the mapped_type of the element with a key value of _Key.

When using operator[] to insert elements, the returned reference does not indicate whether an insertion is changing a pre-existing element or creating a new one. The member functions find and insert can be used to determine whether an element with a specified key is already present before an insertion.

740  {
741  iterator _Where = this->find(_Keyval);
742 
743  if (_Where == this->end())
744  {
745  _Where = this->_Insert(std::make_pair(std::forward<key_type>(_Keyval), mapped_type())).first;
746  }
747 
748  return ((*_Where).second);
749  }
Definition: xutility:563
iterator end()
Returns an iterator pointing to the location succeeding the last element in the concurrent container...
Definition: internal_concurrent_hash.h:292
constexpr pair< typename _Unrefwrap< _Ty1 >::type, typename _Unrefwrap< _Ty2 >::type > make_pair(_Ty1 &&_Val1, _Ty2 &&_Val2)
Definition: utility:323
iterator find(const key_type &_Keyval)
Finds an element that matches a specified key. This function is concurrency safe. ...
Definition: internal_concurrent_hash.h:474
_Element_type mapped_type
The type of a mapped value associated with each key.
Definition: concurrent_unordered_map.h:141
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
void Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::swap ( concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type > &  _Umap)
inline

Swaps the contents of two concurrent_unordered_map objects. This method is not concurrency-safe.

Parameters
_UmapThe concurrent_unordered_map object to swap with.
661  {
662  _Mybase::swap(_Umap);
663  }
void swap(_Concurrent_hash &_Right)
Swaps the contents of two concurrent containers. This function is not concurrency safe...
Definition: internal_concurrent_hash.h:424
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
iterator Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::unsafe_erase ( const_iterator  _Where)
inline

Removes elements from the concurrent_unordered_map at specified positions. This method is not concurrency-safe.

Parameters
_WhereThe iterator position to erase from.

The first member function removes the element of the controlled sequence pointed to by _Where . The second member function removes the elements in the range [_Begin , _End ).

The third member function removes the elements in the range delimited by concurrent_unordered_map::equal_range(_Keyval).

Returns
The first two member functions return an iterator that designates the first element remaining beyond any elements removed, or concurrent_unordered_map::end() if no such element exists. The third member function returns the number of elements it removes.
600  {
601  return _Mybase::unsafe_erase(_Where);
602  }
iterator unsafe_erase(const_iterator _Where)
Removes elements from the container at specified positions. This method is not concurrency-safe.
Definition: internal_concurrent_hash.h:350
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
iterator Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::unsafe_erase ( const_iterator  _Begin,
const_iterator  _End 
)
inline

Removes elements from the concurrent_unordered_map at specified positions. This method is not concurrency-safe.

Parameters
_BeginThe position of the first element in the range of elements to be erased.
_EndThe position of the first element beyond the range of elements to be erased.

The first member function removes the element of the controlled sequence pointed to by _Where . The second member function removes the elements in the range [_Begin , _End ).

The third member function removes the elements in the range delimited by concurrent_unordered_map::equal_range(_Keyval).

Returns
The first two member functions return an iterator that designates the first element remaining beyond any elements removed, or concurrent_unordered_map::end() if no such element exists. The third member function returns the number of elements it removes.
626  {
627  return _Mybase::unsafe_erase(_Begin, _End);
628  }
iterator unsafe_erase(const_iterator _Where)
Removes elements from the container at specified positions. This method is not concurrency-safe.
Definition: internal_concurrent_hash.h:350
template<typename _Key_type , typename _Element_type , typename _Hasher = std::hash<_Key_type>, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> >>
size_type Concurrency::concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type >::unsafe_erase ( const key_type _Keyval)
inline

Removes elements from the concurrent_unordered_map at specified positions. This method is not concurrency-safe.

Parameters
_KeyvalThe key value to erase.

The first member function removes the element of the controlled sequence pointed to by _Where . The second member function removes the elements in the range [_Begin , _End ).

The third member function removes the elements in the range delimited by concurrent_unordered_map::equal_range(_Keyval).

Returns
The first two member functions return an iterator that designates the first element remaining beyond any elements removed, or concurrent_unordered_map::end() if no such element exists. The third member function returns the number of elements it removes.
649  {
650  return _Mybase::unsafe_erase(_Keyval);
651  }
iterator unsafe_erase(const_iterator _Where)
Removes elements from the container at specified positions. This method is not concurrency-safe.
Definition: internal_concurrent_hash.h:350

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