FRAMES NO FRAMES

Class IlcAnyExpIterator

Definition file: ilsolver/anyexp.h
Include file: <ilsolver/ilosolver.h>

An instance of the class IlcAnyExpIterator traverses the values belonging to the domain of a constrained enumerated expression (instance of IlcAnyExp or IlcAnyVar).

For more information, see the concept Iterator.

See Also:

Constructor and Destructor Summary
public IlcAnyExpIterator(IlcAnyExp exp)
Method Summary
public IlcBoolok() const
public IlcAnyoperator*() const
public IlcAnyExpIterator &operator++()
Constructor and Destructor Detail

IlcAnyExpIterator

public IlcAnyExpIterator(IlcAnyExp exp)

This constructor creates an iterator associated with exp to traverse the values belonging to the domain of exp.


Method Detail

ok

public IlcBool ok() const

This member function returns IlcTrue if there is a current element and the iterator points to it. Otherwise, it returns IlcFalse.

To traverse the values belonging to the domain of a costrained enumerated expression, use the following code:

 IlcAny val;
 for (IlcAnyExpIterator iter(exp); iter.ok(); ++iter){
  	    val = *iter;
	        // do something with val
    }
 

operator*

public IlcAny operator*() const

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


operator++

public IlcAnyExpIterator & operator++()

This operator advances the iterator to point to the next value in the domain of the constrained enumerated expression.