• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: google/protobuf/any.proto
3 
4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
5 #include <google/protobuf/any.pb.h>
6 
7 #include <algorithm>
8 
9 #include <google/protobuf/stubs/common.h>
10 #include <google/protobuf/stubs/port.h>
11 #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 
20 namespace google {
21 namespace protobuf {
22 
23 namespace {
24 
25 const ::google::protobuf::Descriptor* Any_descriptor_ = NULL;
26 const ::google::protobuf::internal::GeneratedMessageReflection*
27   Any_reflection_ = NULL;
28 
29 }  // namespace
30 
31 
32 void protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto() GOOGLE_ATTRIBUTE_COLD;
protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto()33 void protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto() {
34   protobuf_AddDesc_google_2fprotobuf_2fany_2eproto();
35   const ::google::protobuf::FileDescriptor* file =
36     ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
37       "google/protobuf/any.proto");
38   GOOGLE_CHECK(file != NULL);
39   Any_descriptor_ = file->message_type(0);
40   static const int Any_offsets_[2] = {
41     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, type_url_),
42     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, value_),
43   };
44   Any_reflection_ =
45     ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
46       Any_descriptor_,
47       Any::default_instance_,
48       Any_offsets_,
49       -1,
50       -1,
51       -1,
52       sizeof(Any),
53       GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _internal_metadata_),
54       GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _is_default_instance_));
55 }
56 
57 namespace {
58 
59 GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
protobuf_AssignDescriptorsOnce()60 inline void protobuf_AssignDescriptorsOnce() {
61   ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
62                  &protobuf_AssignDesc_google_2fprotobuf_2fany_2eproto);
63 }
64 
65 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
protobuf_RegisterTypes(const::std::string &)66 void protobuf_RegisterTypes(const ::std::string&) {
67   protobuf_AssignDescriptorsOnce();
68   ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
69       Any_descriptor_, &Any::default_instance());
70 }
71 
72 }  // namespace
73 
protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto()74 void protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto() {
75   delete Any::default_instance_;
76   delete Any_reflection_;
77 }
78 
79 void protobuf_AddDesc_google_2fprotobuf_2fany_2eproto() GOOGLE_ATTRIBUTE_COLD;
protobuf_AddDesc_google_2fprotobuf_2fany_2eproto()80 void protobuf_AddDesc_google_2fprotobuf_2fany_2eproto() {
81   static bool already_here = false;
82   if (already_here) return;
83   already_here = true;
84   GOOGLE_PROTOBUF_VERIFY_VERSION;
85 
86   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
87     "\n\031google/protobuf/any.proto\022\017google.prot"
88     "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002"
89     " \001(\014Br\n\023com.google.protobufB\010AnyProtoP\001Z"
90     "%github.com/golang/protobuf/ptypes/any\240\001"
91     "\001\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTypes"
92     "b\006proto3", 208);
93   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
94     "google/protobuf/any.proto", &protobuf_RegisterTypes);
95   Any::default_instance_ = new Any();
96   Any::default_instance_->InitAsDefaultInstance();
97   ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fany_2eproto);
98 }
99 
100 // Force AddDescriptors() to be called at static initialization time.
101 struct StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto {
StaticDescriptorInitializer_google_2fprotobuf_2fany_2eprotogoogle::protobuf::StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto102   StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto() {
103     protobuf_AddDesc_google_2fprotobuf_2fany_2eproto();
104   }
105 } static_descriptor_initializer_google_2fprotobuf_2fany_2eproto_;
106 
107 // ===================================================================
108 
PackFrom(const::google::protobuf::Message & message)109 void Any::PackFrom(const ::google::protobuf::Message& message) {
110   _any_metadata_.PackFrom(message);
111 }
112 
PackFrom(const::google::protobuf::Message & message,const::std::string & type_url_prefix)113 void Any::PackFrom(const ::google::protobuf::Message& message,
114                            const ::std::string& type_url_prefix) {
115   _any_metadata_.PackFrom(message, type_url_prefix);
116 }
117 
UnpackTo(::google::protobuf::Message * message) const118 bool Any::UnpackTo(::google::protobuf::Message* message) const {
119   return _any_metadata_.UnpackTo(message);
120 }
121 
122 #if !defined(_MSC_VER) || _MSC_VER >= 1900
123 const int Any::kTypeUrlFieldNumber;
124 const int Any::kValueFieldNumber;
125 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
126 
Any()127 Any::Any()
128   : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&type_url_, &value_) {
129   SharedCtor();
130   // @@protoc_insertion_point(constructor:google.protobuf.Any)
131 }
132 
InitAsDefaultInstance()133 void Any::InitAsDefaultInstance() {
134   _is_default_instance_ = true;
135 }
136 
Any(const Any & from)137 Any::Any(const Any& from)
138   : ::google::protobuf::Message(),
139     _internal_metadata_(NULL),
140     _any_metadata_(&type_url_, &value_) {
141   SharedCtor();
142   MergeFrom(from);
143   // @@protoc_insertion_point(copy_constructor:google.protobuf.Any)
144 }
145 
SharedCtor()146 void Any::SharedCtor() {
147     _is_default_instance_ = false;
148   ::google::protobuf::internal::GetEmptyString();
149   _cached_size_ = 0;
150   type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
151   value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
152 }
153 
~Any()154 Any::~Any() {
155   // @@protoc_insertion_point(destructor:google.protobuf.Any)
156   SharedDtor();
157 }
158 
SharedDtor()159 void Any::SharedDtor() {
160   type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
161   value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
162   if (this != default_instance_) {
163   }
164 }
165 
SetCachedSize(int size) const166 void Any::SetCachedSize(int size) const {
167   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
168   _cached_size_ = size;
169   GOOGLE_SAFE_CONCURRENT_WRITES_END();
170 }
descriptor()171 const ::google::protobuf::Descriptor* Any::descriptor() {
172   protobuf_AssignDescriptorsOnce();
173   return Any_descriptor_;
174 }
175 
default_instance()176 const Any& Any::default_instance() {
177   if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fany_2eproto();
178   return *default_instance_;
179 }
180 
181 Any* Any::default_instance_ = NULL;
182 
New(::google::protobuf::Arena * arena) const183 Any* Any::New(::google::protobuf::Arena* arena) const {
184   Any* n = new Any;
185   if (arena != NULL) {
186     arena->Own(n);
187   }
188   return n;
189 }
190 
Clear()191 void Any::Clear() {
192 // @@protoc_insertion_point(message_clear_start:google.protobuf.Any)
193   type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
194   value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
195 }
196 
MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream * input)197 bool Any::MergePartialFromCodedStream(
198     ::google::protobuf::io::CodedInputStream* input) {
199 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(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()));
212           DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
213             this->type_url().data(), this->type_url().length(),
214             ::google::protobuf::internal::WireFormatLite::PARSE,
215             "google.protobuf.Any.type_url"));
216         } 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   }
248 success:
249   // @@protoc_insertion_point(parse_success:google.protobuf.Any)
250   return true;
251 failure:
252   // @@protoc_insertion_point(parse_failure:google.protobuf.Any)
253   return false;
254 #undef DO_
255 }
256 
SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream * output) const257 void 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) {
262     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
263       this->type_url().data(), this->type_url().length(),
264       ::google::protobuf::internal::WireFormatLite::SERIALIZE,
265       "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 
InternalSerializeWithCachedSizesToArray(bool deterministic,::google::protobuf::uint8 * target) const279 ::google::protobuf::uint8* Any::InternalSerializeWithCachedSizesToArray(
280     bool deterministic, ::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) {
284     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
285       this->type_url().data(), this->type_url().length(),
286       ::google::protobuf::internal::WireFormatLite::SERIALIZE,
287       "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 
ByteSize() const304 int Any::ByteSize() const {
305 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Any)
306   int total_size = 0;
307 
308   // optional string type_url = 1;
309   if (this->type_url().size() > 0) {
310     total_size += 1 +
311       ::google::protobuf::internal::WireFormatLite::StringSize(
312         this->type_url());
313   }
314 
315   // optional bytes value = 2;
316   if (this->value().size() > 0) {
317     total_size += 1 +
318       ::google::protobuf::internal::WireFormatLite::BytesSize(
319         this->value());
320   }
321 
322   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
323   _cached_size_ = total_size;
324   GOOGLE_SAFE_CONCURRENT_WRITES_END();
325   return total_size;
326 }
327 
MergeFrom(const::google::protobuf::Message & from)328 void Any::MergeFrom(const ::google::protobuf::Message& from) {
329 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Any)
330   if (GOOGLE_PREDICT_FALSE(&from == this)) {
331     ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
332   }
333   const Any* source =
334       ::google::protobuf::internal::DynamicCastToGenerated<const Any>(
335           &from);
336   if (source == NULL) {
337   // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Any)
338     ::google::protobuf::internal::ReflectionOps::Merge(from, this);
339   } else {
340   // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Any)
341     MergeFrom(*source);
342   }
343 }
344 
MergeFrom(const Any & from)345 void Any::MergeFrom(const Any& from) {
346 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Any)
347   if (GOOGLE_PREDICT_FALSE(&from == this)) {
348     ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
349   }
350   if (from.type_url().size() > 0) {
351 
352     type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_);
353   }
354   if (from.value().size() > 0) {
355 
356     value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
357   }
358 }
359 
CopyFrom(const::google::protobuf::Message & from)360 void Any::CopyFrom(const ::google::protobuf::Message& from) {
361 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Any)
362   if (&from == this) return;
363   Clear();
364   MergeFrom(from);
365 }
366 
CopyFrom(const Any & from)367 void Any::CopyFrom(const Any& from) {
368 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Any)
369   if (&from == this) return;
370   Clear();
371   MergeFrom(from);
372 }
373 
IsInitialized() const374 bool Any::IsInitialized() const {
375 
376   return true;
377 }
378 
Swap(Any * other)379 void Any::Swap(Any* other) {
380   if (other == this) return;
381   InternalSwap(other);
382 }
InternalSwap(Any * other)383 void Any::InternalSwap(Any* other) {
384   type_url_.Swap(&other->type_url_);
385   value_.Swap(&other->value_);
386   _internal_metadata_.Swap(&other->_internal_metadata_);
387   std::swap(_cached_size_, other->_cached_size_);
388 }
389 
GetMetadata() const390 ::google::protobuf::Metadata Any::GetMetadata() const {
391   protobuf_AssignDescriptorsOnce();
392   ::google::protobuf::Metadata metadata;
393   metadata.descriptor = Any_descriptor_;
394   metadata.reflection = Any_reflection_;
395   return metadata;
396 }
397 
398 #if PROTOBUF_INLINE_NOT_IN_HEADERS
399 // Any
400 
401 // optional string type_url = 1;
clear_type_url()402 void Any::clear_type_url() {
403   type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
404 }
type_url() const405  const ::std::string& Any::type_url() const {
406   // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url)
407   return type_url_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
408 }
set_type_url(const::std::string & value)409  void Any::set_type_url(const ::std::string& value) {
410 
411   type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
412   // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url)
413 }
set_type_url(const char * value)414  void Any::set_type_url(const char* value) {
415 
416   type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
417   // @@protoc_insertion_point(field_set_char:google.protobuf.Any.type_url)
418 }
set_type_url(const char * value,size_t size)419  void Any::set_type_url(const char* value, size_t size) {
420 
421   type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
422       ::std::string(reinterpret_cast<const char*>(value), size));
423   // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.type_url)
424 }
mutable_type_url()425  ::std::string* Any::mutable_type_url() {
426 
427   // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url)
428   return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
429 }
release_type_url()430  ::std::string* Any::release_type_url() {
431   // @@protoc_insertion_point(field_release:google.protobuf.Any.type_url)
432 
433   return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
434 }
set_allocated_type_url(::std::string * type_url)435  void Any::set_allocated_type_url(::std::string* type_url) {
436   if (type_url != NULL) {
437 
438   } else {
439 
440   }
441   type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url);
442   // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url)
443 }
444 
445 // optional bytes value = 2;
clear_value()446 void Any::clear_value() {
447   value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
448 }
value() const449  const ::std::string& Any::value() const {
450   // @@protoc_insertion_point(field_get:google.protobuf.Any.value)
451   return value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
452 }
set_value(const::std::string & value)453  void Any::set_value(const ::std::string& value) {
454 
455   value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
456   // @@protoc_insertion_point(field_set:google.protobuf.Any.value)
457 }
set_value(const char * value)458  void Any::set_value(const char* value) {
459 
460   value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
461   // @@protoc_insertion_point(field_set_char:google.protobuf.Any.value)
462 }
set_value(const void * value,size_t size)463  void Any::set_value(const void* value, size_t size) {
464 
465   value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
466       ::std::string(reinterpret_cast<const char*>(value), size));
467   // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.value)
468 }
mutable_value()469  ::std::string* Any::mutable_value() {
470 
471   // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value)
472   return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
473 }
release_value()474  ::std::string* Any::release_value() {
475   // @@protoc_insertion_point(field_release:google.protobuf.Any.value)
476 
477   return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
478 }
set_allocated_value(::std::string * value)479  void Any::set_allocated_value(::std::string* value) {
480   if (value != NULL) {
481 
482   } else {
483 
484   }
485   value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
486   // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value)
487 }
488 
489 #endif  // PROTOBUF_INLINE_NOT_IN_HEADERS
490 
491 // @@protoc_insertion_point(namespace_scope)
492 
493 }  // namespace protobuf
494 }  // namespace google
495 
496 // @@protoc_insertion_point(global_scope)
497