User manual:   Main Page   Overview   Installation   User Interface   Tutorial   Example   FAQ   Version Updates
Reference manual:   Class List   Class Members   Globals, enums and defines

LinkedList< T >::iterator Class Reference

Defines an iterator of a list of type LinkedList. More...

List of all members.

Public Methods

 iterator ()
 iterator (const iterator &iter)
T & operator * ()
iterator & operator++ ()
iterator operator++ (int)
iterator operator+ (int inc)
iterator & operator-- ()
iterator operator-- (int)
iterator operator- (int inc)
iterator & operator= (const iterator &iter)
bool operator== (const iterator &iter)
bool operator!= (const iterator &iter)


Detailed Description

template<class T>
class LinkedList< T >::iterator

Defines an iterator of a list of type LinkedList.

The iterator is used to iterate over the elements of a list. The iterator at each moment is pointing to an element in the list. Example of usage:

        
LinkedList<int> list;
LinkedList<int>::iterator iter;
int val;
for (iter=list.begin(); iter!=list.end(); iter++) { // iterating over the elements
        val = (int)(*iter); // extracting the value
        .
        .
        .
} 


Constructor & Destructor Documentation

template<class T>
LinkedList< T >::iterator::iterator   [inline]
 

Default constructor.

Initializes the iterator to point to nothing.

template<class T>
LinkedList< T >::iterator::iterator const iterator &    iter [inline]
 

Copy constructor.

Initializes the iterator to point at the same element as iter

Parameters:
iter A reference to a list iterator to copy


Member Function Documentation

template<class T>
T& LinkedList< T >::iterator::operator *   [inline]
 

Returns the value of the element pointed to by this iterator.

Returns:
A reference of the value pointed by the iterator

template<class T>
bool LinkedList< T >::iterator::operator!= const iterator &    iter [inline]
 

Compares the 2 iterators (by the elements they're pointing to.

Parameters:
iter The iterator to compare to
Return values:
true The 2 iterators point to different elements
false The 2 iterators point to the same element

template<class T>
iterator LinkedList< T >::iterator::operator+ int    inc [inline]
 

Updates the iterator to more forward inc elements in the list (postfix operator).

Parameters:
inc The number of steps to move forward in the list
Returns:
A copy of the iterator

template<class T>
iterator LinkedList< T >::iterator::operator++ int    [inline]
 

Updates the iterator to point on the next list element (postfix operator).

Returns:
A copy of the iterator

template<class T>
iterator& LinkedList< T >::iterator::operator++   [inline]
 

Updates the iterator to point on the next list element (prefix operator).

Returns:
A reference of the current iterator

template<class T>
iterator LinkedList< T >::iterator::operator- int    inc [inline]
 

Updates the iterator to more backwards inc elements in the list (postfix operator).

Parameters:
inc The number of steps to move backwards in the list
Returns:
A copy of the iterator

template<class T>
iterator LinkedList< T >::iterator::operator-- int    [inline]
 

Updates the iterator to point on the previous list element (postfix operator).

Returns:
A copy of the iterator

template<class T>
iterator& LinkedList< T >::iterator::operator--   [inline]
 

Updates the iterator to point on the previous list element (prefix operator).

Returns:
A reference of the current iterator

template<class T>
iterator& LinkedList< T >::iterator::operator= const iterator &    iter [inline]
 

Updates the current iterator to point to the same element pointed by the given iterator.

Parameters:
iter The iterator to copy
Returns:
A reference of the current iterator

template<class T>
bool LinkedList< T >::iterator::operator== const iterator &    iter [inline]
 

Compares the 2 iterators (by the elements they're pointing to.

Parameters:
iter The iterator to compare to
Return values:
true The 2 iterators point to the same element
false The 2 iterators point to different elements


The documentation for this class was generated from the following file:
MeshMaker 5.2 Manual
This software library was written by Roni Raab, ronir@cs.technion.ac.il.
Last updated on May 2003.
This software is for academic and research use only.