14#ifndef OR_TOOLS_LINEAR_SOLVER_PROTO_SOLVER_PROTO_UTILS_H_
15#define OR_TOOLS_LINEAR_SOLVER_PROTO_SOLVER_PROTO_UTILS_H_
21#include "absl/log/check.h"
22#include "absl/log/log.h"
23#include "absl/status/statusor.h"
24#include "google/protobuf/message.h"
30using google::protobuf::Message;
38 bool log_error, absl::StatusOr<MPSolutionResponse> response) {
41 LOG(ERROR) <<
"Error status: " << response.status();
46 return error_response;
48 return std::move(response).value();
72 if constexpr (!std::is_base_of<Message, P>::value) {
77 CHECK(parameters.SerializeToString(&bytes));
void set_status_str(Arg_ &&arg, Args_... args)
void set_status(::operations_research::MPSolverResponseStatus value)
In SWIG mode, we don't want anything besides these top-level includes.
std::string EncodeParametersAsString(const P ¶meters)
std::string ProtobufShortDebugString(const P &message)
MPSolutionResponse ConvertStatusOrMPSolutionResponse(bool log_error, absl::StatusOr< MPSolutionResponse > response)