18 #define _PPL_CONTAINER
20 #if !(defined (_M_X64) || defined (_M_IX86) || defined (_M_ARM) || defined (_M_ARM64))
21 #error ERROR: Concurrency Runtime is supported only on X64, X86, ARM, and ARM64 architectures.
25 #error ERROR: Concurrency Runtime is not supported when compiling /clr.
28 #pragma pack(push,_CRT_PACKING)
30 #pragma warning(disable: 4100) // Unreferenced formal parameter - needed for document generation
37 template<
typename _Key_type,
typename _Element_type,
typename _Key_comparator,
typename _Allocator_type,
bool _Allow_multimapping>
41 typedef std::pair<const _Key_type, _Element_type>
value_type;
45 typedef typename _Allocator_type::template rebind<value_type>::other
allocator_type;
82 template<
class _Type1,
class _Type2>
85 return (_Value.first);
120 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> > >
252 : _Mybase(_Number_of_buckets, _Key_compare(_Hasher, _Key_equality), _Allocator)
254 this->
rehash(_Number_of_buckets);
311 template <
typename _Iterator>
314 : _Mybase(_Number_of_buckets, _Key_compare(), allocator_type())
316 this->
rehash(_Number_of_buckets);
317 for (; _Begin != _End; ++_Begin)
482 return this->
_Insert(_Value).first;
510 template<
class _Iterator>
541 template<
class _Valty>
576 template<
class _Valty>
578 typename std::remove_reference<_Valty>::type>::value, iterator>::type
714 iterator _Where = this->
find(_Keyval);
716 if (_Where == this->
end())
721 return ((*_Where).second);
745 iterator _Where = this->
find(_Keyval);
747 if (_Where == this->
end())
752 return ((*_Where).second);
768 mapped_type&
at(
const key_type& _Keyval)
770 iterator _Where = this->
find(_Keyval);
772 if (_Where == this->
end())
774 throw std::out_of_range(
"invalid concurrent_unordered_map<K, T> key");
777 return ((*_Where).second);
793 const mapped_type&
at(
const key_type& _Keyval)
const
795 const_iterator _Where = this->
find(_Keyval);
797 if (_Where == this->
end())
799 throw std::out_of_range(
"invalid concurrent_unordered_map<K, T> key");
802 return ((*_Where).second);
835 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> > >
967 : _Mybase(_Number_of_buckets, _Key_compare(_Hasher, _Key_equality), _Allocator)
969 this->
rehash(_Number_of_buckets);
1026 template <
typename _Iterator>
1029 : _Mybase(_Number_of_buckets, _Key_compare(), allocator_type())
1031 this->
rehash(_Number_of_buckets);
1032 for (; _Begin != _End; ++_Begin)
1163 return this->
_Insert(_Value).first;
1192 return this->
_Insert(_Value).first;
1218 template<
class _Iterator>
1247 template<
class _Valty>
1279 template<
class _Valty>
1280 typename std::enable_if<!std::is_same<const_iterator, typename std::remove_reference<_Valty>::type>::value, iterator>::type
1399 #pragma warning(pop)
concurrent_unordered_multimap(const concurrent_unordered_multimap &_Umap, const allocator_type &_Allocator)
Constructs a concurrent unordered multimap.
Definition: concurrent_unordered_map.h:1077
_Mybase::const_iterator const_iterator
The type of a constant iterator for the controlled sequence.
Definition: concurrent_unordered_map.h:926
concurrent_unordered_map(const allocator_type &_Allocator)
Constructs a concurrent unordered map.
Definition: concurrent_unordered_map.h:273
concurrent_unordered_multimap(const allocator_type &_Allocator)
Constructs a concurrent unordered multimap.
Definition: concurrent_unordered_map.h:988
details::_Hash_compare< _Key_type, _Hasher, _Key_equality > _Key_compare
Definition: concurrent_unordered_map.h:126
constexpr const _Ty &() _Left
Definition: algorithm:3722
hasher hash_function() const
Returns the stored hash function object.
Definition: concurrent_unordered_map.h:1378
concurrent_unordered_map & operator=(const concurrent_unordered_map &_Umap)
Assigns the contents of another concurrent_unordered_map object to this one. This method is not concu...
Definition: concurrent_unordered_map.h:400
_Mybase::difference_type difference_type
The type of a signed distance between two elements.
Definition: concurrent_unordered_map.h:914
static const _Type1 & _Key_function(const std::pair< _Type1, _Type2 > &_Value)
Definition: concurrent_unordered_map.h:83
concurrent_unordered_multimap(const concurrent_unordered_multimap &_Umap)
Constructs a concurrent unordered multimap.
Definition: concurrent_unordered_map.h:1054
_Mybase::pointer pointer
The type of a pointer to an element.
Definition: concurrent_unordered_map.h:169
void rehash(size_type _Buckets)
Rebuilds the hash table.
Definition: internal_concurrent_hash.h:842
value_type second_argument_type
Definition: concurrent_unordered_map.h:66
_Mybase::difference_type difference_type
The type of a signed distance between two elements.
Definition: concurrent_unordered_map.h:199
iterator insert(const_iterator _Where, const value_type &_Value)
Adds elements to the concurrent_unordered_multimap object.
Definition: concurrent_unordered_map.h:1189
concurrent_unordered_multimap(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 multimap.
Definition: concurrent_unordered_map.h:965
void insert(_Iterator _First, _Iterator _Last)
Adds elements to the concurrent_unordered_map object.
Definition: concurrent_unordered_map.h:511
Definition: concurrent_unordered_map.h:38
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.
Definition: concurrent_unordered_map.h:250
_Mybase::size_type size_type
The type of an unsigned distance between two elements.
Definition: concurrent_unordered_map.h:193
_Key_equality _M_key_compare_object
Definition: internal_concurrent_hash.h:55
Definition: internal_concurrent_hash.h:27
void insert(_Iterator _First, _Iterator _Last)
Adds elements to the concurrent_unordered_multimap object.
Definition: concurrent_unordered_map.h:1219
_Mybase::const_iterator const_local_iterator
The type of a constant bucket iterator for the controlled sequence.
Definition: concurrent_unordered_map.h:938
void swap(_Concurrent_hash &_Right)
Swaps the contents of two concurrent containers. This function is not concurrency safe...
Definition: internal_concurrent_hash.h:424
_Mybase::reference reference
The type of a reference to an element.
Definition: concurrent_unordered_map.h:181
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_multimap object.
Definition: concurrent_unordered_map.h:1281
iterator unsafe_erase(const_iterator _First, const_iterator _Last)
Removes elements from the concurrent_unordered_multimap at specified positions. This method is not co...
Definition: concurrent_unordered_map.h:1354
_Key_equality key_equal
The type of the comparison function.
Definition: concurrent_unordered_map.h:872
hasher _M_hash_object
Definition: internal_concurrent_hash.h:54
const mapped_type & at(const key_type &_Keyval) const
Finds an element in a concurrent_unordered_map with a specified key value.. This method is concurrenc...
Definition: concurrent_unordered_map.h:793
The Concurrency namespace provides classes and functions that provide access to the Concurrency Runti...
Definition: agents.h:43
details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, _Key_compare, _Allocator_type, true > > _Mybase
Definition: concurrent_unordered_map.h:842
_Mybase::const_iterator const_iterator
The type of a constant iterator for the controlled sequence.
Definition: concurrent_unordered_map.h:211
allocator_type::const_pointer const_pointer
Definition: internal_concurrent_hash.h:101
iterator unsafe_erase(const_iterator _Begin, const_iterator _End)
Removes elements from the concurrent_unordered_map at specified positions. This method is not concurr...
Definition: concurrent_unordered_map.h:629
_Key_compare _M_comparator
Definition: concurrent_unordered_map.h:79
void swap(concurrent_unordered_map &_Umap)
Swaps the contents of two concurrent_unordered_map objects. This method is not concurrency-safe.
Definition: concurrent_unordered_map.h:664
_Mybase::pointer pointer
The type of a pointer to an element.
Definition: concurrent_unordered_map.h:884
Definition: internal_concurrent_hash.h:88
_Mybase::size_type size_type
The type of an unsigned distance between two elements.
Definition: concurrent_unordered_map.h:908
std::conditional< std::is_same< key_type, value_type >::value, typename _Mylist::const_iterator, typename _Mylist::iterator >::type iterator
Definition: internal_concurrent_hash.h:108
iterator end()
Returns an iterator pointing to the location succeeding the last element in the concurrent container...
Definition: internal_concurrent_hash.h:292
std::pair< iterator, bool > insert(_Valty &&_Value)
Adds elements to the concurrent_unordered_map object.
Definition: concurrent_unordered_map.h:542
hasher hash_function() const
Gets the stored hash function object.
Definition: concurrent_unordered_map.h:676
_Container_base0 _Container_base
Definition: xutility:269
mapped_type & at(const key_type &_Keyval)
Finds an element in a concurrent_unordered_map with a specified key value.. This method is concurrenc...
Definition: concurrent_unordered_map.h:768
std::pair< const _Key_type, _Element_type > value_type
Definition: concurrent_unordered_map.h:41
_Mybase::iterator local_iterator
The type of a bucket iterator for the controlled sequence.
Definition: concurrent_unordered_map.h:932
_Concurrent_unordered_map_traits(const _Key_compare &_Traits)
Definition: concurrent_unordered_map.h:56
void swap(concurrent_unordered_multimap &_Umap)
Swaps the contents of two concurrent_unordered_multimap objects. This method is not concurrency-safe...
Definition: concurrent_unordered_map.h:1366
Definition: internal_split_ordered_list.h:30
Definition: concurrent_unordered_map.h:49
concurrent_unordered_multimap & operator=(const concurrent_unordered_multimap &_Umap)
Assigns the contents of another concurrent_unordered_multimap object to this one. This method is not ...
Definition: concurrent_unordered_map.h:1115
iterator insert(const value_type &_Value)
Adds elements to the concurrent_unordered_multimap object.
Definition: concurrent_unordered_map.h:1161
_Allocator_type::template rebind< value_type >::other allocator_type
Definition: concurrent_unordered_map.h:45
_Mybase::iterator iterator
The type of an iterator for the controlled sequence.
Definition: concurrent_unordered_map.h:205
concurrent_unordered_multimap(concurrent_unordered_multimap &&_Umap)
Constructs a concurrent unordered multimap.
Definition: concurrent_unordered_map.h:1097
iterator unsafe_erase(const_iterator _Where)
Removes elements from the concurrent_unordered_multimap at specified positions. This method is not co...
Definition: concurrent_unordered_map.h:1305
details::_Hash_compare< _Key_type, _Hasher, _Key_equality > _Key_compare
Definition: concurrent_unordered_map.h:841
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
constexpr pair< typename _Unrefwrap< _Ty1 >::type, typename _Unrefwrap< _Ty2 >::type > make_pair(_Ty1 &&_Val1, _Ty2 &&_Val2)
Definition: utility:340
_Mybase::const_iterator const_local_iterator
The type of a constant bucket iterator for the controlled sequence.
Definition: concurrent_unordered_map.h:223
_Key_comparator _Key_compare
Definition: concurrent_unordered_map.h:43
_Traits::value_type value_type
Definition: internal_concurrent_hash.h:97
_Mybase::iterator iterator
The type of an iterator for the controlled sequence.
Definition: concurrent_unordered_map.h:920
std::pair< iterator, bool > _Insert(_ValTy &&_Value)
Definition: internal_concurrent_hash.h:861
allocator_type::reference reference
Definition: internal_concurrent_hash.h:102
concurrent_unordered_map< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type > _Mytype
Definition: concurrent_unordered_map.h:125
concurrent_unordered_map(concurrent_unordered_map &&_Umap)
Constructs a concurrent unordered map.
Definition: concurrent_unordered_map.h:382
size_type unsafe_erase(const key_type &_Keyval)
Removes elements from the concurrent_unordered_multimap at specified positions. This method is not co...
Definition: concurrent_unordered_map.h:1328
iterator insert(_Valty &&_Value)
Adds elements to the concurrent_unordered_multimap object.
Definition: concurrent_unordered_map.h:1248
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
allocator_type::pointer pointer
Definition: internal_concurrent_hash.h:100
_Key_type key_type
The type of an ordering key.
Definition: concurrent_unordered_map.h:133
_Mybase::value_type value_type
The type of an element.
Definition: concurrent_unordered_map.h:139
size_type unsafe_erase(const key_type &_Keyval)
Removes elements from the concurrent_unordered_map at specified positions. This method is not concurr...
Definition: concurrent_unordered_map.h:652
_Key_equality key_equal
The type of the comparison function.
Definition: concurrent_unordered_map.h:157
_Value_compare(const _Key_compare &_Traits)
Definition: concurrent_unordered_map.h:74
_Key_type key_type
Definition: concurrent_unordered_map.h:42
_Hasher hasher
The type of the hash function.
Definition: concurrent_unordered_map.h:151
_Mybase::const_pointer const_pointer
The type of a constant pointer to an element.
Definition: concurrent_unordered_map.h:890
_Mybase::const_pointer const_pointer
The type of a constant pointer to an element.
Definition: concurrent_unordered_map.h:175
_In_ _Value
Definition: corecrt_wstdlib.h:65
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.
Definition: concurrent_unordered_map.h:312
key_equal key_eq() const
Returns the stored equality comparison function object.
Definition: concurrent_unordered_map.h:1390
allocator_type::difference_type difference_type
Definition: internal_concurrent_hash.h:106
_Concurrent_unordered_map_traits()
Definition: concurrent_unordered_map.h:52
allocator_type::const_reference const_reference
Definition: internal_concurrent_hash.h:103
_Mybase::reference reference
The type of a reference to an element.
Definition: concurrent_unordered_map.h:896
mapped_type & operator[](const key_type &_Keyval)
Finds or inserts an element with the specified key. This method is concurrency-safe.
Definition: concurrent_unordered_map.h:712
_Element_type mapped_type
The type of a mapped value associated with each key.
Definition: concurrent_unordered_map.h:145
details::_Concurrent_hash< details::_Concurrent_unordered_map_traits< _Key_type, _Element_type, _Key_compare, _Allocator_type, false > > _Mybase
Definition: concurrent_unordered_map.h:127
The concurrent_unordered_multimap class is an concurrency-safe container that controls a varying-leng...
Definition: concurrent_unordered_map.h:836
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Element_type mapped_type
The type of a mapped value associated with each key.
Definition: concurrent_unordered_map.h:860
allocator_type::size_type size_type
Definition: internal_concurrent_hash.h:105
std::pair< iterator, bool > insert(const value_type &_Value)
Adds elements to the concurrent_unordered_map object.
Definition: concurrent_unordered_map.h:448
concurrent_unordered_multimap(_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 multimap.
Definition: concurrent_unordered_map.h:1027
iterator unsafe_erase(const_iterator _Where)
Removes elements from the concurrent_unordered_map at specified positions. This method is not concurr...
Definition: concurrent_unordered_map.h:603
value_type first_argument_type
Definition: concurrent_unordered_map.h:65
_Mybase::const_reference const_reference
The type of a constant reference to an element.
Definition: concurrent_unordered_map.h:187
_Key_compare _M_comparator
Definition: concurrent_unordered_map.h:87
_Mybase::const_reference const_reference
The type of a constant reference to an element.
Definition: concurrent_unordered_map.h:902
key_equal key_eq() const
Gets the stored equality comparison function object.
Definition: concurrent_unordered_map.h:688
_Mybase::value_type value_type
The type of an element.
Definition: concurrent_unordered_map.h:854
concurrent_unordered_multimap< _Key_type, _Element_type, _Hasher, _Key_equality, _Allocator_type > _Mytype
Definition: concurrent_unordered_map.h:840
concurrent_unordered_map(const concurrent_unordered_map &_Umap)
Constructs a concurrent unordered map.
Definition: concurrent_unordered_map.h:339
bool result_type
Definition: concurrent_unordered_map.h:67
concurrent_unordered_multimap & operator=(concurrent_unordered_multimap &&_Umap)
Assigns the contents of another concurrent_unordered_multimap object to this one. This method is not ...
Definition: concurrent_unordered_map.h:1135
_Hasher hasher
The type of the hash function.
Definition: concurrent_unordered_map.h:866
_Key_type key_type
The type of an ordering key.
Definition: concurrent_unordered_map.h:848
_Mybase::allocator_type allocator_type
The type of an allocator for managing storage.
Definition: concurrent_unordered_map.h:163
_Concurrent_hash & operator=(const _Concurrent_hash &_Right)
Definition: internal_concurrent_hash.h:148
mapped_type & operator[](key_type &&_Keyval)
Finds or inserts an element with the specified key. This method is concurrency-safe.
Definition: concurrent_unordered_map.h:743
concurrent_unordered_map(const concurrent_unordered_map &_Umap, const allocator_type &_Allocator)
Constructs a concurrent unordered map.
Definition: concurrent_unordered_map.h:362
Definition: concurrent_unordered_map.h:60
iterator insert(const_iterator _Where, const value_type &_Value)
Adds elements to the concurrent_unordered_map object.
Definition: concurrent_unordered_map.h:479
_Traits::allocator_type allocator_type
Definition: internal_concurrent_hash.h:99
_FwdIt _Last
Definition: algorithm:1936
_Mybase::allocator_type allocator_type
The type of an allocator for managing storage.
Definition: concurrent_unordered_map.h:878
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.
Definition: concurrent_unordered_map.h:579
_Mybase::iterator local_iterator
The type of a bucket iterator for the controlled sequence.
Definition: concurrent_unordered_map.h:217
constexpr const _Ty &() _Right
Definition: algorithm:3723
concurrent_unordered_map & operator=(concurrent_unordered_map &&_Umap)
Assigns the contents of another concurrent_unordered_map object to this one. This method is not concu...
Definition: concurrent_unordered_map.h:420
The concurrent_unordered_map class is a concurrency-safe container that controls a varying-length seq...
Definition: concurrent_unordered_map.h:121
bool operator()(const value_type &_Left, const value_type &_Right) const
Definition: concurrent_unordered_map.h:69