Overview | Group | Tree | Graph | Deprecated | Index | Concepts |
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 void | beginVisit(IloExtractableI * e) |
public virtual void | endVisit(IloExtractableI * e) |
public | IloExtractableVisitor() |
public virtual void | visitChildren(IloExtractableI * parent, IloExtractableArray children) |
public virtual void | visitChildren(IloExtractableI * parent, IloExtractableI * child) |
Method Detail |
---|
The default constructor.
This method begins the introspection.
This method ends the inspection.
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])
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)