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:
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:
- is_valid. Returns T if more elements exist beyond the current index.
- set_to. Set the current index to a particular value.
- length. Returns the number of elements in the whole collection.
Member Function Documentation
template<class T>
virtual T & Iter<T>::current () const [virtual]
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:
- /home/cunkel/doxygen-gen/nci/suif/suif2b/basesuif/suifkernel/iter.h
Generated at Wed Apr 25 17:34:58 2001 for NCI SUIF by
written by Dimitri van Heesch, © 1997-1999