20 #ifndef __TBB_concurrent_unordered_map_H 21 #define __TBB_concurrent_unordered_map_H 28 namespace interface5 {
31 template<
typename Key,
typename T,
typename Hash_compare,
typename Allocator,
bool Allow_multimapping>
39 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 40 typedef internal::node_handle<Key, value_type, Allocator>
node_type;
41 #endif // __TBB_UNORDERED_NODE_HANDLE_PRESENT 48 template<
class Type1,
class Type2>
56 template<
typename Key,
typename T,
typename Hasher,
typename Key_equality,
typename Allocator>
59 template <
typename Key,
typename T,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
60 typename Allocator = tbb::tbb_allocator<std::pair<const Key, T> > >
62 public internal::concurrent_unordered_base< concurrent_unordered_map_traits<Key, T,
63 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, false> >
66 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
68 typedef internal::concurrent_unordered_base< traits_type >
base_type;
75 using base_type::find;
76 using base_type::insert;
87 typedef typename base_type::pointer
pointer;
99 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 101 #endif // __TBB_UNORDERED_NODE_HANDLE_PRESENT 121 template <
typename Iterator>
130 template <
typename Iterator>
137 template <
typename Iterator>
145 #if __TBB_INITIALIZER_LISTS_PRESENT 152 insert(il.begin(),il.end());
158 insert(il.begin(), il.end());
165 insert(il.begin(), il.end());
168 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 171 #if __TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 178 return static_cast<concurrent_unordered_map&>(base_type::operator=(table));
187 return static_cast<concurrent_unordered_map&>(base_type::operator=(
std::move(table)));
189 #endif //__TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 191 #if __TBB_CPP11_RVALUE_REF_PRESENT 196 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 197 template<
typename Hash,
typename Equality>
201 template<
typename Hash,
typename Equality>
205 template<
typename Hash,
typename Equality>
209 template<
typename Hash,
typename Equality>
213 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 229 return ((*where).second);
241 return ((*where).second);
253 return ((*where).second);
257 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 262 template<
template<
typename...>
typename Map,
typename Key,
typename Element,
typename... Args>
263 using cu_map_t = Map<
265 std::conditional_t< (
sizeof...(Args)>0) && !is_allocator_v< pack_element_t<0, Args...> >,
267 std::conditional_t< (
sizeof...(Args)>1) && !is_allocator_v< pack_element_t<1, Args...> >,
268 pack_element_t<1, Args...>, std::equal_to<Key> >,
269 std::conditional_t< (
sizeof...(Args)>0) && is_allocator_v< pack_element_t<
sizeof...(Args)-1, Args...> >,
276 concurrent_unordered_map (I, I)
277 -> internal::cu_map_t<concurrent_unordered_map, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>>;
280 template<
typename I,
typename... Args>
281 concurrent_unordered_map(I, I,
size_t, Args...)
282 -> internal::cu_map_t<concurrent_unordered_map, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>, Args...>;
285 template<
typename Key,
typename Element>
286 concurrent_unordered_map(std::initializer_list<std::pair<const Key, Element>>)
287 -> internal::cu_map_t<concurrent_unordered_map, Key, Element>;
290 template<
typename Key,
typename Element,
typename... Args>
291 concurrent_unordered_map(std::initializer_list<std::pair<const Key, Element>>,
size_t, Args...)
292 -> internal::cu_map_t<concurrent_unordered_map, Key, Element, Args...>;
296 template <
typename Key,
typename T,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
297 typename Allocator = tbb::tbb_allocator<std::pair<const Key, T> > >
298 class concurrent_unordered_multimap :
299 public internal::concurrent_unordered_base< concurrent_unordered_map_traits< Key, T,
300 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, true> >
303 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
305 typedef internal::concurrent_unordered_base<traits_type>
base_type;
306 #if __TBB_EXTRA_DEBUG 309 using traits_type::allow_multimapping;
311 using base_type::insert;
334 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 336 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 356 template <
typename Iterator>
365 template <
typename Iterator>
372 template <
typename Iterator>
380 #if __TBB_INITIALIZER_LISTS_PRESENT 383 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
385 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
387 insert(il.begin(),il.end());
393 insert(il.begin(), il.end());
400 insert(il.begin(), il.end());
403 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 405 #if __TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 412 return static_cast<concurrent_unordered_multimap&>(base_type::operator=(table));
415 concurrent_unordered_multimap(concurrent_unordered_multimap&& table)
416 : base_type(std::
move(table))
419 concurrent_unordered_multimap& operator=(concurrent_unordered_multimap&& table)
421 return static_cast<concurrent_unordered_multimap&>(base_type::operator=(
std::move(table)));
423 #endif //__TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 425 #if __TBB_CPP11_RVALUE_REF_PRESENT 430 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 431 template<
typename Hash,
typename Equality>
433 { this->internal_merge(source); }
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 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 454 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 459 -> internal::cu_map_t<concurrent_unordered_multimap, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>>;
462 template<
typename I,
typename... Args>
464 -> internal::cu_map_t<concurrent_unordered_multimap, internal::iterator_key_t<I>, internal::iterator_mapped_t<I>, Args...>;
467 template<
typename Key,
typename Element>
469 -> internal::cu_map_t<concurrent_unordered_multimap, Key, Element>;
472 template<
typename Key,
typename Element,
typename... Args>
479 using interface5::concurrent_unordered_map;
480 using interface5::concurrent_unordered_multimap;
484 #endif// __TBB_concurrent_unordered_map_H concurrent_unordered_map_traits(const hash_compare &hc)
base_type::pointer pointer
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
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 ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle * key
concurrent_unordered_map(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
void merge(concurrent_unordered_map< Key, T, Hash, Equality, Allocator > &source)
concurrent_unordered_multimap(const concurrent_unordered_multimap &table, const Allocator &a)
void move(tbb_thread &t1, tbb_thread &t2)
concurrent_unordered_multimap(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
void merge(concurrent_unordered_map< Key, T, Hash, Equality, Allocator > &&source)
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 allocator_type &a)
base_type::iterator local_iterator
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
const mapped_type & at(const key_type &key) const
concurrent_unordered_map(const concurrent_unordered_map &table, const Allocator &a)
base_type::size_type size_type
std::pair< iterator, bool > insert(const value_type &value)
iterator find(const key_type &key)
hash_compare my_hash_compare
concurrent_unordered_map(size_type n_of_buckets, const allocator_type &a)
std::pair< const Key, T > value_type
concurrent_unordered_map(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::node_type node_type
concurrent_unordered_map(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
static const size_type initial_bucket_number
base_type::const_iterator const_iterator
base_type::iterator local_iterator
Class for determining type of std::allocator<T>::value_type.
base_type::allocator_type allocator_type
concurrent_unordered_multimap(concurrent_unordered_multimap &&table, const Allocator &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 end
concurrent_unordered_map_traits()
internal::concurrent_unordered_base< traits_type > base_type
base_type::allocator_type allocator_type
concurrent_unordered_multimap(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::const_reference const_reference
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
concurrent_unordered_map(const Allocator &a)
base_type::difference_type difference_type
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())
concurrent_unordered_map(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
void merge(concurrent_unordered_multimap< Key, T, Hash, Equality, Allocator > &source)
concurrent_unordered_multimap(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_map(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::reference reference
base_type::value_type value_type
base_type::difference_type difference_type
Hash_compare hash_compare
auto first(Container &c) -> decltype(begin(c))
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())
concurrent_unordered_multimap(size_type n_of_buckets, const allocator_type &a)
allocator_traits< Alloc >::template rebind_alloc< T >::other type
void merge(concurrent_unordered_multimap< Key, T, Hash, Equality, Allocator > &&source)
static const Key & get_key(const std::pair< Type1, Type2 > &value)
void internal_merge(SourceType &source)
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_multimap(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
base_type::const_iterator const_local_iterator
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
base_type::value_type value_type
base_type::iterator iterator
void merge(concurrent_unordered_map< Key, T, Hash, Equality, Allocator > &&source)
internal::concurrent_unordered_base< traits_type > base_type
void merge(concurrent_unordered_multimap< Key, T, Hash, Equality, Allocator > &&source)
auto last(Container &c) -> decltype(begin(c))
base_type::const_iterator const_iterator
concurrent_unordered_multimap(const Allocator &a)
base_type::iterator iterator
concurrent_unordered_map_traits< Key, T, hash_compare, Allocator, false > traits_type
base_type::const_reference const_reference
mapped_type & at(const key_type &key)
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::node_type node_type
base_type::size_type size_type
concurrent_unordered_map(concurrent_unordered_map &&table, const Allocator &a)
tbb::internal::allocator_rebind< Allocator, value_type >::type allocator_type
base_type::const_pointer const_pointer
concurrent_unordered_base & operator=(const concurrent_unordered_base &right)
base_type::pointer pointer
void merge(concurrent_unordered_multimap< Key, T, Hash, Equality, Allocator > &source)
internal::node_handle< Key, value_type, Allocator > node_type
void merge(concurrent_unordered_map< Key, T, Hash, Equality, Allocator > &source)
base_type::const_pointer const_pointer
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
mapped_type & operator[](const key_type &key)
base_type::reference reference
Identifiers declared inside namespace internal should never be used directly by client code.