Skip to main content
FRAMES NO FRAMES

Class IloTupleIterator

Definition file: ilopl/ilotuplecollection.h
Map of IloTupleIteratorIloTupleIteratorIloTupleIteratorIloDataIterator
This class allows you to iterate on the elements of an IloTupleSet.

It contains an internal tuple that is reused at each iteration. There is no allocation of a tuple per iteration.

Method Summary
public IloTupleIterator(IloTupleSet coll)
public IloBoolok() const
public IloTupleoperator*()
public voidoperator++()
Method Detail

IloTupleIterator

public IloTupleIterator(IloTupleSet coll)

Creates an iterator on the given collection.

The collection is frozen: you cannot commit on it until you end the iterator.


ok

public IloBool ok() const

This member function returns IloTrue if there is a current element and the invoking iterator points to it. Otherwise, it returns IloFalse.

To traverse the elements of a finite set of pointers, use the following code:

 IloTuple val;
 for(IloTupleIterator iter(set); iter.ok(); ++iter){
         val = *iter;
         // do something with val
 }

Returns:

IloTrue if there is a current element and the invoking iterator points to it.

operator*

public IloTuple operator*()

This operator returns the current tuple, the one to which the invoking iterator points.

Returns:

The current tuple in the iteration.

operator++

public void operator++()

This operator makes the iterator point to the next value in the data set.