OR-Tools  9.0
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 {
22 constexpr CpSolverRequest::CpSolverRequest(
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 {
31  CpSolverRequest _instance;
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 
42 const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
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  PROTOBUF_FIELD_OFFSET(::operations_research::sat::v1::CpSolverRequest, model_),
49  PROTOBUF_FIELD_OFFSET(::operations_research::sat::v1::CpSolverRequest, parameters_as_string_),
50 };
51 static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
52  { 0, -1, sizeof(::operations_research::sat::v1::CpSolverRequest)},
53 };
54 
55 static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
56  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::operations_research::sat::v1::_CpSolverRequest_default_instance_),
57 };
58 
59 const char descriptor_table_protodef_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
60  "\n\"ortools/sat/cp_model_service.proto\022\032op"
61  "erations_research.sat.v1\032\032ortools/sat/cp"
62  "_model.proto\"e\n\017CpSolverRequest\0224\n\005model"
63  "\030\001 \001(\0132%.operations_research.sat.CpModel"
64  "Proto\022\034\n\024parameters_as_string\030\002 \001(\t2t\n\010C"
65  "pSolver\022h\n\014SolveProblem\022+.operations_res"
66  "earch.sat.v1.CpSolverRequest\032).operation"
67  "s_research.sat.CpSolverResponse\"\000BG\n\031com"
68  ".google.ortools.sat.v1B\023CpModelServicePr"
69  "otoP\001\252\002\022Google.OrTools.Satb\006proto3"
70  ;
71 static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_deps[1] = {
73 };
74 static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_once;
75 const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto = {
76  false, false, 394, descriptor_table_protodef_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto, "ortools/sat/cp_model_service.proto",
80 };
81 PROTOBUF_ATTRIBUTE_WEAK ::PROTOBUF_NAMESPACE_ID::Metadata
83  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto);
85 }
86 
87 // Force running AddDescriptors() at dynamic initialization time.
88 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);
89 namespace operations_research {
90 namespace sat {
91 namespace v1 {
92 
93 // ===================================================================
94 
96  public:
97  static const ::operations_research::sat::CpModelProto& model(const CpSolverRequest* msg);
98 };
99 
100 const ::operations_research::sat::CpModelProto&
101 CpSolverRequest::_Internal::model(const CpSolverRequest* msg) {
102  return *msg->model_;
103 }
104 void CpSolverRequest::clear_model() {
105  if (GetArena() == nullptr && model_ != nullptr) {
106  delete model_;
107  }
108  model_ = nullptr;
109 }
110 CpSolverRequest::CpSolverRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
111  : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
112  SharedCtor();
113  RegisterArenaDtor(arena);
114  // @@protoc_insertion_point(arena_constructor:operations_research.sat.v1.CpSolverRequest)
115 }
116 CpSolverRequest::CpSolverRequest(const CpSolverRequest& from)
117  : ::PROTOBUF_NAMESPACE_ID::Message() {
118  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
119  parameters_as_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
120  if (!from._internal_parameters_as_string().empty()) {
121  parameters_as_string_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_parameters_as_string(),
122  GetArena());
123  }
124  if (from._internal_has_model()) {
125  model_ = new ::operations_research::sat::CpModelProto(*from.model_);
126  } else {
127  model_ = nullptr;
128  }
129  // @@protoc_insertion_point(copy_constructor:operations_research.sat.v1.CpSolverRequest)
130 }
131 
132 void CpSolverRequest::SharedCtor() {
133 parameters_as_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
134 model_ = nullptr;
135 }
136 
137 CpSolverRequest::~CpSolverRequest() {
138  // @@protoc_insertion_point(destructor:operations_research.sat.v1.CpSolverRequest)
139  SharedDtor();
140  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
141 }
142 
143 void CpSolverRequest::SharedDtor() {
144  GOOGLE_DCHECK(GetArena() == nullptr);
145  parameters_as_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
146  if (this != internal_default_instance()) delete model_;
147 }
148 
149 void CpSolverRequest::ArenaDtor(void* object) {
150  CpSolverRequest* _this = reinterpret_cast< CpSolverRequest* >(object);
151  (void)_this;
152 }
153 void CpSolverRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
154 }
155 void CpSolverRequest::SetCachedSize(int size) const {
156  _cached_size_.Set(size);
157 }
158 
159 void CpSolverRequest::Clear() {
160 // @@protoc_insertion_point(message_clear_start:operations_research.sat.v1.CpSolverRequest)
161  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
162  // Prevent compiler warnings about cached_has_bits being unused
163  (void) cached_has_bits;
164 
165  parameters_as_string_.ClearToEmpty();
166  if (GetArena() == nullptr && model_ != nullptr) {
167  delete model_;
168  }
169  model_ = nullptr;
170  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
171 }
172 
173 const char* CpSolverRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
174 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
175  while (!ctx->Done(&ptr)) {
176  ::PROTOBUF_NAMESPACE_ID::uint32 tag;
177  ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
178  CHK_(ptr);
179  switch (tag >> 3) {
180  // .operations_research.sat.CpModelProto model = 1;
181  case 1:
182  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
183  ptr = ctx->ParseMessage(_internal_mutable_model(), ptr);
184  CHK_(ptr);
185  } else goto handle_unusual;
186  continue;
187  // string parameters_as_string = 2;
188  case 2:
189  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
190  auto str = _internal_mutable_parameters_as_string();
191  ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
192  CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "operations_research.sat.v1.CpSolverRequest.parameters_as_string"));
193  CHK_(ptr);
194  } else goto handle_unusual;
195  continue;
196  default: {
197  handle_unusual:
198  if ((tag & 7) == 4 || tag == 0) {
199  ctx->SetLastTag(tag);
200  goto success;
201  }
202  ptr = UnknownFieldParse(tag,
203  _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
204  ptr, ctx);
205  CHK_(ptr != nullptr);
206  continue;
207  }
208  } // switch
209  } // while
210 success:
211  return ptr;
212 failure:
213  ptr = nullptr;
214  goto success;
215 #undef CHK_
216 }
217 
218 ::PROTOBUF_NAMESPACE_ID::uint8* CpSolverRequest::_InternalSerialize(
219  ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
220  // @@protoc_insertion_point(serialize_to_array_start:operations_research.sat.v1.CpSolverRequest)
221  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
222  (void) cached_has_bits;
223 
224  // .operations_research.sat.CpModelProto model = 1;
225  if (this->has_model()) {
226  target = stream->EnsureSpace(target);
227  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
228  InternalWriteMessage(
229  1, _Internal::model(this), target, stream);
230  }
231 
232  // string parameters_as_string = 2;
233  if (this->parameters_as_string().size() > 0) {
234  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
235  this->_internal_parameters_as_string().data(), static_cast<int>(this->_internal_parameters_as_string().length()),
236  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
237  "operations_research.sat.v1.CpSolverRequest.parameters_as_string");
238  target = stream->WriteStringMaybeAliased(
239  2, this->_internal_parameters_as_string(), target);
240  }
241 
242  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
243  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
244  _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
245  }
246  // @@protoc_insertion_point(serialize_to_array_end:operations_research.sat.v1.CpSolverRequest)
247  return target;
248 }
249 
250 size_t CpSolverRequest::ByteSizeLong() const {
251 // @@protoc_insertion_point(message_byte_size_start:operations_research.sat.v1.CpSolverRequest)
252  size_t total_size = 0;
253 
254  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
255  // Prevent compiler warnings about cached_has_bits being unused
256  (void) cached_has_bits;
257 
258  // string parameters_as_string = 2;
259  if (this->parameters_as_string().size() > 0) {
260  total_size += 1 +
261  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
262  this->_internal_parameters_as_string());
263  }
264 
265  // .operations_research.sat.CpModelProto model = 1;
266  if (this->has_model()) {
267  total_size += 1 +
268  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
269  *model_);
270  }
271 
272  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
273  return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
274  _internal_metadata_, total_size, &_cached_size_);
275  }
276  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
277  SetCachedSize(cached_size);
278  return total_size;
279 }
280 
281 void CpSolverRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
282 // @@protoc_insertion_point(generalized_merge_from_start:operations_research.sat.v1.CpSolverRequest)
283  GOOGLE_DCHECK_NE(&from, this);
284  const CpSolverRequest* source =
285  ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<CpSolverRequest>(
286  &from);
287  if (source == nullptr) {
288  // @@protoc_insertion_point(generalized_merge_from_cast_fail:operations_research.sat.v1.CpSolverRequest)
289  ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
290  } else {
291  // @@protoc_insertion_point(generalized_merge_from_cast_success:operations_research.sat.v1.CpSolverRequest)
292  MergeFrom(*source);
293  }
294 }
295 
296 void CpSolverRequest::MergeFrom(const CpSolverRequest& from) {
297 // @@protoc_insertion_point(class_specific_merge_from_start:operations_research.sat.v1.CpSolverRequest)
298  GOOGLE_DCHECK_NE(&from, this);
299  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
300  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
301  (void) cached_has_bits;
302 
303  if (from.parameters_as_string().size() > 0) {
304  _internal_set_parameters_as_string(from._internal_parameters_as_string());
305  }
306  if (from.has_model()) {
307  _internal_mutable_model()->::operations_research::sat::CpModelProto::MergeFrom(from._internal_model());
308  }
309 }
310 
311 void CpSolverRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
312 // @@protoc_insertion_point(generalized_copy_from_start:operations_research.sat.v1.CpSolverRequest)
313  if (&from == this) return;
314  Clear();
315  MergeFrom(from);
316 }
317 
318 void CpSolverRequest::CopyFrom(const CpSolverRequest& from) {
319 // @@protoc_insertion_point(class_specific_copy_from_start:operations_research.sat.v1.CpSolverRequest)
320  if (&from == this) return;
321  Clear();
322  MergeFrom(from);
323 }
324 
325 bool CpSolverRequest::IsInitialized() const {
326  return true;
327 }
328 
329 void CpSolverRequest::InternalSwap(CpSolverRequest* other) {
330  using std::swap;
331  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
332  parameters_as_string_.Swap(&other->parameters_as_string_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
333  swap(model_, other->model_);
334 }
335 
336 ::PROTOBUF_NAMESPACE_ID::Metadata CpSolverRequest::GetMetadata() const {
337  return GetMetadataStatic();
338 }
339 
340 
341 // @@protoc_insertion_point(namespace_scope)
342 } // namespace v1
343 } // namespace sat
344 } // namespace operations_research
345 PROTOBUF_NAMESPACE_OPEN
346 template<> PROTOBUF_NOINLINE ::operations_research::sat::v1::CpSolverRequest* Arena::CreateMaybeMessage< ::operations_research::sat::v1::CpSolverRequest >(Arena* arena) {
347  return Arena::CreateMessageInternal< ::operations_research::sat::v1::CpSolverRequest >(arena);
348 }
349 PROTOBUF_NAMESPACE_CLOSE
350 
351 // @@protoc_insertion_point(global_scope)
352 #include <google/protobuf/port_undef.inc>
static const ::operations_research::sat::CpModelProto & model(const CpSolverRequest *msg)
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ortools_2fsat_2fcp_5fmodel_2eproto
Definition: cp_model.pb.cc:985
#define CHK_(x)
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable *const descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_deps[1]
const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold)
::PROTOBUF_NAMESPACE_ID::Message const *const file_default_instances[]
::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto[1]
PROTOBUF_ATTRIBUTE_WEAK ::PROTOBUF_NAMESPACE_ID::Metadata descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_metadata_getter(int index)
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const ** file_level_service_descriptors_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const ** file_level_enum_descriptors_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto
::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto_once
PROTOBUF_NAMESPACE_OPEN PROTOBUF_NOINLINE ::operations_research::sat::v1::CpSolverRequest * Arena::CreateMaybeMessage< ::operations_research::sat::v1::CpSolverRequest >(Arena *arena)
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ortools_2fsat_2fcp_5fmodel_5fservice_2eproto
void swap(IdMap< K, V > &a, IdMap< K, V > &b)
Definition: id_map.h:263
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CpSolverRequestDefaultTypeInternal _CpSolverRequest_default_instance_
Collection of objects used to extend the Constraint Solver library.
static constexpr ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema * schemas
int index
Definition: pack.cc:509
static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]