| Index: third_party/protobuf/src/google/protobuf/struct.pb.cc
|
| diff --git a/third_party/protobuf/src/google/protobuf/struct.pb.cc b/third_party/protobuf/src/google/protobuf/struct.pb.cc
|
| index 11ccabbf3b977c7b5dc27042bd70c33d7e5ac4e6..8bd2f8bec6a3f2bf8db25768e4d74306760a2d5a 100644
|
| --- a/third_party/protobuf/src/google/protobuf/struct.pb.cc
|
| +++ b/third_party/protobuf/src/google/protobuf/struct.pb.cc
|
| @@ -19,16 +19,17 @@
|
|
|
| namespace google {
|
| namespace protobuf {
|
| +class StructDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Struct> {};
|
| +StructDefaultTypeInternal _Struct_default_instance_;
|
| +class ValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<Value> {};
|
| +ValueDefaultTypeInternal _Value_default_instance_;
|
| +class ListValueDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<ListValue> {};
|
| +ListValueDefaultTypeInternal _ListValue_default_instance_;
|
|
|
| namespace {
|
|
|
| -const ::google::protobuf::Descriptor* Struct_descriptor_ = NULL;
|
| -const ::google::protobuf::internal::GeneratedMessageReflection*
|
| - Struct_reflection_ = NULL;
|
| -const ::google::protobuf::Descriptor* Struct_FieldsEntry_descriptor_ = NULL;
|
| -const ::google::protobuf::Descriptor* Value_descriptor_ = NULL;
|
| -const ::google::protobuf::internal::GeneratedMessageReflection*
|
| - Value_reflection_ = NULL;
|
| +::google::protobuf::Metadata file_level_metadata[4];
|
| +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
|
| struct ValueOneofInstance {
|
| int null_value_;
|
| double number_value_;
|
| @@ -36,153 +37,148 @@ struct ValueOneofInstance {
|
| bool bool_value_;
|
| const ::google::protobuf::Struct* struct_value_;
|
| const ::google::protobuf::ListValue* list_value_;
|
| -}* Value_default_oneof_instance_ = NULL;
|
| -const ::google::protobuf::Descriptor* ListValue_descriptor_ = NULL;
|
| -const ::google::protobuf::internal::GeneratedMessageReflection*
|
| - ListValue_reflection_ = NULL;
|
| -const ::google::protobuf::EnumDescriptor* NullValue_descriptor_ = NULL;
|
| +} Value_default_oneof_instance_;
|
|
|
| } // namespace
|
|
|
|
|
| -void protobuf_AssignDesc_google_2fprotobuf_2fstruct_2eproto() {
|
| - protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto();
|
| - const ::google::protobuf::FileDescriptor* file =
|
| - ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
|
| - "google/protobuf/struct.proto");
|
| - GOOGLE_CHECK(file != NULL);
|
| - Struct_descriptor_ = file->message_type(0);
|
| - static const int Struct_offsets_[1] = {
|
| +const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fstruct_2eproto() GOOGLE_ATTRIBUTE_COLD;
|
| +const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fstruct_2eproto() {
|
| + static const ::google::protobuf::uint32 offsets[] = {
|
| + ~0u, // no _has_bits_
|
| + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, _internal_metadata_),
|
| + ~0u, // no _extensions_
|
| + ~0u, // no _oneof_case_
|
| GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, fields_),
|
| - };
|
| - Struct_reflection_ =
|
| - ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
|
| - Struct_descriptor_,
|
| - Struct::default_instance_,
|
| - Struct_offsets_,
|
| - -1,
|
| - -1,
|
| - -1,
|
| - sizeof(Struct),
|
| - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, _internal_metadata_),
|
| - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, _is_default_instance_));
|
| - Struct_FieldsEntry_descriptor_ = Struct_descriptor_->nested_type(0);
|
| - Value_descriptor_ = file->message_type(1);
|
| - static const int Value_offsets_[7] = {
|
| - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, null_value_),
|
| - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, number_value_),
|
| - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, string_value_),
|
| - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, bool_value_),
|
| - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, struct_value_),
|
| - PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, list_value_),
|
| + ~0u, // no _has_bits_
|
| + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _internal_metadata_),
|
| + ~0u, // no _extensions_
|
| + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _oneof_case_[0]),
|
| + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), null_value_),
|
| + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), number_value_),
|
| + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), string_value_),
|
| + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), bool_value_),
|
| + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), struct_value_),
|
| + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET((&Value_default_oneof_instance_), list_value_),
|
| GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, kind_),
|
| - };
|
| - Value_reflection_ =
|
| - ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
|
| - Value_descriptor_,
|
| - Value::default_instance_,
|
| - Value_offsets_,
|
| - -1,
|
| - -1,
|
| - -1,
|
| - Value_default_oneof_instance_,
|
| - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _oneof_case_[0]),
|
| - sizeof(Value),
|
| - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _internal_metadata_),
|
| - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _is_default_instance_));
|
| - ListValue_descriptor_ = file->message_type(2);
|
| - static const int ListValue_offsets_[1] = {
|
| + ~0u, // no _has_bits_
|
| + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, _internal_metadata_),
|
| + ~0u, // no _extensions_
|
| + ~0u, // no _oneof_case_
|
| GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, values_),
|
| };
|
| - ListValue_reflection_ =
|
| - ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
|
| - ListValue_descriptor_,
|
| - ListValue::default_instance_,
|
| - ListValue_offsets_,
|
| - -1,
|
| - -1,
|
| - -1,
|
| - sizeof(ListValue),
|
| - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, _internal_metadata_),
|
| - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, _is_default_instance_));
|
| - NullValue_descriptor_ = file->enum_type(0);
|
| + return offsets;
|
| }
|
|
|
| +static const ::google::protobuf::internal::MigrationSchema schemas[] = {
|
| + { 0, -1, sizeof(Struct)},
|
| + { 5, -1, sizeof(Value)},
|
| + { 16, -1, sizeof(ListValue)},
|
| +};
|
| +
|
| +static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = {
|
| + {reinterpret_cast<const ::google::protobuf::Message*>(&_Struct_default_instance_), NULL},
|
| + {reinterpret_cast<const ::google::protobuf::Message*>(&_Value_default_instance_), &Value_default_oneof_instance_},
|
| + {reinterpret_cast<const ::google::protobuf::Message*>(&_ListValue_default_instance_), NULL},
|
| +};
|
| +
|
| namespace {
|
|
|
| -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
|
| -inline void protobuf_AssignDescriptorsOnce() {
|
| - ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
|
| - &protobuf_AssignDesc_google_2fprotobuf_2fstruct_2eproto);
|
| +void protobuf_AssignDescriptors() {
|
| + protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto();
|
| + ::google::protobuf::MessageFactory* factory = NULL;
|
| + AssignDescriptors(
|
| + "google/protobuf/struct.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2fstruct_2eproto(), factory,
|
| + file_level_metadata, file_level_enum_descriptors, NULL);
|
| +}
|
| +
|
| +void protobuf_AssignDescriptorsOnce() {
|
| + static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
|
| + ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
|
| }
|
|
|
| +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
|
| void protobuf_RegisterTypes(const ::std::string&) {
|
| protobuf_AssignDescriptorsOnce();
|
| + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4);
|
| + const ::google::protobuf::Descriptor* Struct_FieldsEntry_descriptor = file_level_metadata[0].descriptor;
|
| ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
| - Struct_descriptor_, &Struct::default_instance());
|
| - ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
| - Struct_FieldsEntry_descriptor_,
|
| + Struct_FieldsEntry_descriptor,
|
| ::google::protobuf::internal::MapEntry<
|
| ::std::string,
|
| ::google::protobuf::Value,
|
| ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
|
| ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
|
| 0>::CreateDefaultInstance(
|
| - Struct_FieldsEntry_descriptor_));
|
| - ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
| - Value_descriptor_, &Value::default_instance());
|
| - ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
| - ListValue_descriptor_, &ListValue::default_instance());
|
| + Struct_FieldsEntry_descriptor));
|
| }
|
|
|
| } // namespace
|
|
|
| void protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto() {
|
| - delete Struct::default_instance_;
|
| - delete Struct_reflection_;
|
| - delete Value::default_instance_;
|
| - delete Value_default_oneof_instance_;
|
| - delete Value_reflection_;
|
| - delete ListValue::default_instance_;
|
| - delete ListValue_reflection_;
|
| + _Struct_default_instance_.Shutdown();
|
| + delete file_level_metadata[1].reflection;
|
| + _Value_default_instance_.Shutdown();
|
| + delete file_level_metadata[2].reflection;
|
| + _ListValue_default_instance_.Shutdown();
|
| + delete file_level_metadata[3].reflection;
|
| }
|
|
|
| -void protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto() {
|
| - static bool already_here = false;
|
| - if (already_here) return;
|
| - already_here = true;
|
| +void protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto_impl() {
|
| GOOGLE_PROTOBUF_VERIFY_VERSION;
|
|
|
| + ::google::protobuf::internal::InitProtobufDefaults();
|
| + _Struct_default_instance_.DefaultConstruct();
|
| + _Value_default_instance_.DefaultConstruct();
|
| + _ListValue_default_instance_.DefaultConstruct();
|
| + Value_default_oneof_instance_.null_value_ = 0;
|
| + Value_default_oneof_instance_.number_value_ = 0;
|
| + Value_default_oneof_instance_.string_value_.UnsafeSetDefault(
|
| + &::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| + Value_default_oneof_instance_.bool_value_ = false;
|
| + Value_default_oneof_instance_.struct_value_ = const_cast< ::google::protobuf::Struct*>(
|
| + ::google::protobuf::Struct::internal_default_instance());
|
| + Value_default_oneof_instance_.list_value_ = const_cast< ::google::protobuf::ListValue*>(
|
| + ::google::protobuf::ListValue::internal_default_instance());
|
| +}
|
| +
|
| +void protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto() {
|
| + static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
|
| + ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto_impl);
|
| +}
|
| +void protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_impl() {
|
| + protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto();
|
| + static const char descriptor[] = {
|
| + "\n\034google/protobuf/struct.proto\022\017google.p"
|
| + "rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo"
|
| + "gle.protobuf.Struct.FieldsEntry\032E\n\013Field"
|
| + "sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo"
|
| + "gle.protobuf.Value:\0028\001\"\352\001\n\005Value\0220\n\nnull"
|
| + "_value\030\001 \001(\0162\032.google.protobuf.NullValue"
|
| + "H\000\022\026\n\014number_value\030\002 \001(\001H\000\022\026\n\014string_val"
|
| + "ue\030\003 \001(\tH\000\022\024\n\nbool_value\030\004 \001(\010H\000\022/\n\014stru"
|
| + "ct_value\030\005 \001(\0132\027.google.protobuf.StructH"
|
| + "\000\0220\n\nlist_value\030\006 \001(\0132\032.google.protobuf."
|
| + "ListValueH\000B\006\n\004kind\"3\n\tListValue\022&\n\006valu"
|
| + "es\030\001 \003(\0132\026.google.protobuf.Value*\033\n\tNull"
|
| + "Value\022\016\n\nNULL_VALUE\020\000B\201\001\n\023com.google.pro"
|
| + "tobufB\013StructProtoP\001Z1github.com/golang/"
|
| + "protobuf/ptypes/struct;structpb\370\001\001\242\002\003GPB"
|
| + "\252\002\036Google.Protobuf.WellKnownTypesb\006proto"
|
| + "3"
|
| + };
|
| ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
|
| - "\n\034google/protobuf/struct.proto\022\017google.p"
|
| - "rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo"
|
| - "gle.protobuf.Struct.FieldsEntry\032E\n\013Field"
|
| - "sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo"
|
| - "gle.protobuf.Value:\0028\001\"\352\001\n\005Value\0220\n\nnull"
|
| - "_value\030\001 \001(\0162\032.google.protobuf.NullValue"
|
| - "H\000\022\026\n\014number_value\030\002 \001(\001H\000\022\026\n\014string_val"
|
| - "ue\030\003 \001(\tH\000\022\024\n\nbool_value\030\004 \001(\010H\000\022/\n\014stru"
|
| - "ct_value\030\005 \001(\0132\027.google.protobuf.StructH"
|
| - "\000\0220\n\nlist_value\030\006 \001(\0132\032.google.protobuf."
|
| - "ListValueH\000B\006\n\004kind\"3\n\tListValue\022&\n\006valu"
|
| - "es\030\001 \003(\0132\026.google.protobuf.Value*\033\n\tNull"
|
| - "Value\022\016\n\nNULL_VALUE\020\000B\201\001\n\023com.google.pro"
|
| - "tobufB\013StructProtoP\001Z1github.com/golang/"
|
| - "protobuf/ptypes/struct;structpb\240\001\001\242\002\003GPB"
|
| - "\252\002\036Google.Protobuf.WellKnownTypesb\006proto"
|
| - "3", 641);
|
| + descriptor, 641);
|
| ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
| "google/protobuf/struct.proto", &protobuf_RegisterTypes);
|
| - Struct::default_instance_ = new Struct();
|
| - Value::default_instance_ = new Value();
|
| - Value_default_oneof_instance_ = new ValueOneofInstance();
|
| - ListValue::default_instance_ = new ListValue();
|
| - Struct::default_instance_->InitAsDefaultInstance();
|
| - Value::default_instance_->InitAsDefaultInstance();
|
| - ListValue::default_instance_->InitAsDefaultInstance();
|
| ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto);
|
| }
|
|
|
| +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_once_);
|
| +void protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto() {
|
| + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_once_,
|
| + &protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto_impl);
|
| +}
|
| // Force AddDescriptors() to be called at static initialization time.
|
| struct StaticDescriptorInitializer_google_2fprotobuf_2fstruct_2eproto {
|
| StaticDescriptorInitializer_google_2fprotobuf_2fstruct_2eproto() {
|
| @@ -191,10 +187,10 @@ struct StaticDescriptorInitializer_google_2fprotobuf_2fstruct_2eproto {
|
| } static_descriptor_initializer_google_2fprotobuf_2fstruct_2eproto_;
|
| const ::google::protobuf::EnumDescriptor* NullValue_descriptor() {
|
| protobuf_AssignDescriptorsOnce();
|
| - return NullValue_descriptor_;
|
| + return file_level_enum_descriptors[0];
|
| }
|
| bool NullValue_IsValid(int value) {
|
| - switch(value) {
|
| + switch (value) {
|
| case 0:
|
| return true;
|
| default:
|
| @@ -203,15 +199,10 @@ bool NullValue_IsValid(int value) {
|
| }
|
|
|
|
|
| -namespace {
|
| -
|
| -static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD;
|
| -static void MergeFromFail(int line) {
|
| - GOOGLE_CHECK(false) << __FILE__ << ":" << line;
|
| -}
|
| -
|
| -} // namespace
|
| +// ===================================================================
|
|
|
| +#if PROTOBUF_INLINE_NOT_IN_HEADERS
|
| +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
|
|
|
| // ===================================================================
|
|
|
| @@ -221,29 +212,44 @@ const int Struct::kFieldsFieldNumber;
|
|
|
| Struct::Struct()
|
| : ::google::protobuf::Message(), _internal_metadata_(NULL) {
|
| + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
|
| + protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto();
|
| + }
|
| SharedCtor();
|
| // @@protoc_insertion_point(constructor:google.protobuf.Struct)
|
| }
|
| -
|
| -void Struct::InitAsDefaultInstance() {
|
| - _is_default_instance_ = true;
|
| +Struct::Struct(::google::protobuf::Arena* arena)
|
| + : ::google::protobuf::Message(),
|
| + _internal_metadata_(arena),
|
| + fields_(arena) {
|
| +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
| + protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto();
|
| +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
| + SharedCtor();
|
| + RegisterArenaDtor(arena);
|
| + // @@protoc_insertion_point(arena_constructor:google.protobuf.Struct)
|
| }
|
| -
|
| Struct::Struct(const Struct& from)
|
| : ::google::protobuf::Message(),
|
| - _internal_metadata_(NULL) {
|
| - SharedCtor();
|
| - MergeFrom(from);
|
| + _internal_metadata_(NULL),
|
| + _cached_size_(0) {
|
| + _internal_metadata_.MergeFrom(from._internal_metadata_);
|
| + const ::google::protobuf::Descriptor*& Struct_FieldsEntry_descriptor = file_level_metadata[0].descriptor;
|
| + fields_.SetAssignDescriptorCallback(
|
| + protobuf_AssignDescriptorsOnce);
|
| + fields_.SetEntryDescriptor(
|
| + &Struct_FieldsEntry_descriptor);
|
| + fields_.MergeFrom(from.fields_);
|
| // @@protoc_insertion_point(copy_constructor:google.protobuf.Struct)
|
| }
|
|
|
| void Struct::SharedCtor() {
|
| - _is_default_instance_ = false;
|
| - _cached_size_ = 0;
|
| + const ::google::protobuf::Descriptor*& Struct_FieldsEntry_descriptor = file_level_metadata[0].descriptor;
|
| fields_.SetAssignDescriptorCallback(
|
| protobuf_AssignDescriptorsOnce);
|
| fields_.SetEntryDescriptor(
|
| - &::google::protobuf::Struct_FieldsEntry_descriptor_);
|
| + &Struct_FieldsEntry_descriptor);
|
| + _cached_size_ = 0;
|
| }
|
|
|
| Struct::~Struct() {
|
| @@ -252,10 +258,19 @@ Struct::~Struct() {
|
| }
|
|
|
| void Struct::SharedDtor() {
|
| - if (this != default_instance_) {
|
| + ::google::protobuf::Arena* arena = GetArenaNoVirtual();
|
| + if (arena != NULL) {
|
| + return;
|
| }
|
| +
|
| }
|
|
|
| +void Struct::ArenaDtor(void* object) {
|
| + Struct* _this = reinterpret_cast< Struct* >(object);
|
| + (void)_this;
|
| +}
|
| +void Struct::RegisterArenaDtor(::google::protobuf::Arena* arena) {
|
| +}
|
| void Struct::SetCachedSize(int size) const {
|
| GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
| _cached_size_ = size;
|
| @@ -263,22 +278,16 @@ void Struct::SetCachedSize(int size) const {
|
| }
|
| const ::google::protobuf::Descriptor* Struct::descriptor() {
|
| protobuf_AssignDescriptorsOnce();
|
| - return Struct_descriptor_;
|
| + return file_level_metadata[1].descriptor;
|
| }
|
|
|
| const Struct& Struct::default_instance() {
|
| - if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto();
|
| - return *default_instance_;
|
| + protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto();
|
| + return *internal_default_instance();
|
| }
|
|
|
| -Struct* Struct::default_instance_ = NULL;
|
| -
|
| Struct* Struct::New(::google::protobuf::Arena* arena) const {
|
| - Struct* n = new Struct;
|
| - if (arena != NULL) {
|
| - arena->Own(n);
|
| - }
|
| - return n;
|
| + return ::google::protobuf::Arena::CreateMessage<Struct>(arena);
|
| }
|
|
|
| void Struct::Clear() {
|
| @@ -292,29 +301,30 @@ bool Struct::MergePartialFromCodedStream(
|
| ::google::protobuf::uint32 tag;
|
| // @@protoc_insertion_point(parse_start:google.protobuf.Struct)
|
| for (;;) {
|
| - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
|
| + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
|
| tag = p.first;
|
| if (!p.second) goto handle_unusual;
|
| switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
| // map<string, .google.protobuf.Value> fields = 1;
|
| case 1: {
|
| - if (tag == 10) {
|
| + if (tag == 10u) {
|
| DO_(input->IncrementRecursionDepth());
|
| - parse_loop_fields:
|
| - ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry(fields_.NewEntry());
|
| + Struct_FieldsEntry::Parser< ::google::protobuf::internal::MapField<
|
| + ::std::string, ::google::protobuf::Value,
|
| + ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
|
| + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
|
| + 0 >,
|
| + ::google::protobuf::Map< ::std::string, ::google::protobuf::Value > > parser(&fields_);
|
| DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
|
| - input, entry.get()));
|
| - (*mutable_fields())[entry->key()].Swap(entry->mutable_value());
|
| + input, &parser));
|
| DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
| - entry->key().data(), entry->key().length(),
|
| + parser.key().data(), parser.key().length(),
|
| ::google::protobuf::internal::WireFormatLite::PARSE,
|
| "google.protobuf.Struct.FieldsEntry.key"));
|
| } else {
|
| goto handle_unusual;
|
| }
|
| - if (input->ExpectTag(10)) goto parse_loop_fields;
|
| input->UnsafeDecrementRecursionDepth();
|
| - if (input->ExpectAtEnd()) goto success;
|
| break;
|
| }
|
|
|
| @@ -343,41 +353,123 @@ void Struct::SerializeWithCachedSizes(
|
| ::google::protobuf::io::CodedOutputStream* output) const {
|
| // @@protoc_insertion_point(serialize_start:google.protobuf.Struct)
|
| // map<string, .google.protobuf.Value> fields = 1;
|
| - {
|
| - ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
|
| - for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
|
| - it = this->fields().begin();
|
| - it != this->fields().end(); ++it) {
|
| - entry.reset(fields_.NewEntryWrapper(it->first, it->second));
|
| - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
| - 1, *entry, output);
|
| - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
| - it->first.data(), it->first.length(),
|
| - ::google::protobuf::internal::WireFormatLite::SERIALIZE,
|
| - "google.protobuf.Struct.FieldsEntry.key");
|
| + if (!this->fields().empty()) {
|
| + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_pointer
|
| + ConstPtr;
|
| + typedef ConstPtr SortItem;
|
| + typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
|
| + struct Utf8Check {
|
| + static void Check(ConstPtr p) {
|
| + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
| + p->first.data(), p->first.length(),
|
| + ::google::protobuf::internal::WireFormatLite::SERIALIZE,
|
| + "google.protobuf.Struct.FieldsEntry.key");
|
| + }
|
| + };
|
| +
|
| + if (output->IsSerializationDeterministic() &&
|
| + this->fields().size() > 1) {
|
| + ::google::protobuf::scoped_array<SortItem> items(
|
| + new SortItem[this->fields().size()]);
|
| + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::size_type size_type;
|
| + size_type n = 0;
|
| + for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
|
| + it = this->fields().begin();
|
| + it != this->fields().end(); ++it, ++n) {
|
| + items[n] = SortItem(&*it);
|
| + }
|
| + ::std::sort(&items[0], &items[n], Less());
|
| + ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
|
| + for (size_type i = 0; i < n; i++) {
|
| + entry.reset(fields_.NewEntryWrapper(
|
| + items[i]->first, items[i]->second));
|
| + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
| + 1, *entry, output);
|
| + if (entry->GetArena() != NULL) {
|
| + entry.release();
|
| + }
|
| + Utf8Check::Check(items[i]);
|
| + }
|
| + } else {
|
| + ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
|
| + for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
|
| + it = this->fields().begin();
|
| + it != this->fields().end(); ++it) {
|
| + entry.reset(fields_.NewEntryWrapper(
|
| + it->first, it->second));
|
| + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
| + 1, *entry, output);
|
| + if (entry->GetArena() != NULL) {
|
| + entry.release();
|
| + }
|
| + Utf8Check::Check(&*it);
|
| + }
|
| }
|
| }
|
|
|
| // @@protoc_insertion_point(serialize_end:google.protobuf.Struct)
|
| }
|
|
|
| -::google::protobuf::uint8* Struct::SerializeWithCachedSizesToArray(
|
| - ::google::protobuf::uint8* target) const {
|
| +::google::protobuf::uint8* Struct::InternalSerializeWithCachedSizesToArray(
|
| + bool deterministic, ::google::protobuf::uint8* target) const {
|
| + (void)deterministic; // Unused
|
| // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct)
|
| // map<string, .google.protobuf.Value> fields = 1;
|
| - {
|
| - ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
|
| - for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
|
| - it = this->fields().begin();
|
| - it != this->fields().end(); ++it) {
|
| - entry.reset(fields_.NewEntryWrapper(it->first, it->second));
|
| - target = ::google::protobuf::internal::WireFormatLite::
|
| - WriteMessageNoVirtualToArray(
|
| - 1, *entry, target);
|
| - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
| - it->first.data(), it->first.length(),
|
| - ::google::protobuf::internal::WireFormatLite::SERIALIZE,
|
| - "google.protobuf.Struct.FieldsEntry.key");
|
| + if (!this->fields().empty()) {
|
| + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_pointer
|
| + ConstPtr;
|
| + typedef ConstPtr SortItem;
|
| + typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
|
| + struct Utf8Check {
|
| + static void Check(ConstPtr p) {
|
| + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
| + p->first.data(), p->first.length(),
|
| + ::google::protobuf::internal::WireFormatLite::SERIALIZE,
|
| + "google.protobuf.Struct.FieldsEntry.key");
|
| + }
|
| + };
|
| +
|
| + if (deterministic &&
|
| + this->fields().size() > 1) {
|
| + ::google::protobuf::scoped_array<SortItem> items(
|
| + new SortItem[this->fields().size()]);
|
| + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::size_type size_type;
|
| + size_type n = 0;
|
| + for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
|
| + it = this->fields().begin();
|
| + it != this->fields().end(); ++it, ++n) {
|
| + items[n] = SortItem(&*it);
|
| + }
|
| + ::std::sort(&items[0], &items[n], Less());
|
| + ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
|
| + for (size_type i = 0; i < n; i++) {
|
| + entry.reset(fields_.NewEntryWrapper(
|
| + items[i]->first, items[i]->second));
|
| + target = ::google::protobuf::internal::WireFormatLite::
|
| + InternalWriteMessageNoVirtualToArray(
|
| + 1, *entry, deterministic, target);
|
| +;
|
| + if (entry->GetArena() != NULL) {
|
| + entry.release();
|
| + }
|
| + Utf8Check::Check(items[i]);
|
| + }
|
| + } else {
|
| + ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
|
| + for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
|
| + it = this->fields().begin();
|
| + it != this->fields().end(); ++it) {
|
| + entry.reset(fields_.NewEntryWrapper(
|
| + it->first, it->second));
|
| + target = ::google::protobuf::internal::WireFormatLite::
|
| + InternalWriteMessageNoVirtualToArray(
|
| + 1, *entry, deterministic, target);
|
| +;
|
| + if (entry->GetArena() != NULL) {
|
| + entry.release();
|
| + }
|
| + Utf8Check::Check(&*it);
|
| + }
|
| }
|
| }
|
|
|
| @@ -385,33 +477,41 @@ void Struct::SerializeWithCachedSizes(
|
| return target;
|
| }
|
|
|
| -int Struct::ByteSize() const {
|
| +size_t Struct::ByteSizeLong() const {
|
| // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Struct)
|
| - int total_size = 0;
|
| + size_t total_size = 0;
|
|
|
| // map<string, .google.protobuf.Value> fields = 1;
|
| - total_size += 1 * this->fields_size();
|
| + total_size += 1 *
|
| + ::google::protobuf::internal::FromIntSize(this->fields_size());
|
| {
|
| ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
|
| for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
|
| it = this->fields().begin();
|
| it != this->fields().end(); ++it) {
|
| + if (entry.get() != NULL && entry->GetArena() != NULL) {
|
| + entry.release();
|
| + }
|
| entry.reset(fields_.NewEntryWrapper(it->first, it->second));
|
| total_size += ::google::protobuf::internal::WireFormatLite::
|
| MessageSizeNoVirtual(*entry);
|
| }
|
| + if (entry.get() != NULL && entry->GetArena() != NULL) {
|
| + entry.release();
|
| + }
|
| }
|
|
|
| + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
|
| GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
| - _cached_size_ = total_size;
|
| + _cached_size_ = cached_size;
|
| GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
| return total_size;
|
| }
|
|
|
| void Struct::MergeFrom(const ::google::protobuf::Message& from) {
|
| // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Struct)
|
| - if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
|
| - const Struct* source =
|
| + GOOGLE_DCHECK_NE(&from, this);
|
| + const Struct* source =
|
| ::google::protobuf::internal::DynamicCastToGenerated<const Struct>(
|
| &from);
|
| if (source == NULL) {
|
| @@ -425,7 +525,8 @@ void Struct::MergeFrom(const ::google::protobuf::Message& from) {
|
|
|
| void Struct::MergeFrom(const Struct& from) {
|
| // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Struct)
|
| - if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
|
| + GOOGLE_DCHECK_NE(&from, this);
|
| + _internal_metadata_.MergeFrom(from._internal_metadata_);
|
| fields_.MergeFrom(from.fields_);
|
| }
|
|
|
| @@ -444,26 +545,36 @@ void Struct::CopyFrom(const Struct& from) {
|
| }
|
|
|
| bool Struct::IsInitialized() const {
|
| -
|
| return true;
|
| }
|
|
|
| void Struct::Swap(Struct* other) {
|
| if (other == this) return;
|
| + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
|
| + InternalSwap(other);
|
| + } else {
|
| + Struct* temp = New(GetArenaNoVirtual());
|
| + temp->MergeFrom(*other);
|
| + other->CopyFrom(*this);
|
| + InternalSwap(temp);
|
| + if (GetArenaNoVirtual() == NULL) {
|
| + delete temp;
|
| + }
|
| + }
|
| +}
|
| +void Struct::UnsafeArenaSwap(Struct* other) {
|
| + if (other == this) return;
|
| + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
|
| InternalSwap(other);
|
| }
|
| void Struct::InternalSwap(Struct* other) {
|
| fields_.Swap(&other->fields_);
|
| - _internal_metadata_.Swap(&other->_internal_metadata_);
|
| std::swap(_cached_size_, other->_cached_size_);
|
| }
|
|
|
| ::google::protobuf::Metadata Struct::GetMetadata() const {
|
| protobuf_AssignDescriptorsOnce();
|
| - ::google::protobuf::Metadata metadata;
|
| - metadata.descriptor = Struct_descriptor_;
|
| - metadata.reflection = Struct_reflection_;
|
| - return metadata;
|
| + return file_level_metadata[1];
|
| }
|
|
|
| #if PROTOBUF_INLINE_NOT_IN_HEADERS
|
| @@ -502,33 +613,63 @@ const int Value::kListValueFieldNumber;
|
|
|
| Value::Value()
|
| : ::google::protobuf::Message(), _internal_metadata_(NULL) {
|
| + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
|
| + protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto();
|
| + }
|
| SharedCtor();
|
| // @@protoc_insertion_point(constructor:google.protobuf.Value)
|
| }
|
| -
|
| -void Value::InitAsDefaultInstance() {
|
| - _is_default_instance_ = true;
|
| - Value_default_oneof_instance_->null_value_ = 0;
|
| - Value_default_oneof_instance_->number_value_ = 0;
|
| - Value_default_oneof_instance_->string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| - Value_default_oneof_instance_->bool_value_ = false;
|
| - Value_default_oneof_instance_->struct_value_ = const_cast< ::google::protobuf::Struct*>(&::google::protobuf::Struct::default_instance());
|
| - Value_default_oneof_instance_->list_value_ = const_cast< ::google::protobuf::ListValue*>(&::google::protobuf::ListValue::default_instance());
|
| +Value::Value(::google::protobuf::Arena* arena)
|
| + : ::google::protobuf::Message(),
|
| + _internal_metadata_(arena) {
|
| +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
| + protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto();
|
| +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
| + SharedCtor();
|
| + RegisterArenaDtor(arena);
|
| + // @@protoc_insertion_point(arena_constructor:google.protobuf.Value)
|
| }
|
| -
|
| Value::Value(const Value& from)
|
| : ::google::protobuf::Message(),
|
| - _internal_metadata_(NULL) {
|
| - SharedCtor();
|
| - MergeFrom(from);
|
| + _internal_metadata_(NULL),
|
| + _cached_size_(0) {
|
| + _internal_metadata_.MergeFrom(from._internal_metadata_);
|
| + clear_has_kind();
|
| + switch (from.kind_case()) {
|
| + case kNullValue: {
|
| + set_null_value(from.null_value());
|
| + break;
|
| + }
|
| + case kNumberValue: {
|
| + set_number_value(from.number_value());
|
| + break;
|
| + }
|
| + case kStringValue: {
|
| + set_string_value(from.string_value());
|
| + break;
|
| + }
|
| + case kBoolValue: {
|
| + set_bool_value(from.bool_value());
|
| + break;
|
| + }
|
| + case kStructValue: {
|
| + mutable_struct_value()->::google::protobuf::Struct::MergeFrom(from.struct_value());
|
| + break;
|
| + }
|
| + case kListValue: {
|
| + mutable_list_value()->::google::protobuf::ListValue::MergeFrom(from.list_value());
|
| + break;
|
| + }
|
| + case KIND_NOT_SET: {
|
| + break;
|
| + }
|
| + }
|
| // @@protoc_insertion_point(copy_constructor:google.protobuf.Value)
|
| }
|
|
|
| void Value::SharedCtor() {
|
| - _is_default_instance_ = false;
|
| - ::google::protobuf::internal::GetEmptyString();
|
| - _cached_size_ = 0;
|
| clear_has_kind();
|
| + _cached_size_ = 0;
|
| }
|
|
|
| Value::~Value() {
|
| @@ -537,13 +678,22 @@ Value::~Value() {
|
| }
|
|
|
| void Value::SharedDtor() {
|
| + ::google::protobuf::Arena* arena = GetArenaNoVirtual();
|
| + if (arena != NULL) {
|
| + return;
|
| + }
|
| +
|
| if (has_kind()) {
|
| clear_kind();
|
| }
|
| - if (this != default_instance_) {
|
| - }
|
| }
|
|
|
| +void Value::ArenaDtor(void* object) {
|
| + Value* _this = reinterpret_cast< Value* >(object);
|
| + (void)_this;
|
| +}
|
| +void Value::RegisterArenaDtor(::google::protobuf::Arena* arena) {
|
| +}
|
| void Value::SetCachedSize(int size) const {
|
| GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
| _cached_size_ = size;
|
| @@ -551,27 +701,21 @@ void Value::SetCachedSize(int size) const {
|
| }
|
| const ::google::protobuf::Descriptor* Value::descriptor() {
|
| protobuf_AssignDescriptorsOnce();
|
| - return Value_descriptor_;
|
| + return file_level_metadata[2].descriptor;
|
| }
|
|
|
| const Value& Value::default_instance() {
|
| - if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto();
|
| - return *default_instance_;
|
| + protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto();
|
| + return *internal_default_instance();
|
| }
|
|
|
| -Value* Value::default_instance_ = NULL;
|
| -
|
| Value* Value::New(::google::protobuf::Arena* arena) const {
|
| - Value* n = new Value;
|
| - if (arena != NULL) {
|
| - arena->Own(n);
|
| - }
|
| - return n;
|
| + return ::google::protobuf::Arena::CreateMessage<Value>(arena);
|
| }
|
|
|
| void Value::clear_kind() {
|
| // @@protoc_insertion_point(one_of_clear_start:google.protobuf.Value)
|
| - switch(kind_case()) {
|
| + switch (kind_case()) {
|
| case kNullValue: {
|
| // No need to clear
|
| break;
|
| @@ -581,7 +725,8 @@ void Value::clear_kind() {
|
| break;
|
| }
|
| case kStringValue: {
|
| - kind_.string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| + kind_.string_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
|
| + GetArenaNoVirtual());
|
| break;
|
| }
|
| case kBoolValue: {
|
| @@ -589,11 +734,15 @@ void Value::clear_kind() {
|
| break;
|
| }
|
| case kStructValue: {
|
| - delete kind_.struct_value_;
|
| + if (GetArenaNoVirtual() == NULL) {
|
| + delete kind_.struct_value_;
|
| + }
|
| break;
|
| }
|
| case kListValue: {
|
| - delete kind_.list_value_;
|
| + if (GetArenaNoVirtual() == NULL) {
|
| + delete kind_.list_value_;
|
| + }
|
| break;
|
| }
|
| case KIND_NOT_SET: {
|
| @@ -615,13 +764,13 @@ bool Value::MergePartialFromCodedStream(
|
| ::google::protobuf::uint32 tag;
|
| // @@protoc_insertion_point(parse_start:google.protobuf.Value)
|
| for (;;) {
|
| - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
|
| + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
|
| tag = p.first;
|
| if (!p.second) goto handle_unusual;
|
| switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
| - // optional .google.protobuf.NullValue null_value = 1;
|
| + // .google.protobuf.NullValue null_value = 1;
|
| case 1: {
|
| - if (tag == 8) {
|
| + if (tag == 8u) {
|
| int value;
|
| DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
|
| int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
|
| @@ -630,14 +779,12 @@ bool Value::MergePartialFromCodedStream(
|
| } else {
|
| goto handle_unusual;
|
| }
|
| - if (input->ExpectTag(17)) goto parse_number_value;
|
| break;
|
| }
|
|
|
| - // optional double number_value = 2;
|
| + // double number_value = 2;
|
| case 2: {
|
| - if (tag == 17) {
|
| - parse_number_value:
|
| + if (tag == 17u) {
|
| clear_kind();
|
| DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
|
| double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
|
| @@ -646,14 +793,12 @@ bool Value::MergePartialFromCodedStream(
|
| } else {
|
| goto handle_unusual;
|
| }
|
| - if (input->ExpectTag(26)) goto parse_string_value;
|
| break;
|
| }
|
|
|
| - // optional string string_value = 3;
|
| + // string string_value = 3;
|
| case 3: {
|
| - if (tag == 26) {
|
| - parse_string_value:
|
| + if (tag == 26u) {
|
| DO_(::google::protobuf::internal::WireFormatLite::ReadString(
|
| input, this->mutable_string_value()));
|
| DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
| @@ -663,14 +808,12 @@ bool Value::MergePartialFromCodedStream(
|
| } else {
|
| goto handle_unusual;
|
| }
|
| - if (input->ExpectTag(32)) goto parse_bool_value;
|
| break;
|
| }
|
|
|
| - // optional bool bool_value = 4;
|
| + // bool bool_value = 4;
|
| case 4: {
|
| - if (tag == 32) {
|
| - parse_bool_value:
|
| + if (tag == 32u) {
|
| clear_kind();
|
| DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
|
| bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
|
| @@ -679,33 +822,28 @@ bool Value::MergePartialFromCodedStream(
|
| } else {
|
| goto handle_unusual;
|
| }
|
| - if (input->ExpectTag(42)) goto parse_struct_value;
|
| break;
|
| }
|
|
|
| - // optional .google.protobuf.Struct struct_value = 5;
|
| + // .google.protobuf.Struct struct_value = 5;
|
| case 5: {
|
| - if (tag == 42) {
|
| - parse_struct_value:
|
| + if (tag == 42u) {
|
| DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
|
| input, mutable_struct_value()));
|
| } else {
|
| goto handle_unusual;
|
| }
|
| - if (input->ExpectTag(50)) goto parse_list_value;
|
| break;
|
| }
|
|
|
| - // optional .google.protobuf.ListValue list_value = 6;
|
| + // .google.protobuf.ListValue list_value = 6;
|
| case 6: {
|
| - if (tag == 50) {
|
| - parse_list_value:
|
| + if (tag == 50u) {
|
| DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
|
| input, mutable_list_value()));
|
| } else {
|
| goto handle_unusual;
|
| }
|
| - if (input->ExpectAtEnd()) goto success;
|
| break;
|
| }
|
|
|
| @@ -733,18 +871,18 @@ failure:
|
| void Value::SerializeWithCachedSizes(
|
| ::google::protobuf::io::CodedOutputStream* output) const {
|
| // @@protoc_insertion_point(serialize_start:google.protobuf.Value)
|
| - // optional .google.protobuf.NullValue null_value = 1;
|
| + // .google.protobuf.NullValue null_value = 1;
|
| if (has_null_value()) {
|
| ::google::protobuf::internal::WireFormatLite::WriteEnum(
|
| 1, this->null_value(), output);
|
| }
|
|
|
| - // optional double number_value = 2;
|
| + // double number_value = 2;
|
| if (has_number_value()) {
|
| ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->number_value(), output);
|
| }
|
|
|
| - // optional string string_value = 3;
|
| + // string string_value = 3;
|
| if (has_string_value()) {
|
| ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
| this->string_value().data(), this->string_value().length(),
|
| @@ -754,18 +892,18 @@ void Value::SerializeWithCachedSizes(
|
| 3, this->string_value(), output);
|
| }
|
|
|
| - // optional bool bool_value = 4;
|
| + // bool bool_value = 4;
|
| if (has_bool_value()) {
|
| ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->bool_value(), output);
|
| }
|
|
|
| - // optional .google.protobuf.Struct struct_value = 5;
|
| + // .google.protobuf.Struct struct_value = 5;
|
| if (has_struct_value()) {
|
| ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
| 5, *kind_.struct_value_, output);
|
| }
|
|
|
| - // optional .google.protobuf.ListValue list_value = 6;
|
| + // .google.protobuf.ListValue list_value = 6;
|
| if (has_list_value()) {
|
| ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
| 6, *kind_.list_value_, output);
|
| @@ -774,21 +912,22 @@ void Value::SerializeWithCachedSizes(
|
| // @@protoc_insertion_point(serialize_end:google.protobuf.Value)
|
| }
|
|
|
| -::google::protobuf::uint8* Value::SerializeWithCachedSizesToArray(
|
| - ::google::protobuf::uint8* target) const {
|
| +::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray(
|
| + bool deterministic, ::google::protobuf::uint8* target) const {
|
| + (void)deterministic; // Unused
|
| // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value)
|
| - // optional .google.protobuf.NullValue null_value = 1;
|
| + // .google.protobuf.NullValue null_value = 1;
|
| if (has_null_value()) {
|
| target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
|
| 1, this->null_value(), target);
|
| }
|
|
|
| - // optional double number_value = 2;
|
| + // double number_value = 2;
|
| if (has_number_value()) {
|
| target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->number_value(), target);
|
| }
|
|
|
| - // optional string string_value = 3;
|
| + // string string_value = 3;
|
| if (has_string_value()) {
|
| ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
|
| this->string_value().data(), this->string_value().length(),
|
| @@ -799,65 +938,65 @@ void Value::SerializeWithCachedSizes(
|
| 3, this->string_value(), target);
|
| }
|
|
|
| - // optional bool bool_value = 4;
|
| + // bool bool_value = 4;
|
| if (has_bool_value()) {
|
| target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bool_value(), target);
|
| }
|
|
|
| - // optional .google.protobuf.Struct struct_value = 5;
|
| + // .google.protobuf.Struct struct_value = 5;
|
| if (has_struct_value()) {
|
| target = ::google::protobuf::internal::WireFormatLite::
|
| - WriteMessageNoVirtualToArray(
|
| - 5, *kind_.struct_value_, target);
|
| + InternalWriteMessageNoVirtualToArray(
|
| + 5, *kind_.struct_value_, false, target);
|
| }
|
|
|
| - // optional .google.protobuf.ListValue list_value = 6;
|
| + // .google.protobuf.ListValue list_value = 6;
|
| if (has_list_value()) {
|
| target = ::google::protobuf::internal::WireFormatLite::
|
| - WriteMessageNoVirtualToArray(
|
| - 6, *kind_.list_value_, target);
|
| + InternalWriteMessageNoVirtualToArray(
|
| + 6, *kind_.list_value_, false, target);
|
| }
|
|
|
| // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Value)
|
| return target;
|
| }
|
|
|
| -int Value::ByteSize() const {
|
| +size_t Value::ByteSizeLong() const {
|
| // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Value)
|
| - int total_size = 0;
|
| + size_t total_size = 0;
|
|
|
| switch (kind_case()) {
|
| - // optional .google.protobuf.NullValue null_value = 1;
|
| + // .google.protobuf.NullValue null_value = 1;
|
| case kNullValue: {
|
| total_size += 1 +
|
| ::google::protobuf::internal::WireFormatLite::EnumSize(this->null_value());
|
| break;
|
| }
|
| - // optional double number_value = 2;
|
| + // double number_value = 2;
|
| case kNumberValue: {
|
| total_size += 1 + 8;
|
| break;
|
| }
|
| - // optional string string_value = 3;
|
| + // string string_value = 3;
|
| case kStringValue: {
|
| total_size += 1 +
|
| ::google::protobuf::internal::WireFormatLite::StringSize(
|
| this->string_value());
|
| break;
|
| }
|
| - // optional bool bool_value = 4;
|
| + // bool bool_value = 4;
|
| case kBoolValue: {
|
| total_size += 1 + 1;
|
| break;
|
| }
|
| - // optional .google.protobuf.Struct struct_value = 5;
|
| + // .google.protobuf.Struct struct_value = 5;
|
| case kStructValue: {
|
| total_size += 1 +
|
| ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
|
| *kind_.struct_value_);
|
| break;
|
| }
|
| - // optional .google.protobuf.ListValue list_value = 6;
|
| + // .google.protobuf.ListValue list_value = 6;
|
| case kListValue: {
|
| total_size += 1 +
|
| ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
|
| @@ -868,16 +1007,17 @@ int Value::ByteSize() const {
|
| break;
|
| }
|
| }
|
| + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
|
| GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
| - _cached_size_ = total_size;
|
| + _cached_size_ = cached_size;
|
| GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
| return total_size;
|
| }
|
|
|
| void Value::MergeFrom(const ::google::protobuf::Message& from) {
|
| // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Value)
|
| - if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
|
| - const Value* source =
|
| + GOOGLE_DCHECK_NE(&from, this);
|
| + const Value* source =
|
| ::google::protobuf::internal::DynamicCastToGenerated<const Value>(
|
| &from);
|
| if (source == NULL) {
|
| @@ -891,7 +1031,8 @@ void Value::MergeFrom(const ::google::protobuf::Message& from) {
|
|
|
| void Value::MergeFrom(const Value& from) {
|
| // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Value)
|
| - if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
|
| + GOOGLE_DCHECK_NE(&from, this);
|
| + _internal_metadata_.MergeFrom(from._internal_metadata_);
|
| switch (from.kind_case()) {
|
| case kNullValue: {
|
| set_null_value(from.null_value());
|
| @@ -938,33 +1079,43 @@ void Value::CopyFrom(const Value& from) {
|
| }
|
|
|
| bool Value::IsInitialized() const {
|
| -
|
| return true;
|
| }
|
|
|
| void Value::Swap(Value* other) {
|
| if (other == this) return;
|
| + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
|
| + InternalSwap(other);
|
| + } else {
|
| + Value* temp = New(GetArenaNoVirtual());
|
| + temp->MergeFrom(*other);
|
| + other->CopyFrom(*this);
|
| + InternalSwap(temp);
|
| + if (GetArenaNoVirtual() == NULL) {
|
| + delete temp;
|
| + }
|
| + }
|
| +}
|
| +void Value::UnsafeArenaSwap(Value* other) {
|
| + if (other == this) return;
|
| + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
|
| InternalSwap(other);
|
| }
|
| void Value::InternalSwap(Value* other) {
|
| std::swap(kind_, other->kind_);
|
| std::swap(_oneof_case_[0], other->_oneof_case_[0]);
|
| - _internal_metadata_.Swap(&other->_internal_metadata_);
|
| std::swap(_cached_size_, other->_cached_size_);
|
| }
|
|
|
| ::google::protobuf::Metadata Value::GetMetadata() const {
|
| protobuf_AssignDescriptorsOnce();
|
| - ::google::protobuf::Metadata metadata;
|
| - metadata.descriptor = Value_descriptor_;
|
| - metadata.reflection = Value_reflection_;
|
| - return metadata;
|
| + return file_level_metadata[2];
|
| }
|
|
|
| #if PROTOBUF_INLINE_NOT_IN_HEADERS
|
| // Value
|
|
|
| -// optional .google.protobuf.NullValue null_value = 1;
|
| +// .google.protobuf.NullValue null_value = 1;
|
| bool Value::has_null_value() const {
|
| return kind_case() == kNullValue;
|
| }
|
| @@ -977,14 +1128,14 @@ void Value::clear_null_value() {
|
| clear_has_kind();
|
| }
|
| }
|
| - ::google::protobuf::NullValue Value::null_value() const {
|
| +::google::protobuf::NullValue Value::null_value() const {
|
| // @@protoc_insertion_point(field_get:google.protobuf.Value.null_value)
|
| if (has_null_value()) {
|
| return static_cast< ::google::protobuf::NullValue >(kind_.null_value_);
|
| }
|
| return static_cast< ::google::protobuf::NullValue >(0);
|
| }
|
| - void Value::set_null_value(::google::protobuf::NullValue value) {
|
| +void Value::set_null_value(::google::protobuf::NullValue value) {
|
| if (!has_null_value()) {
|
| clear_kind();
|
| set_has_null_value();
|
| @@ -993,7 +1144,7 @@ void Value::clear_null_value() {
|
| // @@protoc_insertion_point(field_set:google.protobuf.Value.null_value)
|
| }
|
|
|
| -// optional double number_value = 2;
|
| +// double number_value = 2;
|
| bool Value::has_number_value() const {
|
| return kind_case() == kNumberValue;
|
| }
|
| @@ -1006,14 +1157,14 @@ void Value::clear_number_value() {
|
| clear_has_kind();
|
| }
|
| }
|
| - double Value::number_value() const {
|
| +double Value::number_value() const {
|
| // @@protoc_insertion_point(field_get:google.protobuf.Value.number_value)
|
| if (has_number_value()) {
|
| return kind_.number_value_;
|
| }
|
| return 0;
|
| }
|
| - void Value::set_number_value(double value) {
|
| +void Value::set_number_value(double value) {
|
| if (!has_number_value()) {
|
| clear_kind();
|
| set_has_number_value();
|
| @@ -1022,7 +1173,7 @@ void Value::clear_number_value() {
|
| // @@protoc_insertion_point(field_set:google.protobuf.Value.number_value)
|
| }
|
|
|
| -// optional string string_value = 3;
|
| +// string string_value = 3;
|
| bool Value::has_string_value() const {
|
| return kind_case() == kStringValue;
|
| }
|
| @@ -1031,79 +1182,107 @@ void Value::set_has_string_value() {
|
| }
|
| void Value::clear_string_value() {
|
| if (has_string_value()) {
|
| - kind_.string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| + kind_.string_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
|
| + GetArenaNoVirtual());
|
| clear_has_kind();
|
| }
|
| }
|
| - const ::std::string& Value::string_value() const {
|
| +const ::std::string& Value::string_value() const {
|
| // @@protoc_insertion_point(field_get:google.protobuf.Value.string_value)
|
| if (has_string_value()) {
|
| - return kind_.string_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| + return kind_.string_value_.Get();
|
| }
|
| return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
|
| }
|
| - void Value::set_string_value(const ::std::string& value) {
|
| - // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value)
|
| +void Value::set_string_value(const ::std::string& value) {
|
| if (!has_string_value()) {
|
| clear_kind();
|
| set_has_string_value();
|
| kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| }
|
| - kind_.string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
|
| + kind_.string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
|
| + GetArenaNoVirtual());
|
| // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value)
|
| }
|
| - void Value::set_string_value(const char* value) {
|
| +void Value::set_string_value(const char* value) {
|
| if (!has_string_value()) {
|
| clear_kind();
|
| set_has_string_value();
|
| kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| }
|
| - kind_.string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
|
| - ::std::string(value));
|
| + kind_.string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
|
| + ::std::string(value), GetArenaNoVirtual());
|
| // @@protoc_insertion_point(field_set_char:google.protobuf.Value.string_value)
|
| }
|
| - void Value::set_string_value(const char* value, size_t size) {
|
| +void Value::set_string_value(const char* value,
|
| + size_t size) {
|
| if (!has_string_value()) {
|
| clear_kind();
|
| set_has_string_value();
|
| kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| }
|
| - kind_.string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
|
| - reinterpret_cast<const char*>(value), size));
|
| + kind_.string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
|
| + reinterpret_cast<const char*>(value), size),
|
| + GetArenaNoVirtual());
|
| // @@protoc_insertion_point(field_set_pointer:google.protobuf.Value.string_value)
|
| }
|
| - ::std::string* Value::mutable_string_value() {
|
| +::std::string* Value::mutable_string_value() {
|
| if (!has_string_value()) {
|
| clear_kind();
|
| set_has_string_value();
|
| kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| }
|
| + return kind_.string_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
|
| + GetArenaNoVirtual());
|
| // @@protoc_insertion_point(field_mutable:google.protobuf.Value.string_value)
|
| - return kind_.string_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| }
|
| - ::std::string* Value::release_string_value() {
|
| +::std::string* Value::release_string_value() {
|
| // @@protoc_insertion_point(field_release:google.protobuf.Value.string_value)
|
| if (has_string_value()) {
|
| clear_has_kind();
|
| - return kind_.string_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| + return kind_.string_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
|
| + GetArenaNoVirtual());
|
| } else {
|
| return NULL;
|
| }
|
| }
|
| - void Value::set_allocated_string_value(::std::string* string_value) {
|
| +::std::string* Value::unsafe_arena_release_string_value() {
|
| + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.string_value)
|
| + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
|
| + if (has_string_value()) {
|
| + clear_has_kind();
|
| + return kind_.string_value_.UnsafeArenaRelease(
|
| + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
|
| + } else {
|
| + return NULL;
|
| + }
|
| +}
|
| +void Value::set_allocated_string_value(::std::string* string_value) {
|
| if (!has_string_value()) {
|
| kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| }
|
| clear_kind();
|
| if (string_value != NULL) {
|
| set_has_string_value();
|
| - kind_.string_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
|
| - string_value);
|
| + kind_.string_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value,
|
| + GetArenaNoVirtual());
|
| }
|
| // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.string_value)
|
| }
|
| +void Value::unsafe_arena_set_allocated_string_value(::std::string* string_value) {
|
| + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
|
| + if (!has_string_value()) {
|
| + kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
| + }
|
| + clear_kind();
|
| + if (string_value) {
|
| + set_has_string_value();
|
| + kind_.string_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value, GetArenaNoVirtual());
|
| + }
|
| + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.string_value)
|
| +}
|
|
|
| -// optional bool bool_value = 4;
|
| +// bool bool_value = 4;
|
| bool Value::has_bool_value() const {
|
| return kind_case() == kBoolValue;
|
| }
|
| @@ -1116,14 +1295,14 @@ void Value::clear_bool_value() {
|
| clear_has_kind();
|
| }
|
| }
|
| - bool Value::bool_value() const {
|
| +bool Value::bool_value() const {
|
| // @@protoc_insertion_point(field_get:google.protobuf.Value.bool_value)
|
| if (has_bool_value()) {
|
| return kind_.bool_value_;
|
| }
|
| return false;
|
| }
|
| - void Value::set_bool_value(bool value) {
|
| +void Value::set_bool_value(bool value) {
|
| if (!has_bool_value()) {
|
| clear_kind();
|
| set_has_bool_value();
|
| @@ -1132,7 +1311,7 @@ void Value::clear_bool_value() {
|
| // @@protoc_insertion_point(field_set:google.protobuf.Value.bool_value)
|
| }
|
|
|
| -// optional .google.protobuf.Struct struct_value = 5;
|
| +// .google.protobuf.Struct struct_value = 5;
|
| bool Value::has_struct_value() const {
|
| return kind_case() == kStructValue;
|
| }
|
| @@ -1141,7 +1320,9 @@ void Value::set_has_struct_value() {
|
| }
|
| void Value::clear_struct_value() {
|
| if (has_struct_value()) {
|
| - delete kind_.struct_value_;
|
| + if (GetArenaNoVirtual() == NULL) {
|
| + delete kind_.struct_value_;
|
| + }
|
| clear_has_kind();
|
| }
|
| }
|
| @@ -1155,7 +1336,9 @@ void Value::clear_struct_value() {
|
| if (!has_struct_value()) {
|
| clear_kind();
|
| set_has_struct_value();
|
| - kind_.struct_value_ = new ::google::protobuf::Struct;
|
| + kind_.struct_value_ =
|
| + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::Struct >(
|
| + GetArenaNoVirtual());
|
| }
|
| // @@protoc_insertion_point(field_mutable:google.protobuf.Value.struct_value)
|
| return kind_.struct_value_;
|
| @@ -1164,6 +1347,42 @@ void Value::clear_struct_value() {
|
| // @@protoc_insertion_point(field_release:google.protobuf.Value.struct_value)
|
| if (has_struct_value()) {
|
| clear_has_kind();
|
| + if (GetArenaNoVirtual() != NULL) {
|
| + ::google::protobuf::Struct* temp = new ::google::protobuf::Struct(*kind_.struct_value_);
|
| + kind_.struct_value_ = NULL;
|
| + return temp;
|
| + } else {
|
| + ::google::protobuf::Struct* temp = kind_.struct_value_;
|
| + kind_.struct_value_ = NULL;
|
| + return temp;
|
| + }
|
| + } else {
|
| + return NULL;
|
| + }
|
| +}
|
| +void Value::set_allocated_struct_value(::google::protobuf::Struct* struct_value) {
|
| + clear_kind();
|
| + if (struct_value) {
|
| + if (GetArenaNoVirtual() != NULL &&
|
| + ::google::protobuf::Arena::GetArena(struct_value) == NULL) {
|
| + GetArenaNoVirtual()->Own(struct_value);
|
| + } else if (GetArenaNoVirtual() !=
|
| + ::google::protobuf::Arena::GetArena(struct_value)) {
|
| + ::google::protobuf::Struct* new_struct_value =
|
| + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::Struct >(
|
| + GetArenaNoVirtual());
|
| + new_struct_value->CopyFrom(*struct_value);
|
| + struct_value = new_struct_value;
|
| + }
|
| + set_has_struct_value();
|
| + kind_.struct_value_ = struct_value;
|
| + }
|
| + // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.struct_value)
|
| +}
|
| + ::google::protobuf::Struct* Value::unsafe_arena_release_struct_value() {
|
| + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.struct_value)
|
| + if (has_struct_value()) {
|
| + clear_has_kind();
|
| ::google::protobuf::Struct* temp = kind_.struct_value_;
|
| kind_.struct_value_ = NULL;
|
| return temp;
|
| @@ -1171,16 +1390,16 @@ void Value::clear_struct_value() {
|
| return NULL;
|
| }
|
| }
|
| -void Value::set_allocated_struct_value(::google::protobuf::Struct* struct_value) {
|
| + void Value::unsafe_arena_set_allocated_struct_value(::google::protobuf::Struct* struct_value) {
|
| clear_kind();
|
| if (struct_value) {
|
| set_has_struct_value();
|
| kind_.struct_value_ = struct_value;
|
| }
|
| - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.struct_value)
|
| + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.struct_value)
|
| }
|
|
|
| -// optional .google.protobuf.ListValue list_value = 6;
|
| +// .google.protobuf.ListValue list_value = 6;
|
| bool Value::has_list_value() const {
|
| return kind_case() == kListValue;
|
| }
|
| @@ -1189,7 +1408,9 @@ void Value::set_has_list_value() {
|
| }
|
| void Value::clear_list_value() {
|
| if (has_list_value()) {
|
| - delete kind_.list_value_;
|
| + if (GetArenaNoVirtual() == NULL) {
|
| + delete kind_.list_value_;
|
| + }
|
| clear_has_kind();
|
| }
|
| }
|
| @@ -1203,7 +1424,9 @@ void Value::clear_list_value() {
|
| if (!has_list_value()) {
|
| clear_kind();
|
| set_has_list_value();
|
| - kind_.list_value_ = new ::google::protobuf::ListValue;
|
| + kind_.list_value_ =
|
| + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ListValue >(
|
| + GetArenaNoVirtual());
|
| }
|
| // @@protoc_insertion_point(field_mutable:google.protobuf.Value.list_value)
|
| return kind_.list_value_;
|
| @@ -1212,6 +1435,42 @@ void Value::clear_list_value() {
|
| // @@protoc_insertion_point(field_release:google.protobuf.Value.list_value)
|
| if (has_list_value()) {
|
| clear_has_kind();
|
| + if (GetArenaNoVirtual() != NULL) {
|
| + ::google::protobuf::ListValue* temp = new ::google::protobuf::ListValue(*kind_.list_value_);
|
| + kind_.list_value_ = NULL;
|
| + return temp;
|
| + } else {
|
| + ::google::protobuf::ListValue* temp = kind_.list_value_;
|
| + kind_.list_value_ = NULL;
|
| + return temp;
|
| + }
|
| + } else {
|
| + return NULL;
|
| + }
|
| +}
|
| +void Value::set_allocated_list_value(::google::protobuf::ListValue* list_value) {
|
| + clear_kind();
|
| + if (list_value) {
|
| + if (GetArenaNoVirtual() != NULL &&
|
| + ::google::protobuf::Arena::GetArena(list_value) == NULL) {
|
| + GetArenaNoVirtual()->Own(list_value);
|
| + } else if (GetArenaNoVirtual() !=
|
| + ::google::protobuf::Arena::GetArena(list_value)) {
|
| + ::google::protobuf::ListValue* new_list_value =
|
| + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ListValue >(
|
| + GetArenaNoVirtual());
|
| + new_list_value->CopyFrom(*list_value);
|
| + list_value = new_list_value;
|
| + }
|
| + set_has_list_value();
|
| + kind_.list_value_ = list_value;
|
| + }
|
| + // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.list_value)
|
| +}
|
| + ::google::protobuf::ListValue* Value::unsafe_arena_release_list_value() {
|
| + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.list_value)
|
| + if (has_list_value()) {
|
| + clear_has_kind();
|
| ::google::protobuf::ListValue* temp = kind_.list_value_;
|
| kind_.list_value_ = NULL;
|
| return temp;
|
| @@ -1219,13 +1478,13 @@ void Value::clear_list_value() {
|
| return NULL;
|
| }
|
| }
|
| -void Value::set_allocated_list_value(::google::protobuf::ListValue* list_value) {
|
| + void Value::unsafe_arena_set_allocated_list_value(::google::protobuf::ListValue* list_value) {
|
| clear_kind();
|
| if (list_value) {
|
| set_has_list_value();
|
| kind_.list_value_ = list_value;
|
| }
|
| - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.list_value)
|
| + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.list_value)
|
| }
|
|
|
| bool Value::has_kind() const {
|
| @@ -1247,24 +1506,33 @@ const int ListValue::kValuesFieldNumber;
|
|
|
| ListValue::ListValue()
|
| : ::google::protobuf::Message(), _internal_metadata_(NULL) {
|
| + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
|
| + protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto();
|
| + }
|
| SharedCtor();
|
| // @@protoc_insertion_point(constructor:google.protobuf.ListValue)
|
| }
|
| -
|
| -void ListValue::InitAsDefaultInstance() {
|
| - _is_default_instance_ = true;
|
| +ListValue::ListValue(::google::protobuf::Arena* arena)
|
| + : ::google::protobuf::Message(),
|
| + _internal_metadata_(arena),
|
| + values_(arena) {
|
| +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
| + protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto();
|
| +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
|
| + SharedCtor();
|
| + RegisterArenaDtor(arena);
|
| + // @@protoc_insertion_point(arena_constructor:google.protobuf.ListValue)
|
| }
|
| -
|
| ListValue::ListValue(const ListValue& from)
|
| : ::google::protobuf::Message(),
|
| - _internal_metadata_(NULL) {
|
| - SharedCtor();
|
| - MergeFrom(from);
|
| + _internal_metadata_(NULL),
|
| + values_(from.values_),
|
| + _cached_size_(0) {
|
| + _internal_metadata_.MergeFrom(from._internal_metadata_);
|
| // @@protoc_insertion_point(copy_constructor:google.protobuf.ListValue)
|
| }
|
|
|
| void ListValue::SharedCtor() {
|
| - _is_default_instance_ = false;
|
| _cached_size_ = 0;
|
| }
|
|
|
| @@ -1274,10 +1542,19 @@ ListValue::~ListValue() {
|
| }
|
|
|
| void ListValue::SharedDtor() {
|
| - if (this != default_instance_) {
|
| + ::google::protobuf::Arena* arena = GetArenaNoVirtual();
|
| + if (arena != NULL) {
|
| + return;
|
| }
|
| +
|
| }
|
|
|
| +void ListValue::ArenaDtor(void* object) {
|
| + ListValue* _this = reinterpret_cast< ListValue* >(object);
|
| + (void)_this;
|
| +}
|
| +void ListValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
|
| +}
|
| void ListValue::SetCachedSize(int size) const {
|
| GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
| _cached_size_ = size;
|
| @@ -1285,22 +1562,16 @@ void ListValue::SetCachedSize(int size) const {
|
| }
|
| const ::google::protobuf::Descriptor* ListValue::descriptor() {
|
| protobuf_AssignDescriptorsOnce();
|
| - return ListValue_descriptor_;
|
| + return file_level_metadata[3].descriptor;
|
| }
|
|
|
| const ListValue& ListValue::default_instance() {
|
| - if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto();
|
| - return *default_instance_;
|
| + protobuf_InitDefaults_google_2fprotobuf_2fstruct_2eproto();
|
| + return *internal_default_instance();
|
| }
|
|
|
| -ListValue* ListValue::default_instance_ = NULL;
|
| -
|
| ListValue* ListValue::New(::google::protobuf::Arena* arena) const {
|
| - ListValue* n = new ListValue;
|
| - if (arena != NULL) {
|
| - arena->Own(n);
|
| - }
|
| - return n;
|
| + return ::google::protobuf::Arena::CreateMessage<ListValue>(arena);
|
| }
|
|
|
| void ListValue::Clear() {
|
| @@ -1314,23 +1585,20 @@ bool ListValue::MergePartialFromCodedStream(
|
| ::google::protobuf::uint32 tag;
|
| // @@protoc_insertion_point(parse_start:google.protobuf.ListValue)
|
| for (;;) {
|
| - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
|
| + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
|
| tag = p.first;
|
| if (!p.second) goto handle_unusual;
|
| switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
| // repeated .google.protobuf.Value values = 1;
|
| case 1: {
|
| - if (tag == 10) {
|
| + if (tag == 10u) {
|
| DO_(input->IncrementRecursionDepth());
|
| - parse_loop_values:
|
| DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
|
| input, add_values()));
|
| } else {
|
| goto handle_unusual;
|
| }
|
| - if (input->ExpectTag(10)) goto parse_loop_values;
|
| input->UnsafeDecrementRecursionDepth();
|
| - if (input->ExpectAtEnd()) goto success;
|
| break;
|
| }
|
|
|
| @@ -1367,42 +1635,47 @@ void ListValue::SerializeWithCachedSizes(
|
| // @@protoc_insertion_point(serialize_end:google.protobuf.ListValue)
|
| }
|
|
|
| -::google::protobuf::uint8* ListValue::SerializeWithCachedSizesToArray(
|
| - ::google::protobuf::uint8* target) const {
|
| +::google::protobuf::uint8* ListValue::InternalSerializeWithCachedSizesToArray(
|
| + bool deterministic, ::google::protobuf::uint8* target) const {
|
| + (void)deterministic; // Unused
|
| // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue)
|
| // repeated .google.protobuf.Value values = 1;
|
| for (unsigned int i = 0, n = this->values_size(); i < n; i++) {
|
| target = ::google::protobuf::internal::WireFormatLite::
|
| - WriteMessageNoVirtualToArray(
|
| - 1, this->values(i), target);
|
| + InternalWriteMessageNoVirtualToArray(
|
| + 1, this->values(i), false, target);
|
| }
|
|
|
| // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ListValue)
|
| return target;
|
| }
|
|
|
| -int ListValue::ByteSize() const {
|
| +size_t ListValue::ByteSizeLong() const {
|
| // @@protoc_insertion_point(message_byte_size_start:google.protobuf.ListValue)
|
| - int total_size = 0;
|
| + size_t total_size = 0;
|
|
|
| // repeated .google.protobuf.Value values = 1;
|
| - total_size += 1 * this->values_size();
|
| - for (int i = 0; i < this->values_size(); i++) {
|
| - total_size +=
|
| - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
|
| - this->values(i));
|
| + {
|
| + unsigned int count = this->values_size();
|
| + total_size += 1UL * count;
|
| + for (unsigned int i = 0; i < count; i++) {
|
| + total_size +=
|
| + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
|
| + this->values(i));
|
| + }
|
| }
|
|
|
| + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
|
| GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
| - _cached_size_ = total_size;
|
| + _cached_size_ = cached_size;
|
| GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
| return total_size;
|
| }
|
|
|
| void ListValue::MergeFrom(const ::google::protobuf::Message& from) {
|
| // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ListValue)
|
| - if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
|
| - const ListValue* source =
|
| + GOOGLE_DCHECK_NE(&from, this);
|
| + const ListValue* source =
|
| ::google::protobuf::internal::DynamicCastToGenerated<const ListValue>(
|
| &from);
|
| if (source == NULL) {
|
| @@ -1416,7 +1689,8 @@ void ListValue::MergeFrom(const ::google::protobuf::Message& from) {
|
|
|
| void ListValue::MergeFrom(const ListValue& from) {
|
| // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ListValue)
|
| - if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
|
| + GOOGLE_DCHECK_NE(&from, this);
|
| + _internal_metadata_.MergeFrom(from._internal_metadata_);
|
| values_.MergeFrom(from.values_);
|
| }
|
|
|
| @@ -1435,26 +1709,36 @@ void ListValue::CopyFrom(const ListValue& from) {
|
| }
|
|
|
| bool ListValue::IsInitialized() const {
|
| -
|
| return true;
|
| }
|
|
|
| void ListValue::Swap(ListValue* other) {
|
| if (other == this) return;
|
| + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
|
| + InternalSwap(other);
|
| + } else {
|
| + ListValue* temp = New(GetArenaNoVirtual());
|
| + temp->MergeFrom(*other);
|
| + other->CopyFrom(*this);
|
| + InternalSwap(temp);
|
| + if (GetArenaNoVirtual() == NULL) {
|
| + delete temp;
|
| + }
|
| + }
|
| +}
|
| +void ListValue::UnsafeArenaSwap(ListValue* other) {
|
| + if (other == this) return;
|
| + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
|
| InternalSwap(other);
|
| }
|
| void ListValue::InternalSwap(ListValue* other) {
|
| values_.UnsafeArenaSwap(&other->values_);
|
| - _internal_metadata_.Swap(&other->_internal_metadata_);
|
| std::swap(_cached_size_, other->_cached_size_);
|
| }
|
|
|
| ::google::protobuf::Metadata ListValue::GetMetadata() const {
|
| protobuf_AssignDescriptorsOnce();
|
| - ::google::protobuf::Metadata metadata;
|
| - metadata.descriptor = ListValue_descriptor_;
|
| - metadata.reflection = ListValue_reflection_;
|
| - return metadata;
|
| + return file_level_metadata[3];
|
| }
|
|
|
| #if PROTOBUF_INLINE_NOT_IN_HEADERS
|
|
|