24 #ifndef __TBB_concurrent_unordered_map_H 25 #define __TBB_concurrent_unordered_map_H 32 namespace interface5 {
35 template<
typename Key,
typename T,
typename Hash_compare,
typename Allocator,
bool Allow_multimapping>
43 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 44 typedef internal::node_handle<Key, value_type, Allocator>
node_type;
45 #endif // __TBB_UNORDERED_NODE_HANDLE_PRESENT 52 template<
class Type1,
class Type2>
60 template<
typename Key,
typename T,
typename Hasher,
typename Key_equality,
typename Allocator>
63 template <
typename Key,
typename T,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
64 typename Allocator = tbb::tbb_allocator<std::pair<const Key, T> > >
66 public internal::concurrent_unordered_base< concurrent_unordered_map_traits<Key, T,
67 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, false> >
70 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
72 typedef internal::concurrent_unordered_base< traits_type >
base_type;
79 using base_type::find;
80 using base_type::insert;
91 typedef typename base_type::pointer
pointer;
103 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 105 #endif // __TBB_UNORDERED_NODE_HANDLE_PRESENT 125 template <
typename Iterator>
134 template <
typename Iterator>
141 template <
typename Iterator>
149 #if __TBB_INITIALIZER_LISTS_PRESENT 156 insert(il.begin(),il.end());
162 insert(il.begin(), il.end());
169 insert(il.begin(), il.end());
172 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 175 #if __TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 182 return static_cast<concurrent_unordered_map&>(base_type::operator=(table));
191 return static_cast<concurrent_unordered_map&>(base_type::operator=(
std::move(table)));
193 #endif //__TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 195 #if __TBB_CPP11_RVALUE_REF_PRESENT 200 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 201 template<
typename Hash,
typename Equality>
205 template<
typename Hash,
typename Equality>
209 template<
typename Hash,
typename Equality>
213 template<
typename Hash,
typename Equality>
217 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 233 return ((*where).second);
245 return ((*where).second);
257 return ((*where).second);
261 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 266 template<
template<
typename...>
typename Map,
typename Key,
typename Element,
typename... Args>
267 using cu_map_t = Map<
269 std::conditional_t< (
sizeof...(Args)>0) && !is_allocator_v< pack_element_t<0, Args...> >,
271 std::conditional_t< (
sizeof...(Args)>1) && !is_allocator_v< pack_element_t<1, Args...> >,
272 pack_element_t<1, Args...>, std::equal_to<Key> >,
273 std::conditional_t< (
sizeof...(Args)>0) && is_allocator_v< pack_element_t<
sizeof...(Args)-1, Args...> >,
280 concurrent_unordered_map (I, I)
281 -> internal::cu_map_t<concurrent_unordered_map, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>>;
284 template<
typename I,
typename... Args>
285 concurrent_unordered_map(I, I,
size_t, Args...)
286 -> internal::cu_map_t<concurrent_unordered_map, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>, Args...>;
289 template<
typename Key,
typename Element>
290 concurrent_unordered_map(std::initializer_list<std::pair<const Key, Element>>)
291 -> internal::cu_map_t<concurrent_unordered_map, Key, Element>;
294 template<
typename Key,
typename Element,
typename... Args>
295 concurrent_unordered_map(std::initializer_list<std::pair<const Key, Element>>,
size_t, Args...)
296 -> internal::cu_map_t<concurrent_unordered_map, Key, Element, Args...>;
300 template <
typename Key,
typename T,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
301 typename Allocator = tbb::tbb_allocator<std::pair<const Key, T> > >
302 class concurrent_unordered_multimap :
303 public internal::concurrent_unordered_base< concurrent_unordered_map_traits< Key, T,
304 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, true> >
307 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
309 typedef internal::concurrent_unordered_base<traits_type>
base_type;
310 #if __TBB_EXTRA_DEBUG 313 using traits_type::allow_multimapping;
315 using base_type::insert;
338 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 340 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 360 template <
typename Iterator>
369 template <
typename Iterator>
376 template <
typename Iterator>
384 #if __TBB_INITIALIZER_LISTS_PRESENT 387 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
389 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
391 insert(il.begin(),il.end());
397 insert(il.begin(), il.end());
404 insert(il.begin(), il.end());
407 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 409 #if __TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 416 return static_cast<concurrent_unordered_multimap&>(base_type::operator=(table));
419 concurrent_unordered_multimap(concurrent_unordered_multimap&& table)
420 : base_type(std::
move(table))
423 concurrent_unordered_multimap& operator=(concurrent_unordered_multimap&& table)
425 return static_cast<concurrent_unordered_multimap&>(base_type::operator=(
std::move(table)));
427 #endif //__TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 429 #if __TBB_CPP11_RVALUE_REF_PRESENT 434 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 435 template<
typename Hash,
typename Equality>
437 { this->internal_merge(source); }
439 template<
typename Hash,
typename Equality>
441 { this->internal_merge(source); }
443 template<
typename Hash,
typename Equality>
445 { this->internal_merge(source); }
447 template<
typename Hash,
typename Equality>
449 { this->internal_merge(source); }
451 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 458 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 463 -> internal::cu_map_t<concurrent_unordered_multimap, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>>;
466 template<
typename I,
typename... Args>
468 -> internal::cu_map_t<concurrent_unordered_multimap, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>, Args...>;
471 template<
typename Key,
typename Element>
473 -> internal::cu_map_t<concurrent_unordered_multimap, Key, Element>;
476 template<
typename Key,
typename Element,
typename... Args>
483 using interface5::concurrent_unordered_map;
484 using interface5::concurrent_unordered_multimap;
488 #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
concurrent_unordered_multimap(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::size_type size_type
void merge(concurrent_unordered_multimap< Key, T, Hash, Equality, Allocator > &&source)
concurrent_unordered_map_traits(const hash_compare &hc)
void merge(concurrent_unordered_multimap< Key, T, Hash, Equality, Allocator > &source)
concurrent_unordered_map(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
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())
concurrent_unordered_map(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_multimap(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
void merge(concurrent_unordered_map< Key, T, Hash, Equality, Allocator > &&source)
base_type::value_type value_type
base_type::difference_type difference_type
base_type::value_type value_type
base_type::const_iterator const_iterator
base_type::const_iterator const_iterator
hash_compare my_hash_compare
base_type::const_pointer const_pointer
concurrent_unordered_base & operator=(const concurrent_unordered_base &right)
concurrent_unordered_multimap(const Allocator &a)
base_type::iterator local_iterator
concurrent_unordered_multimap(concurrent_unordered_multimap &&table, const Allocator &a)
auto first(Container &c) -> decltype(begin(c))
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
tbb::internal::allocator_rebind< Allocator, value_type >::type allocator_type
mapped_type & at(const key_type &key)
static const Key & get_key(const std::pair< Type1, Type2 > &value)
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())
allocator_traits< Alloc >::template rebind_alloc< T >::other type
concurrent_unordered_map(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
void internal_merge(SourceType &source)
base_type::const_iterator const_local_iterator
concurrent_unordered_map_traits()
base_type::size_type size_type
concurrent_unordered_multimap(size_type n_of_buckets, const allocator_type &a)
base_type::iterator iterator
concurrent_unordered_multimap(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
void merge(concurrent_unordered_multimap< Key, T, Hash, Equality, Allocator > &source)
void merge(concurrent_unordered_map< Key, T, Hash, Equality, Allocator > &source)
concurrent_unordered_map_traits< Key, T, hash_compare, Allocator, false > traits_type
mapped_type & operator[](const key_type &key)
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
concurrent_unordered_map_traits< Key, T, hash_compare, Allocator, true > traits_type
auto last(Container &c) -> decltype(begin(c))
base_type::reference reference
base_type::iterator iterator
concurrent_unordered_map(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
internal::concurrent_unordered_base< traits_type > base_type
std::pair< const Key, T > value_type
base_type::node_type node_type
base_type::const_reference const_reference
concurrent_unordered_multimap(Iterator first, Iterator last, size_type n_of_buckets, 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 value
internal::node_handle< Key, value_type, Allocator > node_type
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
internal::concurrent_unordered_base< traits_type > base_type
const mapped_type & at(const key_type &key) const
base_type::allocator_type allocator_type
base_type::node_type node_type
void merge(concurrent_unordered_map< Key, T, Hash, Equality, Allocator > &source)
base_type::const_reference const_reference
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
Hash_compare hash_compare
concurrent_unordered_multimap(const concurrent_unordered_multimap &table, const Allocator &a)
concurrent_unordered_map(const Allocator &a)
concurrent_unordered_map(concurrent_unordered_map &&table, const Allocator &a)
concurrent_unordered_map(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::difference_type difference_type
void move(tbb_thread &t1, tbb_thread &t2)
base_type::const_iterator const_local_iterator
concurrent_unordered_multimap(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
base_type::reference reference
base_type::iterator local_iterator
iterator find(const key_type &key)
std::pair< iterator, bool > insert(const value_type &value)
base_type::pointer pointer
static const size_type initial_bucket_number
concurrent_unordered_map(const concurrent_unordered_map &table, const Allocator &a)
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())
Class for determining type of std::allocator<T>::value_type.
Identifiers declared inside namespace internal should never be used directly by client code.
base_type::const_pointer const_pointer
void merge(concurrent_unordered_map< Key, T, Hash, Equality, Allocator > &&source)
void merge(concurrent_unordered_multimap< Key, T, Hash, Equality, Allocator > &&source)
base_type::allocator_type allocator_type
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())
base_type::pointer pointer