FreeNOS
|
Iterate through a HashTable. More...
#include <HashIterator.h>
Public Member Functions | |
HashIterator (HashTable< K, V > &hash) | |
Class constructor. More... | |
virtual | ~HashIterator () |
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 V & | current () |
Get the current value. More... | |
virtual const K & | key () |
Get the current key. More... | |
virtual V & | next () |
Fetch the next item. More... | |
virtual bool | remove () |
Remove the current item from the underlying Container. More... | |
virtual void | operator++ (int num) |
Increment operator. More... | |
Public Member Functions inherited from Iterator< V > | |
virtual | ~Iterator () |
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... | |
Private Attributes | |
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 HashTable.
Definition at line 39 of file HashIterator.h.
|
inline |
Class constructor.
hash | Reference to the HashTable to iterate. |
Definition at line 48 of file HashIterator.h.
|
inlinevirtual |
Destructor.
Definition at line 56 of file HashIterator.h.
|
inlinevirtual |
Get the current value.
Implements Iterator< V >.
Definition at line 103 of file HashIterator.h.
References ListIterator< T >::current(), HashIterator< K, V >::m_hash, and HashIterator< K, V >::m_iter.
|
inlinevirtual |
Get the current value (read-only).
Definition at line 93 of file HashIterator.h.
References ListIterator< T >::current(), HashIterator< K, V >::m_hash, and HashIterator< K, V >::m_iter.
|
inlinevirtual |
Check if there is a current item.
Definition at line 83 of file HashIterator.h.
References ListIterator< T >::hasCurrent(), and HashIterator< K, V >::m_iter.
Referenced by FileSystemServer::clearFileCache(), HelpCommand::execute(), ChannelServer< DatastoreServer, DatastoreMessage >::readChannels(), ChannelClient::receiveAny(), FileSystemServer::removeFileFromCache(), UDP::unregisterSockets(), ArgumentContainer::~ArgumentContainer(), ArgumentParser::~ArgumentParser(), ARP::~ARP(), ChannelRegistry::~ChannelRegistry(), and Shell::~Shell().
|
inlinevirtual |
Check if there is more to iterate.
Definition at line 73 of file HashIterator.h.
References ListIterator< T >::hasNext(), and HashIterator< K, V >::m_iter.
|
inlinevirtual |
Get the current key.
Definition at line 113 of file HashIterator.h.
References ListIterator< T >::current(), and HashIterator< K, V >::m_iter.
Referenced by HashIterator< K, V >::remove().
|
inlinevirtual |
Fetch the next item.
This function first fetches the next item and then updates the current item pointer to that item.
Implements Iterator< V >.
Definition at line 126 of file HashIterator.h.
References HashIterator< K, V >::m_hash, HashIterator< 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 Iterator< V >.
Definition at line 151 of file HashIterator.h.
References HashIterator< K, V >::m_iter.
|
inlinevirtual |
Remove the current item from the underlying Container.
Implements Iterator< V >.
Definition at line 136 of file HashIterator.h.
References ListIterator< T >::current(), HashIterator< K, V >::key(), HashIterator< K, V >::m_hash, HashIterator< K, V >::m_iter, and ListIterator< T >::remove().
|
inlinevirtual |
Reset the iterator.
Implements Iterator< V >.
Definition at line 63 of file HashIterator.h.
References HashIterator< K, V >::m_iter, and ListIterator< T >::reset().
|
private |
Points to the HashTable to iterate.
Definition at line 159 of file HashIterator.h.
Referenced by HashIterator< K, V >::current(), HashIterator< K, V >::next(), and HashIterator< K, V >::remove().
|
private |
Iterator of keys.
Definition at line 165 of file HashIterator.h.
Referenced by HashIterator< K, V >::current(), HashIterator< K, V >::hasCurrent(), HashIterator< K, V >::hasNext(), HashIterator< K, V >::key(), HashIterator< K, V >::next(), HashIterator< K, V >::operator++(), HashIterator< K, V >::remove(), and HashIterator< K, V >::reset().
|
private |
List of keys to iterate.
Definition at line 162 of file HashIterator.h.