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
18 PROTOBUF_PRAGMA_INIT_SEG
19
20 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
21 namespace _pbi = _pb::internal;
22
23 #if defined(__llvm__)
24 #pragma clang diagnostic push
25 #pragma clang diagnostic ignored "-Wuninitialized"
26 #endif // __llvm__
27 PROTOBUF_NAMESPACE_OPEN
Any(::_pbi::ConstantInitialized)28 PROTOBUF_CONSTEXPR Any::Any(
29 ::_pbi::ConstantInitialized)
30 : type_url_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
31 , value_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
32 , _any_metadata_(&type_url_, &value_){}
33 struct AnyDefaultTypeInternal {
AnyDefaultTypeInternalAnyDefaultTypeInternal34 PROTOBUF_CONSTEXPR AnyDefaultTypeInternal()
35 : _instance(::_pbi::ConstantInitialized{}) {}
~AnyDefaultTypeInternalAnyDefaultTypeInternal36 ~AnyDefaultTypeInternal() {}
37 union {
38 Any _instance;
39 };
40 };
41 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AnyDefaultTypeInternal _Any_default_instance_;
42 PROTOBUF_NAMESPACE_CLOSE
43 static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fany_2eproto[1];
44 static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
45 static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
46
47 const uint32_t TableStruct_google_2fprotobuf_2fany_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
48 ~0u, // no _has_bits_
49 PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _internal_metadata_),
50 ~0u, // no _extensions_
51 ~0u, // no _oneof_case_
52 ~0u, // no _weak_field_map_
53 ~0u, // no _inlined_string_donated_
54 PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, type_url_),
55 PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, value_),
56 };
57 static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
58 { 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Any)},
59 };
60
61 static const ::_pb::Message* const file_default_instances[] = {
62 &::PROTOBUF_NAMESPACE_ID::_Any_default_instance_._instance,
63 };
64
65 const char descriptor_table_protodef_google_2fprotobuf_2fany_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
66 "\n\031google/protobuf/any.proto\022\017google.prot"
67 "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002"
68 " \001(\014Bv\n\023com.google.protobufB\010AnyProtoP\001Z"
69 ",google.golang.org/protobuf/types/known/"
70 "anypb\242\002\003GPB\252\002\036Google.Protobuf.WellKnownT"
71 "ypesb\006proto3"
72 ;
73 static ::_pbi::once_flag descriptor_table_google_2fprotobuf_2fany_2eproto_once;
74 const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto = {
75 false, false, 212, descriptor_table_protodef_google_2fprotobuf_2fany_2eproto,
76 "google/protobuf/any.proto",
77 &descriptor_table_google_2fprotobuf_2fany_2eproto_once, nullptr, 0, 1,
78 schemas, file_default_instances, TableStruct_google_2fprotobuf_2fany_2eproto::offsets,
79 file_level_metadata_google_2fprotobuf_2fany_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto,
80 file_level_service_descriptors_google_2fprotobuf_2fany_2eproto,
81 };
descriptor_table_google_2fprotobuf_2fany_2eproto_getter()82 PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fany_2eproto_getter() {
83 return &descriptor_table_google_2fprotobuf_2fany_2eproto;
84 }
85
86 // Force running AddDescriptors() at dynamic initialization time.
87 PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fany_2eproto(&descriptor_table_google_2fprotobuf_2fany_2eproto);
88 PROTOBUF_NAMESPACE_OPEN
89
90 // ===================================================================
91
GetAnyFieldDescriptors(const::PROTOBUF_NAMESPACE_ID::Message & message,const::PROTOBUF_NAMESPACE_ID::FieldDescriptor ** type_url_field,const::PROTOBUF_NAMESPACE_ID::FieldDescriptor ** value_field)92 bool Any::GetAnyFieldDescriptors(
93 const ::PROTOBUF_NAMESPACE_ID::Message& message,
94 const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** type_url_field,
95 const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** value_field) {
96 return ::_pbi::GetAnyFieldDescriptors(
97 message, type_url_field, value_field);
98 }
ParseAnyTypeUrl(::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url,std::string * full_type_name)99 bool Any::ParseAnyTypeUrl(
100 ::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url,
101 std::string* full_type_name) {
102 return ::_pbi::ParseAnyTypeUrl(type_url, full_type_name);
103 }
104
105 class Any::_Internal {
106 public:
107 };
108
Any(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)109 Any::Any(::PROTOBUF_NAMESPACE_ID::Arena* arena,
110 bool is_message_owned)
111 : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
112 _any_metadata_(&type_url_, &value_) {
113 SharedCtor();
114 // @@protoc_insertion_point(arena_constructor:google.protobuf.Any)
115 }
Any(const Any & from)116 Any::Any(const Any& from)
117 : ::PROTOBUF_NAMESPACE_ID::Message(),
118 _any_metadata_(&type_url_, &value_) {
119 _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
120 type_url_.InitDefault();
121 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
122 type_url_.Set("", GetArenaForAllocation());
123 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
124 if (!from._internal_type_url().empty()) {
125 type_url_.Set(from._internal_type_url(),
126 GetArenaForAllocation());
127 }
128 value_.InitDefault();
129 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
130 value_.Set("", GetArenaForAllocation());
131 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
132 if (!from._internal_value().empty()) {
133 value_.Set(from._internal_value(),
134 GetArenaForAllocation());
135 }
136 // @@protoc_insertion_point(copy_constructor:google.protobuf.Any)
137 }
138
SharedCtor()139 inline void Any::SharedCtor() {
140 type_url_.InitDefault();
141 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
142 type_url_.Set("", GetArenaForAllocation());
143 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
144 value_.InitDefault();
145 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
146 value_.Set("", GetArenaForAllocation());
147 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
148 }
149
~Any()150 Any::~Any() {
151 // @@protoc_insertion_point(destructor:google.protobuf.Any)
152 if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
153 (void)arena;
154 return;
155 }
156 SharedDtor();
157 }
158
SharedDtor()159 inline void Any::SharedDtor() {
160 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
161 type_url_.Destroy();
162 value_.Destroy();
163 }
164
SetCachedSize(int size) const165 void Any::SetCachedSize(int size) const {
166 _cached_size_.Set(size);
167 }
168
Clear()169 void Any::Clear() {
170 // @@protoc_insertion_point(message_clear_start:google.protobuf.Any)
171 uint32_t cached_has_bits = 0;
172 // Prevent compiler warnings about cached_has_bits being unused
173 (void) cached_has_bits;
174
175 type_url_.ClearToEmpty();
176 value_.ClearToEmpty();
177 _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
178 }
179
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)180 const char* Any::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
181 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
182 while (!ctx->Done(&ptr)) {
183 uint32_t tag;
184 ptr = ::_pbi::ReadTag(ptr, &tag);
185 switch (tag >> 3) {
186 // string type_url = 1;
187 case 1:
188 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
189 auto str = _internal_mutable_type_url();
190 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
191 CHK_(ptr);
192 CHK_(::_pbi::VerifyUTF8(str, "google.protobuf.Any.type_url"));
193 } else
194 goto handle_unusual;
195 continue;
196 // bytes value = 2;
197 case 2:
198 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
199 auto str = _internal_mutable_value();
200 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
201 CHK_(ptr);
202 } else
203 goto handle_unusual;
204 continue;
205 default:
206 goto handle_unusual;
207 } // switch
208 handle_unusual:
209 if ((tag == 0) || ((tag & 7) == 4)) {
210 CHK_(ptr);
211 ctx->SetLastTag(tag);
212 goto message_done;
213 }
214 ptr = UnknownFieldParse(
215 tag,
216 _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
217 ptr, ctx);
218 CHK_(ptr != nullptr);
219 } // while
220 message_done:
221 return ptr;
222 failure:
223 ptr = nullptr;
224 goto message_done;
225 #undef CHK_
226 }
227
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const228 uint8_t* Any::_InternalSerialize(
229 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
230 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any)
231 uint32_t cached_has_bits = 0;
232 (void) cached_has_bits;
233
234 // string type_url = 1;
235 if (!this->_internal_type_url().empty()) {
236 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
237 this->_internal_type_url().data(), static_cast<int>(this->_internal_type_url().length()),
238 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
239 "google.protobuf.Any.type_url");
240 target = stream->WriteStringMaybeAliased(
241 1, this->_internal_type_url(), target);
242 }
243
244 // bytes value = 2;
245 if (!this->_internal_value().empty()) {
246 target = stream->WriteBytesMaybeAliased(
247 2, this->_internal_value(), target);
248 }
249
250 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
251 target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
252 _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
253 }
254 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any)
255 return target;
256 }
257
ByteSizeLong() const258 size_t Any::ByteSizeLong() const {
259 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Any)
260 size_t total_size = 0;
261
262 uint32_t cached_has_bits = 0;
263 // Prevent compiler warnings about cached_has_bits being unused
264 (void) cached_has_bits;
265
266 // string type_url = 1;
267 if (!this->_internal_type_url().empty()) {
268 total_size += 1 +
269 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
270 this->_internal_type_url());
271 }
272
273 // bytes value = 2;
274 if (!this->_internal_value().empty()) {
275 total_size += 1 +
276 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
277 this->_internal_value());
278 }
279
280 return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
281 }
282
283 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Any::_class_data_ = {
284 ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
285 Any::MergeImpl
286 };
GetClassData() const287 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Any::GetClassData() const { return &_class_data_; }
288
MergeImpl(::PROTOBUF_NAMESPACE_ID::Message * to,const::PROTOBUF_NAMESPACE_ID::Message & from)289 void Any::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
290 const ::PROTOBUF_NAMESPACE_ID::Message& from) {
291 static_cast<Any *>(to)->MergeFrom(
292 static_cast<const Any &>(from));
293 }
294
295
MergeFrom(const Any & from)296 void Any::MergeFrom(const Any& from) {
297 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Any)
298 GOOGLE_DCHECK_NE(&from, this);
299 uint32_t cached_has_bits = 0;
300 (void) cached_has_bits;
301
302 if (!from._internal_type_url().empty()) {
303 _internal_set_type_url(from._internal_type_url());
304 }
305 if (!from._internal_value().empty()) {
306 _internal_set_value(from._internal_value());
307 }
308 _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
309 }
310
CopyFrom(const Any & from)311 void Any::CopyFrom(const Any& from) {
312 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Any)
313 if (&from == this) return;
314 Clear();
315 MergeFrom(from);
316 }
317
IsInitialized() const318 bool Any::IsInitialized() const {
319 return true;
320 }
321
InternalSwap(Any * other)322 void Any::InternalSwap(Any* other) {
323 using std::swap;
324 auto* lhs_arena = GetArenaForAllocation();
325 auto* rhs_arena = other->GetArenaForAllocation();
326 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
327 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
328 &type_url_, lhs_arena,
329 &other->type_url_, rhs_arena
330 );
331 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
332 &value_, lhs_arena,
333 &other->value_, rhs_arena
334 );
335 }
336
GetMetadata() const337 ::PROTOBUF_NAMESPACE_ID::Metadata Any::GetMetadata() const {
338 return ::_pbi::AssignDescriptors(
339 &descriptor_table_google_2fprotobuf_2fany_2eproto_getter, &descriptor_table_google_2fprotobuf_2fany_2eproto_once,
340 file_level_metadata_google_2fprotobuf_2fany_2eproto[0]);
341 }
342
343 // @@protoc_insertion_point(namespace_scope)
344 PROTOBUF_NAMESPACE_CLOSE
345 PROTOBUF_NAMESPACE_OPEN
346 template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::Any*
CreateMaybeMessage(Arena * arena)347 Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Any >(Arena* arena) {
348 return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Any >(arena);
349 }
350 PROTOBUF_NAMESPACE_CLOSE
351
352 // @@protoc_insertion_point(global_scope)
353 #if defined(__llvm__)
354 #pragma clang diagnostic pop
355 #endif // __llvm__
356 #include <google/protobuf/port_undef.inc>
357