blob: 0bf523b3759c5edcca64a358e991b56bf1c1ebf0 [file] [log] [blame]
Feng Xiao33c92802015-05-11 13:47:41 -07001// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: google/protobuf/any.proto
3
4#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
Bo Yang1f0286a2015-12-04 13:18:44 -08005#include <google/protobuf/any.pb.h>
Feng Xiao33c92802015-05-11 13:47:41 -07006
7#include <algorithm>
8
9#include <google/protobuf/stubs/common.h>
Feng Xiaoe841bac2015-12-11 17:09:20 -080010#include <google/protobuf/stubs/port.h>
Feng Xiao33c92802015-05-11 13:47:41 -070011#include <google/protobuf/stubs/once.h>
12#include <google/protobuf/io/coded_stream.h>
13#include <google/protobuf/wire_format_lite_inl.h>
14#include <google/protobuf/descriptor.h>
15#include <google/protobuf/generated_message_reflection.h>
16#include <google/protobuf/reflection_ops.h>
17#include <google/protobuf/wire_format.h>
18// @@protoc_insertion_point(includes)
19
20namespace google {
21namespace protobuf {
22
23namespace {
24
25const ::google::protobuf::Descriptor* Any_descriptor_ = NULL;
26const ::google::protobuf::internal::GeneratedMessageReflection*
27 Any_reflection_ = NULL;
28
29} // namespace
30
31
32void protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto() {
33 protobuf_AddDesc_google_2fprotobuf_2fany_2eproto();
34 const ::google::protobuf::FileDescriptor* file =
35 ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
36 "google/protobuf/any.proto");
37 GOOGLE_CHECK(file != NULL);
38 Any_descriptor_ = file->message_type(0);
39 static const int Any_offsets_[2] = {
40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, type_url_),
41 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, value_),
42 };
43 Any_reflection_ =
44 ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
45 Any_descriptor_,
46 Any::default_instance_,
47 Any_offsets_,
48 -1,
49 -1,
50 -1,
51 sizeof(Any),
52 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _internal_metadata_),
53 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _is_default_instance_));
54}
55
56namespace {
57
58GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
59inline void protobuf_AssignDescriptorsOnce() {
60 ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
61 &protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto);
62}
63
64void protobuf_RegisterTypes(const ::std::string&) {
65 protobuf_AssignDescriptorsOnce();
66 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
67 Any_descriptor_, &Any::default_instance());
68}
69
70} // namespace
71
72void protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto() {
73 delete Any::default_instance_;
74 delete Any_reflection_;
75}
76
77void protobuf_AddDesc_google_2fprotobuf_2fany_2eproto() {
78 static bool already_here = false;
79 if (already_here) return;
80 already_here = true;
81 GOOGLE_PROTOBUF_VERIFY_VERSION;
82
83 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
84 "\n\031google/protobuf/any.proto\022\017google.prot"
85 "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002"
Xiao Hang9fd0f152015-08-04 15:07:44 -070086 " \001(\014BK\n\023com.google.protobufB\010AnyProtoP\001\240"
87 "\001\001\242\002\003GPB\252\002\036Google.Protobuf.WellKnownType"
88 "sb\006proto3", 169);
Feng Xiao33c92802015-05-11 13:47:41 -070089 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
90 "google/protobuf/any.proto", &protobuf_RegisterTypes);
91 Any::default_instance_ = new Any();
92 Any::default_instance_->InitAsDefaultInstance();
93 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto);
94}
95
96// Force AddDescriptors() to be called at static initialization time.
97struct StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto {
98 StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto() {
99 protobuf_AddDesc_google_2fprotobuf_2fany_2eproto();
100 }
101} static_descriptor_initializer_google_2fprotobuf_2fany_2eproto_;
102
103namespace {
104
105static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD;
106static void MergeFromFail(int line) {
107 GOOGLE_CHECK(false) << __FILE__ << ":" << line;
108}
109
110} // namespace
111
112
113// ===================================================================
114
Bo Yang5db21732015-05-21 14:28:59 -0700115void Any::PackFrom(const ::google::protobuf::Message& message) {
116 _any_metadata_.PackFrom(message);
117}
118
119bool Any::UnpackTo(::google::protobuf::Message* message) const {
120 return _any_metadata_.UnpackTo(message);
121}
122
Bo Yang1f0286a2015-12-04 13:18:44 -0800123#if !defined(_MSC_VER) || _MSC_VER >= 1900
Feng Xiao33c92802015-05-11 13:47:41 -0700124const int Any::kTypeUrlFieldNumber;
125const int Any::kValueFieldNumber;
Bo Yang1f0286a2015-12-04 13:18:44 -0800126#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Feng Xiao33c92802015-05-11 13:47:41 -0700127
128Any::Any()
Bo Yang5db21732015-05-21 14:28:59 -0700129 : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&type_url_, &value_) {
Feng Xiao33c92802015-05-11 13:47:41 -0700130 SharedCtor();
131 // @@protoc_insertion_point(constructor:google.protobuf.Any)
132}
133
134void Any::InitAsDefaultInstance() {
135 _is_default_instance_ = true;
136}
137
138Any::Any(const Any& from)
139 : ::google::protobuf::Message(),
Bo Yang5db21732015-05-21 14:28:59 -0700140 _internal_metadata_(NULL),
141 _any_metadata_(&type_url_, &value_) {
Feng Xiao33c92802015-05-11 13:47:41 -0700142 SharedCtor();
143 MergeFrom(from);
144 // @@protoc_insertion_point(copy_constructor:google.protobuf.Any)
145}
146
147void Any::SharedCtor() {
148 _is_default_instance_ = false;
149 ::google::protobuf::internal::GetEmptyString();
150 _cached_size_ = 0;
151 type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
152 value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
153}
154
155Any::~Any() {
156 // @@protoc_insertion_point(destructor:google.protobuf.Any)
157 SharedDtor();
158}
159
160void Any::SharedDtor() {
161 type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
162 value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
163 if (this != default_instance_) {
164 }
165}
166
167void Any::SetCachedSize(int size) const {
168 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
169 _cached_size_ = size;
170 GOOGLE_SAFE_CONCURRENT_WRITES_END();
171}
172const ::google::protobuf::Descriptor* Any::descriptor() {
173 protobuf_AssignDescriptorsOnce();
174 return Any_descriptor_;
175}
176
177const Any& Any::default_instance() {
178 if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fany_2eproto();
179 return *default_instance_;
180}
181
182Any* Any::default_instance_ = NULL;
183
184Any* Any::New(::google::protobuf::Arena* arena) const {
185 Any* n = new Any;
186 if (arena != NULL) {
187 arena->Own(n);
188 }
189 return n;
190}
191
192void Any::Clear() {
193 type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
194 value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
195}
196
197bool Any::MergePartialFromCodedStream(
198 ::google::protobuf::io::CodedInputStream* input) {
199#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
200 ::google::protobuf::uint32 tag;
201 // @@protoc_insertion_point(parse_start:google.protobuf.Any)
202 for (;;) {
203 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
204 tag = p.first;
205 if (!p.second) goto handle_unusual;
206 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
207 // optional string type_url = 1;
208 case 1: {
209 if (tag == 10) {
210 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
211 input, this->mutable_type_url()));
Jisi Liu4c663d82015-08-25 17:03:05 -0700212 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
Feng Xiao33c92802015-05-11 13:47:41 -0700213 this->type_url().data(), this->type_url().length(),
Jisi Liu4c663d82015-08-25 17:03:05 -0700214 ::google::protobuf::internal::WireFormatLite::PARSE,
215 "google.protobuf.Any.type_url"));
Feng Xiao33c92802015-05-11 13:47:41 -0700216 } else {
217 goto handle_unusual;
218 }
219 if (input->ExpectTag(18)) goto parse_value;
220 break;
221 }
222
223 // optional bytes value = 2;
224 case 2: {
225 if (tag == 18) {
226 parse_value:
227 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
228 input, this->mutable_value()));
229 } else {
230 goto handle_unusual;
231 }
232 if (input->ExpectAtEnd()) goto success;
233 break;
234 }
235
236 default: {
237 handle_unusual:
238 if (tag == 0 ||
239 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
240 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
241 goto success;
242 }
243 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
244 break;
245 }
246 }
247 }
248success:
249 // @@protoc_insertion_point(parse_success:google.protobuf.Any)
250 return true;
251failure:
252 // @@protoc_insertion_point(parse_failure:google.protobuf.Any)
253 return false;
254#undef DO_
255}
256
257void Any::SerializeWithCachedSizes(
258 ::google::protobuf::io::CodedOutputStream* output) const {
259 // @@protoc_insertion_point(serialize_start:google.protobuf.Any)
260 // optional string type_url = 1;
261 if (this->type_url().size() > 0) {
Jisi Liu4c663d82015-08-25 17:03:05 -0700262 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
Feng Xiao33c92802015-05-11 13:47:41 -0700263 this->type_url().data(), this->type_url().length(),
Jisi Liu4c663d82015-08-25 17:03:05 -0700264 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
Feng Xiao33c92802015-05-11 13:47:41 -0700265 "google.protobuf.Any.type_url");
266 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
267 1, this->type_url(), output);
268 }
269
270 // optional bytes value = 2;
271 if (this->value().size() > 0) {
272 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
273 2, this->value(), output);
274 }
275
276 // @@protoc_insertion_point(serialize_end:google.protobuf.Any)
277}
278
279::google::protobuf::uint8* Any::SerializeWithCachedSizesToArray(
280 ::google::protobuf::uint8* target) const {
281 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any)
282 // optional string type_url = 1;
283 if (this->type_url().size() > 0) {
Jisi Liu4c663d82015-08-25 17:03:05 -0700284 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
Feng Xiao33c92802015-05-11 13:47:41 -0700285 this->type_url().data(), this->type_url().length(),
Jisi Liu4c663d82015-08-25 17:03:05 -0700286 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
Feng Xiao33c92802015-05-11 13:47:41 -0700287 "google.protobuf.Any.type_url");
288 target =
289 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
290 1, this->type_url(), target);
291 }
292
293 // optional bytes value = 2;
294 if (this->value().size() > 0) {
295 target =
296 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
297 2, this->value(), target);
298 }
299
300 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any)
301 return target;
302}
303
304int Any::ByteSize() const {
305 int total_size = 0;
306
307 // optional string type_url = 1;
308 if (this->type_url().size() > 0) {
309 total_size += 1 +
310 ::google::protobuf::internal::WireFormatLite::StringSize(
311 this->type_url());
312 }
313
314 // optional bytes value = 2;
315 if (this->value().size() > 0) {
316 total_size += 1 +
317 ::google::protobuf::internal::WireFormatLite::BytesSize(
318 this->value());
319 }
320
321 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
322 _cached_size_ = total_size;
323 GOOGLE_SAFE_CONCURRENT_WRITES_END();
324 return total_size;
325}
326
327void Any::MergeFrom(const ::google::protobuf::Message& from) {
328 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
Bo Yang5db21732015-05-21 14:28:59 -0700329 const Any* source =
330 ::google::protobuf::internal::DynamicCastToGenerated<const Any>(
331 &from);
Feng Xiao33c92802015-05-11 13:47:41 -0700332 if (source == NULL) {
333 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
334 } else {
335 MergeFrom(*source);
336 }
337}
338
339void Any::MergeFrom(const Any& from) {
340 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
341 if (from.type_url().size() > 0) {
342
343 type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_);
344 }
345 if (from.value().size() > 0) {
346
347 value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
348 }
349}
350
351void Any::CopyFrom(const ::google::protobuf::Message& from) {
352 if (&from == this) return;
353 Clear();
354 MergeFrom(from);
355}
356
357void Any::CopyFrom(const Any& from) {
358 if (&from == this) return;
359 Clear();
360 MergeFrom(from);
361}
362
363bool Any::IsInitialized() const {
364
365 return true;
366}
367
368void Any::Swap(Any* other) {
369 if (other == this) return;
370 InternalSwap(other);
371}
372void Any::InternalSwap(Any* other) {
373 type_url_.Swap(&other->type_url_);
374 value_.Swap(&other->value_);
375 _internal_metadata_.Swap(&other->_internal_metadata_);
376 std::swap(_cached_size_, other->_cached_size_);
377}
378
379::google::protobuf::Metadata Any::GetMetadata() const {
380 protobuf_AssignDescriptorsOnce();
381 ::google::protobuf::Metadata metadata;
382 metadata.descriptor = Any_descriptor_;
383 metadata.reflection = Any_reflection_;
384 return metadata;
385}
386
387#if PROTOBUF_INLINE_NOT_IN_HEADERS
388// Any
389
390// optional string type_url = 1;
Bo Yang5db21732015-05-21 14:28:59 -0700391void Any::clear_type_url() {
Feng Xiao33c92802015-05-11 13:47:41 -0700392 type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
393}
394 const ::std::string& Any::type_url() const {
395 // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url)
396 return type_url_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
397}
398 void Any::set_type_url(const ::std::string& value) {
399
400 type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
401 // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url)
402}
403 void Any::set_type_url(const char* value) {
404
405 type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
406 // @@protoc_insertion_point(field_set_char:google.protobuf.Any.type_url)
407}
408 void Any::set_type_url(const char* value, size_t size) {
409
410 type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
411 ::std::string(reinterpret_cast<const char*>(value), size));
412 // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.type_url)
413}
414 ::std::string* Any::mutable_type_url() {
415
416 // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url)
417 return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
418}
419 ::std::string* Any::release_type_url() {
420
421 return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
422}
423 void Any::set_allocated_type_url(::std::string* type_url) {
424 if (type_url != NULL) {
425
426 } else {
427
428 }
429 type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url);
430 // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url)
431}
432
433// optional bytes value = 2;
Bo Yang5db21732015-05-21 14:28:59 -0700434void Any::clear_value() {
Feng Xiao33c92802015-05-11 13:47:41 -0700435 value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
436}
437 const ::std::string& Any::value() const {
438 // @@protoc_insertion_point(field_get:google.protobuf.Any.value)
439 return value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
440}
441 void Any::set_value(const ::std::string& value) {
442
443 value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
444 // @@protoc_insertion_point(field_set:google.protobuf.Any.value)
445}
446 void Any::set_value(const char* value) {
447
448 value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
449 // @@protoc_insertion_point(field_set_char:google.protobuf.Any.value)
450}
451 void Any::set_value(const void* value, size_t size) {
452
453 value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
454 ::std::string(reinterpret_cast<const char*>(value), size));
455 // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.value)
456}
457 ::std::string* Any::mutable_value() {
458
459 // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value)
460 return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
461}
462 ::std::string* Any::release_value() {
463
464 return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
465}
466 void Any::set_allocated_value(::std::string* value) {
467 if (value != NULL) {
468
469 } else {
470
471 }
472 value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
473 // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value)
474}
475
476#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
477
478// @@protoc_insertion_point(namespace_scope)
479
480} // namespace protobuf
481} // namespace google
482
483// @@protoc_insertion_point(global_scope)