Skip to content

Commit e4105ff

Browse files
committed
util: add status.proto
1 parent 42c0bb3 commit e4105ff

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

ortools/util/BUILD.bazel

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# limitations under the License.
1313

1414
load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
15+
load("@protobuf//bazel:java_proto_library.bzl", "java_proto_library")
1516
load("@protobuf//bazel:proto_library.bzl", "proto_library")
1617
load("@protobuf//bazel:py_proto_library.bzl", "py_proto_library")
1718
load("@rules_cc//cc:cc_library.bzl", "cc_library")
@@ -361,6 +362,26 @@ cc_library(
361362
],
362363
)
363364

365+
proto_library(
366+
name = "status_proto",
367+
srcs = ["status.proto"],
368+
)
369+
370+
cc_proto_library(
371+
name = "status_cc_proto",
372+
deps = [":status_proto"],
373+
)
374+
375+
java_proto_library(
376+
name = "status_java_proto",
377+
deps = [":status_proto"],
378+
)
379+
380+
py_proto_library(
381+
name = "status_py_pb2",
382+
deps = [":status_proto"],
383+
)
384+
364385
cc_library(
365386
name = "random_engine",
366387
hdrs = ["random_engine.h"],

ortools/util/status.proto

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2010-2025 Google LLC
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
14+
syntax = "proto3";
15+
16+
package operations_research;
17+
18+
option java_package = "com.google.ortools.util";
19+
option java_multiple_files = true;
20+
option java_outer_classname = "StatusProtobuf";
21+
22+
// The streamed version of absl::Status.
23+
message StatusProto {
24+
// The status code, one of the absl::StatusCode.
25+
int32 code = 1;
26+
27+
// The status message.
28+
string message = 2;
29+
}

0 commit comments

Comments
 (0)