Main Page Class Hierarchy Compound List File List Compound Members File Members
Iter Class Reference
A template for iterators (using the iterhelper).
More...
#include <suifkernel/iter.h>
Inheritance diagram for Iter:
List of all members.
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.
Constructor & Destructor Documentation
template<class T>
Iter<T>::Iter<T> (
|
Iterator * iter) |
|
template<class T>
Iter<T>::Iter<T> (
|
const Iter<T> & other) |
|
template<class T>
Iter<T>::~Iter<T> (
|
void) [inline, virtual] |
|
Member Function Documentation
template<class T>
T & Iter<T>::current (
|
void) const [inline, virtual] |
|
The documentation for this class was generated from the following file:
- nci/suif/suif2b/basesuif/suifkernel/iter.h
Generated at Mon Jul 31 13:43:20 2000 for NCI SUIF by
1.1.2 written by Dimitri van Heesch,
© 1997-2000