21#include "absl/status/statusor.h"
24#include "scip/pub_message.h"
25#include "scip/type_message.h"
46SCIP_RETCODE SCIPMessageHandlerFree(SCIP_MESSAGEHDLR*
const handler) {
49 CHECK_EQ(SCIPmessagehdlrSetData(handler,
nullptr), SCIP_OKAY);
55 SCIP_MESSAGEHDLR*
const handler,
64 LOG(ERROR) <<
"Unexpected SCIP message: " <<
message;
89void SCIPMessageHandlerInfo(SCIP_MESSAGEHDLR*
const handler, FILE*,
95void SCIPMessageHandlerDialog(SCIP_MESSAGEHDLR*
const handler, FILE*,
101void SCIPMessageHandlerWarning(SCIP_MESSAGEHDLR*
const handler, FILE*,
110 if (handler !=
nullptr) {
111 CHECK_EQ(SCIPmessagehdlrRelease(&handler), SCIP_OKAY);
116 if (handler !=
nullptr) {
117 SCIPmessagehdlrCapture(handler);
126 auto data = std::make_unique<SCIP_MessagehdlrData>(gscip_message_handler);
127 SCIP_MESSAGEHDLR* message_handler =
nullptr;
129 SCIPmessagehdlrCreate(&message_handler,
133 SCIPMessageHandlerWarning,
134 SCIPMessageHandlerDialog,
135 SCIPMessageHandlerInfo,
136 SCIPMessageHandlerFree,
148 : handler_(handler) {}
151 if (handler_ !=
nullptr) {
~ScopedSCIPMessageHandlerDisabler()
ScopedSCIPMessageHandlerDisabler(const MessageHandlerPtr &handler)
absl::StatusOr< MessageHandlerPtr > MakeSCIPMessageHandler(const GScipMessageHandler gscip_message_handler)
Make a message handler for SCIP that calls the input function.
MessageHandlerPtr CaptureMessageHandlerPtr(SCIP_MESSAGEHDLR *const handler)
std::unique_ptr< SCIP_MESSAGEHDLR, ReleaseSCIPMessageHandler > MessageHandlerPtr
In SWIG mode, we don't want anything besides these top-level includes.
std::function< void(GScipMessageType type, absl::string_view message)> GScipMessageHandler
#define RETURN_IF_SCIP_ERROR(x)
This is an incomplete SCIP struct meant to be fully defined by SCIP users.
std::atomic< bool > disabled
const operations_research::GScipMessageHandler gscip_message_handler
SCIP_MessagehdlrData(const operations_research::GScipMessageHandler gscip_message_handler)
void operator()(SCIP_MESSAGEHDLR *handler) const