20 #ifndef __TBB_concurrent_unordered_set_H 21 #define __TBB_concurrent_unordered_set_H 28 namespace interface5 {
31 template<
typename Key,
typename Hash_compare,
typename Allocator,
bool Allow_multimapping>
39 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 43 #endif // __TBB_UNORDERED_NODE_HANDLE_PRESENT 57 template<
typename Key,
typename Hasher,
typename Key_equality,
typename Allocator>
60 template <
typename Key,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
typename Allocator = tbb::tbb_allocator<Key> >
61 class concurrent_unordered_set :
public internal::concurrent_unordered_base< concurrent_unordered_set_traits<Key, internal::hash_compare<Key, Hasher, Key_equality>, Allocator, false> >
64 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
66 typedef internal::concurrent_unordered_base< traits_type >
base_type;
70 using traits_type::allow_multimapping;
72 using base_type::insert;
83 typedef typename base_type::pointer
pointer;
95 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 101 const key_equal& a_keyeq = key_equal(),
const allocator_type& a =
allocator_type())
102 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
106 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
110 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
116 template <
typename Iterator>
118 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
const allocator_type& a =
allocator_type())
119 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
124 template <
typename Iterator>
126 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
131 template <
typename Iterator>
133 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
138 #if __TBB_INITIALIZER_LISTS_PRESENT 139 concurrent_unordered_set(std::initializer_list<value_type> il, size_type n_of_buckets = base_type::initial_bucket_number,
const hasher& a_hasher = hasher(),
141 const key_equal& a_keyeq = key_equal(),
const allocator_type& a =
allocator_type())
142 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
144 insert(il.begin(),il.end());
148 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
150 insert(il.begin(), il.end());
153 concurrent_unordered_set(std::initializer_list<value_type> il, size_type n_of_buckets,
const hasher& a_hasher,
const allocator_type& a)
154 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
156 insert(il.begin(), il.end());
159 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 161 #if __TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 166 concurrent_unordered_set& operator=(
const concurrent_unordered_set& table)
168 return static_cast<concurrent_unordered_set&
>(base_type::operator=(table));
171 concurrent_unordered_set(concurrent_unordered_set&& table)
175 concurrent_unordered_set& operator=(concurrent_unordered_set&& table)
177 return static_cast<concurrent_unordered_set&
>(base_type::operator=(
std::move(table)));
179 #endif //__TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 181 #if __TBB_CPP11_RVALUE_REF_PRESENT 183 : base_type(
std::
move(table), a)
187 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 188 template<
typename Hash,
typename Equality>
190 { this->internal_merge(source); }
192 template<
typename Hash,
typename Equality>
194 { this->internal_merge(source); }
196 template<
typename Hash,
typename Equality>
198 { this->internal_merge(source); }
200 template<
typename Hash,
typename Equality>
202 { this->internal_merge(source); }
204 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 207 : base_type(table, a)
212 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 217 template <
template<
typename...>
typename Set,
typename T,
typename... Args>
218 using cu_set_t = Set <
220 std::conditional_t< (
sizeof...(Args)>0) && !is_allocator_v< pack_element_t<0, Args...> >,
222 std::conditional_t< (
sizeof...(Args)>1) && !is_allocator_v< pack_element_t<1, Args...> >,
223 pack_element_t<1, Args...>, std::equal_to<T> >,
224 std::conditional_t< (
sizeof...(Args)>0) && is_allocator_v< pack_element_t<
sizeof...(Args)-1, Args...> >,
232 -> internal::cu_set_t<concurrent_unordered_set, internal::iterator_value_t<I>>;
235 template<
typename I,
typename... Args>
237 -> internal::cu_set_t<concurrent_unordered_set, internal::iterator_value_t<I>, Args...>;
242 -> internal::cu_set_t<concurrent_unordered_set, T>;
245 template<
typename T,
typename... Args>
251 template <
typename Key,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
252 typename Allocator = tbb::tbb_allocator<Key> >
254 public internal::concurrent_unordered_base< concurrent_unordered_set_traits<Key,
255 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, true> >
258 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
260 typedef internal::concurrent_unordered_base< traits_type >
base_type;
261 #if __TBB_EXTRA_DEBUG 264 using traits_type::allow_multimapping;
266 using base_type::insert;
289 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 291 #endif // __TBB_UNORDERED_NODE_HANDLE_PRESENT 295 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
297 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
301 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
305 const allocator_type& a)
306 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
312 template <
typename Iterator>
314 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
316 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
321 template <
typename Iterator>
323 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
328 template <
typename Iterator>
330 const allocator_type& a)
331 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
336 #if __TBB_INITIALIZER_LISTS_PRESENT 339 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
const allocator_type& a =
allocator_type())
340 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
342 insert(il.begin(),il.end());
346 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
348 insert(il.begin(), il.end());
352 const allocator_type& a)
353 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
355 insert(il.begin(), il.end());
358 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 361 #if __TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 366 concurrent_unordered_multiset& operator=(
const concurrent_unordered_multiset& table)
368 return static_cast<concurrent_unordered_multiset&
>(base_type::operator=(table));
371 concurrent_unordered_multiset(concurrent_unordered_multiset&& table)
375 concurrent_unordered_multiset& operator=(concurrent_unordered_multiset&& table)
377 return static_cast<concurrent_unordered_multiset&
>(base_type::operator=(
std::move(table)));
379 #endif //__TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 381 #if __TBB_CPP11_RVALUE_REF_PRESENT 383 : base_type(
std::
move(table), a)
388 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 389 template<
typename Hash,
typename Equality>
391 { this->internal_merge(source); }
393 template<
typename Hash,
typename Equality>
395 { this->internal_merge(source); }
397 template<
typename Hash,
typename Equality>
399 { this->internal_merge(source); }
401 template<
typename Hash,
typename Equality>
403 { this->internal_merge(source); }
405 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 408 : base_type(table, a)
412 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 417 -> internal::cu_set_t<concurrent_unordered_multiset, internal::iterator_value_t<I>>;
420 template<
typename I,
typename... Args>
422 -> internal::cu_set_t<concurrent_unordered_multiset, internal::iterator_value_t<I>, Args...>;
427 -> internal::cu_set_t<concurrent_unordered_multiset, T>;
430 template<
typename T,
typename... Args>
442 #endif// __TBB_concurrent_unordered_set_H concurrent_unordered_set_traits< Key, hash_compare, Allocator, false > traits_type
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &source)
concurrent_unordered_multiset(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_set(const Allocator &a)
base_type::node_type node_type
concurrent_unordered_set(const concurrent_unordered_set &table, const Allocator &a)
concurrent_unordered_set(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
tbb::internal::allocator_rebind< Allocator, value_type >::type allocator_type
auto last(Container &c) -> decltype(begin(c))
base_type::const_pointer const_pointer
concurrent_unordered_multiset(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::const_iterator const_local_iterator
concurrent_unordered_multiset(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_multiset(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_set(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::difference_type difference_type
concurrent_unordered_set(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_multiset(size_type n_of_buckets, const allocator_type &a)
static const Key & get_key(const value_type &value)
concurrent_unordered_multiset(const Allocator &a)
allocator_traits< Alloc >::template rebind_alloc< T >::other type
internal::concurrent_unordered_base< traits_type > base_type
base_type::node_type node_type
auto first(Container &c) -> decltype(begin(c))
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &source)
base_type::iterator local_iterator
base_type::const_pointer const_pointer
Hash_compare hash_compare
base_type::difference_type difference_type
base_type::const_iterator const_iterator
base_type::pointer pointer
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &&source)
concurrent_unordered_set(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &source)
concurrent_unordered_set(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_iterator
base_type::const_reference const_reference
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_multiset(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())
tbb::internal::node_handle< key_type, key_type, typename internal::split_ordered_list< key_type, allocator_type >::node, allocator_type > node_type
concurrent_unordered_set(size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_set_traits()
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &source)
base_type::pointer pointer
void move(tbb_thread &t1, tbb_thread &t2)
base_type::value_type value_type
concurrent_unordered_set(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &&source)
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
internal::concurrent_unordered_base< traits_type > base_type
concurrent_unordered_set_traits(const hash_compare &hc)
base_type::iterator iterator
base_type::reference reference
concurrent_unordered_multiset(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::const_iterator const_local_iterator
base_type::iterator iterator
Identifiers declared inside namespace internal should never be used directly by client code...
concurrent_unordered_multiset(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::iterator local_iterator
concurrent_unordered_set(concurrent_unordered_set &&table, const Allocator &a)
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &&source)
hash_compare my_hash_compare
base_type::allocator_type allocator_type
base_type::reference reference
concurrent_unordered_set_traits< Key, hash_compare, Allocator, true > traits_type
base_type::size_type size_type
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &&source)
concurrent_unordered_set(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_multiset(concurrent_unordered_multiset &&table, const Allocator &a)
base_type::const_reference const_reference
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
concurrent_unordered_multiset(const concurrent_unordered_multiset &table, const Allocator &a)
base_type::size_type size_type
base_type::allocator_type allocator_type
base_type::value_type value_type