What can you do with a generic callback?

Generic callbacks are flexible and multi-purpose.

In your application, you can do the following things with the generic callback:
Query information about current solution status and progress
Using the routines CPXXcallbackgetinfoint and CPXcallbackgetinfoint, CPXXcallbackgetinfolong and CPXcallbackgetinfolong, CPXXcallbackgetinfodbl and CPXcallbackgetinfodbl, and CPXXcallbackgetincumbent and CPXcallbackgetincumbent, you can obtain information that CPLEX has currently calculated about your problem and how much work CPLEX has performed so far. See also the enumeration CPXCALLBACKINFO for a list of information that can be queried from a generic callback.
Inject heuristic solutions
Using CPXXcallbackpostheursoln and CPXcallbackpostheursoln, you can inject a feasible solution (for example, a solution found by a heuristic that you implemented) into the CPLEX solution process.
Reject integer-feasible solutions as candidates
Upon request, CPLEX will invoke the generic callback for each integer-feasible solution that CPLEX finds. This convention gives you a chance to reject the solution (with and without adding lazy constraints that cut off the solution). See CPXXcallbackgetcandidatepoint and CPXcallbackgetcandidatepoint, CPXXcallbackgetcandidateray and CPXcallbackgetcandidateray, and CPXXcallbackrejectcandidate and CPXcallbackrejectcandidate for more details.
Get the current relaxed solution
Upon request, CPLEX will invoke the callback whenever CPLEX finds a (fractional) solution to a relaxed problem available. This solution can be queried with CPXXcallbackgetrelaxationpoint and CPXcallbackgetrelaxationpoint.
Add user cuts
You can add user cuts to the current relaxed solution in a generic callback by means of the routine CPXXcallbackaddusercuts and CPXcallbackaddusercuts.
Implement a customized branching strategy
Upon request, CPLEX will invoke the generic callback prior to branching at a node in the branch-and-cut tree. This convention gives you the possibility either to specify a custom branching decision, or to let CPLEX branch according to the selected branching strategy. For more information, see CPX_CALLBACKCONTEXT_BRANCHING, CPXXcallbackmakebranch and CPXcallbackmakebranch, and CPXXcallbackprunenode and CPXcallbackprunenode.
Force termination
You can force CPLEX to terminate optimization from a generic callback by means of the routine CPXXcallbackabort and CPXcallbackabort.