FreeNOS
|
Iterate through a constant (read-only) HashTable. More...
#include <ConstHashIterator.h>
Public Member Functions | |
ConstHashIterator (const HashTable< K, V > &hash) | |
Class constructor. More... | |
virtual | ~ConstHashIterator () |
Destructor. More... | |
virtual void | reset () |
Reset the iterator. More... | |
virtual bool | hasNext () const |
Check if there is more to iterate. More... | |
virtual bool | hasCurrent () const |
Check if there is a current item. More... | |
virtual const V & | current () const |
Get the current value (read-only). More... | |
virtual const K & | key () const |
Get the current key. More... | |
virtual const V & | next () |
Fetch the next item. More... | |
virtual void | operator++ (int num) |
Increment operator. More... | |
Public Member Functions inherited from ConstIterator< V > | |
virtual | ~ConstIterator () |
Destructor. More... | |
virtual bool | hasNext () const=0 |
Check if there is more to iterate. More... | |
virtual bool | hasCurrent () const=0 |
Check if there is a current item. More... | |
virtual const V & | current () const=0 |
Get the current item read-only. More... | |
Private Attributes | |
const HashTable< K, V > & | m_hash |
Points to the HashTable to iterate. More... | |
List< K > | m_keys |
List of keys to iterate. More... | |
ListIterator< K > | m_iter |
Iterator of keys. More... | |
Iterate through a constant (read-only) HashTable.
Definition at line 39 of file ConstHashIterator.h.
|
inline |
Class constructor.
hash | Reference to the HashTable to iterate. |
Definition at line 48 of file ConstHashIterator.h.
|
inlinevirtual |
Destructor.
Definition at line 56 of file ConstHashIterator.h.
|
inlinevirtual |
Get the current value (read-only).
Definition at line 92 of file ConstHashIterator.h.
References ListIterator< T >::current(), ConstHashIterator< K, V >::m_hash, and ConstHashIterator< K, V >::m_iter.
|
inlinevirtual |
Check if there is a current item.
Definition at line 82 of file ConstHashIterator.h.
References ListIterator< T >::hasCurrent(), and ConstHashIterator< K, V >::m_iter.
Referenced by ArgumentParser::getUsage().
|
inlinevirtual |
Check if there is more to iterate.
Definition at line 72 of file ConstHashIterator.h.
References ListIterator< T >::hasNext(), and ConstHashIterator< K, V >::m_iter.
|
inlinevirtual |
Get the current key.
Definition at line 102 of file ConstHashIterator.h.
References ListIterator< T >::current(), and ConstHashIterator< K, V >::m_iter.
|
inlinevirtual |
Fetch the next item.
This function first fetches the next item and then updates the current item pointer to that item.
Implements ConstIterator< V >.
Definition at line 115 of file ConstHashIterator.h.
References ConstHashIterator< K, V >::m_hash, ConstHashIterator< K, V >::m_iter, and ListIterator< T >::next().
|
inlinevirtual |
Increment operator.
This function first increment the current item and then updates the next item pointer.
num | Ignored |
Implements ConstIterator< V >.
Definition at line 128 of file ConstHashIterator.h.
References ConstHashIterator< K, V >::m_iter.
|
inlinevirtual |
Reset the iterator.
Implements ConstIterator< V >.
Definition at line 63 of file ConstHashIterator.h.
References ConstHashIterator< K, V >::m_iter, and ListIterator< T >::reset().
|
private |
Points to the HashTable to iterate.
Definition at line 136 of file ConstHashIterator.h.
Referenced by ConstHashIterator< K, V >::current(), and ConstHashIterator< K, V >::next().
|
private |
Iterator of keys.
Definition at line 142 of file ConstHashIterator.h.
Referenced by ConstHashIterator< K, V >::current(), ConstHashIterator< K, V >::hasCurrent(), ConstHashIterator< K, V >::hasNext(), ConstHashIterator< K, V >::key(), ConstHashIterator< K, V >::next(), ConstHashIterator< K, V >::operator++(), and ConstHashIterator< K, V >::reset().
|
private |
List of keys to iterate.
Definition at line 139 of file ConstHashIterator.h.