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