36 VLOG(3) <<
"EventExec";
37 CHECK_NE(scip,
nullptr);
38 CHECK_NE(eventhdlr,
nullptr);
39 CHECK_NE(event,
nullptr);
41 SCIP_EVENTHDLRDATA*
const event_handler_data =
42 SCIPeventhdlrGetData(eventhdlr);
43 CHECK_NE(event_handler_data,
nullptr);
45 return event_handler_data->handler->Execute(
46 {event_handler_data->gscip, SCIPeventGetType(event)});
93 if (gscip_ !=
nullptr || event_handler_ !=
nullptr) {
94 return absl::InternalError(
"Already registered");
100 SCIP_EVENTHDLRDATA*
const event_handler_data =
new SCIP_EVENTHDLRDATA;
101 event_handler_data->gscip = gscip;
102 event_handler_data->handler =
this;
105 gscip->scip(), &event_handler_, description_.
name.c_str(),
106 description_.
description.c_str(), EventExec, event_handler_data));
107 if (event_handler_ ==
nullptr) {
109 return absl::InternalError(
"SCIP failed to create event handler");
113 SCIPsetEventhdlrInit(gscip->scip(), event_handler_, EventInit));
115 SCIPsetEventhdlrExit(gscip->scip(), event_handler_, EventExit));
117 SCIPsetEventhdlrFree(gscip->scip(), event_handler_, EventFree));
118 return absl::OkStatus();
134 for (
const GScipEventHandler::CaughtEvent& caught_event :
135 handler.caught_events_) {
136 SCIP_CALL(SCIPdropEvent(handler.gscip_->scip(), caught_event.event_type,
137 handler.event_handler_,
138 nullptr, caught_event.filter_pos));
141 handler.caught_events_.clear();