ILOG CPLEX 11.0 User's Manual > Advanced Programming Techniques > Using Optimization Callbacks > Implementing Callbacks in ILOG CPLEX with Concert Technology > Callback Interface

Two callback classes in the hierarchy need extra attention. The first is the base class IloCplex::CallbackI (IloCplex.CallbackI). Since there is no corresponding callback in the Callable Library, this class cannot be used for implementing user callbacks. Instead, its purpose is to provide an interface common to all callback functions. This consists of the methods getModel, which returns the model that is extracted to the IloCplex object that is calling the callback, getEnv, which returns the corresponding environment (C++ only), and abort, which aborts the current optimization. Further, methods getNrows and getNcols allow you to query the number of rows and columns of the current cplex LP matrix. These methods can be called from all callbacks.

Note
For C++ users, no manipulation of the model or, more precisely, any extracted modeling object is allowed during the execution of a callback. No modification is allowed of any array or expression not local to the callback function itself (that is, constructed and ended in it). The only exception is the modification of array elements. For example, x[i] = 0 would be permissible, whereas x.add(0) would not unless x is a local array of the callback.