| Overview | Group | Tree | Graph | Index | Concepts |
This macro defines a trace class named _thisI with
n data members. When n is greater than zero, the types and
names of the data members must be supplied as arguments to the macro. Each
data member is defined by its type ti and a name
ai.
You can use the macro ILOCPTRACEWRAPPER to wrap an existing
instance of IlcTrace when you want to use it within
Concert Technology objects. In order to use an instance of
IlcTrace in that way, you need to follow these steps:
IlcTrace in an instance of
IloCPTrace.
IloSolver::addTrace to add the trace to the model.Example
Here is how to define a trace wrapper with no (zero) data members:
ILOCPTRACEWRAPPER0(PrintConstraintTrace, solver) {
solver.setTraceMode(IlcTrue);
IlcPrintTrace trace(solver, IlcTraceConstraint);
solver.setTrace(trace);
}
That macro generates code similar to the following lines:
class PrintConstraintTraceConcertI : public IloCPTraceI {
public:
PrintConstraintTraceConcertI();
~PrintConstraintTraceConcertI();
virtual void execute(const IloSolver solver) const;
};
PrintConstraintTraceConcertI::PrintConstraintTraceConcertI() :
IloCPTraceI() {}
PrintConstraintTraceConcertI::~PrintConstraintTraceConcertI() {}
IloCPTrace PrintConstraintTrace(IloEnv env) {
return new (env) PrintConstraintTraceConcertI();
}
void PrintConstraintTraceConcertI::execute(const IloSolver solver) const
{
solver.setTraceMode(IlcTrue);
IlcPrintTrace trace(solver, IlcTraceConstraint);
solver.setTrace(trace);
}
See Also: