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 40 typedef internal::node_handle<Key, Key, allocator_type>
node_type;
41 #endif // __TBB_UNORDERED_NODE_HANDLE_PRESENT 55 template<
typename Key,
typename Hasher,
typename Key_equality,
typename Allocator>
58 template <
typename Key,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
typename Allocator = tbb::tbb_allocator<Key> >
59 class concurrent_unordered_set :
public internal::concurrent_unordered_base< concurrent_unordered_set_traits<Key, internal::hash_compare<Key, Hasher, Key_equality>, Allocator, false> >
62 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
64 typedef internal::concurrent_unordered_base< traits_type >
base_type;
70 using base_type::insert;
81 typedef typename base_type::pointer
pointer;
93 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 114 template <
typename Iterator>
122 template <
typename Iterator>
129 template <
typename Iterator>
136 #if __TBB_INITIALIZER_LISTS_PRESENT 142 insert(il.begin(),il.end());
148 insert(il.begin(), il.end());
154 insert(il.begin(), il.end());
157 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 159 #if __TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 166 return static_cast<concurrent_unordered_set&>(base_type::operator=(table));
175 return static_cast<concurrent_unordered_set&>(base_type::operator=(
std::move(table)));
177 #endif //__TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 179 #if __TBB_CPP11_RVALUE_REF_PRESENT 185 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 186 template<
typename Hash,
typename Equality>
190 template<
typename Hash,
typename Equality>
194 template<
typename Hash,
typename Equality>
198 template<
typename Hash,
typename Equality>
202 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 210 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 215 template <
template<
typename...>
typename Set,
typename T,
typename... Args>
216 using cu_set_t = Set <
218 std::conditional_t< (
sizeof...(Args)>0) && !is_allocator_v< pack_element_t<0, Args...> >,
220 std::conditional_t< (
sizeof...(Args)>1) && !is_allocator_v< pack_element_t<1, Args...> >,
221 pack_element_t<1, Args...>, std::equal_to<T> >,
222 std::conditional_t< (
sizeof...(Args)>0) && is_allocator_v< pack_element_t<
sizeof...(Args)-1, Args...> >,
229 concurrent_unordered_set(I, I)
230 -> internal::cu_set_t<concurrent_unordered_set, internal::iterator_value_t<I>>;
233 template<
typename I,
typename... Args>
234 concurrent_unordered_set(I, I,
size_t, Args...)
235 -> internal::cu_set_t<concurrent_unordered_set, internal::iterator_value_t<I>, Args...>;
239 concurrent_unordered_set(std::initializer_list<T>)
240 -> internal::cu_set_t<concurrent_unordered_set, T>;
243 template<
typename T,
typename... Args>
244 concurrent_unordered_set(std::initializer_list<T>,
size_t, Args...)
245 -> internal::cu_set_t<concurrent_unordered_set, T, Args...>;
249 template <
typename Key,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
250 typename Allocator = tbb::tbb_allocator<Key> >
251 class concurrent_unordered_multiset :
252 public internal::concurrent_unordered_base< concurrent_unordered_set_traits<Key,
253 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, true> >
256 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
258 typedef internal::concurrent_unordered_base< traits_type >
base_type;
259 #if __TBB_EXTRA_DEBUG 262 using traits_type::allow_multimapping;
264 using base_type::insert;
287 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 289 #endif // __TBB_UNORDERED_NODE_HANDLE_PRESENT 310 template <
typename Iterator>
319 template <
typename Iterator>
326 template <
typename Iterator>
334 #if __TBB_INITIALIZER_LISTS_PRESENT 338 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
340 insert(il.begin(),il.end());
346 insert(il.begin(), il.end());
353 insert(il.begin(), il.end());
356 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 359 #if __TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 366 return static_cast<concurrent_unordered_multiset&>(base_type::operator=(table));
369 concurrent_unordered_multiset(concurrent_unordered_multiset&& table)
370 : base_type(std::
move(table))
373 concurrent_unordered_multiset& operator=(concurrent_unordered_multiset&& table)
375 return static_cast<concurrent_unordered_multiset&>(base_type::operator=(
std::move(table)));
377 #endif //__TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 379 #if __TBB_CPP11_RVALUE_REF_PRESENT 386 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 387 template<
typename Hash,
typename Equality>
389 { this->internal_merge(source); }
391 template<
typename Hash,
typename Equality>
393 { this->internal_merge(source); }
395 template<
typename Hash,
typename Equality>
397 { this->internal_merge(source); }
399 template<
typename Hash,
typename Equality>
401 { this->internal_merge(source); }
403 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 410 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 415 -> internal::cu_set_t<concurrent_unordered_multiset, internal::iterator_value_t<I>>;
418 template<
typename I,
typename... Args>
420 -> internal::cu_set_t<concurrent_unordered_multiset, internal::iterator_value_t<I>, Args...>;
425 -> internal::cu_set_t<concurrent_unordered_multiset, T>;
428 template<
typename T,
typename... Args>
435 using interface5::concurrent_unordered_set;
436 using interface5::concurrent_unordered_multiset;
440 #endif// __TBB_concurrent_unordered_set_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 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_set_traits< Key, hash_compare, Allocator, false > traits_type
concurrent_unordered_multiset(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
base_type::iterator iterator
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &source)
void move(tbb_thread &t1, tbb_thread &t2)
base_type::pointer pointer
internal::node_handle< Key, Key, allocator_type > node_type
concurrent_unordered_set_traits< Key, hash_compare, Allocator, true > traits_type
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())
base_type::reference reference
base_type::const_iterator const_local_iterator
internal::concurrent_unordered_base< traits_type > base_type
base_type::difference_type difference_type
base_type::iterator local_iterator
static const Key & get_key(const value_type &value)
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
base_type::allocator_type allocator_type
base_type::const_iterator const_iterator
base_type::size_type size_type
std::pair< iterator, bool > insert(const value_type &value)
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)
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &source)
tbb::internal::allocator_rebind< Allocator, value_type >::type allocator_type
concurrent_unordered_set(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
static const size_type initial_bucket_number
base_type::allocator_type allocator_type
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &source)
Class for determining type of std::allocator<T>::value_type.
base_type::reference reference
hash_compare my_hash_compare
concurrent_unordered_multiset(size_type n_of_buckets, const allocator_type &a)
base_type::value_type value_type
concurrent_unordered_multiset(const concurrent_unordered_multiset &table, const Allocator &a)
concurrent_unordered_multiset(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_set(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
base_type::pointer pointer
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
concurrent_unordered_multiset(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
auto first(Container &c) -> decltype(begin(c))
base_type::iterator local_iterator
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())
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &&source)
concurrent_unordered_set(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
allocator_traits< Alloc >::template rebind_alloc< T >::other type
base_type::const_pointer const_pointer
base_type::iterator iterator
concurrent_unordered_multiset(concurrent_unordered_multiset &&table, const Allocator &a)
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_set_traits(const hash_compare &hc)
concurrent_unordered_set_traits()
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &source)
base_type::const_reference const_reference
void internal_merge(SourceType &source)
Hash_compare hash_compare
concurrent_unordered_set(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
auto last(Container &c) -> decltype(begin(c))
base_type::const_pointer const_pointer
base_type::node_type node_type
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &&source)
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &&source)
concurrent_unordered_set(size_type n_of_buckets, const allocator_type &a)
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
base_type::difference_type difference_type
base_type::size_type size_type
concurrent_unordered_multiset(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
base_type::const_iterator const_iterator
base_type::const_reference const_reference
concurrent_unordered_set(const concurrent_unordered_set &table, const Allocator &a)
concurrent_unordered_set(concurrent_unordered_set &&table, const Allocator &a)
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())
concurrent_unordered_set(const Allocator &a)
base_type::value_type value_type
base_type::node_type node_type
concurrent_unordered_base & operator=(const concurrent_unordered_base &right)
concurrent_unordered_multiset(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
Identifiers declared inside namespace internal should never be used directly by client code.
concurrent_unordered_multiset(const Allocator &a)
internal::concurrent_unordered_base< traits_type > base_type
base_type::const_iterator const_local_iterator