24 #ifndef __TBB_concurrent_unordered_map_H 25 #define __TBB_concurrent_unordered_map_H 33 namespace interface5 {
36 template<
typename Key,
typename T,
typename Hash_compare,
typename Allocator,
bool Allow_multimapping>
50 template<
class Type1,
class Type2>
58 template <
typename Key,
typename T,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
59 typename Allocator = tbb::tbb_allocator<std::pair<const Key, T> > >
61 public internal::concurrent_unordered_base< concurrent_unordered_map_traits<Key, T,
62 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, false> >
65 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
67 typedef internal::concurrent_unordered_base< traits_type >
base_type;
71 using traits_type::allow_multimapping;
74 using base_type::find;
75 using base_type::insert;
86 typedef typename base_type::pointer
pointer;
101 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
103 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
107 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
111 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
117 template <
typename Iterator>
119 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
121 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
126 template <
typename Iterator>
128 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
133 template <
typename Iterator>
135 const allocator_type& a)
136 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
141 #if __TBB_INITIALIZER_LISTS_PRESENT 142 concurrent_unordered_map(std::initializer_list<value_type> il, size_type n_of_buckets = base_type::initial_bucket_number,
144 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
146 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
148 insert(il.begin(),il.end());
152 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
154 insert(il.begin(), il.end());
158 const allocator_type& a)
159 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
161 insert(il.begin(), il.end());
164 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 166 #if __TBB_CPP11_RVALUE_REF_PRESENT 167 #if !__TBB_IMPLICIT_MOVE_PRESENT 172 concurrent_unordered_map& operator=(
const concurrent_unordered_map& table)
174 return static_cast<concurrent_unordered_map&
>(base_type::operator=(table));
177 concurrent_unordered_map(concurrent_unordered_map&& table)
181 concurrent_unordered_map& operator=(concurrent_unordered_map&& table)
183 return static_cast<concurrent_unordered_map&
>(base_type::operator=(
std::move(table)));
189 #endif //__TBB_CPP11_RVALUE_REF_PRESENT 192 : base_type(table, a)
198 iterator where = find(key);
202 where = insert(std::pair<key_type, mapped_type>(key, mapped_type())).first;
205 return ((*where).second);
208 mapped_type&
at(
const key_type&
key)
210 iterator where = find(key);
217 return ((*where).second);
220 const mapped_type&
at(
const key_type&
key)
const 222 const_iterator where = find(key);
229 return ((*where).second);
233 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 238 template<
template<
typename...>
typename Map,
typename Key,
typename Element,
typename... Args>
239 using cu_map_t = Map<
241 std::conditional_t< (
sizeof...(Args)>0) && !is_allocator_v< pack_element_t<0, Args...> >,
243 std::conditional_t< (
sizeof...(Args)>1) && !is_allocator_v< pack_element_t<1, Args...> >,
244 pack_element_t<1, Args...>, std::equal_to<Key> >,
245 std::conditional_t< (
sizeof...(Args)>0) && is_allocator_v< pack_element_t<
sizeof...(Args)-1, Args...> >,
253 -> internal::cu_map_t<concurrent_unordered_map, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>>;
256 template<
typename I,
typename... Args>
258 -> internal::cu_map_t<concurrent_unordered_map, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>, Args...>;
261 template<
typename Key,
typename Element>
263 -> internal::cu_map_t<concurrent_unordered_map, Key, Element>;
266 template<
typename Key,
typename Element,
typename... Args>
272 template <
typename Key,
typename T,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
273 typename Allocator = tbb::tbb_allocator<std::pair<const Key, T> > >
275 public internal::concurrent_unordered_base< concurrent_unordered_map_traits< Key, T,
276 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, true> >
279 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
281 typedef internal::concurrent_unordered_base<traits_type>
base_type;
282 #if __TBB_EXTRA_DEBUG 285 using traits_type::allow_multimapping;
287 using base_type::insert;
313 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
315 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
319 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
323 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
329 template <
typename Iterator>
331 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
333 : base_type(n_of_buckets,key_compare(a_hasher,a_keyeq), a)
338 template <
typename Iterator>
340 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
345 template <
typename Iterator>
347 const allocator_type& a)
348 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
353 #if __TBB_INITIALIZER_LISTS_PRESENT 356 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
358 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
360 insert(il.begin(),il.end());
364 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
366 insert(il.begin(), il.end());
370 const allocator_type& a)
371 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
373 insert(il.begin(), il.end());
376 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 378 #if __TBB_CPP11_RVALUE_REF_PRESENT 379 #if !__TBB_IMPLICIT_MOVE_PRESENT 384 concurrent_unordered_multimap& operator=(
const concurrent_unordered_multimap& table)
386 return static_cast<concurrent_unordered_multimap&
>(base_type::operator=(table));
389 concurrent_unordered_multimap(concurrent_unordered_multimap&& table)
393 concurrent_unordered_multimap& operator=(concurrent_unordered_multimap&& table)
395 return static_cast<concurrent_unordered_multimap&
>(base_type::operator=(
std::move(table)));
401 #endif //__TBB_CPP11_RVALUE_REF_PRESENT 404 : base_type(table, a)
408 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 413 -> internal::cu_map_t<concurrent_unordered_multimap, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>>;
416 template<
typename I,
typename... Args>
418 -> internal::cu_map_t<concurrent_unordered_multimap, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>, Args...>;
421 template<
typename Key,
typename Element>
423 -> internal::cu_map_t<concurrent_unordered_multimap, Key, Element>;
426 template<
typename Key,
typename Element,
typename... Args>
438 #endif// __TBB_concurrent_unordered_map_H void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp end
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
Hash_compare hash_compare
concurrent_unordered_map_traits< Key, T, hash_compare, Allocator, true > traits_type
concurrent_unordered_multimap(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::allocator_type allocator_type
concurrent_unordered_multimap(size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_map(size_type n_of_buckets=base_type::initial_bucket_number, const hasher &a_hasher=hasher(), const key_equal &a_keyeq=key_equal(), const allocator_type &a=allocator_type())
base_type::const_iterator const_iterator
concurrent_unordered_multimap(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
base_type::difference_type difference_type
concurrent_unordered_map(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::iterator iterator
concurrent_unordered_multimap(const Allocator &a)
base_type::size_type size_type
concurrent_unordered_map(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::pointer pointer
concurrent_unordered_multimap(concurrent_unordered_multimap &&table, const Allocator &a)
__TBB_IMPLICIT_MOVE_PRESENT
auto first(Container &c) -> decltype(begin(c))
mapped_type & operator[](const key_type &key)
base_type::value_type value_type
base_type::difference_type difference_type
concurrent_unordered_multimap(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_multimap(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_map(concurrent_unordered_map &&table, const Allocator &a)
__TBB_IMPLICIT_MOVE_PRESENT
base_type::iterator local_iterator
static const Key & get_key(const std::pair< Type1, Type2 > &value)
base_type::iterator iterator
internal::concurrent_unordered_base< traits_type > base_type
const mapped_type & at(const key_type &key) const
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
base_type::const_iterator const_iterator
base_type::allocator_type allocator_type
concurrent_unordered_multimap(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
auto last(Container &c) -> decltype(begin(c))
base_type::value_type value_type
concurrent_unordered_map(const concurrent_unordered_map &table, const Allocator &a)
concurrent_unordered_map_traits(const hash_compare &hc)
tbb::internal::allocator_rebind< Allocator, value_type >::type allocator_type
concurrent_unordered_map(size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_multimap(Iterator first, Iterator last, size_type n_of_buckets=base_type::initial_bucket_number, const hasher &a_hasher=hasher(), const key_equal &a_keyeq=key_equal(), const allocator_type &a=allocator_type())
base_type::const_iterator const_local_iterator
base_type::const_iterator const_local_iterator
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
concurrent_unordered_map(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key
base_type::size_type size_type
mapped_type & at(const key_type &key)
base_type::iterator local_iterator
base_type::pointer pointer
allocator_traits< Alloc >::template rebind_alloc< T >::other type
concurrent_unordered_multimap(size_type n_of_buckets=base_type::initial_bucket_number, const hasher &a_hasher=hasher(), const key_equal &a_keyeq=key_equal(), const allocator_type &a=allocator_type())
base_type::const_reference const_reference
void move(tbb_thread &t1, tbb_thread &t2)
concurrent_unordered_map(const Allocator &a)
base_type::reference reference
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
base_type::reference reference
std::pair< const Key, T > value_type
concurrent_unordered_multimap(const concurrent_unordered_multimap &table, const Allocator &a)
base_type::const_pointer const_pointer
concurrent_unordered_map(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_map_traits< Key, T, hash_compare, Allocator, false > traits_type
internal::concurrent_unordered_base< traits_type > base_type
hash_compare my_hash_compare
concurrent_unordered_map(Iterator first, Iterator last, size_type n_of_buckets=base_type::initial_bucket_number, const hasher &a_hasher=hasher(), const key_equal &a_keyeq=key_equal(), const allocator_type &a=allocator_type())
Identifiers declared inside namespace internal should never be used directly by client code...
concurrent_unordered_map(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_map_traits()
base_type::const_pointer const_pointer
base_type::const_reference const_reference
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.