Scippy

SCIP

Solving Constraint Integer Programs

objeventhdlr.h File Reference

Detailed Description

C++ wrapper for event handlers.

Author
Tobias Achterberg

Definition in file objeventhdlr.h.

#include <cstring>
#include "scip/scip.h"
#include "objscip/objcloneable.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPincludeObjEventhdlr (SCIP *scip, scip::ObjEventhdlr *objeventhdlr, SCIP_Bool deleteobject)
 
scip::ObjEventhdlrSCIPfindObjEventhdlr (SCIP *scip, const char *name)
 
scip::ObjEventhdlrSCIPgetObjEventhdlr (SCIP *scip, SCIP_EVENTHDLR *eventhdlr)
 

Function Documentation

SCIP_RETCODE SCIPincludeObjEventhdlr ( SCIP scip,
scip::ObjEventhdlr objeventhdlr,
SCIP_Bool  deleteobject 
)

creates the event handler for the given event handler object and includes it in SCIP

The method should be called in one of the following ways:

  1. The user is resposible of deleting the object: SCIP_CALL( SCIPcreate(&scip) ); ... MyEventhdlr* myeventhdlr = new MyEventhdlr(...); SCIP_CALL( SCIPincludeObjEventhdlr(scip, &myeventhdlr, FALSE) ); ... SCIP_CALL( SCIPfree(&scip) ); delete myeventhdlr; // delete eventhdlr AFTER SCIPfree() !
  1. The object pointer is passed to SCIP and deleted by SCIP in the SCIPfree() call: SCIP_CALL( SCIPcreate(&scip) ); ... SCIP_CALL( SCIPincludeObjEventhdlr(scip, new MyEventhdlr(...), TRUE) ); ... SCIP_CALL( SCIPfree(&scip) ); // destructor of MyEventhdlr is called here
Parameters
scipSCIP data structure
objeventhdlrevent handler object
deleteobjectshould the event handler object be deleted when eventhdlristic is freed?
scip::ObjEventhdlr* SCIPfindObjEventhdlr ( SCIP scip,
const char *  name 
)

returns the eventhdlr object of the given name, or 0 if not existing

Parameters
scipSCIP data structure
namename of event handler
scip::ObjEventhdlr* SCIPgetObjEventhdlr ( SCIP scip,
SCIP_EVENTHDLR eventhdlr 
)

returns the eventhdlr object for the given event handler

Parameters
scipSCIP data structure
eventhdlrevent handler