OR-Tools  9.2
cp_model_service.pb.cc
Go to the documentation of this file.
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: ortools/sat/cp_model_service.proto
3 
5 
6 #include <algorithm>
7 
8 #include <google/protobuf/io/coded_stream.h>
9 #include <google/protobuf/extension_set.h>
10 #include <google/protobuf/wire_format_lite.h>
11 #include <google/protobuf/descriptor.h>
12 #include <google/protobuf/generated_message_reflection.h>
13 #include <google/protobuf/reflection_ops.h>
14 #include <google/protobuf/wire_format.h>
15 // @@protoc_insertion_point(includes)
16 #include <google/protobuf/port_def.inc>
17 
18 PROTOBUF_PRAGMA_INIT_SEG
19 namespace operations_research {
20 namespace sat {
21 namespace v1 {
23  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
24  : parameters_as_string_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
25  , model_(nullptr){}
28  : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
30  union {
32  };
33 };
34 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CpSolverRequestDefaultTypeInternal _CpSolverRequest_default_instance_;
35 } // namespace v1
36 } // namespace sat
37 } // namespace operations_research
38 static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto[1];
39 static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto = nullptr;
40 static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto = nullptr;
41 
43  ~0u, // no _has_bits_
44  PROTOBUF_FIELD_OFFSET(::operations_research::sat::v1::CpSolverRequest, _internal_metadata_),
45  ~0u, // no _extensions_
46  ~0u, // no _oneof_case_
47  ~0u, // no _weak_field_map_
48  ~0u, // no _inlined_string_donated_
49  PROTOBUF_FIELD_OFFSET(::operations_research::sat::v1::CpSolverRequest, model_),
50  PROTOBUF_FIELD_OFFSET(::operations_research::sat::v1::CpSolverRequest, parameters_as_string_),
51 };
52 static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
54 };
55 
56 static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
57  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::operations_research::sat::v1::_CpSolverRequest_default_instance_),
58 };
59 
60 const char descriptor_table_protodef_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
61  "\n\"ortools/sat/cp_model_service.proto\022\032op"
62  "erations_research.sat.v1\032\032ortools/sat/cp"
63  "_model.proto\"e\n\017CpSolverRequest\0224\n\005model"
64  "\030\001 \001(\0132%.operations_research.sat.CpModel"
65  "Proto\022\034\n\024parameters_as_string\030\002 \001(\t2t\n\010C"
66  "pSolver\022h\n\014SolveProblem\022+.operations_res"
67  "earch.sat.v1.CpSolverRequest\032).operation"
68  "s_research.sat.CpSolverResponse\"\000BG\n\031com"
69  ".google.ortools.sat.v1B\023CpModelServicePr"
70  "otoP\001\252\002\022Google.OrTools.Satb\006proto3"
71  ;
72 static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_deps[1] = {
74 };
75 static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_once;
76 const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto = {
77  false, false, 394, descriptor_table_protodef_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto, "ortools/sat/cp_model_service.proto",
81 };
82 PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_getter() {
84 }
85 
86 // Force running AddDescriptors() at dynamic initialization time.
87 PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto(&descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto);
88 namespace operations_research {
89 namespace sat {
90 namespace v1 {
91 
92 // ===================================================================
93 
95  public:
96  static const ::operations_research::sat::CpModelProto& model(const CpSolverRequest* msg);
97 };
98 
99 const ::operations_research::sat::CpModelProto&
101  return *msg->model_;
102 }
104  if (GetArenaForAllocation() == nullptr && model_ != nullptr) {
105  delete model_;
106  }
107  model_ = nullptr;
108 }
109 CpSolverRequest::CpSolverRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena,
110  bool is_message_owned)
111  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
112  SharedCtor();
113  if (!is_message_owned) {
114  RegisterArenaDtor(arena);
115  }
116  // @@protoc_insertion_point(arena_constructor:operations_research.sat.v1.CpSolverRequest)
117 }
119  : ::PROTOBUF_NAMESPACE_ID::Message() {
120  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
121  parameters_as_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
122  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
123  parameters_as_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
124  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
125  if (!from._internal_parameters_as_string().empty()) {
126  parameters_as_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_parameters_as_string(),
127  GetArenaForAllocation());
128  }
129  if (from._internal_has_model()) {
130  model_ = new ::operations_research::sat::CpModelProto(*from.model_);
131  } else {
132  model_ = nullptr;
133  }
134  // @@protoc_insertion_point(copy_constructor:operations_research.sat.v1.CpSolverRequest)
135 }
136 
137 inline void CpSolverRequest::SharedCtor() {
138 parameters_as_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
139 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
140  parameters_as_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
141 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
142 model_ = nullptr;
143 }
144 
146  // @@protoc_insertion_point(destructor:operations_research.sat.v1.CpSolverRequest)
147  if (GetArenaForAllocation() != nullptr) return;
148  SharedDtor();
149  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
150 }
151 
152 inline void CpSolverRequest::SharedDtor() {
153  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
154  parameters_as_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
155  if (this != internal_default_instance()) delete model_;
156 }
157 
158 void CpSolverRequest::ArenaDtor(void* object) {
159  CpSolverRequest* _this = reinterpret_cast< CpSolverRequest* >(object);
160  (void)_this;
161 }
162 void CpSolverRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
163 }
164 void CpSolverRequest::SetCachedSize(int size) const {
165  _cached_size_.Set(size);
166 }
167 
169 // @@protoc_insertion_point(message_clear_start:operations_research.sat.v1.CpSolverRequest)
170  uint32_t cached_has_bits = 0;
171  // Prevent compiler warnings about cached_has_bits being unused
172  (void) cached_has_bits;
173 
174  parameters_as_string_.ClearToEmpty();
175  if (GetArenaForAllocation() == nullptr && model_ != nullptr) {
176  delete model_;
177  }
178  model_ = nullptr;
179  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
180 }
181 
182 const char* CpSolverRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
183 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
184  while (!ctx->Done(&ptr)) {
185  uint32_t tag;
186  ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
187  switch (tag >> 3) {
188  // .operations_research.sat.CpModelProto model = 1;
189  case 1:
190  if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
191  ptr = ctx->ParseMessage(_internal_mutable_model(), ptr);
192  CHK_(ptr);
193  } else
194  goto handle_unusual;
195  continue;
196  // string parameters_as_string = 2;
197  case 2:
198  if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
199  auto str = _internal_mutable_parameters_as_string();
200  ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
201  CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "operations_research.sat.v1.CpSolverRequest.parameters_as_string"));
202  CHK_(ptr);
203  } else
204  goto handle_unusual;
205  continue;
206  default:
207  goto handle_unusual;
208  } // switch
209  handle_unusual:
210  if ((tag == 0) || ((tag & 7) == 4)) {
211  CHK_(ptr);
212  ctx->SetLastTag(tag);
213  goto message_done;
214  }
215  ptr = UnknownFieldParse(
216  tag,
217  _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
218  ptr, ctx);
219  CHK_(ptr != nullptr);
220  } // while
221 message_done:
222  return ptr;
223 failure:
224  ptr = nullptr;
225  goto message_done;
226 #undef CHK_
227 }
228 
230  uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
231  // @@protoc_insertion_point(serialize_to_array_start:operations_research.sat.v1.CpSolverRequest)
232  uint32_t cached_has_bits = 0;
233  (void) cached_has_bits;
234 
235  // .operations_research.sat.CpModelProto model = 1;
236  if (this->_internal_has_model()) {
237  target = stream->EnsureSpace(target);
238  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
239  InternalWriteMessage(
240  1, _Internal::model(this), target, stream);
241  }
242 
243  // string parameters_as_string = 2;
244  if (!this->_internal_parameters_as_string().empty()) {
245  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
246  this->_internal_parameters_as_string().data(), static_cast<int>(this->_internal_parameters_as_string().length()),
247  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
248  "operations_research.sat.v1.CpSolverRequest.parameters_as_string");
249  target = stream->WriteStringMaybeAliased(
250  2, this->_internal_parameters_as_string(), target);
251  }
252 
253  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
254  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
255  _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
256  }
257  // @@protoc_insertion_point(serialize_to_array_end:operations_research.sat.v1.CpSolverRequest)
258  return target;
259 }
260 
262 // @@protoc_insertion_point(message_byte_size_start:operations_research.sat.v1.CpSolverRequest)
263  size_t total_size = 0;
264 
265  uint32_t cached_has_bits = 0;
266  // Prevent compiler warnings about cached_has_bits being unused
267  (void) cached_has_bits;
268 
269  // string parameters_as_string = 2;
270  if (!this->_internal_parameters_as_string().empty()) {
271  total_size += 1 +
272  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
273  this->_internal_parameters_as_string());
274  }
275 
276  // .operations_research.sat.CpModelProto model = 1;
277  if (this->_internal_has_model()) {
278  total_size += 1 +
279  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
280  *model_);
281  }
282 
283  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
284 }
285 
286 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CpSolverRequest::_class_data_ = {
287  ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
288  CpSolverRequest::MergeImpl
289 };
290 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CpSolverRequest::GetClassData() const { return &_class_data_; }
291 
292 void CpSolverRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
293  const ::PROTOBUF_NAMESPACE_ID::Message& from) {
294  static_cast<CpSolverRequest *>(to)->MergeFrom(
295  static_cast<const CpSolverRequest &>(from));
296 }
297 
298 
300 // @@protoc_insertion_point(class_specific_merge_from_start:operations_research.sat.v1.CpSolverRequest)
301  GOOGLE_DCHECK_NE(&from, this);
302  uint32_t cached_has_bits = 0;
303  (void) cached_has_bits;
304 
305  if (!from._internal_parameters_as_string().empty()) {
306  _internal_set_parameters_as_string(from._internal_parameters_as_string());
307  }
308  if (from._internal_has_model()) {
309  _internal_mutable_model()->::operations_research::sat::CpModelProto::MergeFrom(from._internal_model());
310  }
311  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
312 }
313 
315 // @@protoc_insertion_point(class_specific_copy_from_start:operations_research.sat.v1.CpSolverRequest)
316  if (&from == this) return;
317  Clear();
318  MergeFrom(from);
319 }
320 
322  return true;
323 }
324 
325 void CpSolverRequest::InternalSwap(CpSolverRequest* other) {
326  using std::swap;
327  auto* lhs_arena = GetArenaForAllocation();
328  auto* rhs_arena = other->GetArenaForAllocation();
329  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
330  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
331  &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
332  &parameters_as_string_, lhs_arena,
333  &other->parameters_as_string_, rhs_arena
334  );
335  swap(model_, other->model_);
336 }
337 
338 ::PROTOBUF_NAMESPACE_ID::Metadata CpSolverRequest::GetMetadata() const {
339  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
342 }
343 
344 // @@protoc_insertion_point(namespace_scope)
345 } // namespace v1
346 } // namespace sat
347 } // namespace operations_research
348 PROTOBUF_NAMESPACE_OPEN
349 template<> PROTOBUF_NOINLINE ::operations_research::sat::v1::CpSolverRequest* Arena::CreateMaybeMessage< ::operations_research::sat::v1::CpSolverRequest >(Arena* arena) {
350  return Arena::CreateMessageInternal< ::operations_research::sat::v1::CpSolverRequest >(arena);
351 }
352 PROTOBUF_NAMESPACE_CLOSE
353 
354 // @@protoc_insertion_point(global_scope)
355 #include <google/protobuf/port_undef.inc>
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable *const descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_deps[1]
void MergeFrom(const CpSolverRequest &from)
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const ** file_level_enum_descriptors_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto
static const CpSolverRequest * internal_default_instance()
void swap(IdMap< K, V > &a, IdMap< K, V > &b)
Definition: id_map.h:263
const uint32_t TableStruct_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto::offsets [] PROTOBUF_SECTION_VARIABLE(protodesc_cold)
uint8_t * _InternalSerialize(uint8_t *target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream *stream) const final
void MergeFrom(const CpModelProto &from)
PROTOBUF_NAMESPACE_OPEN PROTOBUF_NOINLINE ::operations_research::sat::v1::CpSolverRequest * Arena::CreateMaybeMessage< ::operations_research::sat::v1::CpSolverRequest >(Arena *arena)
void CopyFrom(const CpSolverRequest &from)
::PROTOBUF_NAMESPACE_ID::Message const *const file_default_instances[]
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const ** file_level_service_descriptors_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final
PROTOBUF_ATTRIBUTE_WEAKconst ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable * descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_getter()
::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_once
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ortools_2fsat_2fcp_5fmodel_2eproto
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final
static const ::operations_research::sat::CpModelProto & model(const CpSolverRequest *msg)
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final
const char * _InternalParse(const char *ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext *ctx) final
#define CHK_(x)
::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto[1]
Collection of objects used to extend the Constraint Solver library.
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CpSolverRequestDefaultTypeInternal _CpSolverRequest_default_instance_
friend void swap(CpSolverRequest &a, CpSolverRequest &b)
static constexpr ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema * schemas
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData * GetClassData() const final