Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

Iter Class Reference

A template for iterators (using the iterhelper). More...

#include <suifkernel/iter.h>

Class diagram for Iter:

IterHelper

List of all members.

Public Members

virtual T& current () const
Iter ( Iterator* iter )
Iter ( const Iter &other )
virtual ~Iter (void)

Detailed Description

template<class T> class Iter

A template for iterators (using the iterhelper).

Common usage:

 for (Iter<Expression*> iter = st->get_expression_iterator(); 
      iter.is_valid(); iter.next()) {
     Expression *e = iter.current();
 }
An iterator is an ordered collection of objects. It has a concept of a current element position which is initialized to the first element of the collection. One can advance the position by using next or set it back by using previous.

The current element can be retrieved with current. Other useful methods:


Member Function Documentation

template<class T>
virtual T & Iter<T>::current () const [virtual]

Reimplemented from IterHelper.

template<class T>
Iter<T>::Iter<T> (Iterator * iter)

template<class T>
Iter<T>::Iter<T> (const Iter<T> & other)

template<class T>
virtual Iter<T>::~Iter<T> (void) [virtual]


The documentation for this class was generated from the following file:
Generated at Wed Apr 25 17:34:58 2001 for NCI SUIF by doxygen  written by Dimitri van Heesch, © 1997-1999