diff options
Diffstat (limited to 'src/google/protobuf/struct.pb.cc')
-rw-r--r-- | src/google/protobuf/struct.pb.cc | 78 |
1 files changed, 50 insertions, 28 deletions
diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index 3bbbbfa4..fe3ba327 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -14,6 +14,10 @@ #include <google/protobuf/generated_message_reflection.h> #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif // @@protoc_insertion_point(includes) namespace google { namespace protobuf { @@ -49,7 +53,11 @@ namespace protobuf_google_2fprotobuf_2fstruct_2eproto { void InitDefaultsListValueImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS + ::google::protobuf::internal::InitProtobufDefaultsForceUnique(); +#else ::google::protobuf::internal::InitProtobufDefaults(); +#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS { void* ptr = &::google::protobuf::_Struct_FieldsEntry_DoNotUse_default_instance_; new (ptr) ::google::protobuf::Struct_FieldsEntry_DoNotUse(); @@ -266,12 +274,7 @@ Struct::~Struct() { } void Struct::SharedDtor() { - ::google::protobuf::Arena* arena = GetArenaNoVirtual(); - GOOGLE_DCHECK(arena == NULL); - if (arena != NULL) { - return; - } - + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); } void Struct::ArenaDtor(void* object) { @@ -628,6 +631,36 @@ void Value::InitAsDefaultInstance() { ::google::protobuf::_Value_default_instance_.list_value_ = const_cast< ::google::protobuf::ListValue*>( ::google::protobuf::ListValue::internal_default_instance()); } +void Value::set_allocated_struct_value(::google::protobuf::Struct* struct_value) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_kind(); + if (struct_value) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(struct_value); + if (message_arena != submessage_arena) { + struct_value = ::google::protobuf::internal::GetOwnedMessage( + message_arena, struct_value, submessage_arena); + } + set_has_struct_value(); + kind_.struct_value_ = struct_value; + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.struct_value) +} +void Value::set_allocated_list_value(::google::protobuf::ListValue* list_value) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_kind(); + if (list_value) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(list_value); + if (message_arena != submessage_arena) { + list_value = ::google::protobuf::internal::GetOwnedMessage( + message_arena, list_value, submessage_arena); + } + set_has_list_value(); + kind_.list_value_ = list_value; + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.list_value) +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Value::kNullValueFieldNumber; const int Value::kNumberValueFieldNumber; @@ -702,12 +735,7 @@ Value::~Value() { } void Value::SharedDtor() { - ::google::protobuf::Arena* arena = GetArenaNoVirtual(); - GOOGLE_DCHECK(arena == NULL); - if (arena != NULL) { - return; - } - + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); if (has_kind()) { clear_kind(); } @@ -863,7 +891,7 @@ bool Value::MergePartialFromCodedStream( case 5: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, mutable_struct_value())); } else { goto handle_unusual; @@ -875,7 +903,7 @@ bool Value::MergePartialFromCodedStream( case 6: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, mutable_list_value())); } else { goto handle_unusual; @@ -991,14 +1019,14 @@ void Value::SerializeWithCachedSizes( // .google.protobuf.Struct struct_value = 5; if (has_struct_value()) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( + InternalWriteMessageToArray( 5, *kind_.struct_value_, deterministic, target); } // .google.protobuf.ListValue list_value = 6; if (has_list_value()) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( + InternalWriteMessageToArray( 6, *kind_.list_value_, deterministic, target); } @@ -1046,14 +1074,14 @@ size_t Value::ByteSizeLong() const { // .google.protobuf.Struct struct_value = 5; case kStructValue: { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + ::google::protobuf::internal::WireFormatLite::MessageSize( *kind_.struct_value_); break; } // .google.protobuf.ListValue list_value = 6; case kListValue: { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + ::google::protobuf::internal::WireFormatLite::MessageSize( *kind_.list_value_); break; } @@ -1216,12 +1244,7 @@ ListValue::~ListValue() { } void ListValue::SharedDtor() { - ::google::protobuf::Arena* arena = GetArenaNoVirtual(); - GOOGLE_DCHECK(arena == NULL); - if (arena != NULL) { - return; - } - + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); } void ListValue::ArenaDtor(void* object) { @@ -1273,8 +1296,7 @@ bool ListValue::MergePartialFromCodedStream( case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_values())); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_values())); } else { goto handle_unusual; } @@ -1332,7 +1354,7 @@ void ListValue::SerializeWithCachedSizes( for (unsigned int i = 0, n = static_cast<unsigned int>(this->values_size()); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( + InternalWriteMessageToArray( 1, this->values(static_cast<int>(i)), deterministic, target); } @@ -1359,7 +1381,7 @@ size_t ListValue::ByteSizeLong() const { total_size += 1UL * count; for (unsigned int i = 0; i < count; i++) { total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + ::google::protobuf::internal::WireFormatLite::MessageSize( this->values(static_cast<int>(i))); } } |