31 template<typename KeyArg, typename MappedArg, typename HashArg = typename DefaultHash<KeyArg>::Hash,
35 typedef KeyTraitsArg KeyTraits;
36 typedef MappedTraitsArg MappedTraits;
40 typedef typename KeyTraits::TraitType
KeyType;
45 typedef HashArg HashFunctions;
63 const_iterator
begin()
const;
64 const_iterator
end()
const;
82 void remove(iterator);
94 static const typename PairType::first_type&
extract(
const PairType& p) {
return p.first; }
97 template<
typename ValueType,
typename ValueTraits,
typename HashFunctions>
99 typedef typename ValueType::first_type
KeyType;
102 static unsigned hash(
const KeyType& key) {
return HashFunctions::hash(key); }
106 location.first = key;
107 location.second = mapped;
111 template<
typename T,
typename U,
typename V,
typename W,
typename X>
114 m_impl.swap(other.m_impl);
117 template<
typename T,
typename U,
typename V,
typename W,
typename X>
120 return m_impl.size();
123 template<
typename T,
typename U,
typename V,
typename W,
typename X>
126 return m_impl.capacity();
129 template<
typename T,
typename U,
typename V,
typename W,
typename X>
132 return m_impl.isEmpty();
135 template<
typename T,
typename U,
typename V,
typename W,
typename X>
138 return m_impl.begin();
141 template<
typename T,
typename U,
typename V,
typename W,
typename X>
147 template<
typename T,
typename U,
typename V,
typename W,
typename X>
150 return m_impl.begin();
153 template<
typename T,
typename U,
typename V,
typename W,
typename X>
159 template<
typename T,
typename U,
typename V,
typename W,
typename X>
162 return m_impl.find(key);
165 template<
typename T,
typename U,
typename V,
typename W,
typename X>
168 return m_impl.find(key);
171 template<
typename T,
typename U,
typename V,
typename W,
typename X>
174 return m_impl.contains(key);
177 template<
typename T,
typename U,
typename V,
typename W,
typename X>
178 inline pair<typename HashMap<T, U, V, W, X>::iterator,
bool>
182 return m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped);
185 template<
typename T,
typename U,
typename V,
typename W,
typename X>
186 pair<typename HashMap<T, U, V, W, X>::iterator,
bool>
189 pair<iterator, bool> result = inlineAdd(key, mapped);
190 if (!result.second) {
192 result.first->second = mapped;
197 template<
typename T,
typename U,
typename V,
typename W,
typename X>
198 pair<typename HashMap<T, U, V, W, X>::iterator,
bool>
201 return inlineAdd(key, mapped);
204 template<
typename T,
typename U,
typename V,
typename W,
typename MappedTraits>
210 return MappedTraits::emptyValue();
211 return entry->second;
214 template<
typename T,
typename U,
typename V,
typename W,
typename X>
217 if (it.
m_impl == m_impl.end())
219 m_impl.checkTableConsistency();
220 m_impl.removeWithoutEntryConsistencyCheck(it.
m_impl);
223 template<
typename T,
typename U,
typename V,
typename W,
typename X>
229 template<
typename T,
typename U,
typename V,
typename W,
typename X>
235 template<
typename T,
typename U,
typename V,
typename W,
typename MappedTraits>
242 return MappedTraits::emptyValue();
248 template<
typename T,
typename U,
typename V,
typename W,
typename X>
256 const_iterator end = a.
end();
257 const_iterator notFound = b.
end();
258 for (const_iterator it = a.
begin(); it != end; ++it) {
259 const_iterator bPos = b.
find(it->first);
260 if (bPos == notFound || it->second != bPos->second)
267 template<
typename T,
typename U,
typename V,
typename W,
typename X>
273 template<
typename MappedType,
typename HashTableType>
276 typedef typename HashTableType::const_iterator iterator;
277 iterator end = collection.end();
278 for (iterator it = collection.begin(); it != end; ++it)
282 template<
typename T,
typename U,
typename V,
typename W,
typename X>
285 deleteAllPairSeconds<typename HashMap<T, U, V, W, X>::MappedType>(collection);
288 template<
typename KeyType,
typename HashTableType>
291 typedef typename HashTableType::const_iterator iterator;
292 iterator end = collection.end();
293 for (iterator it = collection.begin(); it != end; ++it)
297 template<
typename T,
typename U,
typename V,
typename W,
typename X>
300 deleteAllPairFirsts<typename HashMap<T, U, V, W, X>::KeyType>(collection);
303 template<
typename T,
typename U,
typename V,
typename W,
typename X,
typename Y>
308 vector.resize(collection.
size());
310 iterator it = collection.
begin().keys();
311 iterator end = collection.
end().keys();
312 for (
unsigned i = 0; it != end; ++it, ++i)
316 template<
typename T,
typename U,
typename V,
typename W,
typename X,
typename Y>
321 vector.resize(collection.
size());
323 iterator it = collection.
begin().values();
324 iterator end = collection.
end().values();
325 for (
unsigned i = 0; it != end; ++it, ++i)
void remove(const KeyType &)
MappedType get(const KeyType &) const
void deleteAllPairSeconds(HashTableType &collection)
bool contains(const KeyType &) const
pair< typename FirstTraits::TraitType, typename SecondTraits::TraitType > TraitType
void deleteAllValues(const HashMap< T, U, V, W, X > &collection)
void deleteAllPairFirsts(HashTableType &collection)
static unsigned hash(const KeyType &key)
MappedTraits::TraitType MappedType
static void translate(ValueType &location, const KeyType &key, const MappedType &mapped)
pair< iterator, bool > add(const KeyType &, const MappedType &)
void copyValuesToVector(const HashMap< T, U, V, W, X > &collection, Y &vector)
void copyKeysToVector(const HashMap< T, U, V, W, X > &collection, Y &vector)
bool operator==(const HashTableConstKeysIterator< T, U, V > &a, const HashTableConstKeysIterator< T, U, V > &b)
pair< iterator, bool > set(const KeyType &, const MappedType &)
ValueTraits::TraitType ValueType
ValueType::first_type KeyType
iterator find(const KeyType &)
ValueType::second_type MappedType
bool operator!=(const HashTableConstKeysIterator< T, U, V > &a, const HashTableConstKeysIterator< T, U, V > &b)
HashTableType::iterator m_impl
KeyTraits::TraitType KeyType
MappedType take(const KeyType &)
static bool equal(const KeyType &a, const KeyType &b)
void deleteAllKeys(const HashMap< T, U, V, W, X > &collection)