Skip to main content
FRAMES NO FRAMES

Class IloCplex::Callback

Definition file: ilcplex/ilocplexi.h
Map of IloCplex::CallbackIloCplex::CallbackIloCplex::Callback

This class is the handle class for all callback implementation classes available for IloCplex. Callback implementation classes are user-defined classes derived from a subclass of IloCplex::CallbackI.

This class serves two different purposes:

See Also:

Method Summary
public Callback(IloCplex::CallbackI * impl=0)
public voidend()
public IloCplex::CallbackI *getImpl() const
public Callback::TypegetType() const
Inner Enumeration
Callback::Type
Inner Class
Callback::Context
Inner structs
Callback::Function
Method Detail

Callback

public Callback(IloCplex::CallbackI * impl=0)

This constructor creates a callback handle object and initializes it to the implementation object passed as the argument.


end

public void end()

This method deletes the implementation object pointed to by the invoking handle and sets the pointer to 0 (zero).


getImpl

public IloCplex::CallbackI * getImpl() const

This method returns a pointer to the implementation object of the invoking handle.


getType

public Callback::Type getType() const

This method returns the type of the callback implementation object referenced by the invoking handle.


Inner Enumeration Detail

Enumeration Type

Definition file: ilcplex/ilocplexi.h

This enumeration type is used to identify the type of a callback implementation object referred to by an IloCplex::Callback handle.

See Also:

Fields

Simplex = 0 
Barrier = 1 
Crossover = 2 
Network = 3 
MIP = 4 
Probing = 5 
FractionalCut = 6 
DisjunctiveCut = 7 
Branch = 8 
UserCut = 9 
Node = 10 
Heuristic = 11 
Incumbent = 12 
Solve = 13 
FlowMIRCut = 14 
Continuous = 15 
MIPInfo = 16 
ProbingInfo = 17 
FractionalCutInfo = 18 
DisjunctiveCutInfo = 19 
FlowMIRCutInfo = 20 
Tuning = 21 
LazyConstraint = 22 
_Number = 23 

Inner Struct Detail

Struct Callback::Function

Definition file: ilcplex/ilocplexi.h

Interface for CPLEX callback.

Any class to be used as a CPLEX generic callback must implement this interface.

See Also:

Method Summary
public virtual voidinvoke(Callback::Context const & context)
Method Detail

invoke

public virtual void invoke(Callback::Context const & context)

This method invokes the CPLEX generic callback. If an object is registered with CPLEX by means of the method IloCplex::use(Callback::Function, long), then CPLEX will invoke this function of the registered object in all contexts requested by the argument contextMask passed to IloCplex::use(Callback::Function, long).

Note that in this function you must not invoke any functions of the IloCplex that is performing the current solve. All functions that can be invoked from a callback are members of context.

which context the callback is invoked, which progress information can be queried, and which actions can be performed. This instance is valid only during execution of the callback function. Do not keep a reference to it.

Parameters:

context
An instance of IloCplex::Callback::Context that defines in which context the callback is invoked, which progress information can be queried, and which actions can be performed. This instance is valid only during execution of the callback function. Do not keep a reference to it.