template<typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions>
struct water::HashMap< KeyType, ValueType, HashFunctionType >::Iterator
Iterates over the items in a HashMap.
To use it, repeatedly call next() until it returns false, e.g.
{
DBG (
i.getKey() <<
" -> " <<
i.getValue());
}
HashMap(int numberOfSlots=defaultHashTableSize, HashFunctionType hashFunction=HashFunctionType())
Definition HashMap.h:118
register unsigned i
Definition inflate.c:1575
The order in which items are iterated bears no resemblence to the order in which they were originally added!
Obviously as soon as you call any non-const methods on the original hash-map, any iterators that were created beforehand will cease to be valid, and should not be used.
- See also
- HashMap
template<typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions>
| bool water::HashMap< KeyType, ValueType, HashFunctionType >::Iterator::next |
( |
| ) |
|
|
inlinenoexcept |
Moves to the next item, if one is available. When this returns true, you can get the item's key and value using getKey() and getValue(). If it returns false, the iteration has finished and you should stop.