csList< T >::Iterator Class Reference
Iterator for the list. More...
#include <csutil/list.h>
Public Member Functions | |
void | Clear () |
Set iterator to non-existent element. HasCurrent() will return false. | |
T & | FetchCurrent () const |
Return current element. | |
T & | FetchNext () const |
Return next element but don't modify iterator. | |
T & | FetchPrev () const |
T & | FetchPrevious () const |
Return previous element but don't modify iterator. | |
bool | HasCurrent () const |
Test if the Iterator is set to a valid element. | |
bool | HasNext () const |
Test if there is a next element. | |
bool | HasPrevious () const |
Test if there is a previous element. | |
bool | IsFirst () const |
Test if the Iterator is set to the first element. | |
bool | IsLast () const |
Test if the Iterator is set to the last element. | |
bool | IsReverse () const |
Test if the iterator is reversed. | |
Iterator (const csList< T > &list, bool reverse=false) | |
Constructor. | |
Iterator (const Iterator &r) | |
Copy constructor. | |
Iterator () | |
Constructor. | |
T & | Next () |
Advance to next element and return it. | |
T & | operator * () const |
Dereference operator (*). | |
operator T * () const | |
Cast operator. | |
Iterator & | operator++ () |
Advance to next element and return it. | |
Iterator & | operator-- () |
Backup to previous element and return it. | |
T * | operator-> () const |
Dereference operator (->). | |
Iterator & | operator= (const Iterator &r) |
Assignment operator. | |
T & | Prev () |
T & | Previous () |
Backup to previous element and return it. | |
Protected Member Functions | |
Iterator (csListElement *element, bool visit=true, bool rev=false) | |
Friends | |
class | csList< T > |
Detailed Description
template<class T>
class csList< T >::Iterator
Iterator for the list.
Definition at line 72 of file list.h.
Constructor & Destructor Documentation
|
Constructor.
|
|
Copy constructor.
Definition at line 79 of file list.h. References csList< T >::Iterator::ptr, csList< T >::Iterator::reversed, and csList< T >::Iterator::visited. |
|
Constructor.
Definition at line 82 of file list.h. References csList< T >::head, and csList< T >::tail. |
Member Function Documentation
|
Set iterator to non-existent element. HasCurrent() will return false.
|
|
Return current element. Warning! Assumes there is a current element! Definition at line 167 of file list.h. References CS_ASSERT, and csList< T >::csListElement::data. |
|
Return next element but don't modify iterator. Warning! Assumes there is a next element! Definition at line 176 of file list.h. References CS_ASSERT, csList< T >::csListElement::data, and csList< T >::csListElement::next. |
|
Return previous element but don't modify iterator. Warning! Assumes there is a previous element! Definition at line 185 of file list.h. References CS_ASSERT, csList< T >::csListElement::data, and csList< T >::csListElement::prev. Referenced by csList< T >::Iterator::FetchPrev(). |
|
Test if the Iterator is set to a valid element.
Definition at line 92 of file list.h. Referenced by csList< T >::Delete(), csList< T >::InsertAfter(), csList< T >::InsertBefore(), csList< T >::MoveAfter(), and csList< T >::MoveBefore(). |
|
Test if there is a next element.
Definition at line 95 of file list.h. References csList< T >::csListElement::next. |
|
Test if there is a previous element.
Definition at line 98 of file list.h. References csList< T >::csListElement::prev. |
|
Test if the Iterator is set to the first element.
Definition at line 101 of file list.h. References csList< T >::csListElement::prev. |
|
Test if the Iterator is set to the last element.
Definition at line 104 of file list.h. References csList< T >::csListElement::next. |
|
Test if the iterator is reversed.
Definition at line 107 of file list.h. Referenced by csList< T >::Delete(). |
|
Advance to next element and return it.
Definition at line 127 of file list.h. References CS_ASSERT, csList< T >::csListElement::data, and csList< T >::csListElement::next. |
|
Dereference operator (*).
Definition at line 114 of file list.h. References CS_ASSERT, and csList< T >::csListElement::data. |
|
Cast operator.
Definition at line 111 of file list.h. References csList< T >::csListElement::data. |
|
Advance to next element and return it.
Definition at line 147 of file list.h. References csList< T >::csListElement::next. |
|
Backup to previous element and return it.
Definition at line 155 of file list.h. References csList< T >::csListElement::prev. |
|
Dereference operator (->).
Definition at line 117 of file list.h. References csList< T >::csListElement::data. |
|
Assignment operator.
Definition at line 89 of file list.h. References csList< T >::Iterator::ptr, csList< T >::Iterator::reversed, and csList< T >::Iterator::visited. |
|
Backup to previous element and return it.
Definition at line 136 of file list.h. References CS_ASSERT, csList< T >::csListElement::data, and csList< T >::csListElement::prev. Referenced by csList< T >::Iterator::Prev(). |
The documentation for this class was generated from the following file:
- csutil/list.h
Generated for Crystal Space by doxygen 1.4.6