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