Skip to main content
FRAMES NO FRAMES

Class IloExtractableVisitor

Definition file: ilconcert/iloextractable.h
Map of IloExtractableVisitorIloExtractableVisitorIloExtractableVisitor
The class for inspecting all nodes of an expression.

The class IloExtractableVisitor is used to introspect a Concert object and inspect all nodes of the expression.

For example, you can introspect a given expression and look for all the variables within.

You can do this by specializing the visitChildren methods and calling the beginVisit method on the extractable you want to introspect.

For example, if you visit an IloDiff object, you will visit the first expression, then the second expression. When visiting the first or second expression, you will visit their sub-expressions, and so on.

Method Summary
public virtual voidbeginVisit(IloExtractableI * e)
public virtual voidendVisit(IloExtractableI * e)
public IloExtractableVisitor()
public virtual voidvisitChildren(IloExtractableI * parent, IloExtractableArray children)
public virtual voidvisitChildren(IloExtractableI * parent, IloExtractableI * child)
Method Detail

IloExtractableVisitor

public IloExtractableVisitor()

The default constructor.


beginVisit

public virtual void beginVisit(IloExtractableI * e)

This method begins the introspection.


endVisit

public virtual void endVisit(IloExtractableI * e)

This method ends the inspection.


visitChildren

public virtual void visitChildren(IloExtractableI * parent, IloExtractableArray children)

This method is called when the member of the object is an array.

For example, when visiting an IloAllDiff(env, [x,y,z]) , you use

 visitChildren(AllDiff, [x,y,z]) 

visitChildren

public virtual void visitChildren(IloExtractableI * parent, IloExtractableI * child)

This method is called when visiting a sub-extractable.

For example, if you want to display all the variables in your object, you use:

 visitChildren(IloExtractableI* parent, IloExtractableI* child){
 IloExtractable extr(child); if (child.isVariable()) cout << extr;
 } 

If you visit IloDiff(env, X, Y) , for example, you would call this method as:

 visitChildren(Diff, X) 

then

 visitChildren(Diff, Y)