FRAMES NO FRAMES

Class IloAnySet::Iterator

Definition file: ilconcert/iloanyset.h
For IBM® ILOG® Solver: an iterator to traverse the elements of IloAnySet.

An instance of the nested class IloAnySet::Iterator is an iterator that traverses the elements of a finite set of pointers (an instance of IloAnySet).

See Also:

Constructor and Destructor Summary
public Iterator(const IloAnySetI * coll)
public Iterator(const IloAnySet coll)
public Iterator(IloGenAlloc * heap, const IloAnySetI * coll)
public ~Iterator()
Method Summary
public IloBoolok() const
public IloAnyoperator*()
public voidoperator++()
Constructor and Destructor Detail

Iterator

public Iterator(const IloAnySetI * coll)

.


Iterator

public Iterator(const IloAnySet coll)

.


Iterator

public Iterator(IloGenAlloc * heap, const IloAnySetI * coll)

.


~Iterator

public ~Iterator()

.


Method Detail

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:

 for(IloAnySet::Iterator iter(set); iter.ok(); ++iter){
         IloAny val = *iter;
         // do something with val
 }

operator*

public IloAny operator*()

This operator returns the current value.


operator++

public void operator++()

This operator advances the iterator to point to the next value in the dataset.