diff options
Diffstat (limited to 'src/google/protobuf/struct.pb.cc')
-rw-r--r-- | src/google/protobuf/struct.pb.cc | 133 |
1 files changed, 54 insertions, 79 deletions
diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index 309a4d2d..8f2d4848 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -7,7 +7,6 @@ #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/port.h> -#include <google/protobuf/stubs/once.h> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/wire_format_lite_inl.h> #include <google/protobuf/descriptor.h> @@ -19,6 +18,10 @@ #include "third_party/protobuf/version.h" #endif // @@protoc_insertion_point(includes) + +namespace protobuf_google_2fprotobuf_2fstruct_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fstruct_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ListValue; +} // namespace protobuf_google_2fprotobuf_2fstruct_2eproto namespace google { namespace protobuf { class Struct_FieldsEntry_DoNotUseDefaultTypeInternal { @@ -50,14 +53,9 @@ class ListValueDefaultTypeInternal { } // namespace protobuf } // namespace google namespace protobuf_google_2fprotobuf_2fstruct_2eproto { -void InitDefaultsListValueImpl() { +static void InitDefaultsListValue() { 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(); @@ -83,9 +81,11 @@ void InitDefaultsListValueImpl() { ::google::protobuf::ListValue::InitAsDefaultInstance(); } -void InitDefaultsListValue() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsListValueImpl); +LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<0> scc_info_ListValue = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsListValue}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_ListValue.base); } ::google::protobuf::Metadata file_level_metadata[4]; @@ -142,15 +142,14 @@ static ::google::protobuf::Message const * const file_default_instances[] = { void protobuf_AssignDescriptors() { AddDescriptors(); - ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( - "google/protobuf/struct.proto", schemas, file_default_instances, TableStruct::offsets, factory, + "google/protobuf/struct.proto", schemas, file_default_instances, TableStruct::offsets, file_level_metadata, file_level_enum_descriptors, NULL); } void protobuf_AssignDescriptorsOnce() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); } void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; @@ -187,8 +186,8 @@ void AddDescriptorsImpl() { } void AddDescriptors() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); } // Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { @@ -240,9 +239,8 @@ const int Struct::kFieldsFieldNumber; Struct::Struct() : ::google::protobuf::Message(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); - } + ::google::protobuf::internal::InitSCC( + &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Struct) } @@ -250,22 +248,20 @@ Struct::Struct(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), fields_(arena) { - ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Struct) } Struct::Struct(const Struct& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), - _cached_size_(0) { + _internal_metadata_(NULL) { _internal_metadata_.MergeFrom(from._internal_metadata_); fields_.MergeFrom(from.fields_); // @@protoc_insertion_point(copy_constructor:google.protobuf.Struct) } void Struct::SharedCtor() { - _cached_size_ = 0; } Struct::~Struct() { @@ -284,9 +280,7 @@ void Struct::ArenaDtor(void* object) { void Struct::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void Struct::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + _cached_size_.Set(size); } const ::google::protobuf::Descriptor* Struct::descriptor() { ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); @@ -294,7 +288,7 @@ const ::google::protobuf::Descriptor* Struct::descriptor() { } const Struct& Struct::default_instance() { - ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); return *internal_default_instance(); } @@ -315,7 +309,7 @@ bool Struct::MergePartialFromCodedStream( ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Struct) for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + ::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)) { @@ -385,7 +379,7 @@ void Struct::SerializeWithCachedSizes( if (output->IsSerializationDeterministic() && this->fields().size() > 1) { - ::google::protobuf::scoped_array<SortItem> items( + ::std::unique_ptr<SortItem[]> items( new SortItem[this->fields().size()]); typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::size_type size_type; size_type n = 0; @@ -395,7 +389,7 @@ void Struct::SerializeWithCachedSizes( items[static_cast<ptrdiff_t>(n)] = SortItem(&*it); } ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less()); - ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry; + ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry; for (size_type i = 0; i < n; i++) { entry.reset(fields_.NewEntryWrapper( items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second)); @@ -407,7 +401,7 @@ void Struct::SerializeWithCachedSizes( Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]); } } else { - ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry; + ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry; for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator it = this->fields().begin(); it != this->fields().end(); ++it) { @@ -454,7 +448,7 @@ void Struct::SerializeWithCachedSizes( if (deterministic && this->fields().size() > 1) { - ::google::protobuf::scoped_array<SortItem> items( + ::std::unique_ptr<SortItem[]> items( new SortItem[this->fields().size()]); typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::size_type size_type; size_type n = 0; @@ -464,7 +458,7 @@ void Struct::SerializeWithCachedSizes( items[static_cast<ptrdiff_t>(n)] = SortItem(&*it); } ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less()); - ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry; + ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry; for (size_type i = 0; i < n; i++) { entry.reset(fields_.NewEntryWrapper( items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second)); @@ -478,7 +472,7 @@ void Struct::SerializeWithCachedSizes( Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]); } } else { - ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry; + ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry; for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator it = this->fields().begin(); it != this->fields().end(); ++it) { @@ -517,7 +511,7 @@ size_t Struct::ByteSizeLong() const { total_size += 1 * ::google::protobuf::internal::FromIntSize(this->fields_size()); { - ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry; + ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry; for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator it = this->fields().begin(); it != this->fields().end(); ++it) { @@ -534,9 +528,7 @@ size_t Struct::ByteSizeLong() const { } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + SetCachedSize(cached_size); return total_size; } @@ -606,7 +598,6 @@ void Struct::InternalSwap(Struct* other) { using std::swap; fields_.Swap(&other->fields_); _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata Struct::GetMetadata() const { @@ -669,24 +660,22 @@ const int Value::kListValueFieldNumber; Value::Value() : ::google::protobuf::Message(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); - } + ::google::protobuf::internal::InitSCC( + &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Value) } Value::Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { - ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Value) } Value::Value(const Value& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), - _cached_size_(0) { + _internal_metadata_(NULL) { _internal_metadata_.MergeFrom(from._internal_metadata_); clear_has_kind(); switch (from.kind_case()) { @@ -723,7 +712,6 @@ Value::Value(const Value& from) void Value::SharedCtor() { clear_has_kind(); - _cached_size_ = 0; } Value::~Value() { @@ -745,9 +733,7 @@ void Value::ArenaDtor(void* object) { void Value::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void Value::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + _cached_size_.Set(size); } const ::google::protobuf::Descriptor* Value::descriptor() { ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); @@ -755,7 +741,7 @@ const ::google::protobuf::Descriptor* Value::descriptor() { } const Value& Value::default_instance() { - ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); return *internal_default_instance(); } @@ -816,7 +802,7 @@ bool Value::MergePartialFromCodedStream( ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.Value) for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + ::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)) { @@ -960,13 +946,13 @@ void Value::SerializeWithCachedSizes( // .google.protobuf.Struct struct_value = 5; if (has_struct_value()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 5, *kind_.struct_value_, output); + 5, this->_internal_struct_value(), output); } // .google.protobuf.ListValue list_value = 6; if (has_list_value()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 6, *kind_.list_value_, output); + 6, this->_internal_list_value(), output); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { @@ -1014,14 +1000,14 @@ void Value::SerializeWithCachedSizes( if (has_struct_value()) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageToArray( - 5, *kind_.struct_value_, deterministic, target); + 5, this->_internal_struct_value(), deterministic, target); } // .google.protobuf.ListValue list_value = 6; if (has_list_value()) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageToArray( - 6, *kind_.list_value_, deterministic, target); + 6, this->_internal_list_value(), deterministic, target); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { @@ -1084,9 +1070,7 @@ size_t Value::ByteSizeLong() const { } } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + SetCachedSize(cached_size); return total_size; } @@ -1185,7 +1169,6 @@ void Value::InternalSwap(Value* other) { swap(kind_, other->kind_); swap(_oneof_case_[0], other->_oneof_case_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata Value::GetMetadata() const { @@ -1204,9 +1187,8 @@ const int ListValue::kValuesFieldNumber; ListValue::ListValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); - } + ::google::protobuf::internal::InitSCC( + &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ListValue) } @@ -1214,7 +1196,7 @@ ListValue::ListValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), values_(arena) { - ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.ListValue) @@ -1222,14 +1204,12 @@ ListValue::ListValue(::google::protobuf::Arena* arena) ListValue::ListValue(const ListValue& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), - values_(from.values_), - _cached_size_(0) { + values_(from.values_) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:google.protobuf.ListValue) } void ListValue::SharedCtor() { - _cached_size_ = 0; } ListValue::~ListValue() { @@ -1248,9 +1228,7 @@ void ListValue::ArenaDtor(void* object) { void ListValue::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void ListValue::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + _cached_size_.Set(size); } const ::google::protobuf::Descriptor* ListValue::descriptor() { ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); @@ -1258,7 +1236,7 @@ const ::google::protobuf::Descriptor* ListValue::descriptor() { } const ListValue& ListValue::default_instance() { - ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); + ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); return *internal_default_instance(); } @@ -1279,7 +1257,7 @@ bool ListValue::MergePartialFromCodedStream( ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:google.protobuf.ListValue) for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + ::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)) { @@ -1381,9 +1359,7 @@ size_t ListValue::ByteSizeLong() const { } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + SetCachedSize(cached_size); return total_size; } @@ -1453,7 +1429,6 @@ void ListValue::InternalSwap(ListValue* other) { using std::swap; CastToBase(&values_)->InternalSwap(CastToBase(&other->values_)); _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata ListValue::GetMetadata() const { @@ -1467,16 +1442,16 @@ void ListValue::InternalSwap(ListValue* other) { } // namespace google namespace google { namespace protobuf { -template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Struct_FieldsEntry_DoNotUse* Arena::CreateMessage< ::google::protobuf::Struct_FieldsEntry_DoNotUse >(Arena* arena) { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Struct_FieldsEntry_DoNotUse* Arena::CreateMaybeMessage< ::google::protobuf::Struct_FieldsEntry_DoNotUse >(Arena* arena) { return Arena::CreateMessageInternal< ::google::protobuf::Struct_FieldsEntry_DoNotUse >(arena); } -template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Struct* Arena::CreateMessage< ::google::protobuf::Struct >(Arena* arena) { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Struct* Arena::CreateMaybeMessage< ::google::protobuf::Struct >(Arena* arena) { return Arena::CreateMessageInternal< ::google::protobuf::Struct >(arena); } -template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Value* Arena::CreateMessage< ::google::protobuf::Value >(Arena* arena) { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Value* Arena::CreateMaybeMessage< ::google::protobuf::Value >(Arena* arena) { return Arena::CreateMessageInternal< ::google::protobuf::Value >(arena); } -template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::ListValue* Arena::CreateMessage< ::google::protobuf::ListValue >(Arena* arena) { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::ListValue* Arena::CreateMaybeMessage< ::google::protobuf::ListValue >(Arena* arena) { return Arena::CreateMessageInternal< ::google::protobuf::ListValue >(arena); } } // namespace protobuf |