ULAPI  8.0
Public Member Functions | Friends | List of all members
ULListIterator< T > Class Template Reference

A class for iterating over ULList objects. More...

#include <ulcontainers.h>

Public Member Functions

 ULListIterator ()
 
 ULListIterator (const ULListIterator< T > &it)
 
void clear ()
 
ULListIterator< T > & operator= (const ULListIterator< T > &it)
 
 operator bool () const
 
bool operator== (const ULListIterator< T > &it) const
 
bool operator!= (const ULListIterator< T > &it) const
 
ULListIterator< T > & operator++ ()
 
ULListIterator< T > operator++ (int)
 
ULListIterator< T > & operator-- ()
 
ULListIterator< T > operator-- (int)
 
void increment ()
 
void decrement ()
 
T & operator* ()
 
T & getData ()
 
bool isAtEnd () const
 
bool isAtBeginning () const
 
int getIndex () const
 
ULList< T > * getList ()
 

Friends

class ULList< T >
 

Detailed Description

template<class T>
class ULListIterator< T >

A class for iterating over ULList objects.

Constructor & Destructor Documentation

template<class T >
ULListIterator< T >::ULListIterator ( )

Default construcor.

template<class T >
ULListIterator< T >::ULListIterator ( const ULListIterator< T > &  it)

Copy construcor.

Member Function Documentation

template<class T >
void ULListIterator< T >::clear ( )

Sets all data to default values (specifically, pointing to no node in no list).

template<class T >
void ULListIterator< T >::decrement ( )

Decrements this iterator. This method's main purpose is to give SWIG-based wrappers a non-operator way to decrement an iterator.

template<class T >
T & ULListIterator< T >::getData ( )

Synonym for operator*. This method's main purpose is to provide a non-operator dereferencing method for use by SWIG-based wrappers.

template<class T >
int ULListIterator< T >::getIndex ( ) const
Returns
the 0-based index of the item within the list to which this iterator points. If this iterator is pointing to the end of the list or to no list at all, getIndex returns -1. Note that getIndex takes time proportional to the index returned.
template<class T >
ULList< T > * ULListIterator< T >::getList ( )
Returns
a pointer to the list into which this iterator points.
template<class T >
void ULListIterator< T >::increment ( )

Advances this iterator. This method's main purpose is to give SWIG-based wrappers a non-operator way to increment an iterator.

template<class T >
bool ULListIterator< T >::isAtBeginning ( ) const
Returns
true if this iterator points to the first node of the list with which it is associated. Note that if the list is empty, isAtBeginning returns true even though there is no "first node."
template<class T >
bool ULListIterator< T >::isAtEnd ( ) const
Returns
true if this iterator points to the end of the list with which it is associated. The "end" of a list is not a node–it's a spot just beyond the final node in the list. Note that an iterator for which isAtEnd returns true must not be dereferenced using operator*.
template<class T >
ULListIterator< T >::operator bool ( ) const
Returns
true if this iterator does not point to the end of the list with which it is associated. A typical use of the boolean operator is to control a loop iterating over the whole list, like this: "for (iterator = list.begin(); iterator; ++iterator) {...}".
template<class T >
bool ULListIterator< T >::operator!= ( const ULListIterator< T > &  it) const

Inequality operator.

template<class T >
T & ULListIterator< T >::operator* ( )
Returns
a reference to the data stored in the node pointed to by this iterator.
Precondition
This iterator must point to a node in a list. This condition is satisfied if isAtEnd() returns false or operator bool() returns true.
template<class T >
ULListIterator< T > & ULListIterator< T >::operator++ ( )

Pre-increment operator. Advances this iterator to the next node in the list, or to the end of the list if no such node exists.

Returns
a reference to this iterator.
template<class T >
ULListIterator< T > ULListIterator< T >::operator++ ( int  )

Post-increment operator. Advances this iterator to the next node in the list, or to the end of the list if no such node exists.

Returns
a copy of this iterator as it was before incrementation occurred.
template<class T >
ULListIterator< T > & ULListIterator< T >::operator-- ( )

Pre-decrement operator. Advances this iterator to the previous node in the list, or leaves the iterator unchanged if no such node exists.

Returns
a reference to this iterator.
template<class T >
ULListIterator< T > ULListIterator< T >::operator-- ( int  )

Post-decrement operator. Advances this iterator to the previous node in the list, or leaves the iterator unchanged if no such node exists.

Returns
a copy of this iterator as it was before decrementation occurred.
template<class T >
ULListIterator< T > & ULListIterator< T >::operator= ( const ULListIterator< T > &  it)

Assignment operator.

template<class T >
bool ULListIterator< T >::operator== ( const ULListIterator< T > &  it) const

Equality operator.

Friends And Related Function Documentation

template<class T>
friend class ULList< T >
friend

The documentation for this class was generated from the following file: