Iterates over the items in a HashMap. More...
#include <juce_HashMap.h>

Public Member Functions | |
| Iterator (const HashMap &hashMapToIterate) noexcept | |
| Iterator (const Iterator &other) noexcept | |
| KeyType | getKey () const |
| Returns the current item's key. | |
| ValueType | getValue () const |
| Returns the current item's value. | |
| bool | next () noexcept |
| Moves to the next item, if one is available. | |
| bool | operator!= (const Iterator &other) const noexcept |
| ValueType | operator* () const |
| Iterator & | operator++ () noexcept |
| void | reset () noexcept |
| Resets the iterator to its starting position. | |
| void | resetToEnd () noexcept |
Private Member Functions | |
| Iterator & | operator= (const Iterator &)=delete |
Private Attributes | |
| HashEntry * | entry |
| const HashMap & | hashMap |
| int | index |
Iterates over the items in a HashMap.
To use it, repeatedly call next() until it returns false, e.g.
The order in which items are iterated bears no resemblance 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.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Returns the current item's key.
This should only be called when a call to next() has just returned true.
References juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::entry, and juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::HashEntry::key.
|
inline |
Returns the current item's value.
This should only be called when a call to next() has just returned true.
References juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::entry, and juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::HashEntry::value.
Referenced by juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::operator*().
|
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.
References juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::entry, juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::getNumSlots(), juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::hashMap, juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::hashSlots, juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::index, and juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::HashEntry::nextEntry.
Referenced by juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::begin(), and juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::operator++().
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
privatedelete |
|
inlinenoexcept |
Resets the iterator to its starting position.
References juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::entry, and juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::index.
|
inlinenoexcept |
References juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::getNumSlots(), juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::hashMap, and juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::index.
Referenced by juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::end().
|
private |
Referenced by juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::getKey(), juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::getValue(), juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::next(), juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::operator!=(), and juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::reset().
|
private |
|
private |
Referenced by juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::next(), juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::operator!=(), juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::reset(), and juce::HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::resetToEnd().