• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: google/protobuf/any.proto
3 
4 #include <google/protobuf/any.pb.h>
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 PROTOBUF_NAMESPACE_OPEN
18 class AnyDefaultTypeInternal {
19  public:
20   ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Any> _instance;
21 } _Any_default_instance_;
22 PROTOBUF_NAMESPACE_CLOSE
InitDefaultsscc_info_Any_google_2fprotobuf_2fany_2eproto()23 static void InitDefaultsscc_info_Any_google_2fprotobuf_2fany_2eproto() {
24   GOOGLE_PROTOBUF_VERIFY_VERSION;
25 
26   {
27     void* ptr = &PROTOBUF_NAMESPACE_ID::_Any_default_instance_;
28     new (ptr) PROTOBUF_NAMESPACE_ID::Any();
29     ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
30   }
31   PROTOBUF_NAMESPACE_ID::Any::InitAsDefaultInstance();
32 }
33 
34 PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Any_google_2fprotobuf_2fany_2eproto =
35     {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Any_google_2fprotobuf_2fany_2eproto}, {}};
36 
37 static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fprotobuf_2fany_2eproto[1];
38 static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
39 static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
40 
41 const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2fprotobuf_2fany_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
42   ~0u,  // no _has_bits_
43   PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Any, _internal_metadata_),
44   ~0u,  // no _extensions_
45   ~0u,  // no _oneof_case_
46   ~0u,  // no _weak_field_map_
47   PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Any, type_url_),
48   PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Any, value_),
49 };
50 static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
51   { 0, -1, sizeof(PROTOBUF_NAMESPACE_ID::Any)},
52 };
53 
54 static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
55   reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&PROTOBUF_NAMESPACE_ID::_Any_default_instance_),
56 };
57 
58 const char descriptor_table_protodef_google_2fprotobuf_2fany_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
59   "\n\031google/protobuf/any.proto\022\017google.prot"
60   "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002"
61   " \001(\014Bo\n\023com.google.protobufB\010AnyProtoP\001Z"
62   "%github.com/golang/protobuf/ptypes/any\242\002"
63   "\003GPB\252\002\036Google.Protobuf.WellKnownTypesb\006p"
64   "roto3"
65   ;
66 static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2fprotobuf_2fany_2eproto_deps[1] = {
67 };
68 static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_google_2fprotobuf_2fany_2eproto_sccs[1] = {
69   &scc_info_Any_google_2fprotobuf_2fany_2eproto.base,
70 };
71 static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fany_2eproto_once;
72 const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto = {
73   false, false, descriptor_table_protodef_google_2fprotobuf_2fany_2eproto, "google/protobuf/any.proto", 205,
74   &descriptor_table_google_2fprotobuf_2fany_2eproto_once, descriptor_table_google_2fprotobuf_2fany_2eproto_sccs, descriptor_table_google_2fprotobuf_2fany_2eproto_deps, 1, 0,
75   schemas, file_default_instances, TableStruct_google_2fprotobuf_2fany_2eproto::offsets,
76   file_level_metadata_google_2fprotobuf_2fany_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto, file_level_service_descriptors_google_2fprotobuf_2fany_2eproto,
77 };
78 
79 // Force running AddDescriptors() at dynamic initialization time.
80 static bool dynamic_init_dummy_google_2fprotobuf_2fany_2eproto = (static_cast<void>(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_google_2fprotobuf_2fany_2eproto)), true);
81 PROTOBUF_NAMESPACE_OPEN
82 
83 // ===================================================================
84 
InitAsDefaultInstance()85 void Any::InitAsDefaultInstance() {
86 }
GetAnyFieldDescriptors(const::PROTOBUF_NAMESPACE_ID::Message & message,const::PROTOBUF_NAMESPACE_ID::FieldDescriptor ** type_url_field,const::PROTOBUF_NAMESPACE_ID::FieldDescriptor ** value_field)87 bool Any::GetAnyFieldDescriptors(
88     const ::PROTOBUF_NAMESPACE_ID::Message& message,
89     const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** type_url_field,
90     const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** value_field) {
91   return ::PROTOBUF_NAMESPACE_ID::internal::GetAnyFieldDescriptors(
92       message, type_url_field, value_field);
93 }
ParseAnyTypeUrl(const string & type_url,std::string * full_type_name)94 bool Any::ParseAnyTypeUrl(const string& type_url,
95                                   std::string* full_type_name) {
96   return ::PROTOBUF_NAMESPACE_ID::internal::ParseAnyTypeUrl(type_url,
97                                              full_type_name);
98 }
99 
100 class Any::_Internal {
101  public:
102 };
103 
Any(::PROTOBUF_NAMESPACE_ID::Arena * arena)104 Any::Any(::PROTOBUF_NAMESPACE_ID::Arena* arena)
105   : ::PROTOBUF_NAMESPACE_ID::Message(arena),
106   _any_metadata_(&type_url_, &value_) {
107   SharedCtor();
108   RegisterArenaDtor(arena);
109   // @@protoc_insertion_point(arena_constructor:google.protobuf.Any)
110 }
Any(const Any & from)111 Any::Any(const Any& from)
112   : ::PROTOBUF_NAMESPACE_ID::Message(),
113       _any_metadata_(&type_url_, &value_) {
114   _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
115   type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
116   if (!from._internal_type_url().empty()) {
117     type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_type_url(),
118       GetArena());
119   }
120   value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
121   if (!from._internal_value().empty()) {
122     value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_value(),
123       GetArena());
124   }
125   // @@protoc_insertion_point(copy_constructor:google.protobuf.Any)
126 }
127 
SharedCtor()128 void Any::SharedCtor() {
129   ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Any_google_2fprotobuf_2fany_2eproto.base);
130   type_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
131   value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
132 }
133 
~Any()134 Any::~Any() {
135   // @@protoc_insertion_point(destructor:google.protobuf.Any)
136   SharedDtor();
137   _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
138 }
139 
SharedDtor()140 void Any::SharedDtor() {
141   GOOGLE_DCHECK(GetArena() == nullptr);
142   type_url_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
143   value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
144 }
145 
ArenaDtor(void * object)146 void Any::ArenaDtor(void* object) {
147   Any* _this = reinterpret_cast< Any* >(object);
148   (void)_this;
149 }
RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena *)150 void Any::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
151 }
SetCachedSize(int size) const152 void Any::SetCachedSize(int size) const {
153   _cached_size_.Set(size);
154 }
default_instance()155 const Any& Any::default_instance() {
156   ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Any_google_2fprotobuf_2fany_2eproto.base);
157   return *internal_default_instance();
158 }
159 
160 
Clear()161 void Any::Clear() {
162 // @@protoc_insertion_point(message_clear_start:google.protobuf.Any)
163   ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
164   // Prevent compiler warnings about cached_has_bits being unused
165   (void) cached_has_bits;
166 
167   type_url_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
168   value_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
169   _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
170 }
171 
_InternalParse(const char * ptr,::PROTOBUF_NAMESPACE_ID::internal::ParseContext * ctx)172 const char* Any::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
173 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
174   ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
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       // string type_url = 1;
181       case 1:
182         if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
183           auto str = _internal_mutable_type_url();
184           ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
185           CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.protobuf.Any.type_url"));
186           CHK_(ptr);
187         } else goto handle_unusual;
188         continue;
189       // bytes value = 2;
190       case 2:
191         if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
192           auto str = _internal_mutable_value();
193           ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
194           CHK_(ptr);
195         } else goto handle_unusual;
196         continue;
197       default: {
198       handle_unusual:
199         if ((tag & 7) == 4 || tag == 0) {
200           ctx->SetLastTag(tag);
201           goto success;
202         }
203         ptr = UnknownFieldParse(tag,
204             _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
205             ptr, ctx);
206         CHK_(ptr != nullptr);
207         continue;
208       }
209     }  // switch
210   }  // while
211 success:
212   return ptr;
213 failure:
214   ptr = nullptr;
215   goto success;
216 #undef CHK_
217 }
218 
_InternalSerialize(::PROTOBUF_NAMESPACE_ID::uint8 * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const219 ::PROTOBUF_NAMESPACE_ID::uint8* Any::_InternalSerialize(
220     ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
221   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any)
222   ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
223   (void) cached_has_bits;
224 
225   // string type_url = 1;
226   if (this->type_url().size() > 0) {
227     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
228       this->_internal_type_url().data(), static_cast<int>(this->_internal_type_url().length()),
229       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
230       "google.protobuf.Any.type_url");
231     target = stream->WriteStringMaybeAliased(
232         1, this->_internal_type_url(), target);
233   }
234 
235   // bytes value = 2;
236   if (this->value().size() > 0) {
237     target = stream->WriteBytesMaybeAliased(
238         2, this->_internal_value(), target);
239   }
240 
241   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
242     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
243         _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
244   }
245   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any)
246   return target;
247 }
248 
ByteSizeLong() const249 size_t Any::ByteSizeLong() const {
250 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Any)
251   size_t total_size = 0;
252 
253   ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
254   // Prevent compiler warnings about cached_has_bits being unused
255   (void) cached_has_bits;
256 
257   // string type_url = 1;
258   if (this->type_url().size() > 0) {
259     total_size += 1 +
260       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
261         this->_internal_type_url());
262   }
263 
264   // bytes value = 2;
265   if (this->value().size() > 0) {
266     total_size += 1 +
267       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
268         this->_internal_value());
269   }
270 
271   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
272     return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
273         _internal_metadata_, total_size, &_cached_size_);
274   }
275   int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
276   SetCachedSize(cached_size);
277   return total_size;
278 }
279 
MergeFrom(const::PROTOBUF_NAMESPACE_ID::Message & from)280 void Any::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
281 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Any)
282   GOOGLE_DCHECK_NE(&from, this);
283   const Any* source =
284       ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Any>(
285           &from);
286   if (source == nullptr) {
287   // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Any)
288     ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
289   } else {
290   // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Any)
291     MergeFrom(*source);
292   }
293 }
294 
MergeFrom(const Any & from)295 void Any::MergeFrom(const Any& from) {
296 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Any)
297   GOOGLE_DCHECK_NE(&from, this);
298   _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
299   ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
300   (void) cached_has_bits;
301 
302   if (from.type_url().size() > 0) {
303     _internal_set_type_url(from._internal_type_url());
304   }
305   if (from.value().size() > 0) {
306     _internal_set_value(from._internal_value());
307   }
308 }
309 
CopyFrom(const::PROTOBUF_NAMESPACE_ID::Message & from)310 void Any::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
311 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Any)
312   if (&from == this) return;
313   Clear();
314   MergeFrom(from);
315 }
316 
CopyFrom(const Any & from)317 void Any::CopyFrom(const Any& from) {
318 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Any)
319   if (&from == this) return;
320   Clear();
321   MergeFrom(from);
322 }
323 
IsInitialized() const324 bool Any::IsInitialized() const {
325   return true;
326 }
327 
InternalSwap(Any * other)328 void Any::InternalSwap(Any* other) {
329   using std::swap;
330   _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
331   type_url_.Swap(&other->type_url_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
332   value_.Swap(&other->value_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
333 }
334 
GetMetadata() const335 ::PROTOBUF_NAMESPACE_ID::Metadata Any::GetMetadata() const {
336   return GetMetadataStatic();
337 }
338 
339 
340 // @@protoc_insertion_point(namespace_scope)
341 PROTOBUF_NAMESPACE_CLOSE
342 PROTOBUF_NAMESPACE_OPEN
CreateMaybeMessage(Arena * arena)343 template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Any >(Arena* arena) {
344   return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::Any >(arena);
345 }
346 PROTOBUF_NAMESPACE_CLOSE
347 
348 // @@protoc_insertion_point(global_scope)
349 #include <google/protobuf/port_undef.inc>
350