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
csList< T >::Iterator::Iterator | ( | ) | [inline] |
Copy constructor.
Definition at line 79 of file list.h.
References csList< T >::Iterator::ptr, csList< T >::Iterator::reversed, and csList< T >::Iterator::visited.
csList< T >::Iterator::Iterator | ( | const csList< T > & | list, | |
bool | reverse = false | |||
) | [inline] |
Constructor.
Definition at line 82 of file list.h.
References csList< T >::head, and csList< T >::tail.
Member Function Documentation
void csList< T >::Iterator::Clear | ( | ) | [inline] |
Set iterator to non-existent element. HasCurrent() will return false.
T& csList< T >::Iterator::FetchCurrent | ( | ) | const [inline] |
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.
T& csList< T >::Iterator::FetchNext | ( | ) | const [inline] |
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.
T& csList< T >::Iterator::FetchPrevious | ( | ) | const [inline] |
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().
bool csList< T >::Iterator::HasCurrent | ( | ) | const [inline] |
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().
bool csList< T >::Iterator::HasNext | ( | ) | const [inline] |
Test if there is a next element.
Definition at line 95 of file list.h.
References csList< T >::csListElement::next.
bool csList< T >::Iterator::HasPrevious | ( | ) | const [inline] |
Test if there is a previous element.
Definition at line 98 of file list.h.
References csList< T >::csListElement::prev.
bool csList< T >::Iterator::IsFirst | ( | ) | const [inline] |
Test if the Iterator is set to the first element.
Definition at line 101 of file list.h.
References csList< T >::csListElement::prev.
bool csList< T >::Iterator::IsLast | ( | ) | const [inline] |
Test if the Iterator is set to the last element.
Definition at line 104 of file list.h.
References csList< T >::csListElement::next.
bool csList< T >::Iterator::IsReverse | ( | ) | const [inline] |
Test if the iterator is reversed.
Definition at line 107 of file list.h.
Referenced by csList< T >::Delete().
T& csList< T >::Iterator::Next | ( | ) | [inline] |
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.
T& csList< T >::Iterator::operator * | ( | ) | const [inline] |
Dereference operator (*).
Definition at line 114 of file list.h.
References CS_ASSERT, and csList< T >::csListElement::data.
csList< T >::Iterator::operator T * | ( | ) | const [inline] |
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.
T* csList< T >::Iterator::operator-> | ( | ) | const [inline] |
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.
T& csList< T >::Iterator::Previous | ( | ) | [inline] |
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.7