Overview | Group | Tree | Graph | Index | Concepts |
The body of this macro defines a piece of code to execute when the object to which the listener is added emits the event in question. No value is returned from a listener.
The listener macro takes three mandatory parameters:
Depending on the specific macro used, optional parameters can be added using pairs of arguments specifying the parameter type and the parameter name.
The following code from the example
YourSolverHomeexamplessrcea1max_listen.cpp
defines a listener which monitors operator invocation:
ILOIIMLISTENER0(OperatorListener, IloPoolOperator::InvocationEvent, event) { IloPoolOperator op = event.getOperator(); OperatorStatistics * stat = GetOperatorStatistics(op); stat->invocations++; }
See Also: