24 #ifndef __TBB_concurrent_unordered_set_H 25 #define __TBB_concurrent_unordered_set_H 27 #include "internal/_concurrent_unordered_impl.h" 32 namespace interface5 {
35 template<
typename Key,
typename Hash_compare,
typename Allocator,
bool Allow_multimapping>
39 typedef Key value_type;
41 typedef Hash_compare hash_compare;
42 typedef typename Allocator::template rebind<value_type>::other allocator_type;
43 enum { allow_multimapping = Allow_multimapping };
48 typedef hash_compare value_compare;
50 static const Key& get_key(
const value_type& value) {
54 hash_compare my_hash_compare;
57 template <
typename Key,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
typename Allocator = tbb::tbb_allocator<Key> >
58 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::concurrent_unordered_base< concurrent_unordered_set_traits<Key, hash_compare, Allocator, false> > base_type;
67 using traits_type::allow_multimapping;
69 using base_type::insert;
73 typedef typename base_type::value_type value_type;
74 typedef Key mapped_type;
75 typedef Hasher hasher;
76 typedef Key_equality key_equal;
79 typedef typename base_type::allocator_type allocator_type;
80 typedef typename base_type::pointer pointer;
81 typedef typename base_type::const_pointer const_pointer;
82 typedef typename base_type::reference reference;
83 typedef typename base_type::const_reference const_reference;
85 typedef typename base_type::size_type size_type;
86 typedef typename base_type::difference_type difference_type;
88 typedef typename base_type::iterator iterator;
89 typedef typename base_type::const_iterator const_iterator;
90 typedef typename base_type::iterator local_iterator;
91 typedef typename base_type::const_iterator const_local_iterator;
94 explicit concurrent_unordered_set(size_type n_of_buckets = base_type::initial_bucket_number,
const hasher& a_hasher = hasher(),
95 const key_equal& a_keyeq = key_equal(),
const allocator_type& a = allocator_type())
96 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
104 template <
typename Iterator>
105 concurrent_unordered_set(Iterator first, Iterator last, size_type n_of_buckets = base_type::initial_bucket_number,
const hasher& a_hasher = hasher(),
106 const key_equal& a_keyeq = key_equal(),
const allocator_type& a = allocator_type())
107 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
112 #if __TBB_INITIALIZER_LISTS_PRESENT 113 concurrent_unordered_set(std::initializer_list<value_type> il, size_type n_of_buckets = base_type::initial_bucket_number,
const hasher& a_hasher = hasher(),
115 const key_equal& a_keyeq = key_equal(),
const allocator_type& a = allocator_type())
116 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
118 this->insert(il.begin(),il.end());
120 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 122 #if __TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_BROKEN 128 concurrent_unordered_set& operator=(
const concurrent_unordered_set& table)
130 return static_cast<concurrent_unordered_set&
>(base_type::operator=(table));
133 concurrent_unordered_set(concurrent_unordered_set&& table)
134 : base_type(std::move(table))
138 concurrent_unordered_set& operator=(concurrent_unordered_set&& table)
140 return static_cast<concurrent_unordered_set&
>(base_type::operator=(std::move(table)));
142 #endif //__TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_BROKEN 144 concurrent_unordered_set(
const concurrent_unordered_set& table,
const Allocator& a)
145 : base_type(table, a)
149 #if __TBB_CPP11_RVALUE_REF_PRESENT 150 concurrent_unordered_set(concurrent_unordered_set&& table,
const Allocator& a)
151 : base_type(std::move(table), a)
154 #endif //__TBB_CPP11_RVALUE_REF_PRESENT 158 template <
typename Key,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
159 typename Allocator = tbb::tbb_allocator<Key> >
161 public internal::concurrent_unordered_base< concurrent_unordered_set_traits<Key,
162 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, true> >
167 typedef internal::concurrent_unordered_base< traits_type > base_type;
168 #if __TBB_EXTRA_DEBUG 171 using traits_type::allow_multimapping;
173 using base_type::insert;
176 typedef Key key_type;
177 typedef typename base_type::value_type value_type;
178 typedef Key mapped_type;
179 typedef Hasher hasher;
180 typedef Key_equality key_equal;
183 typedef typename base_type::allocator_type allocator_type;
184 typedef typename base_type::pointer pointer;
185 typedef typename base_type::const_pointer const_pointer;
186 typedef typename base_type::reference reference;
187 typedef typename base_type::const_reference const_reference;
189 typedef typename base_type::size_type size_type;
190 typedef typename base_type::difference_type difference_type;
192 typedef typename base_type::iterator iterator;
193 typedef typename base_type::const_iterator const_iterator;
194 typedef typename base_type::iterator local_iterator;
195 typedef typename base_type::const_iterator const_local_iterator;
199 const hasher& _Hasher = hasher(),
const key_equal& _Key_equality = key_equal(),
200 const allocator_type& a = allocator_type())
201 : base_type(n_of_buckets, key_compare(_Hasher, _Key_equality), a)
209 template <
typename Iterator>
211 const hasher& _Hasher = hasher(),
const key_equal& _Key_equality = key_equal(),
212 const allocator_type& a = allocator_type())
213 : base_type(n_of_buckets, key_compare(_Hasher, _Key_equality), a)
218 #if __TBB_INITIALIZER_LISTS_PRESENT 219 concurrent_unordered_multiset(std::initializer_list<value_type> il, size_type n_of_buckets = base_type::initial_bucket_number,
const hasher& a_hasher = hasher(),
221 const key_equal& a_keyeq = key_equal(),
const allocator_type& a = allocator_type())
222 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
224 this->insert(il.begin(),il.end());
226 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 228 #if __TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_BROKEN 234 concurrent_unordered_multiset& operator=(
const concurrent_unordered_multiset& table)
236 return static_cast<concurrent_unordered_multiset&
>(base_type::operator=(table));
239 concurrent_unordered_multiset(concurrent_unordered_multiset&& table)
240 : base_type(std::move(table))
244 concurrent_unordered_multiset& operator=(concurrent_unordered_multiset&& table)
246 return static_cast<concurrent_unordered_multiset&
>(base_type::operator=(std::move(table)));
248 #endif //__TBB_CPP11_IMPLICIT_MOVE_MEMBERS_GENERATION_BROKEN 250 concurrent_unordered_multiset(
const concurrent_unordered_multiset& table,
const Allocator& a)
251 : base_type(table, a)
255 #if __TBB_CPP11_RVALUE_REF_PRESENT 256 concurrent_unordered_multiset(concurrent_unordered_multiset&& table,
const Allocator& a)
257 : base_type(std::move(table), a)
260 #endif //__TBB_CPP11_RVALUE_REF_PRESENT 269 #endif// __TBB_concurrent_unordered_set_H Definition: concurrent_unordered_set.h:160
Definition: concurrent_unordered_set.h:58
Definition: concurrent_unordered_set.h:36
The namespace tbb contains all components of the library.
Definition: parallel_for.h:44
Definition: _tbb_hash_compare_impl.h:33