FreeNOS
|
Iterate through a List. More...
#include <ListIterator.h>
Public Member Functions | |
ListIterator (List< T > *list) | |
Class constructor. More... | |
ListIterator (List< T > &list) | |
Class constructor. More... | |
ListIterator (const List< T > &list) | |
Constant class constructor. More... | |
virtual void | reset () |
Reset the iterator. More... | |
virtual bool | hasNext () const |
Check if there is more on the List to iterate. More... | |
virtual bool | hasCurrent () const |
Check if there is a current item on the List. More... | |
virtual const T & | current () const |
Get current item in the List. More... | |
virtual T & | current () |
Get current item in the List. More... | |
virtual T & | next () |
Fetch the next item. More... | |
virtual bool | remove () |
Remove the current item from the List. More... | |
virtual void | operator++ (int num) |
Increment operator. More... | |
Public Member Functions inherited from Iterator< T > | |
virtual | ~Iterator () |
Destructor. More... | |
Private Attributes | |
List< T > & | m_list |
Points to the List to iterate. More... | |
class List< T >::Node * | m_current |
Current node. More... | |
class List< T >::Node * | m_next |
Next node. More... | |
Iterate through a List.
Definition at line 37 of file ListIterator.h.
|
inline |
Class constructor.
list | Reference to the List to iterate. |
Definition at line 46 of file ListIterator.h.
|
inline |
Class constructor.
list | Reference to the List to iterate. |
Definition at line 59 of file ListIterator.h.
|
inline |
Constant class constructor.
list | Reference to the List to iterate. |
Definition at line 72 of file ListIterator.h.
|
inlinevirtual |
Get current item in the List.
Implements Iterator< T >.
Definition at line 124 of file ListIterator.h.
|
inlinevirtual |
Get current item in the List.
Implements Iterator< T >.
Definition at line 114 of file ListIterator.h.
Referenced by ConstHashIterator< K, V >::current(), HashIterator< K, V >::current(), ConstHashIterator< K, V >::key(), HashIterator< K, V >::key(), HashIterator< K, V >::remove(), MpiProxy::startLocalProcess(), and MpiProxy::startRemoteProcess().
|
inlinevirtual |
Check if there is a current item on the List.
Implements Iterator< T >.
Definition at line 104 of file ListIterator.h.
Referenced by HashTable< String, FileCache * >::at(), CoreServer::bootAll(), chdir(), Directory::clear(), Associative< String, FileCache * >::compareTo(), Shell::exec(), Kernel::executeIntVector(), FileSystemServer::findFileCache(), Directory::get(), HashTable< String, FileCache * >::get(), ConstHashIterator< K, V >::hasCurrent(), HashIterator< K, V >::hasCurrent(), HashTable< String, FileCache * >::insert(), LinnCreate::insertDirectory(), DeviceServer::interruptHandler(), ProcessManager::interruptNotify(), HashTable< String, FileCache * >::keys(), FileSystemServer::lookupFile(), MpiHost::parseHostsFile(), CoreServer::prepareCoreInfo(), Directory::read(), MpiHost::receivePacket(), Directory::remove(), HashTable< String, FileCache * >::remove(), FileSystemServer::retryRequests(), TestRunner::run(), MpiProxy::startLocalProcess(), MpiProxy::startRemoteProcess(), IPV4::toAddress(), HashTable< String, FileCache * >::value(), HashTable< String, FileCache * >::values(), Directory::~Directory(), and ProcessShares::~ProcessShares().
|
inlinevirtual |
Check if there is more on the List to iterate.
Implements Iterator< T >.
Definition at line 94 of file ListIterator.h.
Referenced by Associative< String, FileCache * >::clear(), ConstHashIterator< K, V >::hasNext(), and HashIterator< K, V >::hasNext().
|
inlinevirtual |
Fetch the next item.
8 This function first fetches the next item and then updates the current item pointer to that item. It assumes the iterator has a next item.
Implements Iterator< T >.
Definition at line 140 of file ListIterator.h.
Referenced by ConstHashIterator< K, V >::next(), HashIterator< K, V >::next(), and ListIterator< K >::remove().
|
inlinevirtual |
Increment operator.
This function first increment the current item and then updates the next item pointer.
Implements Iterator< T >.
Definition at line 175 of file ListIterator.h.
|
inlinevirtual |
Remove the current item from the List.
Implements Iterator< T >.
Definition at line 153 of file ListIterator.h.
Referenced by HashIterator< K, V >::remove(), and ListIterator< K >::remove().
|
inlinevirtual |
Reset the iterator.
Implements Iterator< T >.
Definition at line 83 of file ListIterator.h.
Referenced by ListIterator< K >::ListIterator(), ConstHashIterator< K, V >::reset(), and HashIterator< K, V >::reset().
|
private |
Current node.
Definition at line 194 of file ListIterator.h.
Referenced by ListIterator< K >::current(), ListIterator< K >::hasCurrent(), ListIterator< K >::ListIterator(), ListIterator< K >::next(), ListIterator< K >::operator++(), ListIterator< K >::remove(), and ListIterator< K >::reset().
|
private |
Points to the List to iterate.
Definition at line 191 of file ListIterator.h.
Referenced by ListIterator< K >::remove(), and ListIterator< K >::reset().
|
private |
Next node.
Definition at line 197 of file ListIterator.h.
Referenced by ListIterator< K >::hasNext(), ListIterator< K >::next(), ListIterator< K >::operator++(), ListIterator< K >::remove(), and ListIterator< K >::reset().