4 #include <google/protobuf/struct.pb.h>
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>
16 #include <google/protobuf/port_def.inc>
18 PROTOBUF_PRAGMA_INIT_SEG
19 PROTOBUF_NAMESPACE_OPEN
21 ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){}
32 ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
44 ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
56 ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
67 PROTOBUF_NAMESPACE_CLOSE
73 PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse, _has_bits_),
74 PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse, _internal_metadata_),
79 PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse,
key_),
80 PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse,
value_),
112 { 0, 8, -1,
sizeof(::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse)},
126 "\n\034google/protobuf/struct.proto\022\017google.p"
127 "rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo"
128 "gle.protobuf.Struct.FieldsEntry\032E\n\013Field"
129 "sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo"
130 "gle.protobuf.Value:\0028\001\"\352\001\n\005Value\0220\n\nnull"
131 "_value\030\001 \001(\0162\032.google.protobuf.NullValue"
132 "H\000\022\026\n\014number_value\030\002 \001(\001H\000\022\026\n\014string_val"
133 "ue\030\003 \001(\tH\000\022\024\n\nbool_value\030\004 \001(\010H\000\022/\n\014stru"
134 "ct_value\030\005 \001(\0132\027.google.protobuf.StructH"
135 "\000\0220\n\nlist_value\030\006 \001(\0132\032.google.protobuf."
136 "ListValueH\000B\006\n\004kind\"3\n\tListValue\022&\n\006valu"
137 "es\030\001 \003(\0132\026.google.protobuf.Value*\033\n\tNull"
138 "Value\022\016\n\nNULL_VALUE\020\000B\177\n\023com.google.prot"
139 "obufB\013StructProtoP\001Z/google.golang.org/p"
140 "rotobuf/types/known/structpb\370\001\001\242\002\003GPB\252\002\036"
141 "Google.Protobuf.WellKnownTypesb\006proto3"
145 false,
false, 638, descriptor_table_protodef_google_2fprotobuf_2fstruct_2eproto,
"google/protobuf/struct.proto",
156 PROTOBUF_NAMESPACE_OPEN
175 : SuperType(
arena) {}
177 MergeFromInternal(other);
192 bool is_message_owned)
193 : ::PROTOBUF_NAMESPACE_ID::
Message(
arena, is_message_owned),
196 if (!is_message_owned) {
197 RegisterArenaDtor(
arena);
202 : ::PROTOBUF_NAMESPACE_ID::
Message() {
213 if (GetArenaForAllocation() !=
nullptr)
return;
228 if (
arena !=
nullptr) {
232 void Struct::SetCachedSize(
int size)
const {
233 _cached_size_.Set(
size);
240 (void) cached_has_bits;
247 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
248 while (!
ctx->Done(&
ptr)) {
254 if (PROTOBUF_PREDICT_TRUE(
static_cast<uint8_t>(
tag) == 10)) {
260 if (!
ctx->DataAvailable(
ptr))
break;
261 }
while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(
ptr));
269 if ((
tag == 0) || ((
tag & 7) == 4)) {
292 (void) cached_has_bits;
295 if (!this->_internal_fields().empty()) {
298 typedef ConstPtr SortItem;
299 typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
301 static void Check(ConstPtr
p) {
303 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
304 p->first.data(),
static_cast<int>(
p->first.length()),
305 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
306 "google.protobuf.Struct.FieldsEntry.key");
310 if (
stream->IsSerializationDeterministic() &&
311 this->_internal_fields().size() > 1) {
312 ::std::unique_ptr<SortItem[]>
items(
313 new SortItem[this->_internal_fields().
size()]);
314 typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >::size_type size_type;
316 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >::const_iterator
317 it = this->_internal_fields().
begin();
318 it != this->_internal_fields().end(); ++
it, ++
n) {
319 items[
static_cast<ptrdiff_t
>(
n)] = SortItem(&*
it);
321 ::std::sort(&
items[0], &
items[
static_cast<ptrdiff_t
>(
n)], Less());
322 for (size_type
i = 0;
i <
n;
i++) {
327 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >::const_iterator
328 it = this->_internal_fields().
begin();
329 it != this->_internal_fields().end(); ++
it) {
336 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
337 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
344 size_t Struct::ByteSizeLong()
const {
346 size_t total_size = 0;
350 (void) cached_has_bits;
355 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >::const_iterator
356 it = this->_internal_fields().
begin();
357 it != this->_internal_fields().end(); ++
it) {
358 total_size += Struct_FieldsEntry_DoNotUse::Funcs::ByteSizeLong(
it->first,
it->second);
361 return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
365 ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
381 (void) cached_has_bits;
389 if (&
from ==
this)
return;
400 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
401 fields_.InternalSwap(&other->fields_);
420 return *
msg->kind_.struct_value_;
424 return *
msg->kind_.list_value_;
431 ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::Struct>::GetOwningArena(struct_value);
432 if (message_arena != submessage_arena) {
434 message_arena, struct_value, submessage_arena);
446 ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::ListValue>::GetOwningArena(list_value);
447 if (message_arena != submessage_arena) {
449 message_arena, list_value, submessage_arena);
457 bool is_message_owned)
458 : ::PROTOBUF_NAMESPACE_ID::
Message(
arena, is_message_owned) {
460 if (!is_message_owned) {
461 RegisterArenaDtor(
arena);
466 : ::PROTOBUF_NAMESPACE_ID::
Message() {
469 switch (
from.kind_case()) {
507 if (GetArenaForAllocation() !=
nullptr)
return;
520 Value* _this =
reinterpret_cast< Value*
>(object);
526 _cached_size_.Set(
size);
531 switch (kind_case()) {
549 if (GetArenaForAllocation() ==
nullptr) {
550 delete kind_.struct_value_;
555 if (GetArenaForAllocation() ==
nullptr) {
556 delete kind_.list_value_;
564 _oneof_case_[0] = KIND_NOT_SET;
572 (void) cached_has_bits;
579 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
580 while (!
ctx->Done(&
ptr)) {
586 if (PROTOBUF_PREDICT_TRUE(
static_cast<uint8_t>(
tag) == 8)) {
595 if (PROTOBUF_PREDICT_TRUE(
static_cast<uint8_t>(
tag) == 17)) {
596 _internal_set_number_value(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(
ptr));
597 ptr +=
sizeof(double);
603 if (PROTOBUF_PREDICT_TRUE(
static_cast<uint8_t>(
tag) == 26)) {
604 auto str = _internal_mutable_string_value();
613 if (PROTOBUF_PREDICT_TRUE(
static_cast<uint8_t>(
tag) == 32)) {
621 if (PROTOBUF_PREDICT_TRUE(
static_cast<uint8_t>(
tag) == 42)) {
622 ptr =
ctx->ParseMessage(_internal_mutable_struct_value(),
ptr);
629 if (PROTOBUF_PREDICT_TRUE(
static_cast<uint8_t>(
tag) == 50)) {
630 ptr =
ctx->ParseMessage(_internal_mutable_list_value(),
ptr);
639 if ((
tag == 0) || ((
tag & 7) == 4)) {
662 (void) cached_has_bits;
665 if (_internal_has_null_value()) {
667 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
668 1, this->_internal_null_value(),
target);
672 if (_internal_has_number_value()) {
674 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(2, this->_internal_number_value(),
target);
678 if (_internal_has_string_value()) {
679 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
680 this->_internal_string_value().
data(),
static_cast<int>(this->_internal_string_value().
length()),
681 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
682 "google.protobuf.Value.string_value");
684 3, this->_internal_string_value(),
target);
688 if (_internal_has_bool_value()) {
690 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_bool_value(),
target);
694 if (_internal_has_struct_value()) {
696 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
697 InternalWriteMessage(
702 if (_internal_has_list_value()) {
704 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
705 InternalWriteMessage(
709 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
710 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
717 size_t Value::ByteSizeLong()
const {
719 size_t total_size = 0;
723 (void) cached_has_bits;
725 switch (kind_case()) {
729 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_null_value());
740 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
741 this->_internal_string_value());
752 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
753 *kind_.struct_value_);
759 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
767 return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
771 ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
787 (void) cached_has_bits;
789 switch (
from.kind_case()) {
791 _internal_set_null_value(
from._internal_null_value());
795 _internal_set_number_value(
from._internal_number_value());
799 _internal_set_string_value(
from._internal_string_value());
803 _internal_set_bool_value(
from._internal_bool_value());
807 _internal_mutable_struct_value()->::PROTOBUF_NAMESPACE_ID::Struct::MergeFrom(
from._internal_struct_value());
811 _internal_mutable_list_value()->::PROTOBUF_NAMESPACE_ID::ListValue::MergeFrom(
from._internal_list_value());
823 if (&
from ==
this)
return;
834 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
835 swap(kind_, other->kind_);
836 swap(_oneof_case_[0], other->_oneof_case_[0]);
852 bool is_message_owned)
853 : ::PROTOBUF_NAMESPACE_ID::
Message(
arena, is_message_owned),
856 if (!is_message_owned) {
862 : ::PROTOBUF_NAMESPACE_ID::
Message(),
863 values_(
from.values_) {
873 if (GetArenaForAllocation() !=
nullptr)
return;
896 (void) cached_has_bits;
903 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
904 while (!
ctx->Done(&
ptr)) {
910 if (PROTOBUF_PREDICT_TRUE(
static_cast<uint8_t>(
tag) == 10)) {
916 if (!
ctx->DataAvailable(
ptr))
break;
917 }
while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(
ptr));
925 if ((
tag == 0) || ((
tag & 7) == 4)) {
948 (void) cached_has_bits;
951 for (
unsigned int i = 0,
954 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
959 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
968 size_t total_size = 0;
972 (void) cached_has_bits;
978 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
msg);
981 return MaybeComputeUnknownFieldsSize(total_size, &
_cached_size_);
985 ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
1001 (void) cached_has_bits;
1009 if (&
from ==
this)
return;
1031 PROTOBUF_NAMESPACE_CLOSE
1032 PROTOBUF_NAMESPACE_OPEN
1034 return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Struct_FieldsEntry_DoNotUse >(
arena);
1037 return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Struct >(
arena);
1040 return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Value >(
arena);
1043 return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::ListValue >(
arena);
1045 PROTOBUF_NAMESPACE_CLOSE
1048 #include <google/protobuf/port_undef.inc>