Data members:
// Iterator on the outer QHash
QHash<QString, QHash<QString, Data> >::const_iterator m_outer;
// End iterator on the outer QHash
QHash<QString, QHash<QString, Data> >::const_iterator m_outerEnd;
// Iterator on the inner QHash. Has an indeterminate value if m_outer == m_outerEnd; otherwise, points to the current binding in the current inner map
QHash<QString, Data>::const_iterator m_inner;
// End iterator on the inner QHash. Has an indeterminate value if m_outer == m_outerEnd; otherwise, is the end() iterator of the current inner map
QHash<QString, Data>::const_iterator m_innerEnd;
// Dereferences the iterator; assumes m_outer != m_outerEnd
Dereference:
Return *m_inner
// Tests for equality with another iterator on the same container
Equals(const const_iterator &other):
If m_outer == m_outerEnd
Return other.m_outer == other.m_outerEnd
Else
Return m_outer == other.m_outer && m_inner == other.m_inner
// A private operation that updates the state right after m_outer has received a new value
NewOuter:
While m_outer != m_outerEnd
m_inner = m_outer->begin()
m_innerEnd = m_outer->end()
If m_inner != m_innerEnd
Break
Increment m_outer
// Sets up this iterator at the beginning of the collection c
Begin(const QHash<QString, QHash<QString, Data> > &c):
m_outer = c.begin()
m_outerEnd = c.end()
Call NewOuter
// Sets up this iterator at the end of the collection c
End(const QHash<QString, QHash<QString, Data> > &c):
m_outer = m_outerEnd = c.end()
// Increments this iterator; assumes m_outer != m_outerEnd
Increment:
Increment m_inner
If m_inner == m_innerEnd
// Done iterating on the current inner map; move to the next outer binding
Increment m_outer
Call NewOuter
Data members:
// Iterator on the outer QHash
QHash<QString, QHash<QString, Data> >::const_iterator m_outer;
// End iterator on the outer QHash
QHash<QString, QHash<QString, Data> >::const_iterator m_outerEnd;
// Iterator on the inner QHash. Has an indeterminate value if m_outer == m_outerEnd; otherwise, points to the current binding in the current inner map
QHash<QString, Data>::const_iterator m_inner;
// End iterator on the inner QHash. Has an indeterminate value if m_outer == m_outerEnd; otherwise, is the end() iterator of the current inner map
QHash<QString, Data>::const_iterator m_innerEnd;
// Dereferences the iterator; assumes m_outer != m_outerEnd
Dereference:
Return *m_inner
// Tests for equality with another iterator on the same container
Equals(const const_iterator &other):
If m_outer == m_outerEnd
Return other.m_outer == other.m_outerEnd
Else
Return m_outer == other.m_outer && m_inner == other.m_inner
// A private operation that updates the state right after m_outer has received a new value
NewOuter:
While m_outer != m_outerEnd
m_inner = m_outer->begin()
m_innerEnd = m_outer->end()
If m_inner != m_innerEnd
Break
Increment m_outer
// Sets up this iterator at the beginning of the collection c
Begin(const QHash<QString, QHash<QString, Data> > &c):
m_outer = c.begin()
m_outerEnd = c.end()
Call NewOuter
// Sets up this iterator at the end of the collection c
End(const QHash<QString, QHash<QString, Data> > &c):
m_outer = m_outerEnd = c.end()
// Increments this iterator; assumes m_outer != m_outerEnd
Increment:
Increment m_inner
If m_inner == m_innerEnd
// Done iterating on the current inner map; move to the next outer binding
Increment m_outer
Call NewOuter
To copy to clipboard, switch view to plain text mode
Bookmarks