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

A class for iterating over lists of type const ULList&. More...

#include <ulcontainers.h>

Public Member Functions

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

Friends

class ULList< T >
 

Detailed Description

template<class T>
class ULListConstIterator< T >

A class for iterating over lists of type const ULList&.

Constructor & Destructor Documentation

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

Default constructor.

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

Copy constructor.

Member Function Documentation

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

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

template<class T >
void ULListConstIterator< 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 >
const T & ULListConstIterator< 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 ULListConstIterator< 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 >
const ULList< T > * ULListConstIterator< T >::getList ( ) const
Returns
a pointer to the list into which this iterator points.
template<class T >
void ULListConstIterator< 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 ULListConstIterator< 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 ULListConstIterator< 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 >
ULListConstIterator< 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.cbegin(); iterator; ++iterator) {...}".
template<class T>
bool ULListConstIterator< T >::operator!= ( const ULListConstIterator< T > &  it) const

Inequality operator.

template<class T >
const T & ULListConstIterator< T >::operator* ( ) const

Dereference operator.

Returns
a const 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 >
ULListConstIterator< T > & ULListConstIterator< 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 >
ULListConstIterator< T > ULListConstIterator< 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 >
ULListConstIterator< T > & ULListConstIterator< 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 >
ULListConstIterator< T > ULListConstIterator< 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>
ULListConstIterator< T > & ULListConstIterator< T >::operator= ( const ULListConstIterator< T > &  it)

Assignment operator.

template<class T>
bool ULListConstIterator< T >::operator== ( const ULListConstIterator< 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: