19#include "absl/status/statusor.h"
20#include "absl/strings/str_cat.h"
21#include "absl/strings/string_view.h"
28 if (
cpu.has_value()) {
31 if (
ram.has_value()) {
51 std::string*
const error) {
57 if (!resources.ok()) {
58 *error = absl::StrCat(
59 "SolverResourcesProto was invalid and could not convert to "
61 resources.status().ToString());
64 *solver_resources = *std::move(resources);
bool has_cpu() const
optional double cpu = 1;
bool has_ram() const
optional double ram = 2;
void set_ram(double value)
void set_cpu(double value)
An object oriented wrapper for quadratic constraints in ModelStorage.
bool AbslParseFlag(const absl::string_view text, SolverType *const value, std::string *const error)
std::string AbslUnparseFlag(const SolverType value)
std::string ProtobufTextFormatPrintToStringForFlag(const google::protobuf::Message &proto)
bool ProtobufParseTextProtoForFlag(absl::string_view text, ProtoType *message_out, std::string *error_out)
SolverResourcesProto Proto() const
std::optional< double > cpu
static absl::StatusOr< SolverResources > FromProto(const SolverResourcesProto &proto)
std::optional< double > ram