26 #include <CommonIdentifiers.h>
30 template<
typename Value,
typename HashFunctions,
typename Traits>
class HashSet;
31 template<
typename Value,
typename HashFunctions,
typename Traits>
36 template<typename ValueArg, typename HashArg = typename DefaultHash<ValueArg>::Hash,
39 typedef HashArg HashFunctions;
40 typedef TraitsArg ValueTraits;
73 template<
typename T,
typename HashTranslator>
iterator find(
const T&);
75 template<
typename T,
typename HashTranslator>
bool contains(
const T&)
const;
87 template<
typename T,
typename HashTranslator> pair<iterator, bool>
add(
const T&);
94 friend void deleteAllValues<>(
const HashSet&);
100 static const T&
extract(
const T& t) {
return t; }
103 template<
typename ValueType,
typename ValueTraits,
typename T,
typename Translator>
105 static unsigned hash(
const T& key) {
return Translator::hash(key); }
106 static bool equal(
const ValueType& a,
const T& b) {
return Translator::equal(a, b); }
107 static void translate(ValueType& location,
const T& key,
const T&,
unsigned hashCode)
109 Translator::translate(location, key, hashCode);
113 template<
typename T,
typename U,
typename V>
116 m_impl.swap(other.m_impl);
119 template<
typename T,
typename U,
typename V>
122 return m_impl.size();
125 template<
typename T,
typename U,
typename V>
128 return m_impl.capacity();
131 template<
typename T,
typename U,
typename V>
134 return m_impl.isEmpty();
137 template<
typename T,
typename U,
typename V>
140 return m_impl.begin();
143 template<
typename T,
typename U,
typename V>
149 template<
typename T,
typename U,
typename V>
152 return m_impl.begin();
155 template<
typename T,
typename U,
typename V>
161 template<
typename T,
typename U,
typename V>
164 return m_impl.find(value);
167 template<
typename T,
typename U,
typename V>
170 return m_impl.find(value);
173 template<
typename T,
typename U,
typename V>
176 return m_impl.contains(value);
179 template<
typename Value,
typename HashFunctions,
typename Traits>
180 template<
typename T,
typename Translator>
185 return m_impl.template find<T, Adapter>(value);
188 template<
typename Value,
typename HashFunctions,
typename Traits>
189 template<
typename T,
typename Translator>
194 return m_impl.template find<T, Adapter>(value);
197 template<
typename Value,
typename HashFunctions,
typename Traits>
198 template<
typename T,
typename Translator>
202 return m_impl.template contains<T, Adapter>(value);
205 template<
typename T,
typename U,
typename V>
208 return m_impl.add(value);
211 template<
typename Value,
typename HashFunctions,
typename Traits>
212 template<
typename T,
typename Translator>
213 pair<typename HashSet<Value, HashFunctions, Traits>::iterator,
bool>
217 return m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
220 template<
typename T,
typename U,
typename V>
223 if (it.
m_impl == m_impl.end())
225 m_impl.checkTableConsistency();
226 m_impl.removeWithoutEntryConsistencyCheck(it.
m_impl);
229 template<
typename T,
typename U,
typename V>
235 template<
typename T,
typename U,
typename V>
241 template<
typename ValueType,
typename HashTableType>
244 typedef typename HashTableType::const_iterator iterator;
245 iterator end = collection.end();
246 for (iterator it = collection.begin(); it != end; ++it)
250 template<
typename T,
typename U,
typename V>
253 deleteAllValues<typename HashSet<T, U, V>::ValueType>(collection.m_impl);
256 template<
typename T,
typename U,
typename V,
typename W>
261 vector.resize(collection.
size());
263 iterator it = collection.
begin();
264 iterator end = collection.
end();
265 for (
unsigned i = 0; it != end; ++it, ++i)
static unsigned hash(const T &key)
ValueTraits::TraitType ValueType
void deleteAllValues(const HashMap< T, U, V, W, X > &collection)
void remove(const ValueType &)
pair< iterator, bool > add(const ValueType &)
void copyToVector(const HashCountedSet< Value, HashFunctions, Traits > &collection, VectorType &vector)
iterator find(const ValueType &)
static bool equal(const ValueType &a, const T &b)
HashTableType::iterator m_impl
bool contains(const ValueType &) const
static void translate(ValueType &location, const T &key, const T &, unsigned hashCode)