16#ifndef OR_TOOLS_GSCIP_GSCIP_EVENT_HANDLER_H_
17#define OR_TOOLS_GSCIP_GSCIP_EVENT_HANDLER_H_
22#include "absl/status/status.h"
23#include "scip/type_event.h"
51 GScip*
gscip()
const {
return gscip_; }
55 SCIP_EVENTTYPE
event_type()
const {
return event_type_; }
62 const SCIP_EVENTTYPE event_type_;
92class GScipEventHandler {
95 : description_(description) {}
109 absl::Status
Register(GScip* gscip);
119 virtual SCIP_RETCODE
Init(GScip* gscip) {
return SCIP_OKAY; }
138 virtual SCIP_RETCODE
Exit(GScip* gscip) {
return SCIP_OKAY; }
157 SCIP_RETCODE
CatchEvent(SCIP_EVENTTYPE event_type);
161 CaughtEvent(
const SCIP_EVENTTYPE event_type,
const int filter_pos)
162 : event_type(event_type), filter_pos(filter_pos) {}
165 SCIP_EVENTTYPE event_type;
185 const GScipEventHandlerDescription description_;
188 GScip* gscip_ =
nullptr;
191 SCIP_EVENTHDLR* event_handler_ =
nullptr;
194 std::vector<CaughtEvent> caught_events_;
GScipEventHandlerContext(GScip *gscip, SCIP_EVENTTYPE event_type)
SCIP_EVENTTYPE event_type() const
friend SCIP_RETCODE DropAllEvents(GScipEventHandler &handler)
virtual ~GScipEventHandler()=default
absl::Status Register(GScip *gscip)
SCIP_RETCODE CatchEvent(SCIP_EVENTTYPE event_type)
GScipEventHandler & operator=(const GScipEventHandler &)=delete
virtual SCIP_RETCODE Init(GScip *gscip)
GScipEventHandler(const GScipEventHandlerDescription &description)
virtual SCIP_RETCODE Execute(GScipEventHandlerContext context)
virtual SCIP_RETCODE Exit(GScip *gscip)
GurobiMPCallbackContext * context
In SWIG mode, we don't want anything besides these top-level includes.
std::string name
See CONSHDLR_NAME in SCIP documentation above.
std::string description
See CONSHDLR_DESC in SCIP documentation above.