Auto-generate files after cl/528634293

pull/12630/head
Protobuf Team Bot 2 years ago
parent 80b0609666
commit b05012cccb
  1. 40
      src/google/protobuf/struct.pb.cc
  2. 33
      src/google/protobuf/struct.pb.h

@ -248,7 +248,8 @@ Struct::Struct(const Struct& from)
inline void Struct::SharedCtor(::_pb::Arena* arena) { inline void Struct::SharedCtor(::_pb::Arena* arena) {
(void)arena; (void)arena;
new (&_impl_) Impl_{ new (&_impl_) Impl_{
/*decltype(_impl_.fields_)*/{::_pbi::ArenaInitialized(), arena} /* decltype(_impl_.fields_) */ { ::PROTOBUF_NAMESPACE_ID::internal::ArenaInitialized(), arena }
, /*decltype(_impl_._cached_size_)*/{} , /*decltype(_impl_._cached_size_)*/{}
}; };
} }
@ -331,26 +332,26 @@ failure:
(void) cached_has_bits; (void) cached_has_bits;
// map<string, .google.protobuf.Value> fields = 1; // map<string, .google.protobuf.Value> fields = 1;
if (!this->_internal_fields().empty()) { if (!_internal_fields().empty()) {
using MapType = ::_pb::Map<std::string, ::PROTOBUF_NAMESPACE_ID::Value>; using MapType = ::PROTOBUF_NAMESPACE_ID::Map<std::string, ::PROTOBUF_NAMESPACE_ID::Value>;
using WireHelper = Struct_FieldsEntry_DoNotUse::Funcs; using WireHelper = Struct_FieldsEntry_DoNotUse::Funcs;
const auto& map_field = this->_internal_fields(); const auto& field = _internal_fields();
auto check_utf8 = [](const MapType::value_type& entry) {
(void)entry; if (stream->IsSerializationDeterministic() && field.size() > 1) {
for (const auto& entry : ::PROTOBUF_NAMESPACE_ID::internal::MapSorterPtr<MapType>(field)) {
target = WireHelper::InternalSerialize(
1, entry.first, entry.second, target, stream);
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
entry.first.data(), static_cast<int>(entry.first.length()), entry.first.data(), static_cast<int>(entry.first.length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "google.protobuf.Struct.fields"); ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "google.protobuf.Struct.fields");
};
if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
target = WireHelper::InternalSerialize(1, entry.first, entry.second, target, stream);
check_utf8(entry);
} }
} else { } else {
for (const auto& entry : map_field) { for (const auto& entry : field) {
target = WireHelper::InternalSerialize(1, entry.first, entry.second, target, stream); target = WireHelper::InternalSerialize(
check_utf8(entry); 1, entry.first, entry.second, target, stream);
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
entry.first.data(), static_cast<int>(entry.first.length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "google.protobuf.Struct.fields");
} }
} }
} }
@ -372,12 +373,9 @@ failure:
(void) cached_has_bits; (void) cached_has_bits;
// map<string, .google.protobuf.Value> fields = 1; // map<string, .google.protobuf.Value> fields = 1;
total_size += 1 * total_size += 1 * ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_internal_fields_size());
::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_fields_size()); for (const auto& entry : _internal_fields()) {
for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >::const_iterator total_size += Struct_FieldsEntry_DoNotUse::Funcs::ByteSizeLong(entry.first, entry.second);
it = this->_internal_fields().begin();
it != this->_internal_fields().end(); ++it) {
total_size += Struct_FieldsEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
} }
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);

@ -277,16 +277,14 @@ class PROTOBUF_EXPORT Struct final :
public: public:
void clear_fields() ; void clear_fields() ;
const ::PROTOBUF_NAMESPACE_ID::Map<std::string, ::PROTOBUF_NAMESPACE_ID::Value>& fields() const;
::PROTOBUF_NAMESPACE_ID::Map<std::string, ::PROTOBUF_NAMESPACE_ID::Value>* mutable_fields();
private: private:
const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >& const ::PROTOBUF_NAMESPACE_ID::Map<std::string, ::PROTOBUF_NAMESPACE_ID::Value>& _internal_fields() const;
_internal_fields() const; ::PROTOBUF_NAMESPACE_ID::Map<std::string, ::PROTOBUF_NAMESPACE_ID::Value>* _internal_mutable_fields();
::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >*
_internal_mutable_fields();
public: public:
const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >&
fields() const;
::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >*
mutable_fields();
// @@protoc_insertion_point(class_scope:google.protobuf.Struct) // @@protoc_insertion_point(class_scope:google.protobuf.Struct)
private: private:
class _Internal; class _Internal;
@ -295,11 +293,10 @@ class PROTOBUF_EXPORT Struct final :
typedef void InternalArenaConstructable_; typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_; typedef void DestructorSkippable_;
struct Impl_ { struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::MapField< ::PROTOBUF_NAMESPACE_ID::internal::MapField<Struct_FieldsEntry_DoNotUse, std::string, ::PROTOBUF_NAMESPACE_ID::Value,
Struct_FieldsEntry_DoNotUse,
std::string, ::PROTOBUF_NAMESPACE_ID::Value,
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> fields_; ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE>
fields_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
}; };
union { Impl_ _impl_; }; union { Impl_ _impl_; };
@ -765,21 +762,17 @@ inline int Struct::fields_size() const {
inline void Struct::clear_fields() { inline void Struct::clear_fields() {
_impl_.fields_.Clear(); _impl_.fields_.Clear();
} }
inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >& inline const ::PROTOBUF_NAMESPACE_ID::Map<std::string, ::PROTOBUF_NAMESPACE_ID::Value>& Struct::_internal_fields() const {
Struct::_internal_fields() const {
return _impl_.fields_.GetMap(); return _impl_.fields_.GetMap();
} }
inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >& inline const ::PROTOBUF_NAMESPACE_ID::Map<std::string, ::PROTOBUF_NAMESPACE_ID::Value>& Struct::fields() const {
Struct::fields() const {
// @@protoc_insertion_point(field_map:google.protobuf.Struct.fields) // @@protoc_insertion_point(field_map:google.protobuf.Struct.fields)
return _internal_fields(); return _internal_fields();
} }
inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >* inline ::PROTOBUF_NAMESPACE_ID::Map<std::string, ::PROTOBUF_NAMESPACE_ID::Value>* Struct::_internal_mutable_fields() {
Struct::_internal_mutable_fields() {
return _impl_.fields_.MutableMap(); return _impl_.fields_.MutableMap();
} }
inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >* inline ::PROTOBUF_NAMESPACE_ID::Map<std::string, ::PROTOBUF_NAMESPACE_ID::Value>* Struct::mutable_fields() {
Struct::mutable_fields() {
// @@protoc_insertion_point(field_mutable_map:google.protobuf.Struct.fields) // @@protoc_insertion_point(field_mutable_map:google.protobuf.Struct.fields)
return _internal_mutable_fields(); return _internal_mutable_fields();
} }

Loading…
Cancel
Save