diff --git a/src/protobuf/build_protobuf.ps1 b/src/protobuf/build_protobuf.ps1 index 414d0b9ce..383189988 100644 --- a/src/protobuf/build_protobuf.ps1 +++ b/src/protobuf/build_protobuf.ps1 @@ -1,5 +1,5 @@ -$protobuf_zip_name = "protobuf-all-3.19.1" -$protobuf = "protobuf-3.19.1" +$protobuf_zip_name = "protobuf-all-21.12" +$protobuf = "protobuf-21.12" $root = Resolve-Path "../.." $work = Join-Path $root "work" $src = Join-Path $root src @@ -8,6 +8,7 @@ Push-Location if (Test-Path $work) { Remove-Item -Force -Recurse $work } +New-Item -ItemType Directory -Path $work # clean Remove-Item $target\lib\debug\libproto*.* @@ -21,15 +22,21 @@ if (Test-Path $target\include\google) { } # expand -unzip -q $src\protobuf\$protobuf_zip_name -d $work +tar -xf $src\protobuf\$protobuf_zip_name.tar.gz -C $work # configure -$cmake_dir = "$work\$protobuf\cmake" +$cmake_dir = "$work\$protobuf" $build_dir = "$work\$protobuf\cmake\build" $install_dir = "$work\$protobuf\cmake\install" New-Item -ItemType Directory -Path $build_dir Set-Location $build_dir -cmake -DCMAKE_INSTALL_PREFIX=$install_dir -Dprotoubf_BUILD_TESTS=OFF -G "Visual Studio 16 2019" $cmake_dir +cmake ` + -DCMAKE_INSTALL_PREFIX="$install_dir" ` + -DCMAKE_CXX_FLAGS_DEBUG="/MTd /Zi /Ob0 /Od /RTC1" ` + -DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" ` + -Dprotoubf_BUILD_TESTS=OFF ` + -G "Visual Studio 17 2022" ` + "$cmake_dir" ## For Debug # build diff --git a/windows/bin/protobuf-net.Reflection.dll b/windows/bin/protobuf-net.Reflection.dll deleted file mode 100644 index e81623457..000000000 Binary files a/windows/bin/protobuf-net.Reflection.dll and /dev/null differ diff --git a/windows/bin/protobuf-net.dll b/windows/bin/protobuf-net.dll deleted file mode 100644 index 399d27c88..000000000 Binary files a/windows/bin/protobuf-net.dll and /dev/null differ diff --git a/windows/bin/protoc.exe b/windows/bin/protoc.exe index d87034025..c3dc563e4 100755 Binary files a/windows/bin/protoc.exe and b/windows/bin/protoc.exe differ diff --git a/windows/bin/protogen.exe b/windows/bin/protogen.exe deleted file mode 100644 index 3ee6c4837..000000000 Binary files a/windows/bin/protogen.exe and /dev/null differ diff --git a/windows/include/google/protobuf/any.h b/windows/include/google/protobuf/any.h index e8336fa14..92ea2bb2c 100644 --- a/windows/include/google/protobuf/any.h +++ b/windows/include/google/protobuf/any.h @@ -37,6 +37,7 @@ #include #include +// Must be included last. #include namespace google { @@ -129,8 +130,8 @@ class PROTOBUF_EXPORT AnyMetadata { // *full_type_name. Returns false if the type_url does not have a "/" // in the type url separating the full type name. // -// NOTE: this function is available publicly as: -// google::protobuf::Any() // static method on the generated message type. +// NOTE: this function is available publicly as a static method on the +// generated message type: google::protobuf::Any::ParseAnyTypeUrl() bool ParseAnyTypeUrl(StringPiece type_url, std::string* full_type_name); // Get the proto type name and prefix from Any::type_url value. For example, diff --git a/windows/include/google/protobuf/any.pb.h b/windows/include/google/protobuf/any.pb.h index ab07cc70d..2c0605267 100644 --- a/windows/include/google/protobuf/any.pb.h +++ b/windows/include/google/protobuf/any.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -42,14 +41,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fany_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto; @@ -70,7 +61,7 @@ class PROTOBUF_EXPORT Any final : public: inline Any() : Any(nullptr) {} ~Any() override; - explicit constexpr Any(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Any(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Any(const Any& from); Any(Any&& from) noexcept @@ -118,14 +109,16 @@ class PROTOBUF_EXPORT Any final : // implements Any ----------------------------------------------- bool PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message) { - return _any_metadata_.PackFrom(GetArena(), message); + GOOGLE_DCHECK_NE(&message, this); + return _impl_._any_metadata_.PackFrom(GetArena(), message); } bool PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message, ::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url_prefix) { - return _any_metadata_.PackFrom(GetArena(), message, type_url_prefix); + GOOGLE_DCHECK_NE(&message, this); + return _impl_._any_metadata_.PackFrom(GetArena(), message, type_url_prefix); } bool UnpackTo(::PROTOBUF_NAMESPACE_ID::Message* message) const { - return _any_metadata_.UnpackTo(message); + return _impl_._any_metadata_.UnpackTo(message); } static bool GetAnyFieldDescriptors( const ::PROTOBUF_NAMESPACE_ID::Message& message, @@ -133,18 +126,18 @@ class PROTOBUF_EXPORT Any final : const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** value_field); template ::value>::type> bool PackFrom(const T& message) { - return _any_metadata_.PackFrom(GetArena(), message); + return _impl_._any_metadata_.PackFrom(GetArena(), message); } template ::value>::type> bool PackFrom(const T& message, ::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url_prefix) { - return _any_metadata_.PackFrom(GetArena(), message, type_url_prefix);} + return _impl_._any_metadata_.PackFrom(GetArena(), message, type_url_prefix);} template ::value>::type> bool UnpackTo(T* message) const { - return _any_metadata_.UnpackTo(message); + return _impl_._any_metadata_.UnpackTo(message); } template bool Is() const { - return _any_metadata_.Is(); + return _impl_._any_metadata_.Is(); } static bool ParseAnyTypeUrl(::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url, std::string* full_type_name); @@ -178,9 +171,11 @@ class PROTOBUF_EXPORT Any final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Any& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Any& from); + void MergeFrom( const Any& from) { + Any::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -189,10 +184,10 @@ class PROTOBUF_EXPORT Any final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Any* other); @@ -205,9 +200,6 @@ class PROTOBUF_EXPORT Any final : protected: explicit Any(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -258,10 +250,13 @@ class PROTOBUF_EXPORT Any final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_url_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata _any_metadata_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_url_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata _any_metadata_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fany_2eproto; }; // =================================================================== @@ -277,7 +272,7 @@ class PROTOBUF_EXPORT Any final : // string type_url = 1; inline void Any::clear_type_url() { - type_url_.ClearToEmpty(); + _impl_.type_url_.ClearToEmpty(); } inline const std::string& Any::type_url() const { // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url) @@ -287,7 +282,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Any::set_type_url(ArgT0&& arg0, ArgT... args) { - type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.type_url_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url) } inline std::string* Any::mutable_type_url() { @@ -296,19 +291,19 @@ inline std::string* Any::mutable_type_url() { return _s; } inline const std::string& Any::_internal_type_url() const { - return type_url_.Get(); + return _impl_.type_url_.Get(); } inline void Any::_internal_set_type_url(const std::string& value) { - type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.type_url_.Set(value, GetArenaForAllocation()); } inline std::string* Any::_internal_mutable_type_url() { - return type_url_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.type_url_.Mutable(GetArenaForAllocation()); } inline std::string* Any::release_type_url() { // @@protoc_insertion_point(field_release:google.protobuf.Any.type_url) - return type_url_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.type_url_.Release(); } inline void Any::set_allocated_type_url(std::string* type_url) { if (type_url != nullptr) { @@ -316,11 +311,10 @@ inline void Any::set_allocated_type_url(std::string* type_url) { } else { } - type_url_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type_url, - GetArenaForAllocation()); + _impl_.type_url_.SetAllocated(type_url, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (type_url_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.type_url_.IsDefault()) { + _impl_.type_url_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url) @@ -328,7 +322,7 @@ inline void Any::set_allocated_type_url(std::string* type_url) { // bytes value = 2; inline void Any::clear_value() { - value_.ClearToEmpty(); + _impl_.value_.ClearToEmpty(); } inline const std::string& Any::value() const { // @@protoc_insertion_point(field_get:google.protobuf.Any.value) @@ -338,7 +332,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Any::set_value(ArgT0&& arg0, ArgT... args) { - value_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.value_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Any.value) } inline std::string* Any::mutable_value() { @@ -347,19 +341,19 @@ inline std::string* Any::mutable_value() { return _s; } inline const std::string& Any::_internal_value() const { - return value_.Get(); + return _impl_.value_.Get(); } inline void Any::_internal_set_value(const std::string& value) { - value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.value_.Set(value, GetArenaForAllocation()); } inline std::string* Any::_internal_mutable_value() { - return value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.value_.Mutable(GetArenaForAllocation()); } inline std::string* Any::release_value() { // @@protoc_insertion_point(field_release:google.protobuf.Any.value) - return value_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.value_.Release(); } inline void Any::set_allocated_value(std::string* value) { if (value != nullptr) { @@ -367,11 +361,10 @@ inline void Any::set_allocated_value(std::string* value) { } else { } - value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, - GetArenaForAllocation()); + _impl_.value_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.value_.IsDefault()) { + _impl_.value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value) diff --git a/windows/include/google/protobuf/any.proto b/windows/include/google/protobuf/any.proto index 6ed8a23cf..e2c2042fd 100644 --- a/windows/include/google/protobuf/any.proto +++ b/windows/include/google/protobuf/any.proto @@ -64,7 +64,7 @@ option objc_class_prefix = "GPB"; // foo = any.unpack(Foo.class); // } // -// Example 3: Pack and unpack a message in Python. +// Example 3: Pack and unpack a message in Python. // // foo = Foo(...) // any = Any() @@ -74,7 +74,7 @@ option objc_class_prefix = "GPB"; // any.Unpack(foo) // ... // -// Example 4: Pack and unpack a message in Go +// Example 4: Pack and unpack a message in Go // // foo := &pb.Foo{...} // any, err := anypb.New(foo) @@ -95,7 +95,7 @@ option objc_class_prefix = "GPB"; // // // JSON -// ==== +// // The JSON representation of an `Any` value uses the regular // representation of the deserialized, embedded message, with an // additional field `@type` which contains the type URL. Example: diff --git a/windows/include/google/protobuf/api.pb.h b/windows/include/google/protobuf/api.pb.h index 26e1946f8..2c4548920 100644 --- a/windows/include/google/protobuf/api.pb.h +++ b/windows/include/google/protobuf/api.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -44,14 +43,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fapi_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fapi_2eproto; @@ -80,7 +71,7 @@ class PROTOBUF_EXPORT Api final : public: inline Api() : Api(nullptr) {} ~Api() override; - explicit constexpr Api(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Api(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Api(const Api& from); Api(Api&& from) noexcept @@ -155,9 +146,11 @@ class PROTOBUF_EXPORT Api final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Api& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Api& from); + void MergeFrom( const Api& from) { + Api::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -166,10 +159,10 @@ class PROTOBUF_EXPORT Api final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Api* other); @@ -182,9 +175,6 @@ class PROTOBUF_EXPORT Api final : protected: explicit Api(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -321,14 +311,17 @@ class PROTOBUF_EXPORT Api final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Method > methods_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Mixin > mixins_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr version_; - ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context_; - int syntax_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Method > methods_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Mixin > mixins_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr version_; + ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context_; + int syntax_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto; }; // ------------------------------------------------------------------- @@ -338,7 +331,7 @@ class PROTOBUF_EXPORT Method final : public: inline Method() : Method(nullptr) {} ~Method() override; - explicit constexpr Method(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Method(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Method(const Method& from); Method(Method&& from) noexcept @@ -413,9 +406,11 @@ class PROTOBUF_EXPORT Method final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Method& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Method& from); + void MergeFrom( const Method& from) { + Method::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -424,10 +419,10 @@ class PROTOBUF_EXPORT Method final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Method* other); @@ -440,9 +435,6 @@ class PROTOBUF_EXPORT Method final : protected: explicit Method(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -557,14 +549,17 @@ class PROTOBUF_EXPORT Method final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr request_type_url_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr response_type_url_; - bool request_streaming_; - bool response_streaming_; - int syntax_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr request_type_url_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr response_type_url_; + bool request_streaming_; + bool response_streaming_; + int syntax_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto; }; // ------------------------------------------------------------------- @@ -574,7 +569,7 @@ class PROTOBUF_EXPORT Mixin final : public: inline Mixin() : Mixin(nullptr) {} ~Mixin() override; - explicit constexpr Mixin(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Mixin(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Mixin(const Mixin& from); Mixin(Mixin&& from) noexcept @@ -649,9 +644,11 @@ class PROTOBUF_EXPORT Mixin final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Mixin& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Mixin& from); + void MergeFrom( const Mixin& from) { + Mixin::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -660,10 +657,10 @@ class PROTOBUF_EXPORT Mixin final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Mixin* other); @@ -676,9 +673,6 @@ class PROTOBUF_EXPORT Mixin final : protected: explicit Mixin(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -729,9 +723,12 @@ class PROTOBUF_EXPORT Mixin final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr root_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr root_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto; }; // =================================================================== @@ -747,7 +744,7 @@ class PROTOBUF_EXPORT Mixin final : // string name = 1; inline void Api::clear_name() { - name_.ClearToEmpty(); + _impl_.name_.ClearToEmpty(); } inline const std::string& Api::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Api.name) @@ -757,7 +754,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Api::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Api.name) } inline std::string* Api::mutable_name() { @@ -766,19 +763,19 @@ inline std::string* Api::mutable_name() { return _s; } inline const std::string& Api::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void Api::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* Api::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* Api::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Api.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.name_.Release(); } inline void Api::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -786,11 +783,10 @@ inline void Api::set_allocated_name(std::string* name) { } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.name) @@ -798,32 +794,32 @@ inline void Api::set_allocated_name(std::string* name) { // repeated .google.protobuf.Method methods = 2; inline int Api::_internal_methods_size() const { - return methods_.size(); + return _impl_.methods_.size(); } inline int Api::methods_size() const { return _internal_methods_size(); } inline void Api::clear_methods() { - methods_.Clear(); + _impl_.methods_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::Method* Api::mutable_methods(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Api.methods) - return methods_.Mutable(index); + return _impl_.methods_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Method >* Api::mutable_methods() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.methods) - return &methods_; + return &_impl_.methods_; } inline const ::PROTOBUF_NAMESPACE_ID::Method& Api::_internal_methods(int index) const { - return methods_.Get(index); + return _impl_.methods_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::Method& Api::methods(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Api.methods) return _internal_methods(index); } inline ::PROTOBUF_NAMESPACE_ID::Method* Api::_internal_add_methods() { - return methods_.Add(); + return _impl_.methods_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::Method* Api::add_methods() { ::PROTOBUF_NAMESPACE_ID::Method* _add = _internal_add_methods(); @@ -833,34 +829,34 @@ inline ::PROTOBUF_NAMESPACE_ID::Method* Api::add_methods() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Method >& Api::methods() const { // @@protoc_insertion_point(field_list:google.protobuf.Api.methods) - return methods_; + return _impl_.methods_; } // repeated .google.protobuf.Option options = 3; inline int Api::_internal_options_size() const { - return options_.size(); + return _impl_.options_.size(); } inline int Api::options_size() const { return _internal_options_size(); } inline ::PROTOBUF_NAMESPACE_ID::Option* Api::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Api.options) - return options_.Mutable(index); + return _impl_.options_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >* Api::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.options) - return &options_; + return &_impl_.options_; } inline const ::PROTOBUF_NAMESPACE_ID::Option& Api::_internal_options(int index) const { - return options_.Get(index); + return _impl_.options_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::Option& Api::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Api.options) return _internal_options(index); } inline ::PROTOBUF_NAMESPACE_ID::Option* Api::_internal_add_options() { - return options_.Add(); + return _impl_.options_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::Option* Api::add_options() { ::PROTOBUF_NAMESPACE_ID::Option* _add = _internal_add_options(); @@ -870,12 +866,12 @@ inline ::PROTOBUF_NAMESPACE_ID::Option* Api::add_options() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >& Api::options() const { // @@protoc_insertion_point(field_list:google.protobuf.Api.options) - return options_; + return _impl_.options_; } // string version = 4; inline void Api::clear_version() { - version_.ClearToEmpty(); + _impl_.version_.ClearToEmpty(); } inline const std::string& Api::version() const { // @@protoc_insertion_point(field_get:google.protobuf.Api.version) @@ -885,7 +881,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Api::set_version(ArgT0&& arg0, ArgT... args) { - version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.version_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Api.version) } inline std::string* Api::mutable_version() { @@ -894,19 +890,19 @@ inline std::string* Api::mutable_version() { return _s; } inline const std::string& Api::_internal_version() const { - return version_.Get(); + return _impl_.version_.Get(); } inline void Api::_internal_set_version(const std::string& value) { - version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.version_.Set(value, GetArenaForAllocation()); } inline std::string* Api::_internal_mutable_version() { - return version_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.version_.Mutable(GetArenaForAllocation()); } inline std::string* Api::release_version() { // @@protoc_insertion_point(field_release:google.protobuf.Api.version) - return version_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.version_.Release(); } inline void Api::set_allocated_version(std::string* version) { if (version != nullptr) { @@ -914,11 +910,10 @@ inline void Api::set_allocated_version(std::string* version) { } else { } - version_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), version, - GetArenaForAllocation()); + _impl_.version_.SetAllocated(version, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (version_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.version_.IsDefault()) { + _impl_.version_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.version) @@ -926,13 +921,13 @@ inline void Api::set_allocated_version(std::string* version) { // .google.protobuf.SourceContext source_context = 5; inline bool Api::_internal_has_source_context() const { - return this != internal_default_instance() && source_context_ != nullptr; + return this != internal_default_instance() && _impl_.source_context_ != nullptr; } inline bool Api::has_source_context() const { return _internal_has_source_context(); } inline const ::PROTOBUF_NAMESPACE_ID::SourceContext& Api::_internal_source_context() const { - const ::PROTOBUF_NAMESPACE_ID::SourceContext* p = source_context_; + const ::PROTOBUF_NAMESPACE_ID::SourceContext* p = _impl_.source_context_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_SourceContext_default_instance_); } @@ -943,9 +938,9 @@ inline const ::PROTOBUF_NAMESPACE_ID::SourceContext& Api::source_context() const inline void Api::unsafe_arena_set_allocated_source_context( ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.source_context_); } - source_context_ = source_context; + _impl_.source_context_ = source_context; if (source_context) { } else { @@ -955,8 +950,8 @@ inline void Api::unsafe_arena_set_allocated_source_context( } inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::release_source_context() { - ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_; - source_context_ = nullptr; + ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = _impl_.source_context_; + _impl_.source_context_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -971,17 +966,17 @@ inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::release_source_context() { inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::unsafe_arena_release_source_context() { // @@protoc_insertion_point(field_release:google.protobuf.Api.source_context) - ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_; - source_context_ = nullptr; + ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = _impl_.source_context_; + _impl_.source_context_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::_internal_mutable_source_context() { - if (source_context_ == nullptr) { + if (_impl_.source_context_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceContext>(GetArenaForAllocation()); - source_context_ = p; + _impl_.source_context_ = p; } - return source_context_; + return _impl_.source_context_; } inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::mutable_source_context() { ::PROTOBUF_NAMESPACE_ID::SourceContext* _msg = _internal_mutable_source_context(); @@ -991,12 +986,11 @@ inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::mutable_source_context() { inline void Api::set_allocated_source_context(::PROTOBUF_NAMESPACE_ID::SourceContext* source_context) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_); + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.source_context_); } if (source_context) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context)); if (message_arena != submessage_arena) { source_context = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -1006,38 +1000,38 @@ inline void Api::set_allocated_source_context(::PROTOBUF_NAMESPACE_ID::SourceCon } else { } - source_context_ = source_context; + _impl_.source_context_ = source_context; // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.source_context) } // repeated .google.protobuf.Mixin mixins = 6; inline int Api::_internal_mixins_size() const { - return mixins_.size(); + return _impl_.mixins_.size(); } inline int Api::mixins_size() const { return _internal_mixins_size(); } inline void Api::clear_mixins() { - mixins_.Clear(); + _impl_.mixins_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::Mixin* Api::mutable_mixins(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Api.mixins) - return mixins_.Mutable(index); + return _impl_.mixins_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Mixin >* Api::mutable_mixins() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.mixins) - return &mixins_; + return &_impl_.mixins_; } inline const ::PROTOBUF_NAMESPACE_ID::Mixin& Api::_internal_mixins(int index) const { - return mixins_.Get(index); + return _impl_.mixins_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::Mixin& Api::mixins(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Api.mixins) return _internal_mixins(index); } inline ::PROTOBUF_NAMESPACE_ID::Mixin* Api::_internal_add_mixins() { - return mixins_.Add(); + return _impl_.mixins_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::Mixin* Api::add_mixins() { ::PROTOBUF_NAMESPACE_ID::Mixin* _add = _internal_add_mixins(); @@ -1047,15 +1041,15 @@ inline ::PROTOBUF_NAMESPACE_ID::Mixin* Api::add_mixins() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Mixin >& Api::mixins() const { // @@protoc_insertion_point(field_list:google.protobuf.Api.mixins) - return mixins_; + return _impl_.mixins_; } // .google.protobuf.Syntax syntax = 7; inline void Api::clear_syntax() { - syntax_ = 0; + _impl_.syntax_ = 0; } inline ::PROTOBUF_NAMESPACE_ID::Syntax Api::_internal_syntax() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::Syntax >(syntax_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::Syntax >(_impl_.syntax_); } inline ::PROTOBUF_NAMESPACE_ID::Syntax Api::syntax() const { // @@protoc_insertion_point(field_get:google.protobuf.Api.syntax) @@ -1063,7 +1057,7 @@ inline ::PROTOBUF_NAMESPACE_ID::Syntax Api::syntax() const { } inline void Api::_internal_set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { - syntax_ = value; + _impl_.syntax_ = value; } inline void Api::set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { _internal_set_syntax(value); @@ -1076,7 +1070,7 @@ inline void Api::set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { // string name = 1; inline void Method::clear_name() { - name_.ClearToEmpty(); + _impl_.name_.ClearToEmpty(); } inline const std::string& Method::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Method.name) @@ -1086,7 +1080,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Method::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Method.name) } inline std::string* Method::mutable_name() { @@ -1095,19 +1089,19 @@ inline std::string* Method::mutable_name() { return _s; } inline const std::string& Method::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void Method::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* Method::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* Method::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Method.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.name_.Release(); } inline void Method::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -1115,11 +1109,10 @@ inline void Method::set_allocated_name(std::string* name) { } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.name) @@ -1127,7 +1120,7 @@ inline void Method::set_allocated_name(std::string* name) { // string request_type_url = 2; inline void Method::clear_request_type_url() { - request_type_url_.ClearToEmpty(); + _impl_.request_type_url_.ClearToEmpty(); } inline const std::string& Method::request_type_url() const { // @@protoc_insertion_point(field_get:google.protobuf.Method.request_type_url) @@ -1137,7 +1130,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Method::set_request_type_url(ArgT0&& arg0, ArgT... args) { - request_type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.request_type_url_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Method.request_type_url) } inline std::string* Method::mutable_request_type_url() { @@ -1146,19 +1139,19 @@ inline std::string* Method::mutable_request_type_url() { return _s; } inline const std::string& Method::_internal_request_type_url() const { - return request_type_url_.Get(); + return _impl_.request_type_url_.Get(); } inline void Method::_internal_set_request_type_url(const std::string& value) { - request_type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.request_type_url_.Set(value, GetArenaForAllocation()); } inline std::string* Method::_internal_mutable_request_type_url() { - return request_type_url_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.request_type_url_.Mutable(GetArenaForAllocation()); } inline std::string* Method::release_request_type_url() { // @@protoc_insertion_point(field_release:google.protobuf.Method.request_type_url) - return request_type_url_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.request_type_url_.Release(); } inline void Method::set_allocated_request_type_url(std::string* request_type_url) { if (request_type_url != nullptr) { @@ -1166,11 +1159,10 @@ inline void Method::set_allocated_request_type_url(std::string* request_type_url } else { } - request_type_url_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), request_type_url, - GetArenaForAllocation()); + _impl_.request_type_url_.SetAllocated(request_type_url, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (request_type_url_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - request_type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.request_type_url_.IsDefault()) { + _impl_.request_type_url_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.request_type_url) @@ -1178,10 +1170,10 @@ inline void Method::set_allocated_request_type_url(std::string* request_type_url // bool request_streaming = 3; inline void Method::clear_request_streaming() { - request_streaming_ = false; + _impl_.request_streaming_ = false; } inline bool Method::_internal_request_streaming() const { - return request_streaming_; + return _impl_.request_streaming_; } inline bool Method::request_streaming() const { // @@protoc_insertion_point(field_get:google.protobuf.Method.request_streaming) @@ -1189,7 +1181,7 @@ inline bool Method::request_streaming() const { } inline void Method::_internal_set_request_streaming(bool value) { - request_streaming_ = value; + _impl_.request_streaming_ = value; } inline void Method::set_request_streaming(bool value) { _internal_set_request_streaming(value); @@ -1198,7 +1190,7 @@ inline void Method::set_request_streaming(bool value) { // string response_type_url = 4; inline void Method::clear_response_type_url() { - response_type_url_.ClearToEmpty(); + _impl_.response_type_url_.ClearToEmpty(); } inline const std::string& Method::response_type_url() const { // @@protoc_insertion_point(field_get:google.protobuf.Method.response_type_url) @@ -1208,7 +1200,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Method::set_response_type_url(ArgT0&& arg0, ArgT... args) { - response_type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.response_type_url_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Method.response_type_url) } inline std::string* Method::mutable_response_type_url() { @@ -1217,19 +1209,19 @@ inline std::string* Method::mutable_response_type_url() { return _s; } inline const std::string& Method::_internal_response_type_url() const { - return response_type_url_.Get(); + return _impl_.response_type_url_.Get(); } inline void Method::_internal_set_response_type_url(const std::string& value) { - response_type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.response_type_url_.Set(value, GetArenaForAllocation()); } inline std::string* Method::_internal_mutable_response_type_url() { - return response_type_url_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.response_type_url_.Mutable(GetArenaForAllocation()); } inline std::string* Method::release_response_type_url() { // @@protoc_insertion_point(field_release:google.protobuf.Method.response_type_url) - return response_type_url_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.response_type_url_.Release(); } inline void Method::set_allocated_response_type_url(std::string* response_type_url) { if (response_type_url != nullptr) { @@ -1237,11 +1229,10 @@ inline void Method::set_allocated_response_type_url(std::string* response_type_u } else { } - response_type_url_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), response_type_url, - GetArenaForAllocation()); + _impl_.response_type_url_.SetAllocated(response_type_url, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (response_type_url_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - response_type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.response_type_url_.IsDefault()) { + _impl_.response_type_url_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.response_type_url) @@ -1249,10 +1240,10 @@ inline void Method::set_allocated_response_type_url(std::string* response_type_u // bool response_streaming = 5; inline void Method::clear_response_streaming() { - response_streaming_ = false; + _impl_.response_streaming_ = false; } inline bool Method::_internal_response_streaming() const { - return response_streaming_; + return _impl_.response_streaming_; } inline bool Method::response_streaming() const { // @@protoc_insertion_point(field_get:google.protobuf.Method.response_streaming) @@ -1260,7 +1251,7 @@ inline bool Method::response_streaming() const { } inline void Method::_internal_set_response_streaming(bool value) { - response_streaming_ = value; + _impl_.response_streaming_ = value; } inline void Method::set_response_streaming(bool value) { _internal_set_response_streaming(value); @@ -1269,29 +1260,29 @@ inline void Method::set_response_streaming(bool value) { // repeated .google.protobuf.Option options = 6; inline int Method::_internal_options_size() const { - return options_.size(); + return _impl_.options_.size(); } inline int Method::options_size() const { return _internal_options_size(); } inline ::PROTOBUF_NAMESPACE_ID::Option* Method::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Method.options) - return options_.Mutable(index); + return _impl_.options_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >* Method::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Method.options) - return &options_; + return &_impl_.options_; } inline const ::PROTOBUF_NAMESPACE_ID::Option& Method::_internal_options(int index) const { - return options_.Get(index); + return _impl_.options_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::Option& Method::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Method.options) return _internal_options(index); } inline ::PROTOBUF_NAMESPACE_ID::Option* Method::_internal_add_options() { - return options_.Add(); + return _impl_.options_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::Option* Method::add_options() { ::PROTOBUF_NAMESPACE_ID::Option* _add = _internal_add_options(); @@ -1301,15 +1292,15 @@ inline ::PROTOBUF_NAMESPACE_ID::Option* Method::add_options() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >& Method::options() const { // @@protoc_insertion_point(field_list:google.protobuf.Method.options) - return options_; + return _impl_.options_; } // .google.protobuf.Syntax syntax = 7; inline void Method::clear_syntax() { - syntax_ = 0; + _impl_.syntax_ = 0; } inline ::PROTOBUF_NAMESPACE_ID::Syntax Method::_internal_syntax() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::Syntax >(syntax_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::Syntax >(_impl_.syntax_); } inline ::PROTOBUF_NAMESPACE_ID::Syntax Method::syntax() const { // @@protoc_insertion_point(field_get:google.protobuf.Method.syntax) @@ -1317,7 +1308,7 @@ inline ::PROTOBUF_NAMESPACE_ID::Syntax Method::syntax() const { } inline void Method::_internal_set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { - syntax_ = value; + _impl_.syntax_ = value; } inline void Method::set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { _internal_set_syntax(value); @@ -1330,7 +1321,7 @@ inline void Method::set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { // string name = 1; inline void Mixin::clear_name() { - name_.ClearToEmpty(); + _impl_.name_.ClearToEmpty(); } inline const std::string& Mixin::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Mixin.name) @@ -1340,7 +1331,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Mixin::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Mixin.name) } inline std::string* Mixin::mutable_name() { @@ -1349,19 +1340,19 @@ inline std::string* Mixin::mutable_name() { return _s; } inline const std::string& Mixin::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void Mixin::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* Mixin::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* Mixin::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Mixin.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.name_.Release(); } inline void Mixin::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -1369,11 +1360,10 @@ inline void Mixin::set_allocated_name(std::string* name) { } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.name) @@ -1381,7 +1371,7 @@ inline void Mixin::set_allocated_name(std::string* name) { // string root = 2; inline void Mixin::clear_root() { - root_.ClearToEmpty(); + _impl_.root_.ClearToEmpty(); } inline const std::string& Mixin::root() const { // @@protoc_insertion_point(field_get:google.protobuf.Mixin.root) @@ -1391,7 +1381,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Mixin::set_root(ArgT0&& arg0, ArgT... args) { - root_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.root_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Mixin.root) } inline std::string* Mixin::mutable_root() { @@ -1400,19 +1390,19 @@ inline std::string* Mixin::mutable_root() { return _s; } inline const std::string& Mixin::_internal_root() const { - return root_.Get(); + return _impl_.root_.Get(); } inline void Mixin::_internal_set_root(const std::string& value) { - root_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.root_.Set(value, GetArenaForAllocation()); } inline std::string* Mixin::_internal_mutable_root() { - return root_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.root_.Mutable(GetArenaForAllocation()); } inline std::string* Mixin::release_root() { // @@protoc_insertion_point(field_release:google.protobuf.Mixin.root) - return root_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.root_.Release(); } inline void Mixin::set_allocated_root(std::string* root) { if (root != nullptr) { @@ -1420,11 +1410,10 @@ inline void Mixin::set_allocated_root(std::string* root) { } else { } - root_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), root, - GetArenaForAllocation()); + _impl_.root_.SetAllocated(root, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (root_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - root_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.root_.IsDefault()) { + _impl_.root_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.root) diff --git a/windows/include/google/protobuf/arena.h b/windows/include/google/protobuf/arena.h index 6dd6467f5..3b5f16c38 100644 --- a/windows/include/google/protobuf/arena.h +++ b/windows/include/google/protobuf/arena.h @@ -37,9 +37,6 @@ #include #include #include -#ifdef max -#undef max // Visual Studio defines this macro -#endif #if defined(_MSC_VER) && !defined(_LIBCPP_STD_VER) && !_HAS_EXCEPTIONS // Work around bugs in MSVC header when _HAS_EXCEPTIONS=0. #include @@ -55,6 +52,7 @@ using type_info = ::type_info; #include #include +// Must be included last. #include #ifdef SWIG @@ -83,10 +81,11 @@ class ReflectionTester; // defined in test_util.h namespace internal { -struct ArenaStringPtr; // defined in arenastring.h -class InlinedStringField; // defined in inlined_string_field.h -class LazyField; // defined in lazy_field.h -class EpsCopyInputStream; // defined in parse_context.h +struct ArenaTestPeer; // defined in arena_test_util.h +class InternalMetadata; // defined in metadata_lite.h +class LazyField; // defined in lazy_field.h +class EpsCopyInputStream; // defined in parse_context.h +class RepeatedPtrFieldBase; // defined in repeated_ptr_field.h template class GenericTypeHandler; // defined in repeated_field.h @@ -316,6 +315,20 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { static_cast(args)...); } + // Allocates memory with the specific size and alignment. + void* AllocateAligned(size_t size, size_t align = 8) { + if (align <= 8) { + return AllocateAlignedNoHook(internal::AlignUpTo8(size)); + } else { + // We are wasting space by over allocating align - 8 bytes. Compared + // to a dedicated function that takes current alignment in consideration. + // Such a scheme would only waste (align - 8)/2 bytes on average, but + // requires a dedicated function in the outline arena allocation + // functions. Possibly re-evaluate tradeoffs later. + return internal::AlignTo(AllocateAlignedNoHook(size + align - 8), align); + } + } + // Create an array of object type T on the arena *without* invoking the // constructor of T. If `arena` is null, then the return value should be freed // with `delete[] x;` (or `::operator delete[](x);`). @@ -397,27 +410,12 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { template class InternalHelper { - public: + private: // Provides access to protected GetOwningArena to generated messages. static Arena* GetOwningArena(const T* p) { return p->GetOwningArena(); } - // Provides access to protected GetArenaForAllocation to generated messages. - static Arena* GetArenaForAllocation(const T* p) { - return GetArenaForAllocationInternal( - p, std::is_convertible()); - } + static void InternalSwap(T* a, T* b) { a->InternalSwap(b); } - // Creates message-owned arena. - static Arena* CreateMessageOwnedArena() { - return new Arena(internal::MessageOwned{}); - } - - // Checks whether the given arena is message-owned. - static bool IsMessageOwnedArena(Arena* arena) { - return arena->IsMessageOwned(); - } - - private: static Arena* GetArenaForAllocationInternal( const T* p, std::true_type /*is_derived_from*/) { return p->GetArenaForAllocation(); @@ -500,6 +498,29 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { friend class TestUtil::ReflectionTester; }; + // Provides access to protected GetOwningArena to generated messages. For + // internal use only. + template + static Arena* InternalGetOwningArena(const T* p) { + return InternalHelper::GetOwningArena(p); + } + + // Provides access to protected GetArenaForAllocation to generated messages. + // For internal use only. + template + static Arena* InternalGetArenaForAllocation(const T* p) { + return InternalHelper::GetArenaForAllocationInternal( + p, std::is_convertible()); + } + + // Creates message-owned arena. For internal use only. + static Arena* InternalCreateMessageOwnedArena() { + return new Arena(internal::MessageOwned{}); + } + + // Checks whether this arena is message-owned. For internal use only. + bool InternalIsMessageOwnedArena() { return IsMessageOwned(); } + // Helper typetraits that indicates support for arenas in a type T at compile // time. This is public only to allow construction of higher-level templated // utilities. @@ -532,6 +553,10 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { return impl_.IsMessageOwned(); } + void ReturnArrayMemory(void* p, size_t size) { + impl_.ReturnArrayMemory(p, size); + } + template PROTOBUF_NDEBUG_INLINE static T* CreateMessageInternal(Arena* arena, Args&&... args) { @@ -622,7 +647,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { // 8 AlignUpTo can be elided. const size_t n = sizeof(T) * num_elements; return static_cast( - AllocateAlignedWithHook(n, alignof(T), RTTI_TYPE_ID(T))); + AllocateAlignedWithHookForArray(n, alignof(T), RTTI_TYPE_ID(T))); } template @@ -765,17 +790,18 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { return nullptr; } - // For friends of arena. - void* AllocateAligned(size_t n, size_t align = 8) { + void* AllocateAlignedWithHookForArray(size_t n, size_t align, + const std::type_info* type) { if (align <= 8) { - return AllocateAlignedNoHook(internal::AlignUpTo8(n)); + return AllocateAlignedWithHookForArray(internal::AlignUpTo8(n), type); } else { // We are wasting space by over allocating align - 8 bytes. Compared // to a dedicated function that takes current alignment in consideration. // Such a scheme would only waste (align - 8)/2 bytes on average, but // requires a dedicated function in the outline arena allocation // functions. Possibly re-evaluate tradeoffs later. - return internal::AlignTo(AllocateAlignedNoHook(n + align - 8), align); + return internal::AlignTo( + AllocateAlignedWithHookForArray(n + align - 8, type), align); } } @@ -786,7 +812,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { } else { // We are wasting space by over allocating align - 8 bytes. Compared // to a dedicated function that takes current alignment in consideration. - // Such a schemee would only waste (align - 8)/2 bytes on average, but + // Such a scheme would only waste (align - 8)/2 bytes on average, but // requires a dedicated function in the outline arena allocation // functions. Possibly re-evaluate tradeoffs later. return internal::AlignTo(AllocateAlignedWithHook(n + align - 8, type), @@ -796,18 +822,22 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { void* AllocateAlignedNoHook(size_t n); void* AllocateAlignedWithHook(size_t n, const std::type_info* type); + void* AllocateAlignedWithHookForArray(size_t n, const std::type_info* type); std::pair AllocateAlignedWithCleanup(size_t n, const std::type_info* type); template friend class internal::GenericTypeHandler; - friend struct internal::ArenaStringPtr; // For AllocateAligned. - friend class internal::InlinedStringField; // For AllocateAligned. + friend class internal::InternalMetadata; // For user_arena(). friend class internal::LazyField; // For CreateMaybeMessage. friend class internal::EpsCopyInputStream; // For parser performance friend class MessageLite; template friend class Map; + template + friend class RepeatedField; // For ReturnArrayMemory + friend class internal::RepeatedPtrFieldBase; // For ReturnArrayMemory + friend struct internal::ArenaTestPeer; }; // Defined above for supporting environments without RTTI. diff --git a/windows/include/google/protobuf/arena_impl.h b/windows/include/google/protobuf/arena_impl.h index 2ffac319b..76727688b 100644 --- a/windows/include/google/protobuf/arena_impl.h +++ b/windows/include/google/protobuf/arena_impl.h @@ -39,11 +39,15 @@ #include #include +#include #ifdef ADDRESS_SANITIZER #include #endif // ADDRESS_SANITIZER +#include + +// Must be included last. #include @@ -51,6 +55,13 @@ namespace google { namespace protobuf { namespace internal { +// To prevent sharing cache lines between threads +#ifdef __cpp_aligned_new +enum { kCacheAlignment = 64 }; +#else +enum { kCacheAlignment = alignof(max_align_t) }; // do the best we can +#endif + inline constexpr size_t AlignUpTo8(size_t n) { // Align n to next multiple of 8 (from Hacker's Delight, Chapter 3.) return (n + 7) & static_cast(-8); @@ -177,6 +188,8 @@ class TaggedAllocationPolicyPtr { uintptr_t policy_; }; +enum class AllocationClient { kDefault, kArray }; + // A simple arena allocator. Calls to allocate functions must be properly // serialized by the caller, hence this class cannot be used as a general // purpose allocator in a multi-threaded program. It serves as a building block @@ -208,11 +221,47 @@ class PROTOBUF_EXPORT SerialArena { } uint64_t SpaceUsed() const; - bool HasSpace(size_t n) { return n <= static_cast(limit_ - ptr_); } + bool HasSpace(size_t n) const { + return n <= static_cast(limit_ - ptr_); + } + // See comments on `cached_blocks_` member for details. + PROTOBUF_ALWAYS_INLINE void* TryAllocateFromCachedBlock(size_t size) { + if (PROTOBUF_PREDICT_FALSE(size < 16)) return nullptr; + // We round up to the next larger block in case the memory doesn't match + // the pattern we are looking for. + const size_t index = Bits::Log2FloorNonZero64(size - 1) - 3; + + if (index >= cached_block_length_) return nullptr; + auto& cached_head = cached_blocks_[index]; + if (cached_head == nullptr) return nullptr; + + void* ret = cached_head; +#ifdef ADDRESS_SANITIZER + ASAN_UNPOISON_MEMORY_REGION(ret, size); +#endif // ADDRESS_SANITIZER + cached_head = cached_head->next; + return ret; + } + + // In kArray mode we look through cached blocks. + // We do not do this by default because most non-array allocations will not + // have the right size and will fail to find an appropriate cached block. + // + // TODO(sbenza): Evaluate if we should use cached blocks for message types of + // the right size. We can statically know if the allocation size can benefit + // from it. + template void* AllocateAligned(size_t n, const AllocationPolicy* policy) { GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n); // Must be already aligned. GOOGLE_DCHECK_GE(limit_, ptr_); + + if (alloc_client == AllocationClient::kArray) { + if (void* res = TryAllocateFromCachedBlock(n)) { + return res; + } + } + if (PROTOBUF_PREDICT_FALSE(!HasSpace(n))) { return AllocateAlignedFallback(n, policy); } @@ -229,6 +278,50 @@ class PROTOBUF_EXPORT SerialArena { return ret; } + // See comments on `cached_blocks_` member for details. + void ReturnArrayMemory(void* p, size_t size) { + // We only need to check for 32-bit platforms. + // In 64-bit platforms the minimum allocation size from Repeated*Field will + // be 16 guaranteed. + if (sizeof(void*) < 8) { + if (PROTOBUF_PREDICT_FALSE(size < 16)) return; + } else { + GOOGLE_DCHECK(size >= 16); + } + + // We round down to the next smaller block in case the memory doesn't match + // the pattern we are looking for. eg, someone might have called Reserve() + // on the repeated field. + const size_t index = Bits::Log2FloorNonZero64(size) - 4; + + if (PROTOBUF_PREDICT_FALSE(index >= cached_block_length_)) { + // We can't put this object on the freelist so make this object the + // freelist. It is guaranteed it is larger than the one we have, and + // large enough to hold another allocation of `size`. + CachedBlock** new_list = static_cast(p); + size_t new_size = size / sizeof(CachedBlock*); + + std::copy(cached_blocks_, cached_blocks_ + cached_block_length_, + new_list); + std::fill(new_list + cached_block_length_, new_list + new_size, nullptr); + cached_blocks_ = new_list; + // Make the size fit in uint8_t. This is the power of two, so we don't + // need anything larger. + cached_block_length_ = + static_cast(std::min(size_t{64}, new_size)); + + return; + } + + auto& cached_head = cached_blocks_[index]; + auto* new_node = static_cast(p); + new_node->next = cached_head; + cached_head = new_node; +#ifdef ADDRESS_SANITIZER + ASAN_POISON_MEMORY_REGION(p, size); +#endif // ADDRESS_SANITIZER + } + public: // Allocate space if the current region provides enough space. bool MaybeAllocateAligned(size_t n, void** out) { @@ -279,7 +372,8 @@ class PROTOBUF_EXPORT SerialArena { // Creates a new SerialArena inside mem using the remaining memory as for // future allocations. - static SerialArena* New(SerialArena::Memory mem, void* owner); + static SerialArena* New(SerialArena::Memory mem, void* owner, + ThreadSafeArenaStats* stats); // Free SerialArena returning the memory passed in to New template Memory Free(Deallocator deallocator); @@ -310,10 +404,28 @@ class PROTOBUF_EXPORT SerialArena { // head_ (and head_->pos will always be non-canonical). We keep these // here to reduce indirection. char* ptr_; + // Limiting address up to which memory can be allocated from the head block. char* limit_; + // For holding sampling information. The pointer is owned by the + // ThreadSafeArena that holds this serial arena. + ThreadSafeArenaStats* arena_stats_; + + // Repeated*Field and Arena play together to reduce memory consumption by + // reusing blocks. Currently, natural growth of the repeated field types makes + // them allocate blocks of size `8 + 2^N, N>=3`. + // When the repeated field grows returns the previous block and we put it in + // this free list. + // `cached_blocks_[i]` points to the free list for blocks of size `8+2^(i+3)`. + // The array of freelists is grown when needed in `ReturnArrayMemory()`. + struct CachedBlock { + // Simple linked list. + CachedBlock* next; + }; + uint8_t cached_block_length_ = 0; + CachedBlock** cached_blocks_ = nullptr; // Constructor is private as only New() should be used. - inline SerialArena(Block* b, void* owner); + inline SerialArena(Block* b, void* owner, ThreadSafeArenaStats* stats); void* AllocateAlignedFallback(size_t n, const AllocationPolicy* policy); std::pair AllocateAlignedWithCleanupFallback( size_t n, const AllocationPolicy* policy); @@ -368,26 +480,34 @@ class PROTOBUF_EXPORT ThreadSafeArena { uint64_t SpaceAllocated() const; uint64_t SpaceUsed() const; + template void* AllocateAligned(size_t n, const std::type_info* type) { SerialArena* arena; if (PROTOBUF_PREDICT_TRUE(!alloc_policy_.should_record_allocs() && GetSerialArenaFast(&arena))) { - return arena->AllocateAligned(n, AllocPolicy()); + return arena->AllocateAligned(n, AllocPolicy()); } else { return AllocateAlignedFallback(n, type); } } + void ReturnArrayMemory(void* p, size_t size) { + SerialArena* arena; + if (PROTOBUF_PREDICT_TRUE(GetSerialArenaFast(&arena))) { + arena->ReturnArrayMemory(p, size); + } + } + // This function allocates n bytes if the common happy case is true and // returns true. Otherwise does nothing and returns false. This strange // semantics is necessary to allow callers to program functions that only // have fallback function calls in tail position. This substantially improves // code for the happy path. PROTOBUF_NDEBUG_INLINE bool MaybeAllocateAligned(size_t n, void** out) { - SerialArena* a; + SerialArena* arena; if (PROTOBUF_PREDICT_TRUE(!alloc_policy_.should_record_allocs() && - GetSerialArenaFromThreadCache(&a))) { - return a->MaybeAllocateAligned(n, out); + GetSerialArenaFromThreadCache(&arena))) { + return arena->MaybeAllocateAligned(n, out); } return false; } @@ -411,6 +531,8 @@ class PROTOBUF_EXPORT ThreadSafeArena { TaggedAllocationPolicyPtr alloc_policy_; // Tagged pointer to AllocPolicy. + static_assert(std::is_trivially_destructible{}, + "SerialArena needs to be trivially destructible."); // Pointer to a linked list of SerialArena. std::atomic threads_; std::atomic hint_; // Fast thread-local block access @@ -449,7 +571,7 @@ class PROTOBUF_EXPORT ThreadSafeArena { // fast path optimizes the case where a single thread uses multiple arenas. ThreadCache* tc = &thread_cache(); SerialArena* serial = hint_.load(std::memory_order_acquire); - if (PROTOBUF_PREDICT_TRUE(serial != NULL && serial->owner() == tc)) { + if (PROTOBUF_PREDICT_TRUE(serial != nullptr && serial->owner() == tc)) { *arena = serial; return true; } @@ -487,7 +609,7 @@ class PROTOBUF_EXPORT ThreadSafeArena { #ifdef _MSC_VER #pragma warning(disable : 4324) #endif - struct alignas(64) ThreadCache { + struct alignas(kCacheAlignment) ThreadCache { #if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL) // If we are using the ThreadLocalStorage class to store the ThreadCache, // then the ThreadCache's default constructor has to be responsible for @@ -495,7 +617,7 @@ class PROTOBUF_EXPORT ThreadSafeArena { ThreadCache() : next_lifecycle_id(0), last_lifecycle_id_seen(-1), - last_serial_arena(NULL) {} + last_serial_arena(nullptr) {} #endif // Number of per-thread lifecycle IDs to reserve. Must be power of two. @@ -518,7 +640,7 @@ class PROTOBUF_EXPORT ThreadSafeArena { #ifdef _MSC_VER #pragma warning(disable : 4324) #endif - struct alignas(64) CacheAlignedLifecycleIdGenerator { + struct alignas(kCacheAlignment) CacheAlignedLifecycleIdGenerator { std::atomic id; }; static CacheAlignedLifecycleIdGenerator lifecycle_id_generator_; @@ -535,6 +657,8 @@ class PROTOBUF_EXPORT ThreadSafeArena { static ThreadCache& thread_cache() { return thread_cache_; } #endif + ThreadSafeArenaStatsHandle arena_stats_; + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ThreadSafeArena); // All protos have pointers back to the arena hence Arena must have // pointer stability. diff --git a/windows/include/google/protobuf/arenastring.h b/windows/include/google/protobuf/arenastring.h index 38c36378c..6bc8395f2 100644 --- a/windows/include/google/protobuf/arenastring.h +++ b/windows/include/google/protobuf/arenastring.h @@ -31,6 +31,7 @@ #ifndef GOOGLE_PROTOBUF_ARENASTRING_H__ #define GOOGLE_PROTOBUF_ARENASTRING_H__ +#include #include #include #include @@ -39,7 +40,9 @@ #include #include #include +#include +// must be last: #include #ifdef SWIG @@ -50,12 +53,14 @@ namespace google { namespace protobuf { namespace internal { - -template -class ExplicitlyConstructed; +class EpsCopyInputStream; class SwapFieldHelper; +// Declared in message_lite.h +PROTOBUF_EXPORT extern ExplicitlyConstructedArenaString + fixed_address_empty_string; + // Lazy string instance to support string fields with non-empty default. // These are initialized on the first call to .get(). class PROTOBUF_EXPORT LazyString { @@ -89,182 +94,229 @@ class PROTOBUF_EXPORT LazyString { const std::string& Init() const; }; -template -class TaggedPtr { +class TaggedStringPtr { public: - TaggedPtr() = default; - explicit constexpr TaggedPtr(const ExplicitlyConstructed* ptr) - : ptr_(const_cast*>(ptr)) {} + // Bit flags qualifying string properties. We can use 2 bits as + // ptr_ is guaranteed and enforced to be aligned on 4 byte boundaries. + enum Flags { + kArenaBit = 0x1, // ptr is arena allocated + kMutableBit = 0x2, // ptr contents are fully mutable + kMask = 0x3 // Bit mask + }; - void SetTagged(T* p) { - Set(p); - ptr_ = reinterpret_cast(as_int() | 1); + // Composed logical types + enum Type { + // Default strings are immutable and never owned. + kDefault = 0, + + // Allocated strings are mutable and (as the name implies) owned. + // A heap allocated string must be deleted. + kAllocated = kMutableBit, + + // Mutable arena strings are strings where the string instance is owned + // by the arena, but the string contents itself are owned by the string + // instance. Mutable arena string instances need to be destroyed which is + // typically done through a cleanup action added to the arena owning it. + kMutableArena = kArenaBit | kMutableBit, + + // Fixed size arena strings are strings where both the string instance and + // the string contents are fully owned by the arena. Fixed size arena + // strings are a platform and c++ library specific customization. Fixed + // size arena strings are immutable, with the exception of custom internal + // updates to the content that fit inside the existing capacity. + // Fixed size arena strings must never be deleted or destroyed. + kFixedSizeArena = kArenaBit, + }; + + TaggedStringPtr() = default; + explicit constexpr TaggedStringPtr(ExplicitlyConstructedArenaString* ptr) + : ptr_(ptr) {} + + // Sets the value to `p`, tagging the value as being a 'default' value. + // See documentation for kDefault for more info. + inline const std::string* SetDefault(const std::string* p) { + return TagAs(kDefault, const_cast(p)); } - void Set(T* p) { ptr_ = p; } - T* Get() const { return reinterpret_cast(as_int() & -2); } - bool IsTagged() const { return as_int() & 1; } - // Returned value is only safe to dereference if IsTagged() == false. - // It is safe to compare. - T* UnsafeGet() const { return static_cast(ptr_); } + // Sets the value to `p`, tagging the value as a heap allocated value. + // Allocated strings are mutable and (as the name implies) owned. + // `p` must not be null + inline std::string* SetAllocated(std::string* p) { + return TagAs(kAllocated, p); + } - bool IsNull() { return ptr_ == nullptr; } + // Sets the value to `p`, tagging the value as a fixed size arena string. + // See documentation for kFixedSizeArena for more info. + // `p` must not be null + inline std::string* SetFixedSizeArena(std::string* p) { + return TagAs(kFixedSizeArena, p); + } + + // Sets the value to `p`, tagging the value as a mutable arena string. + // See documentation for kMutableArena for more info. + // `p` must not be null + inline std::string* SetMutableArena(std::string* p) { + return TagAs(kMutableArena, p); + } + + // Returns true if the contents of the current string are fully mutable. + inline bool IsMutable() const { return as_int() & kMutableBit; } + + // Returns true if the current string is an immutable default value. + inline bool IsDefault() const { return (as_int() & kMask) == kDefault; } + + // If the current string is a heap-allocated mutable value, returns a pointer + // to it. Returns nullptr otherwise. + inline std::string *GetIfAllocated() const { + auto allocated = as_int() ^ kAllocated; + if (allocated & kMask) return nullptr; + + auto ptr = reinterpret_cast(allocated); + PROTOBUF_ASSUME(ptr != nullptr); + return ptr; + } + + // Returns true if the current string is an arena allocated value. + // This means it's either a mutable or fixed size arena string. + inline bool IsArena() const { return as_int() & kArenaBit; } + + // Returns true if the current string is a fixed size arena allocated value. + inline bool IsFixedSizeArena() const { + return (as_int() & kMask) == kFixedSizeArena; + } + + // Returns the contained string pointer. + inline std::string* Get() const { + return reinterpret_cast(as_int() & ~kMask); + } + + // Returns true if the contained pointer is null, indicating some error. + // The Null value is only used during parsing for temporary values. + // A persisted ArenaStringPtr value is never null. + inline bool IsNull() { return ptr_ == nullptr; } private: + static inline void assert_aligned(const void* p) { + GOOGLE_DCHECK_EQ(reinterpret_cast(p) & kMask, 0UL); + } + + inline std::string* TagAs(Type type, std::string* p) { + GOOGLE_DCHECK(p != nullptr); + assert_aligned(p); + ptr_ = reinterpret_cast(reinterpret_cast(p) | type); + return p; + } + uintptr_t as_int() const { return reinterpret_cast(ptr_); } void* ptr_; }; -static_assert(std::is_trivial>::value, - "TaggedPtr must be trivial"); +static_assert(std::is_trivial::value, + "TaggedStringPtr must be trivial"); -// This class encapsulates a pointer to a std::string with or without a donated -// buffer, tagged by bottom bit. It is a high-level wrapper that almost directly -// corresponds to the interface required by string fields in generated -// code. It replaces the old std::string* pointer in such cases. +// This class encapsulates a pointer to a std::string with or without arena +// owned contents, tagged by the bottom bits of the string pointer. It is a +// high-level wrapper that almost directly corresponds to the interface required +// by string fields in generated code. It replaces the old std::string* pointer +// in such cases. // -// The object has different but similar code paths for when the default value is -// the empty string and when it is a non-empty string. -// The empty string is handled different throughout the library and there is a -// single global instance of it we can share. +// The string pointer is tagged to be either a default, externally owned value, +// a mutable heap allocated value, or an arena allocated value. The object uses +// a single global instance of an empty string that is used as the initial +// default value. Fields that have empty default values directly use this global +// default. Fields that have non empty default values are supported through +// lazily initialized default values managed by the LazyString class. // -// For fields with an empty string default value, there are three distinct -// states: -// -// - Pointer set to 'String' tag (LSB is 0), equal to -// &GetEmptyStringAlreadyInited(): field is set to its default value. Points -// to a true std::string*, but we do not own that std::string* (it's a -// globally shared instance). -// -// - Pointer set to 'String' tag (LSB is 0), but not equal to the global empty -// string: field points to a true std::string* instance that we own. This -// instance is either on the heap or on the arena (i.e. registered on -// free()/destructor-call list) as appropriate. -// -// - Pointer set to 'DonatedString' tag (LSB is 1): points to a std::string -// instance with a buffer on the arena (arena is never nullptr in this case). -// -// For fields with a non-empty string default value, there are three distinct -// states: -// -// - Pointer set to 'String' tag (LSB is 0), equal to `nullptr`: -// Field is in "default" mode and does not point to any actual instance. -// Methods that might need to create an instance of the object will pass a -// `const LazyString&` for it. -// -// - Pointer set to 'String' tag (LSB is 0), but not equal to `nullptr`: -// field points to a true std::string* instance that we own. This instance is -// either on the heap or on the arena (i.e. registered on -// free()/destructor-call list) as appropriate. -// -// - Pointer set to 'DonatedString' tag (LSB is 1): points to a std::string -// instance with a buffer on the arena (arena is never nullptr in this case). -// -// Generated code and reflection code both ensure that ptr_ is never null for -// fields with an empty default. +// Generated code and reflection code both ensure that ptr_ is never null. // Because ArenaStringPtr is used in oneof unions, its constructor is a NOP and -// so the field is always manually initialized via method calls. +// the field is always manually initialized via method calls. // -// Side-note: why pass information about the default on every API call? Because -// we don't want to hold it in a member variable, or else this would go into -// every proto message instance. This would be a huge waste of space, since the -// default instance pointer is typically a global (static class field). We want -// the generated code to be as efficient as possible, and if we take -// the default value information as a parameter that's in practice taken from a -// static class field, and compare ptr_ to the default value, we end up with a -// single "cmp %reg, GLOBAL" in the resulting machine code. (Note that this also -// requires the String tag to be 0 so we can avoid the mask before comparing.) +// See TaggedStringPtr for more information about the types of string values +// being held, and the mutable and ownership invariants for each type. struct PROTOBUF_EXPORT ArenaStringPtr { ArenaStringPtr() = default; - explicit constexpr ArenaStringPtr( - const ExplicitlyConstructed* default_value) + constexpr ArenaStringPtr(ExplicitlyConstructedArenaString* default_value, + ConstantInitialized) : tagged_ptr_(default_value) {} - // Some methods below are overloaded on a `default_value` and on tags. - // The tagged overloads help reduce code size in the callers in generated - // code, while the `default_value` overloads are useful from reflection. - // By-value empty struct arguments are elided in the ABI. - struct EmptyDefault {}; - struct NonEmptyDefault {}; + // Called from generated code / reflection runtime only. Resets value to point + // to a default string pointer, with the semantics that this ArenaStringPtr + // does not own the pointed-to memory. Disregards initial value of ptr_ (so + // this is the *ONLY* safe method to call after construction or when + // reinitializing after becoming the active field in a oneof union). + inline void InitDefault(); - void Set(const std::string* default_value, ConstStringParam value, - ::google::protobuf::Arena* arena); - void Set(const std::string* default_value, std::string&& value, - ::google::protobuf::Arena* arena); - void Set(EmptyDefault, ConstStringParam value, ::google::protobuf::Arena* arena); - void Set(EmptyDefault, std::string&& value, ::google::protobuf::Arena* arena); - void Set(NonEmptyDefault, ConstStringParam value, ::google::protobuf::Arena* arena); - void Set(NonEmptyDefault, std::string&& value, ::google::protobuf::Arena* arena); - template - void Set(FirstParam p1, const char* str, ::google::protobuf::Arena* arena) { - Set(p1, ConstStringParam(str), arena); - } - template - void Set(FirstParam p1, const char* str, size_t size, + // Similar to `InitDefault` except that it allows the default value to be + // initialized to an externally owned string. This method is called from + // parsing code. `str` must not be null and outlive this instance. + inline void InitExternal(const std::string* str); + + // Called from generated code / reflection runtime only. Resets the value of + // this instances to the heap allocated value in `str`. `str` must not be + // null. Invokes `arena->Own(str)` to transfer ownership into the arena if + // `arena` is not null, else, `str` will be owned by ArenaStringPtr. This + // function should only be used to initialize a ArenaStringPtr or on an + // instance known to not carry any heap allocated value. + inline void InitAllocated(std::string* str, Arena* arena); + + void Set(ConstStringParam value, Arena* arena); + void Set(std::string&& value, Arena* arena); + void Set(const char* s, Arena* arena); + void Set(const char* s, size_t n, Arena* arena); + + void SetBytes(ConstStringParam value, Arena* arena); + void SetBytes(std::string&& value, Arena* arena); + void SetBytes(const char* s, Arena* arena); + void SetBytes(const void* p, size_t n, Arena* arena); + + template + void Set(std::reference_wrapper const_string_ref, ::google::protobuf::Arena* arena) { - ConstStringParam sp{str, size}; // for string_view and `const string &` - Set(p1, sp, arena); - } - template - void Set(FirstParam p1, - std::reference_wrapper const_string_ref, - ::google::protobuf::Arena* arena) { - Set(p1, const_string_ref.get(), arena); + Set(const_string_ref.get(), arena); } - template - void SetBytes(FirstParam p1, SecondParam&& p2, ::google::protobuf::Arena* arena) { - Set(p1, static_cast(p2), arena); - } - template - void SetBytes(FirstParam p1, const void* str, size_t size, - ::google::protobuf::Arena* arena) { - // must work whether ConstStringParam is string_view or `const string &` - ConstStringParam sp{static_cast(str), size}; - Set(p1, sp, arena); - } + // Returns a mutable std::string reference. + // The version accepting a `LazyString` value is used in the generated code to + // initialize mutable copies for fields with a non-empty default where the + // default value is lazily initialized. + std::string* Mutable(Arena* arena); + std::string* Mutable(const LazyString& default_value, Arena* arena); + + // Gets a mutable pointer with unspecified contents. + // This function is identical to Mutable(), except it is optimized for the + // case where the caller is not interested in the current contents. For + // example, if the current field is not mutable, it will re-initialize the + // value with an empty string rather than a (non-empty) default value. + // Likewise, if the current value is a fixed size arena string with contents, + // it will be initialized into an empty mutable arena string. + std::string* MutableNoCopy(Arena* arena); // Basic accessors. PROTOBUF_NDEBUG_INLINE const std::string& Get() const { // Unconditionally mask away the tag. return *tagged_ptr_.Get(); } - PROTOBUF_NDEBUG_INLINE const std::string* GetPointer() const { - // Unconditionally mask away the tag. + + // Returns a pointer to the stored contents for this instance. + // This method is for internal debugging and tracking purposes only. + PROTOBUF_NDEBUG_INLINE const std::string* UnsafeGetPointer() const + PROTOBUF_RETURNS_NONNULL { return tagged_ptr_.Get(); } - // For fields with an empty default value. - std::string* Mutable(EmptyDefault, ::google::protobuf::Arena* arena); - // For fields with a non-empty default value. - std::string* Mutable(const LazyString& default_value, ::google::protobuf::Arena* arena); - // Release returns a std::string* instance that is heap-allocated and is not // Own()'d by any arena. If the field is not set, this returns nullptr. The - // caller retains ownership. Clears this field back to nullptr state. Used to - // implement release_() methods on generated classes. - PROTOBUF_NODISCARD std::string* Release(const std::string* default_value, - ::google::protobuf::Arena* arena); - PROTOBUF_NODISCARD std::string* ReleaseNonDefault( - const std::string* default_value, ::google::protobuf::Arena* arena); + // caller retains ownership. Clears this field back to the default state. + // Used to implement release_() methods on generated classes. + PROTOBUF_NODISCARD std::string* Release(); // Takes a std::string that is heap-allocated, and takes ownership. The // std::string's destructor is registered with the arena. Used to implement // set_allocated_ in generated classes. - void SetAllocated(const std::string* default_value, std::string* value, - ::google::protobuf::Arena* arena); - - // Swaps internal pointers. Arena-safety semantics: this is guarded by the - // logic in Swap()/UnsafeArenaSwap() at the message level, so this method is - // 'unsafe' if called directly. - inline PROTOBUF_NDEBUG_INLINE static void InternalSwap( - const std::string* default_value, ArenaStringPtr* rhs, Arena* rhs_arena, - ArenaStringPtr* lhs, Arena* lhs_arena); + void SetAllocated(std::string* value, Arena* arena); // Frees storage (if not on an arena). - void Destroy(const std::string* default_value, ::google::protobuf::Arena* arena); - void Destroy(EmptyDefault, ::google::protobuf::Arena* arena); - void Destroy(NonEmptyDefault, ::google::protobuf::Arena* arena); + void Destroy(); // Clears content, but keeps allocated std::string, to avoid the overhead of // heap operations. After this returns, the content (as seen by the user) will @@ -281,48 +333,40 @@ struct PROTOBUF_EXPORT ArenaStringPtr { // (as seen by the user) will always be equal to |default_value|. void ClearToDefault(const LazyString& default_value, ::google::protobuf::Arena* arena); - // Called from generated code / reflection runtime only. Resets value to point - // to a default string pointer, with the semantics that this - // ArenaStringPtr does not own the pointed-to memory. Disregards initial value - // of ptr_ (so this is the *ONLY* safe method to call after construction or - // when reinitializing after becoming the active field in a oneof union). - inline void UnsafeSetDefault(const std::string* default_value); - - // Returns a mutable pointer, but doesn't initialize the string to the - // default value. - std::string* MutableNoArenaNoDefault(const std::string* default_value); - - // Get a mutable pointer with unspecified contents. - // Similar to `MutableNoArenaNoDefault`, but also handles the arena case. - // If the value was donated, the contents are discarded. - std::string* MutableNoCopy(const std::string* default_value, - ::google::protobuf::Arena* arena); - - // Destroy the string. Assumes `arena == nullptr`. - void DestroyNoArena(const std::string* default_value); + // Swaps internal pointers. Arena-safety semantics: this is guarded by the + // logic in Swap()/UnsafeArenaSwap() at the message level, so this method is + // 'unsafe' if called directly. + inline PROTOBUF_NDEBUG_INLINE static void InternalSwap(ArenaStringPtr* rhs, + Arena* rhs_arena, + ArenaStringPtr* lhs, + Arena* lhs_arena); // Internal setter used only at parse time to directly set a donated string // value. - void UnsafeSetTaggedPointer(TaggedPtr value) { - tagged_ptr_ = value; - } + void UnsafeSetTaggedPointer(TaggedStringPtr value) { tagged_ptr_ = value; } // Generated code only! An optimization, in certain cases the generated // code is certain we can obtain a std::string with no default checks and // tag tests. std::string* UnsafeMutablePointer() PROTOBUF_RETURNS_NONNULL; - inline bool IsDefault(const std::string* default_value) const { - // Relies on the fact that kPtrTagString == 0, so if IsString(), ptr_ is the - // actual std::string pointer (and if !IsString(), ptr_ will never be equal - // to any aligned |default_value| pointer). The key is that we want to avoid - // masking in the fastpath const-pointer Get() case for non-arena code. - return tagged_ptr_.UnsafeGet() == default_value; - } + // Returns true if this instances holds an immutable default value. + inline bool IsDefault() const { return tagged_ptr_.IsDefault(); } private: - TaggedPtr tagged_ptr_; + template + inline std::string* NewString(Arena* arena, Args&&... args) { + if (arena == nullptr) { + auto* s = new std::string(std::forward(args)...); + return tagged_ptr_.SetAllocated(s); + } else { + auto* s = Arena::Create(arena, std::forward(args)...); + return tagged_ptr_.SetMutableArena(s); + } + } - bool IsDonatedString() const { return false; } + TaggedStringPtr tagged_ptr_; + + bool IsFixedSizeArena() const { return false; } // Swaps tagged pointer without debug hardening. This is to allow python // protobuf to maintain pointer stability even in DEBUG builds. @@ -332,46 +376,81 @@ struct PROTOBUF_EXPORT ArenaStringPtr { } friend class ::google::protobuf::internal::SwapFieldHelper; + friend class TcParser; // Slow paths. // MutableSlow requires that !IsString() || IsDefault - // Variadic to support 0 args for EmptyDefault and 1 arg for LazyString. + // Variadic to support 0 args for empty default and 1 arg for LazyString. template std::string* MutableSlow(::google::protobuf::Arena* arena, const Lazy&... lazy_default); - // Sets value to a newly allocated string and returns it - std::string* SetAndReturnNewString(); - - // Destroys the non-default string value out-of-line - void DestroyNoArenaSlowPath(); - + friend class EpsCopyInputStream; }; -inline void ArenaStringPtr::UnsafeSetDefault(const std::string* value) { - tagged_ptr_.Set(const_cast(value)); +inline void ArenaStringPtr::InitDefault() { + tagged_ptr_ = TaggedStringPtr(&fixed_address_empty_string); +} + +inline void ArenaStringPtr::InitExternal(const std::string* str) { + tagged_ptr_.SetDefault(str); +} + +inline void ArenaStringPtr::InitAllocated(std::string* str, Arena* arena) { + if (arena != nullptr) { + tagged_ptr_.SetMutableArena(str); + arena->Own(str); + } else { + tagged_ptr_.SetAllocated(str); + } +} + +inline void ArenaStringPtr::Set(const char* s, Arena* arena) { + Set(ConstStringParam{s}, arena); +} + +inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) { + Set(ConstStringParam{s, n}, arena); +} + +inline void ArenaStringPtr::SetBytes(ConstStringParam value, Arena* arena) { + Set(value, arena); +} + +inline void ArenaStringPtr::SetBytes(std::string&& value, Arena* arena) { + Set(std::move(value), arena); +} + +inline void ArenaStringPtr::SetBytes(const char* s, Arena* arena) { + Set(s, arena); +} + +inline void ArenaStringPtr::SetBytes(const void* p, size_t n, Arena* arena) { + Set(ConstStringParam{static_cast(p), n}, arena); } // Make sure rhs_arena allocated rhs, and lhs_arena allocated lhs. inline PROTOBUF_NDEBUG_INLINE void ArenaStringPtr::InternalSwap( // - const std::string* default_value, // ArenaStringPtr* rhs, Arena* rhs_arena, // ArenaStringPtr* lhs, Arena* lhs_arena) { // Silence unused variable warnings in release buildls. - (void)default_value; (void)rhs_arena; (void)lhs_arena; std::swap(lhs->tagged_ptr_, rhs->tagged_ptr_); #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - auto force_realloc = [default_value](ArenaStringPtr* p, Arena* arena) { - if (p->IsDefault(default_value)) return; + auto force_realloc = [](ArenaStringPtr* p, Arena* arena) { + if (p->IsDefault()) return; std::string* old_value = p->tagged_ptr_.Get(); std::string* new_value = - p->IsDonatedString() + p->IsFixedSizeArena() ? Arena::Create(arena, *old_value) : Arena::Create(arena, std::move(*old_value)); - if (arena == nullptr) delete old_value; - p->tagged_ptr_.Set(new_value); + if (arena == nullptr) { + delete old_value; + p->tagged_ptr_.SetAllocated(new_value); + } else { + p->tagged_ptr_.SetMutableArena(new_value); + } }; // Because, at this point, tagged_ptr_ has been swapped, arena should also be // swapped. @@ -385,29 +464,10 @@ inline void ArenaStringPtr::ClearNonDefaultToEmpty() { tagged_ptr_.Get()->clear(); } -inline std::string* ArenaStringPtr::MutableNoArenaNoDefault( - const std::string* default_value) { - // VERY IMPORTANT for performance and code size: this will reduce to a member - // variable load, a pointer check (against |default_value|, in practice a - // static global) and a branch to the slowpath (which calls operator new and - // the ctor). DO NOT add any tagged-pointer operations here. - if (IsDefault(default_value)) { - return SetAndReturnNewString(); - } else { - return UnsafeMutablePointer(); - } -} - -inline void ArenaStringPtr::DestroyNoArena(const std::string* default_value) { - if (!IsDefault(default_value)) { - DestroyNoArenaSlowPath(); - } -} - inline std::string* ArenaStringPtr::UnsafeMutablePointer() { - GOOGLE_DCHECK(!tagged_ptr_.IsTagged()); - GOOGLE_DCHECK(tagged_ptr_.UnsafeGet() != nullptr); - return tagged_ptr_.UnsafeGet(); + GOOGLE_DCHECK(tagged_ptr_.IsMutable()); + GOOGLE_DCHECK(tagged_ptr_.Get() != nullptr); + return tagged_ptr_.Get(); } diff --git a/windows/include/google/protobuf/arenaz_sampler.h b/windows/include/google/protobuf/arenaz_sampler.h new file mode 100644 index 000000000..b04b0cc67 --- /dev/null +++ b/windows/include/google/protobuf/arenaz_sampler.h @@ -0,0 +1,207 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef GOOGLE_PROTOBUF_SRC_GOOGLE_PROTOBUF_ARENAZ_SAMPLER_H__ +#define GOOGLE_PROTOBUF_SRC_GOOGLE_PROTOBUF_ARENAZ_SAMPLER_H__ + +#include +#include +#include + + +// Must be included last. +#include + +namespace google { +namespace protobuf { +namespace internal { + +#if defined(PROTOBUF_ARENAZ_SAMPLE) +struct ThreadSafeArenaStats; +void RecordResetSlow(ThreadSafeArenaStats* info); +void RecordAllocateSlow(ThreadSafeArenaStats* info, size_t requested, + size_t allocated, size_t wasted); +// Stores information about a sampled thread safe arena. All mutations to this +// *must* be made through `Record*` functions below. All reads from this *must* +// only occur in the callback to `ThreadSafeArenazSampler::Iterate`. +struct ThreadSafeArenaStats + : public absl::profiling_internal::Sample { + // Constructs the object but does not fill in any fields. + ThreadSafeArenaStats(); + ~ThreadSafeArenaStats(); + + // Puts the object into a clean state, fills in the logically `const` members, + // blocking for any readers that are currently sampling the object. + void PrepareForSampling() ABSL_EXCLUSIVE_LOCKS_REQUIRED(init_mu); + + // These fields are mutated by the various Record* APIs and need to be + // thread-safe. + std::atomic num_allocations; + std::atomic num_resets; + std::atomic bytes_requested; + std::atomic bytes_allocated; + std::atomic bytes_wasted; + // Records the largest size an arena ever had. Maintained across resets. + std::atomic max_bytes_allocated; + // Bit i when set to 1 indicates that a thread with tid % 63 = i accessed the + // underlying arena. The field is maintained across resets. + std::atomic thread_ids; + + // All of the fields below are set by `PrepareForSampling`, they must not + // be mutated in `Record*` functions. They are logically `const` in that + // sense. These are guarded by init_mu, but that is not externalized to + // clients, who can only read them during + // `ThreadSafeArenazSampler::Iterate` which will hold the lock. + static constexpr int kMaxStackDepth = 64; + int32_t depth; + void* stack[kMaxStackDepth]; + static void RecordAllocateStats(ThreadSafeArenaStats* info, size_t requested, + size_t allocated, size_t wasted) { + if (PROTOBUF_PREDICT_TRUE(info == nullptr)) return; + RecordAllocateSlow(info, requested, allocated, wasted); + } +}; + +ThreadSafeArenaStats* SampleSlow(int64_t* next_sample); +void UnsampleSlow(ThreadSafeArenaStats* info); + +class ThreadSafeArenaStatsHandle { + public: + explicit ThreadSafeArenaStatsHandle() = default; + explicit ThreadSafeArenaStatsHandle(ThreadSafeArenaStats* info) + : info_(info) {} + + ~ThreadSafeArenaStatsHandle() { + if (PROTOBUF_PREDICT_TRUE(info_ == nullptr)) return; + UnsampleSlow(info_); + } + + ThreadSafeArenaStatsHandle(ThreadSafeArenaStatsHandle&& other) noexcept + : info_(absl::exchange(other.info_, nullptr)) {} + + ThreadSafeArenaStatsHandle& operator=( + ThreadSafeArenaStatsHandle&& other) noexcept { + if (PROTOBUF_PREDICT_FALSE(info_ != nullptr)) { + UnsampleSlow(info_); + } + info_ = absl::exchange(other.info_, nullptr); + return *this; + } + + void RecordReset() { + if (PROTOBUF_PREDICT_TRUE(info_ == nullptr)) return; + RecordResetSlow(info_); + } + + ThreadSafeArenaStats* MutableStats() { return info_; } + + friend void swap(ThreadSafeArenaStatsHandle& lhs, + ThreadSafeArenaStatsHandle& rhs) { + std::swap(lhs.info_, rhs.info_); + } + + friend class ThreadSafeArenaStatsHandlePeer; + + private: + ThreadSafeArenaStats* info_ = nullptr; +}; + +using ThreadSafeArenazSampler = + ::absl::profiling_internal::SampleRecorder; + +extern PROTOBUF_THREAD_LOCAL int64_t global_next_sample; + +// Returns an RAII sampling handle that manages registration and unregistation +// with the global sampler. +inline ThreadSafeArenaStatsHandle Sample() { + if (PROTOBUF_PREDICT_TRUE(--global_next_sample > 0)) { + return ThreadSafeArenaStatsHandle(nullptr); + } + return ThreadSafeArenaStatsHandle(SampleSlow(&global_next_sample)); +} + +#else +struct ThreadSafeArenaStats { + static void RecordAllocateStats(ThreadSafeArenaStats*, size_t /*requested*/, + size_t /*allocated*/, size_t /*wasted*/) {} +}; + +ThreadSafeArenaStats* SampleSlow(int64_t* next_sample); +void UnsampleSlow(ThreadSafeArenaStats* info); + +class ThreadSafeArenaStatsHandle { + public: + explicit ThreadSafeArenaStatsHandle() = default; + explicit ThreadSafeArenaStatsHandle(ThreadSafeArenaStats*) {} + + void RecordReset() {} + + ThreadSafeArenaStats* MutableStats() { return nullptr; } + + friend void swap(ThreadSafeArenaStatsHandle&, ThreadSafeArenaStatsHandle&) {} + + private: + friend class ThreadSafeArenaStatsHandlePeer; +}; + +class ThreadSafeArenazSampler { + public: + void Unregister(ThreadSafeArenaStats*) {} + void SetMaxSamples(int32_t) {} +}; + +// Returns an RAII sampling handle that manages registration and unregistation +// with the global sampler. +inline ThreadSafeArenaStatsHandle Sample() { + return ThreadSafeArenaStatsHandle(nullptr); +} +#endif // defined(PROTOBUF_ARENAZ_SAMPLE) + +// Returns a global Sampler. +ThreadSafeArenazSampler& GlobalThreadSafeArenazSampler(); + +// Enables or disables sampling for thread safe arenas. +void SetThreadSafeArenazEnabled(bool enabled); + +// Sets the rate at which thread safe arena will be sampled. +void SetThreadSafeArenazSampleParameter(int32_t rate); + +// Sets a soft max for the number of samples that will be kept. +void SetThreadSafeArenazMaxSamples(int32_t max); + +// Sets the current value for when arenas should be next sampled. +void SetThreadSafeArenazGlobalNextSample(int64_t next_sample); + +} // namespace internal +} // namespace protobuf +} // namespace google + +#include +#endif // GOOGLE_PROTOBUF_SRC_PROTOBUF_ARENAZ_SAMPLER_H__ diff --git a/windows/include/google/protobuf/compiler/code_generator.h b/windows/include/google/protobuf/compiler/code_generator.h index 2cbda270b..9c0b115cf 100644 --- a/windows/include/google/protobuf/compiler/code_generator.h +++ b/windows/include/google/protobuf/compiler/code_generator.h @@ -43,6 +43,7 @@ #include #include +// Must be included last. #include namespace google { @@ -188,9 +189,9 @@ typedef GeneratorContext OutputDirectory; // Several code generators treat the parameter argument as holding a // list of options separated by commas. This helper function parses // a set of comma-delimited name/value pairs: e.g., -// "foo=bar,baz,qux=corge" +// "foo=bar,baz,moo=corge" // parses to the pairs: -// ("foo", "bar"), ("baz", ""), ("qux", "corge") +// ("foo", "bar"), ("baz", ""), ("moo", "corge") PROTOC_EXPORT void ParseGeneratorParameter( const std::string&, std::vector >*); diff --git a/windows/include/google/protobuf/compiler/command_line_interface.h b/windows/include/google/protobuf/compiler/command_line_interface.h index 27178b1be..e8425508b 100644 --- a/windows/include/google/protobuf/compiler/command_line_interface.h +++ b/windows/include/google/protobuf/compiler/command_line_interface.h @@ -49,6 +49,8 @@ #include #include + +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/compiler/cpp/cpp_generator.h b/windows/include/google/protobuf/compiler/cpp/cpp_generator.h index 97e848dc4..1716ab20d 100644 --- a/windows/include/google/protobuf/compiler/cpp/cpp_generator.h +++ b/windows/include/google/protobuf/compiler/cpp/cpp_generator.h @@ -1,106 +1,6 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_CPP_GENERATOR_H_ +#define GOOGLE_PROTOBUF_COMPILER_CPP_CPP_GENERATOR_H_ -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// Generates C++ code for a given .proto file. +#include -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ - -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace cpp { - -// CodeGenerator implementation which generates a C++ source file and -// header. If you create your own protocol compiler binary and you want -// it to support C++ output, you can do so by registering an instance of this -// CodeGenerator with the CommandLineInterface in your main() function. -class PROTOC_EXPORT CppGenerator : public CodeGenerator { - public: - CppGenerator(); - ~CppGenerator(); - - enum class Runtime { - kGoogle3, // Use the internal google3 runtime. - kOpensource, // Use the open-source runtime. - - // Use the open-source runtime with google3 #include paths. We make these - // absolute to avoid ambiguity, so the runtime will be #included like: - // #include "third_party/protobuf/.../google/protobuf/message.h" - kOpensourceGoogle3 - }; - - void set_opensource_runtime(bool opensource) { - opensource_runtime_ = opensource; - } - - // If set to a non-empty string, generated code will do: - // #include "/google/protobuf/message.h" - // instead of: - // #include - // This has no effect if opensource_runtime = false. - void set_runtime_include_base(const std::string& base) { - runtime_include_base_ = base; - } - - // implements CodeGenerator ---------------------------------------- - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const override; - - uint64_t GetSupportedFeatures() const override { - // We don't fully support this yet, but this is needed to unblock the tests, - // and we will have full support before the experimental flag is removed. - return FEATURE_PROTO3_OPTIONAL; - } - - private: - bool opensource_runtime_ = true; - std::string runtime_include_base_; - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CppGenerator); -}; - -} // namespace cpp -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ +#endif // GOOGLE_PROTOBUF_COMPILER_CPP_CPP_GENERATOR_H_ diff --git a/windows/include/google/protobuf/compiler/cpp/cpp_file.h b/windows/include/google/protobuf/compiler/cpp/file.h similarity index 97% rename from windows/include/google/protobuf/compiler/cpp/cpp_file.h rename to windows/include/google/protobuf/compiler/cpp/file.h index e8816020d..ca05361b4 100644 --- a/windows/include/google/protobuf/compiler/cpp/cpp_file.h +++ b/windows/include/google/protobuf/compiler/cpp/file.h @@ -40,11 +40,12 @@ #include #include #include + #include -#include -#include -#include +#include +#include #include +#include namespace google { namespace protobuf { @@ -122,11 +123,11 @@ class FileGenerator { void GenerateInternalForwardDeclarations(const CrossFileReferences& refs, io::Printer* printer); void GenerateSourceIncludes(io::Printer* printer); + void GenerateSourcePrelude(io::Printer* printer); void GenerateSourceDefaultInstance(int idx, io::Printer* printer); void GenerateInitForSCC(const SCC* scc, const CrossFileReferences& refs, io::Printer* printer); - void GenerateTables(io::Printer* printer); void GenerateReflectionInitializationCode(io::Printer* printer); // For other imports, generates their forward-declarations. diff --git a/windows/include/google/protobuf/compiler/cpp/generator.h b/windows/include/google/protobuf/compiler/cpp/generator.h new file mode 100644 index 000000000..1a374b9f1 --- /dev/null +++ b/windows/include/google/protobuf/compiler/cpp/generator.h @@ -0,0 +1,107 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// Generates C++ code for a given .proto file. + +#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ +#define GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ + +#include +#include + +// Must be included last. +#include + +namespace google { +namespace protobuf { +namespace compiler { +namespace cpp { + +// CodeGenerator implementation which generates a C++ source file and +// header. If you create your own protocol compiler binary and you want +// it to support C++ output, you can do so by registering an instance of this +// CodeGenerator with the CommandLineInterface in your main() function. +class PROTOC_EXPORT CppGenerator : public CodeGenerator { + public: + CppGenerator(); + ~CppGenerator() override; + + enum class Runtime { + kGoogle3, // Use the internal google3 runtime. + kOpensource, // Use the open-source runtime. + + // Use the open-source runtime with google3 #include paths. We make these + // absolute to avoid ambiguity, so the runtime will be #included like: + // #include "third_party/protobuf/.../google/protobuf/message.h" + kOpensourceGoogle3 + }; + + void set_opensource_runtime(bool opensource) { + opensource_runtime_ = opensource; + } + + // If set to a non-empty string, generated code will do: + // #include "/google/protobuf/message.h" + // instead of: + // #include + // This has no effect if opensource_runtime = false. + void set_runtime_include_base(const std::string& base) { + runtime_include_base_ = base; + } + + // implements CodeGenerator ---------------------------------------- + bool Generate(const FileDescriptor* file, const std::string& parameter, + GeneratorContext* generator_context, + std::string* error) const override; + + uint64_t GetSupportedFeatures() const override { + // We don't fully support this yet, but this is needed to unblock the tests, + // and we will have full support before the experimental flag is removed. + return FEATURE_PROTO3_OPTIONAL; + } + + private: + bool opensource_runtime_ = true; + std::string runtime_include_base_; + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CppGenerator); +}; + +} // namespace cpp +} // namespace compiler +} // namespace protobuf +} // namespace google + +#include + +#endif // GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ diff --git a/windows/include/google/protobuf/compiler/cpp/cpp_helpers.h b/windows/include/google/protobuf/compiler/cpp/helpers.h similarity index 86% rename from windows/include/google/protobuf/compiler/cpp/cpp_helpers.h rename to windows/include/google/protobuf/compiler/cpp/helpers.h index bd4f48bc8..d8dcda724 100644 --- a/windows/include/google/protobuf/compiler/cpp/cpp_helpers.h +++ b/windows/include/google/protobuf/compiler/cpp/helpers.h @@ -41,10 +41,10 @@ #include #include -#include -#include #include #include +#include +#include #include #include #include @@ -59,6 +59,8 @@ namespace protobuf { namespace compiler { namespace cpp { +enum class ArenaDtorNeeds { kNone = 0, kOnDemand = 1, kRequired = 2 }; + inline std::string ProtobufNamespace(const Options& /* options */) { return "PROTOBUF_NAMESPACE_ID"; } @@ -85,6 +87,11 @@ extern const char kThinSeparator[]; void SetCommonVars(const Options& options, std::map* variables); +// Variables to access message data from the message scope. +void SetCommonMessageDataVariables( + const Descriptor* descriptor, + std::map* variables); + void SetUnknownFieldsVariable(const Descriptor* descriptor, const Options& options, std::map* variables); @@ -121,11 +128,11 @@ std::string QualifiedClassName(const EnumDescriptor* d); // Returns the non-nested type name for the given type. If "qualified" is // true, prefix the type with the full namespace. For example, if you had: // package foo.bar; -// message Baz { message Qux {} } -// Then the qualified ClassName for Qux would be: -// ::foo::bar::Baz_Qux +// message Baz { message Moo {} } +// Then the qualified ClassName for Moo would be: +// ::foo::bar::Baz_Moo // While the non-qualified version would be: -// Baz_Qux +// Baz_Moo inline std::string ClassName(const Descriptor* descriptor, bool qualified) { return qualified ? QualifiedClassName(descriptor, Options()) : ClassName(descriptor); @@ -146,24 +153,26 @@ std::string QualifiedExtensionName(const FieldDescriptor* d); // Type name of default instance. std::string DefaultInstanceType(const Descriptor* descriptor, - const Options& options); + const Options& options, bool split = false); // Non-qualified name of the default_instance of this message. std::string DefaultInstanceName(const Descriptor* descriptor, - const Options& options); + const Options& options, bool split = false); // Non-qualified name of the default instance pointer. This is used only for // implicit weak fields, where we need an extra indirection. std::string DefaultInstancePtr(const Descriptor* descriptor, - const Options& options); + const Options& options, bool split = false); // Fully qualified name of the default_instance of this message. std::string QualifiedDefaultInstanceName(const Descriptor* descriptor, - const Options& options); + const Options& options, + bool split = false); // Fully qualified name of the default instance pointer. std::string QualifiedDefaultInstancePtr(const Descriptor* descriptor, - const Options& options); + const Options& options, + bool split = false); // DescriptorTable variable name. std::string DescriptorTableName(const FileDescriptor* file, @@ -186,6 +195,9 @@ std::string ResolveKeyword(const std::string& name); // anyway, so normally this just returns field->name(). std::string FieldName(const FieldDescriptor* field); +// Returns the (unqualified) private member name for this field in C++ code. +std::string FieldMemberName(const FieldDescriptor* field, bool split); + // Returns an estimate of the compiler's alignment for the field. This // can't guarantee to be correct because the generated code could be compiled on // different systems with different alignment rules. The estimates below assume @@ -348,19 +360,22 @@ bool HasLazyFields(const FileDescriptor* file, const Options& options, bool IsLazy(const FieldDescriptor* field, const Options& options, MessageSCCAnalyzer* scc_analyzer); -inline bool IsLazilyVerifiedLazy(const FieldDescriptor* field, - const Options& options) { - return field->options().lazy() && !field->is_repeated() && - field->type() == FieldDescriptor::TYPE_MESSAGE && - GetOptimizeFor(field->file(), options) != FileOptions::LITE_RUNTIME && - !options.opensource_runtime; +// Is this an explicit (non-profile driven) lazy field, as denoted by +// lazy/unverified_lazy in the descriptor? +inline bool IsExplicitLazy(const FieldDescriptor* field) { + return field->options().lazy() || field->options().unverified_lazy(); } -inline bool IsEagerlyVerifiedLazy(const FieldDescriptor* field, - const Options& options, - MessageSCCAnalyzer* scc_analyzer) { - return IsLazy(field, options, scc_analyzer) && !field->options().lazy(); -} +bool IsEagerlyVerifiedLazy(const FieldDescriptor* field, const Options& options, + MessageSCCAnalyzer* scc_analyzer); + +bool IsLazilyVerifiedLazy(const FieldDescriptor* field, const Options& options); + +// Is the given message being split (go/pdsplit)? +bool ShouldSplit(const Descriptor* desc, const Options& options); + +// Is the given field being split out? +bool ShouldSplit(const FieldDescriptor* field, const Options& options); inline bool IsFieldUsed(const FieldDescriptor* /* field */, const Options& /* options */) { @@ -468,10 +483,49 @@ inline bool IsCrossFileMessage(const FieldDescriptor* field) { } inline std::string MakeDefaultName(const FieldDescriptor* field) { - return "_i_give_permission_to_break_this_code_default_" + FieldName(field) + - "_"; + return StrCat("_i_give_permission_to_break_this_code_default_", + FieldName(field), "_"); } +// Semantically distinct from MakeDefaultName in that it gives the C++ code +// referencing a default field from the message scope, rather than just the +// variable name. +// For example, declarations of default variables should always use just +// MakeDefaultName to produce code like: +// Type _i_give_permission_to_break_this_code_default_field_; +// +// Code that references these should use MakeDefaultFieldName, in case the field +// exists at some nested level like: +// internal_container_._i_give_permission_to_break_this_code_default_field_; +inline std::string MakeDefaultFieldName(const FieldDescriptor* field) { + return StrCat("Impl_::", MakeDefaultName(field)); +} + +inline std::string MakeVarintCachedSizeName(const FieldDescriptor* field) { + return StrCat("_", FieldName(field), "_cached_byte_size_"); +} + +// Semantically distinct from MakeVarintCachedSizeName in that it gives the C++ +// code referencing the object from the message scope, rather than just the +// variable name. +// For example, declarations of default variables should always use just +// MakeVarintCachedSizeName to produce code like: +// Type _field_cached_byte_size_; +// +// Code that references these variables should use +// MakeVarintCachedSizeFieldName, in case the field exists at some nested level +// like: +// internal_container_._field_cached_byte_size_; +inline std::string MakeVarintCachedSizeFieldName(const FieldDescriptor* field, + bool split) { + return StrCat("_impl_.", split ? "_split_->" : "", "_", + FieldName(field), "_cached_byte_size_"); +} + +// Note: A lot of libraries detect Any protos based on Descriptor::full_name() +// while the two functions below use FileDescriptor::name(). In a sane world the +// two approaches should be equivalent. But if you are dealing with descriptors +// from untrusted sources, you might need to match semantics across libraries. bool IsAnyMessage(const FileDescriptor* descriptor, const Options& options); bool IsAnyMessage(const Descriptor* descriptor, const Options& options); @@ -680,6 +734,18 @@ inline std::string SimpleBaseClass(const Descriptor* desc, return ""; } +// Returns true if this message has a _tracker_ field. +inline bool HasTracker(const Descriptor* desc, const Options& options) { + return options.field_listener_options.inject_field_listener_events && + desc->file()->options().optimize_for() != + google::protobuf::FileOptions::LITE_RUNTIME; +} + +// Returns true if this message needs an Impl_ struct for it's data. +inline bool HasImplData(const Descriptor* desc, const Options& options) { + return !HasSimpleBaseClass(desc, options); +} + // Formatter is a functor class which acts as a closure around printer and // the variable map. It's much like printer->Print except it supports both named // variables that are substituted using a key value map and direct arguments. In @@ -711,7 +777,7 @@ inline std::string SimpleBaseClass(const Descriptor* desc, // but consider using named variables. Named variables like $foo$, with some // identifier foo, are looked up in the map. One additional feature is that // spaces are accepted between the '$' delimiters, $ foo$ will -// substiture to " bar" if foo stands for "bar", but in case it's empty +// substitute to " bar" if foo stands for "bar", but in case it's empty // will substitute to "". Hence, for example, // // Format(vars, "$dllexport $void fun();") -> "void fun();" @@ -955,12 +1021,39 @@ inline OneOfRangeImpl OneOfRange(const Descriptor* desc) { return {desc}; } PROTOC_EXPORT std::string StripProto(const std::string& filename); -bool EnableMessageOwnedArena(const Descriptor* desc); +bool EnableMessageOwnedArena(const Descriptor* desc, const Options& options); + +bool EnableMessageOwnedArenaTrial(const Descriptor* desc, + const Options& options); bool ShouldVerify(const Descriptor* descriptor, const Options& options, MessageSCCAnalyzer* scc_analyzer); bool ShouldVerify(const FileDescriptor* file, const Options& options, MessageSCCAnalyzer* scc_analyzer); + +// Indicates whether to use predefined verify methods for a given message. If a +// message is "simple" and needs no special verification per field (e.g. message +// field, repeated packed, UTF8 string, etc.), we can use either VerifySimple or +// VerifySimpleAlwaysCheckInt32 methods as all verification can be done based on +// the wire type. +// +// Otherwise, we need "custom" verify methods tailored to a message to pass +// which field needs a special verification; i.e. InternalVerify. +enum class VerifySimpleType { + kSimpleInt32Never, // Use VerifySimple + kSimpleInt32Always, // Use VerifySimpleAlwaysCheckInt32 + kCustom, // Use InternalVerify and check only for int32 + kCustomInt32Never, // Use InternalVerify but never check for int32 + kCustomInt32Always, // Use InternalVerify and always check for int32 +}; + +// Returns VerifySimpleType if messages can be verified by predefined methods. +VerifySimpleType ShouldVerifySimple(const Descriptor* descriptor); + +bool IsUtf8String(const FieldDescriptor* field); + +bool HasMessageFieldOrExtension(const Descriptor* desc); + } // namespace cpp } // namespace compiler } // namespace protobuf diff --git a/windows/include/google/protobuf/compiler/cpp/cpp_names.h b/windows/include/google/protobuf/compiler/cpp/names.h similarity index 95% rename from windows/include/google/protobuf/compiler/cpp/cpp_names.h rename to windows/include/google/protobuf/compiler/cpp/names.h index 6bcbff061..7404ac530 100644 --- a/windows/include/google/protobuf/compiler/cpp/cpp_names.h +++ b/windows/include/google/protobuf/compiler/cpp/names.h @@ -33,6 +33,7 @@ #include +// Must be included last. #include namespace google { @@ -50,9 +51,9 @@ namespace cpp { // // For example, if you had: // package foo.bar; -// message Baz { message Qux {} } +// message Baz { message Moo {} } // Then the non-qualified version would be: -// Baz_Qux +// Baz_Moo std::string ClassName(const Descriptor* descriptor); std::string ClassName(const EnumDescriptor* enum_descriptor); @@ -60,9 +61,9 @@ std::string ClassName(const EnumDescriptor* enum_descriptor); // // For example, if you had: // package foo.bar; -// message Baz { message Qux {} } -// Then the qualified ClassName for Qux would be: -// ::foo::bar::Baz_Qux +// message Baz { message Moo {} } +// Then the qualified ClassName for Moo would be: +// ::foo::bar::Baz_Moo std::string QualifiedClassName(const Descriptor* d); std::string QualifiedClassName(const EnumDescriptor* d); std::string QualifiedExtensionName(const FieldDescriptor* d); diff --git a/windows/include/google/protobuf/compiler/importer.h b/windows/include/google/protobuf/compiler/importer.h index 08a49c552..2fb88b923 100644 --- a/windows/include/google/protobuf/compiler/importer.h +++ b/windows/include/google/protobuf/compiler/importer.h @@ -41,10 +41,12 @@ #include #include #include + #include #include #include +// Must be included last. #include namespace google { @@ -85,7 +87,7 @@ class PROTOBUF_EXPORT SourceTreeDescriptorDatabase : public DescriptorDatabase { // the specified source_tree. SourceTreeDescriptorDatabase(SourceTree* source_tree, DescriptorDatabase* fallback_database); - ~SourceTreeDescriptorDatabase(); + ~SourceTreeDescriptorDatabase() override; // Instructs the SourceTreeDescriptorDatabase to report any parse errors // to the given MultiFileErrorCollector. This should be called before @@ -124,7 +126,7 @@ class PROTOBUF_EXPORT SourceTreeDescriptorDatabase : public DescriptorDatabase { : public DescriptorPool::ErrorCollector { public: ValidationErrorCollector(SourceTreeDescriptorDatabase* owner); - ~ValidationErrorCollector(); + ~ValidationErrorCollector() override; // implements ErrorCollector --------------------------------------- void AddError(const std::string& filename, const std::string& element_name, @@ -241,7 +243,7 @@ class PROTOBUF_EXPORT SourceTree { class PROTOBUF_EXPORT DiskSourceTree : public SourceTree { public: DiskSourceTree(); - ~DiskSourceTree(); + ~DiskSourceTree() override; // Map a path on disk to a location in the SourceTree. The path may be // either a file or a directory. If it is a directory, the entire tree diff --git a/windows/include/google/protobuf/compiler/java/generator.h b/windows/include/google/protobuf/compiler/java/generator.h new file mode 100644 index 000000000..bbc71700c --- /dev/null +++ b/windows/include/google/protobuf/compiler/java/generator.h @@ -0,0 +1,77 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// Generates Java code for a given .proto file. + +#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ +#define GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ + +#include +#include + +// Must be included last. +#include + +namespace google { +namespace protobuf { +namespace compiler { +namespace java { + +// CodeGenerator implementation which generates Java code. If you create your +// own protocol compiler binary and you want it to support Java output, you +// can do so by registering an instance of this CodeGenerator with the +// CommandLineInterface in your main() function. +class PROTOC_EXPORT JavaGenerator : public CodeGenerator { + public: + JavaGenerator(); + ~JavaGenerator() override; + + // implements CodeGenerator ---------------------------------------- + bool Generate(const FileDescriptor* file, const std::string& parameter, + GeneratorContext* context, std::string* error) const override; + + uint64_t GetSupportedFeatures() const override; + + private: + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(JavaGenerator); +}; + +} // namespace java +} // namespace compiler +} // namespace protobuf +} // namespace google + +#include + +#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ diff --git a/windows/include/google/protobuf/compiler/java/java_generator.h b/windows/include/google/protobuf/compiler/java/java_generator.h index 6315e7c3f..294b1bde0 100644 --- a/windows/include/google/protobuf/compiler/java/java_generator.h +++ b/windows/include/google/protobuf/compiler/java/java_generator.h @@ -1,76 +1,6 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_JAVA_GENERATOR_H_ +#define GOOGLE_PROTOBUF_COMPILER_JAVA_JAVA_GENERATOR_H_ -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// Generates Java code for a given .proto file. +#include -#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ - -#include -#include - -#include - -namespace google { -namespace protobuf { -namespace compiler { -namespace java { - -// CodeGenerator implementation which generates Java code. If you create your -// own protocol compiler binary and you want it to support Java output, you -// can do so by registering an instance of this CodeGenerator with the -// CommandLineInterface in your main() function. -class PROTOC_EXPORT JavaGenerator : public CodeGenerator { - public: - JavaGenerator(); - ~JavaGenerator(); - - // implements CodeGenerator ---------------------------------------- - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* context, std::string* error) const override; - - uint64_t GetSupportedFeatures() const override; - - private: - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(JavaGenerator); -}; - -} // namespace java -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ +#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_JAVA_GENERATOR_H_ diff --git a/windows/include/google/protobuf/compiler/java/java_kotlin_generator.h b/windows/include/google/protobuf/compiler/java/kotlin_generator.h similarity index 99% rename from windows/include/google/protobuf/compiler/java/java_kotlin_generator.h rename to windows/include/google/protobuf/compiler/java/kotlin_generator.h index 66e32b9e0..ccd9688ca 100644 --- a/windows/include/google/protobuf/compiler/java/java_kotlin_generator.h +++ b/windows/include/google/protobuf/compiler/java/kotlin_generator.h @@ -36,6 +36,8 @@ #include #include + +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/compiler/java/java_names.h b/windows/include/google/protobuf/compiler/java/names.h similarity index 100% rename from windows/include/google/protobuf/compiler/java/java_names.h rename to windows/include/google/protobuf/compiler/java/names.h diff --git a/windows/include/google/protobuf/compiler/js/js_generator.h b/windows/include/google/protobuf/compiler/js/js_generator.h deleted file mode 100644 index cd9631afb..000000000 --- a/windows/include/google/protobuf/compiler/js/js_generator.h +++ /dev/null @@ -1,336 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Generates JavaScript code for a given .proto file. -// -#ifndef GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__ - -#include -#include - -#include -#include -#include -#include - -#include - -namespace google { -namespace protobuf { - -class Descriptor; -class EnumDescriptor; -class FieldDescriptor; -class OneofDescriptor; -class FileDescriptor; - -namespace io { -class Printer; -} - -namespace compiler { -namespace js { - -struct GeneratorOptions { - // Output path. - std::string output_dir; - // Namespace prefix. - std::string namespace_prefix; - // Enable binary-format support? - bool binary; - // What style of imports should be used. - enum ImportStyle { - kImportClosure, // goog.require() - kImportCommonJs, // require() - kImportCommonJsStrict, // require() with no global export - kImportBrowser, // no import statements - kImportEs6, // import { member } from '' - } import_style; - - GeneratorOptions() - : output_dir("."), - namespace_prefix(""), - binary(false), - import_style(kImportClosure), - add_require_for_enums(false), - testonly(false), - library(""), - extension(".js"), - one_output_file_per_input_file(false), - annotate_code(false) {} - - bool ParseFromOptions( - const std::vector >& options, - std::string* error); - - // Returns the file name extension to use for generated code. - std::string GetFileNameExtension() const { - return import_style == kImportClosure ? extension : "_pb.js"; - } - - enum OutputMode { - // Create an output file for each input .proto file. - kOneOutputFilePerInputFile, - // Create an output file for each type. - kOneOutputFilePerSCC, - // Put everything in a single file named by the library option. - kEverythingInOneFile, - }; - - // Indicates how to output the generated code based on the provided options. - OutputMode output_mode() const; - - // The remaining options are only relevant when we are using kImportClosure. - - // Add a `goog.requires()` call for each enum type used. If not set, a - // forward declaration with `goog.forwardDeclare` is produced instead. - bool add_require_for_enums; - // Set this as a test-only module via `goog.setTestOnly();`. - bool testonly; - // Create a library with name _lib.js rather than a separate .js file - // per type? - std::string library; - // The extension to use for output file names. - std::string extension; - // Create a separate output file for each input file? - bool one_output_file_per_input_file; - // If true, we should append annotations as comments on the last line for - // generated .js file. Annotations used by tools like https://kythe.io - // to provide cross-references between .js and .proto files. Annotations - // are encoded as base64 proto of GeneratedCodeInfo message (see - // descriptor.proto). - bool annotate_code; -}; - -// CodeGenerator implementation which generates a JavaScript source file and -// header. If you create your own protocol compiler binary and you want it to -// support JavaScript output, you can do so by registering an instance of this -// CodeGenerator with the CommandLineInterface in your main() function. -class PROTOC_EXPORT Generator : public CodeGenerator { - public: - Generator() {} - virtual ~Generator() {} - - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* context, std::string* error) const override { - *error = "Unimplemented Generate() method. Call GenerateAll() instead."; - return false; - } - - bool HasGenerateAll() const override { return true; } - - bool GenerateAll(const std::vector& files, - const std::string& parameter, GeneratorContext* context, - std::string* error) const override; - - uint64 GetSupportedFeatures() const override { - return FEATURE_PROTO3_OPTIONAL; - } - - private: - void GenerateHeader(const GeneratorOptions& options, - const FileDescriptor* file, io::Printer* printer) const; - - // Generate goog.provides() calls. - void FindProvides(const GeneratorOptions& options, io::Printer* printer, - const std::vector& file, - std::set* provided) const; - void FindProvidesForFile(const GeneratorOptions& options, - io::Printer* printer, const FileDescriptor* file, - std::set* provided) const; - void FindProvidesForMessage(const GeneratorOptions& options, - io::Printer* printer, const Descriptor* desc, - std::set* provided) const; - void FindProvidesForEnum(const GeneratorOptions& options, - io::Printer* printer, const EnumDescriptor* enumdesc, - std::set* provided) const; - // For extension fields at file scope. - void FindProvidesForFields(const GeneratorOptions& options, - io::Printer* printer, - const std::vector& fields, - std::set* provided) const; - // Print the goog.provides() found by the methods above. - void GenerateProvides(const GeneratorOptions& options, io::Printer* printer, - std::set* provided) const; - - // Generate goog.setTestOnly() if indicated. - void GenerateTestOnly(const GeneratorOptions& options, - io::Printer* printer) const; - - // Generate goog.requires() calls. - void GenerateRequiresForLibrary( - const GeneratorOptions& options, io::Printer* printer, - const std::vector& files, - std::set* provided) const; - void GenerateRequiresForSCC(const GeneratorOptions& options, - io::Printer* printer, const SCC* scc, - std::set* provided) const; - // For extension fields at file scope. - void GenerateRequiresForExtensions( - const GeneratorOptions& options, io::Printer* printer, - const std::vector& fields, - std::set* provided) const; - void GenerateRequiresImpl(const GeneratorOptions& options, - io::Printer* printer, - std::set* required, - std::set* forwards, - std::set* provided, bool require_jspb, - bool require_extension, bool require_map) const; - void FindRequiresForMessage(const GeneratorOptions& options, - const Descriptor* desc, - std::set* required, - std::set* forwards, - bool* have_message) const; - void FindRequiresForField(const GeneratorOptions& options, - const FieldDescriptor* field, - std::set* required, - std::set* forwards) const; - void FindRequiresForExtension(const GeneratorOptions& options, - const FieldDescriptor* field, - std::set* required, - std::set* forwards) const; - // Generate all things in a proto file into one file. - // If use_short_name is true, the generated file's name will only be short - // name that without directory, otherwise filename equals file->name() - bool GenerateFile(const FileDescriptor* file, const GeneratorOptions& options, - GeneratorContext* context, bool use_short_name) const; - void GenerateFile(const GeneratorOptions& options, io::Printer* printer, - const FileDescriptor* file) const; - - // Generate definitions for all message classes and enums in all files, - // processing the files in dependence order. - void GenerateFilesInDepOrder( - const GeneratorOptions& options, io::Printer* printer, - const std::vector& file) const; - // Helper for above. - void GenerateFileAndDeps(const GeneratorOptions& options, - io::Printer* printer, const FileDescriptor* root, - std::set* all_files, - std::set* generated) const; - - // Generate definitions for all message classes and enums. - void GenerateClassesAndEnums(const GeneratorOptions& options, - io::Printer* printer, - const FileDescriptor* file) const; - - void GenerateFieldValueExpression(io::Printer* printer, - const char* obj_reference, - const FieldDescriptor* field, - bool use_default) const; - - // Generate definition for one class. - void GenerateClass(const GeneratorOptions& options, io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassConstructor(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassFieldInfo(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassConstructorAndDeclareExtensionFieldInfo( - const GeneratorOptions& options, io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassXid(const GeneratorOptions& options, io::Printer* printer, - const Descriptor* desc) const; - void GenerateOneofCaseDefinition(const GeneratorOptions& options, - io::Printer* printer, - const OneofDescriptor* oneof) const; - void GenerateObjectTypedef(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassToObject(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassFieldToObject(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const; - void GenerateClassFromObject(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassFieldFromObject(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const; - void GenerateClassRegistration(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassFields(const GeneratorOptions& options, - io::Printer* printer, const Descriptor* desc) const; - void GenerateClassField(const GeneratorOptions& options, io::Printer* printer, - const FieldDescriptor* desc) const; - void GenerateClassExtensionFieldInfo(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassDeserialize(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassDeserializeBinary(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassDeserializeBinaryField(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const; - void GenerateClassSerializeBinary(const GeneratorOptions& options, - io::Printer* printer, - const Descriptor* desc) const; - void GenerateClassSerializeBinaryField(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const; - - // Generate definition for one enum. - void GenerateEnum(const GeneratorOptions& options, io::Printer* printer, - const EnumDescriptor* enumdesc) const; - - // Generate an extension definition. - void GenerateExtension(const GeneratorOptions& options, io::Printer* printer, - const FieldDescriptor* field) const; - - // Generate addFoo() method for repeated primitive fields. - void GenerateRepeatedPrimitiveHelperMethods(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field, - bool untyped) const; - - // Generate addFoo() method for repeated message fields. - void GenerateRepeatedMessageHelperMethods(const GeneratorOptions& options, - io::Printer* printer, - const FieldDescriptor* field) const; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Generator); -}; - -} // namespace js -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__ diff --git a/windows/include/google/protobuf/compiler/objectivec/objectivec_helpers.h b/windows/include/google/protobuf/compiler/objectivec/objectivec_helpers.h index 13a105240..d21fed215 100644 --- a/windows/include/google/protobuf/compiler/objectivec/objectivec_helpers.h +++ b/windows/include/google/protobuf/compiler/objectivec/objectivec_helpers.h @@ -47,6 +47,10 @@ namespace protobuf { namespace compiler { namespace objectivec { +// Get/Set the path to a file to load for objc class prefix lookups. +std::string PROTOC_EXPORT GetPackageToPrefixMappingsPath(); +void PROTOC_EXPORT SetPackageToPrefixMappingsPath( + const std::string& file_path); // Get/Set if the proto package should be used to make the default prefix for // symbols. This will then impact most of the type naming apis below. It is done // as a global to not break any other generator reusing the methods since they @@ -54,20 +58,18 @@ namespace objectivec { bool PROTOC_EXPORT UseProtoPackageAsDefaultPrefix(); void PROTOC_EXPORT SetUseProtoPackageAsDefaultPrefix(bool on_or_off); // Get/Set the path to a file to load as exceptions when -// `UseProtoPackageAsDefaultPrefixUseProtoPackageAsDefaultPrefix()` is `true`. -// And empty string means there should be no exceptions loaded. +// `UseProtoPackageAsDefaultPrefix()` is `true`. An empty string means there +// should be no exceptions. std::string PROTOC_EXPORT GetProtoPackagePrefixExceptionList(); void PROTOC_EXPORT SetProtoPackagePrefixExceptionList( const std::string& file_path); -// Generator options (see objectivec_generator.cc for a description of each): +// Generator Prefix Validation Options (see objectivec_generator.cc for a +// description of each): struct Options { Options(); std::string expected_prefixes_path; std::vector expected_prefixes_suppressions; - std::string generate_for_named_framework; - std::string named_framework_to_proto_path_mappings_path; - std::string runtime_import_prefix; bool prefixes_must_be_registered; bool require_prefixes; }; @@ -251,7 +253,11 @@ IsProtobufLibraryBundledProtoFile(const FileDescriptor* file); // and the result is false. bool PROTOC_EXPORT ValidateObjCClassPrefixes( const std::vector& files, - const Options& generation_options, std::string* out_error); + const Options& validation_options, std::string* out_error); +// Same was the other ValidateObjCClassPrefixes() calls, but the options all +// come from the environment variables. +bool PROTOC_EXPORT ValidateObjCClassPrefixes( + const std::vector& files, std::string* out_error); // Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform // the input into the expected output. diff --git a/windows/include/google/protobuf/compiler/parser.h b/windows/include/google/protobuf/compiler/parser.h index b5a5df899..d4eb76302 100644 --- a/windows/include/google/protobuf/compiler/parser.h +++ b/windows/include/google/protobuf/compiler/parser.h @@ -42,9 +42,9 @@ #include #include +#include #include #include -#include #include // Must be included last. @@ -122,6 +122,7 @@ class PROTOBUF_EXPORT Parser { private: class LocationRecorder; + struct MapField; // ================================================================= // Error recovery helpers @@ -281,9 +282,6 @@ class PROTOBUF_EXPORT Parser { std::vector* detached_comments) const; private: - // Indexes of parent and current location in the parent - // SourceCodeInfo.location repeated field. For top-level elements, - // parent_index_ is -1. Parser* parser_; SourceCodeInfo* source_code_info_; SourceCodeInfo::Location* location_; @@ -381,6 +379,9 @@ class PROTOBUF_EXPORT Parser { const LocationRecorder& field_location, const FileDescriptorProto* containing_file); + bool ParseMapType(MapField* map_field, FieldDescriptorProto* field, + LocationRecorder& type_name_location); + // Parse an "extensions" declaration. bool ParseExtensions(DescriptorProto* message, const LocationRecorder& extensions_location, @@ -434,7 +435,6 @@ class PROTOBUF_EXPORT Parser { const LocationRecorder& method_location, const FileDescriptorProto* containing_file); - // Parse options of a single method or stream. bool ParseMethodOptions(const LocationRecorder& parent_location, const FileDescriptorProto* containing_file, @@ -444,8 +444,7 @@ class PROTOBUF_EXPORT Parser { // Parse "required", "optional", or "repeated" and fill in "label" // with the value. Returns true if such a label is consumed. bool ParseLabel(FieldDescriptorProto::Label* label, - const LocationRecorder& field_location, - const FileDescriptorProto* containing_file); + const LocationRecorder& field_location); // Parse a type name and fill in "type" (if it is a primitive) or // "type_name" (if it is not) with the type parsed. @@ -485,7 +484,7 @@ class PROTOBUF_EXPORT Parser { // Parses a single part of a multipart option name. A multipart name consists // of names separated by dots. Each name is either an identifier or a series // of identifiers separated by dots and enclosed in parentheses. E.g., - // "foo.(bar.baz).qux". + // "foo.(bar.baz).moo". bool ParseOptionNamePart(UninterpretedOption* uninterpreted_option, const LocationRecorder& part_location, const FileDescriptorProto* containing_file); diff --git a/windows/include/google/protobuf/compiler/plugin.h b/windows/include/google/protobuf/compiler/plugin.h index 7d1bf4508..611713e2c 100644 --- a/windows/include/google/protobuf/compiler/plugin.h +++ b/windows/include/google/protobuf/compiler/plugin.h @@ -64,6 +64,7 @@ #include +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/compiler/plugin.pb.h b/windows/include/google/protobuf/compiler/plugin.pb.h index 569bb30a6..5f3fa52cd 100644 --- a/windows/include/google/protobuf/compiler/plugin.pb.h +++ b/windows/include/google/protobuf/compiler/plugin.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -50,14 +49,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOC_EXPORT TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[4] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOC_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fcompiler_2fplugin_2eproto; @@ -116,7 +107,7 @@ class PROTOC_EXPORT Version final : public: inline Version() : Version(nullptr) {} ~Version() override; - explicit constexpr Version(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Version(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Version(const Version& from); Version(Version&& from) noexcept @@ -198,9 +189,11 @@ class PROTOC_EXPORT Version final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Version& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Version& from); + void MergeFrom( const Version& from) { + Version::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -209,10 +202,10 @@ class PROTOC_EXPORT Version final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Version* other); @@ -225,9 +218,6 @@ class PROTOC_EXPORT Version final : protected: explicit Version(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -309,12 +299,15 @@ class PROTOC_EXPORT Version final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr suffix_; - int32_t major_; - int32_t minor_; - int32_t patch_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr suffix_; + int32_t major_; + int32_t minor_; + int32_t patch_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; }; // ------------------------------------------------------------------- @@ -324,7 +317,7 @@ class PROTOC_EXPORT CodeGeneratorRequest final : public: inline CodeGeneratorRequest() : CodeGeneratorRequest(nullptr) {} ~CodeGeneratorRequest() override; - explicit constexpr CodeGeneratorRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CodeGeneratorRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CodeGeneratorRequest(const CodeGeneratorRequest& from); CodeGeneratorRequest(CodeGeneratorRequest&& from) noexcept @@ -406,9 +399,11 @@ class PROTOC_EXPORT CodeGeneratorRequest final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const CodeGeneratorRequest& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const CodeGeneratorRequest& from); + void MergeFrom( const CodeGeneratorRequest& from) { + CodeGeneratorRequest::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -417,10 +412,10 @@ class PROTOC_EXPORT CodeGeneratorRequest final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CodeGeneratorRequest* other); @@ -433,9 +428,6 @@ class PROTOC_EXPORT CodeGeneratorRequest final : protected: explicit CodeGeneratorRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -538,12 +530,15 @@ class PROTOC_EXPORT CodeGeneratorRequest final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField file_to_generate_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto > proto_file_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr parameter_; - ::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField file_to_generate_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto > proto_file_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr parameter_; + ::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; }; // ------------------------------------------------------------------- @@ -553,7 +548,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : public: inline CodeGeneratorResponse_File() : CodeGeneratorResponse_File(nullptr) {} ~CodeGeneratorResponse_File() override; - explicit constexpr CodeGeneratorResponse_File(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CodeGeneratorResponse_File(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CodeGeneratorResponse_File(const CodeGeneratorResponse_File& from); CodeGeneratorResponse_File(CodeGeneratorResponse_File&& from) noexcept @@ -635,9 +630,11 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const CodeGeneratorResponse_File& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const CodeGeneratorResponse_File& from); + void MergeFrom( const CodeGeneratorResponse_File& from) { + CodeGeneratorResponse_File::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -646,10 +643,10 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CodeGeneratorResponse_File* other); @@ -662,9 +659,6 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : protected: explicit CodeGeneratorResponse_File(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -761,12 +755,15 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr insertion_point_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr content_; - ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr insertion_point_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr content_; + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; }; // ------------------------------------------------------------------- @@ -776,7 +773,7 @@ class PROTOC_EXPORT CodeGeneratorResponse final : public: inline CodeGeneratorResponse() : CodeGeneratorResponse(nullptr) {} ~CodeGeneratorResponse() override; - explicit constexpr CodeGeneratorResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR CodeGeneratorResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); CodeGeneratorResponse(const CodeGeneratorResponse& from); CodeGeneratorResponse(CodeGeneratorResponse&& from) noexcept @@ -858,9 +855,11 @@ class PROTOC_EXPORT CodeGeneratorResponse final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const CodeGeneratorResponse& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const CodeGeneratorResponse& from); + void MergeFrom( const CodeGeneratorResponse& from) { + CodeGeneratorResponse::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -869,10 +868,10 @@ class PROTOC_EXPORT CodeGeneratorResponse final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(CodeGeneratorResponse* other); @@ -885,9 +884,6 @@ class PROTOC_EXPORT CodeGeneratorResponse final : protected: explicit CodeGeneratorResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -992,11 +988,14 @@ class PROTOC_EXPORT CodeGeneratorResponse final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File > file_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr error_; - uint64_t supported_features_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File > file_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr error_; + uint64_t supported_features_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; }; // =================================================================== @@ -1012,26 +1011,26 @@ class PROTOC_EXPORT CodeGeneratorResponse final : // optional int32 major = 1; inline bool Version::_internal_has_major() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool Version::has_major() const { return _internal_has_major(); } inline void Version::clear_major() { - major_ = 0; - _has_bits_[0] &= ~0x00000002u; + _impl_.major_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; } inline int32_t Version::_internal_major() const { - return major_; + return _impl_.major_; } inline int32_t Version::major() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.major) return _internal_major(); } inline void Version::_internal_set_major(int32_t value) { - _has_bits_[0] |= 0x00000002u; - major_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.major_ = value; } inline void Version::set_major(int32_t value) { _internal_set_major(value); @@ -1040,26 +1039,26 @@ inline void Version::set_major(int32_t value) { // optional int32 minor = 2; inline bool Version::_internal_has_minor() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool Version::has_minor() const { return _internal_has_minor(); } inline void Version::clear_minor() { - minor_ = 0; - _has_bits_[0] &= ~0x00000004u; + _impl_.minor_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; } inline int32_t Version::_internal_minor() const { - return minor_; + return _impl_.minor_; } inline int32_t Version::minor() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.minor) return _internal_minor(); } inline void Version::_internal_set_minor(int32_t value) { - _has_bits_[0] |= 0x00000004u; - minor_ = value; + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.minor_ = value; } inline void Version::set_minor(int32_t value) { _internal_set_minor(value); @@ -1068,26 +1067,26 @@ inline void Version::set_minor(int32_t value) { // optional int32 patch = 3; inline bool Version::_internal_has_patch() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } inline bool Version::has_patch() const { return _internal_has_patch(); } inline void Version::clear_patch() { - patch_ = 0; - _has_bits_[0] &= ~0x00000008u; + _impl_.patch_ = 0; + _impl_._has_bits_[0] &= ~0x00000008u; } inline int32_t Version::_internal_patch() const { - return patch_; + return _impl_.patch_; } inline int32_t Version::patch() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.patch) return _internal_patch(); } inline void Version::_internal_set_patch(int32_t value) { - _has_bits_[0] |= 0x00000008u; - patch_ = value; + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.patch_ = value; } inline void Version::set_patch(int32_t value) { _internal_set_patch(value); @@ -1096,15 +1095,15 @@ inline void Version::set_patch(int32_t value) { // optional string suffix = 4; inline bool Version::_internal_has_suffix() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool Version::has_suffix() const { return _internal_has_suffix(); } inline void Version::clear_suffix() { - suffix_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.suffix_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& Version::suffix() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.suffix) @@ -1113,8 +1112,8 @@ inline const std::string& Version::suffix() const { template inline PROTOBUF_ALWAYS_INLINE void Version::set_suffix(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - suffix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.suffix_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.suffix) } inline std::string* Version::mutable_suffix() { @@ -1123,41 +1122,40 @@ inline std::string* Version::mutable_suffix() { return _s; } inline const std::string& Version::_internal_suffix() const { - return suffix_.Get(); + return _impl_.suffix_.Get(); } inline void Version::_internal_set_suffix(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - suffix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.suffix_.Set(value, GetArenaForAllocation()); } inline std::string* Version::_internal_mutable_suffix() { - _has_bits_[0] |= 0x00000001u; - return suffix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.suffix_.Mutable(GetArenaForAllocation()); } inline std::string* Version::release_suffix() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.Version.suffix) if (!_internal_has_suffix()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = suffix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.suffix_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (suffix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - suffix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.suffix_.IsDefault()) { + _impl_.suffix_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void Version::set_allocated_suffix(std::string* suffix) { if (suffix != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - suffix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), suffix, - GetArenaForAllocation()); + _impl_.suffix_.SetAllocated(suffix, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (suffix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - suffix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.suffix_.IsDefault()) { + _impl_.suffix_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.Version.suffix) @@ -1169,13 +1167,13 @@ inline void Version::set_allocated_suffix(std::string* suffix) { // repeated string file_to_generate = 1; inline int CodeGeneratorRequest::_internal_file_to_generate_size() const { - return file_to_generate_.size(); + return _impl_.file_to_generate_.size(); } inline int CodeGeneratorRequest::file_to_generate_size() const { return _internal_file_to_generate_size(); } inline void CodeGeneratorRequest::clear_file_to_generate() { - file_to_generate_.Clear(); + _impl_.file_to_generate_.Clear(); } inline std::string* CodeGeneratorRequest::add_file_to_generate() { std::string* _s = _internal_add_file_to_generate(); @@ -1183,7 +1181,7 @@ inline std::string* CodeGeneratorRequest::add_file_to_generate() { return _s; } inline const std::string& CodeGeneratorRequest::_internal_file_to_generate(int index) const { - return file_to_generate_.Get(index); + return _impl_.file_to_generate_.Get(index); } inline const std::string& CodeGeneratorRequest::file_to_generate(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) @@ -1191,68 +1189,68 @@ inline const std::string& CodeGeneratorRequest::file_to_generate(int index) cons } inline std::string* CodeGeneratorRequest::mutable_file_to_generate(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return file_to_generate_.Mutable(index); + return _impl_.file_to_generate_.Mutable(index); } inline void CodeGeneratorRequest::set_file_to_generate(int index, const std::string& value) { - file_to_generate_.Mutable(index)->assign(value); + _impl_.file_to_generate_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } inline void CodeGeneratorRequest::set_file_to_generate(int index, std::string&& value) { - file_to_generate_.Mutable(index)->assign(std::move(value)); + _impl_.file_to_generate_.Mutable(index)->assign(std::move(value)); // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } inline void CodeGeneratorRequest::set_file_to_generate(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); - file_to_generate_.Mutable(index)->assign(value); + _impl_.file_to_generate_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } inline void CodeGeneratorRequest::set_file_to_generate(int index, const char* value, size_t size) { - file_to_generate_.Mutable(index)->assign( + _impl_.file_to_generate_.Mutable(index)->assign( reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } inline std::string* CodeGeneratorRequest::_internal_add_file_to_generate() { - return file_to_generate_.Add(); + return _impl_.file_to_generate_.Add(); } inline void CodeGeneratorRequest::add_file_to_generate(const std::string& value) { - file_to_generate_.Add()->assign(value); + _impl_.file_to_generate_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } inline void CodeGeneratorRequest::add_file_to_generate(std::string&& value) { - file_to_generate_.Add(std::move(value)); + _impl_.file_to_generate_.Add(std::move(value)); // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } inline void CodeGeneratorRequest::add_file_to_generate(const char* value) { GOOGLE_DCHECK(value != nullptr); - file_to_generate_.Add()->assign(value); + _impl_.file_to_generate_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } inline void CodeGeneratorRequest::add_file_to_generate(const char* value, size_t size) { - file_to_generate_.Add()->assign(reinterpret_cast(value), size); + _impl_.file_to_generate_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& CodeGeneratorRequest::file_to_generate() const { // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return file_to_generate_; + return _impl_.file_to_generate_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* CodeGeneratorRequest::mutable_file_to_generate() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return &file_to_generate_; + return &_impl_.file_to_generate_; } // optional string parameter = 2; inline bool CodeGeneratorRequest::_internal_has_parameter() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool CodeGeneratorRequest::has_parameter() const { return _internal_has_parameter(); } inline void CodeGeneratorRequest::clear_parameter() { - parameter_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.parameter_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& CodeGeneratorRequest::parameter() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.parameter) @@ -1261,8 +1259,8 @@ inline const std::string& CodeGeneratorRequest::parameter() const { template inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorRequest::set_parameter(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - parameter_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.parameter_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.parameter) } inline std::string* CodeGeneratorRequest::mutable_parameter() { @@ -1271,41 +1269,40 @@ inline std::string* CodeGeneratorRequest::mutable_parameter() { return _s; } inline const std::string& CodeGeneratorRequest::_internal_parameter() const { - return parameter_.Get(); + return _impl_.parameter_.Get(); } inline void CodeGeneratorRequest::_internal_set_parameter(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - parameter_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.parameter_.Set(value, GetArenaForAllocation()); } inline std::string* CodeGeneratorRequest::_internal_mutable_parameter() { - _has_bits_[0] |= 0x00000001u; - return parameter_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.parameter_.Mutable(GetArenaForAllocation()); } inline std::string* CodeGeneratorRequest::release_parameter() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.parameter) if (!_internal_has_parameter()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = parameter_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.parameter_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (parameter_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - parameter_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.parameter_.IsDefault()) { + _impl_.parameter_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void CodeGeneratorRequest::set_allocated_parameter(std::string* parameter) { if (parameter != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - parameter_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), parameter, - GetArenaForAllocation()); + _impl_.parameter_.SetAllocated(parameter, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (parameter_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - parameter_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.parameter_.IsDefault()) { + _impl_.parameter_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.parameter) @@ -1313,29 +1310,29 @@ inline void CodeGeneratorRequest::set_allocated_parameter(std::string* parameter // repeated .google.protobuf.FileDescriptorProto proto_file = 15; inline int CodeGeneratorRequest::_internal_proto_file_size() const { - return proto_file_.size(); + return _impl_.proto_file_.size(); } inline int CodeGeneratorRequest::proto_file_size() const { return _internal_proto_file_size(); } inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* CodeGeneratorRequest::mutable_proto_file(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.proto_file) - return proto_file_.Mutable(index); + return _impl_.proto_file_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >* CodeGeneratorRequest::mutable_proto_file() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.proto_file) - return &proto_file_; + return &_impl_.proto_file_; } inline const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& CodeGeneratorRequest::_internal_proto_file(int index) const { - return proto_file_.Get(index); + return _impl_.proto_file_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& CodeGeneratorRequest::proto_file(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.proto_file) return _internal_proto_file(index); } inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* CodeGeneratorRequest::_internal_add_proto_file() { - return proto_file_.Add(); + return _impl_.proto_file_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* CodeGeneratorRequest::add_proto_file() { ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* _add = _internal_add_proto_file(); @@ -1345,24 +1342,24 @@ inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* CodeGeneratorRequest::add_p inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >& CodeGeneratorRequest::proto_file() const { // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorRequest.proto_file) - return proto_file_; + return _impl_.proto_file_; } // optional .google.protobuf.compiler.Version compiler_version = 3; inline bool CodeGeneratorRequest::_internal_has_compiler_version() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || compiler_version_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.compiler_version_ != nullptr); return value; } inline bool CodeGeneratorRequest::has_compiler_version() const { return _internal_has_compiler_version(); } inline void CodeGeneratorRequest::clear_compiler_version() { - if (compiler_version_ != nullptr) compiler_version_->Clear(); - _has_bits_[0] &= ~0x00000002u; + if (_impl_.compiler_version_ != nullptr) _impl_.compiler_version_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const ::PROTOBUF_NAMESPACE_ID::compiler::Version& CodeGeneratorRequest::_internal_compiler_version() const { - const ::PROTOBUF_NAMESPACE_ID::compiler::Version* p = compiler_version_; + const ::PROTOBUF_NAMESPACE_ID::compiler::Version* p = _impl_.compiler_version_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::compiler::_Version_default_instance_); } @@ -1373,20 +1370,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::compiler::Version& CodeGeneratorRequest::c inline void CodeGeneratorRequest::unsafe_arena_set_allocated_compiler_version( ::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(compiler_version_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.compiler_version_); } - compiler_version_ = compiler_version; + _impl_.compiler_version_ = compiler_version; if (compiler_version) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) } inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::release_compiler_version() { - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::compiler::Version* temp = compiler_version_; - compiler_version_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::compiler::Version* temp = _impl_.compiler_version_; + _impl_.compiler_version_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -1400,18 +1397,18 @@ inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::release } inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::unsafe_arena_release_compiler_version() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::compiler::Version* temp = compiler_version_; - compiler_version_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::compiler::Version* temp = _impl_.compiler_version_; + _impl_.compiler_version_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::_internal_mutable_compiler_version() { - _has_bits_[0] |= 0x00000002u; - if (compiler_version_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.compiler_version_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::Version>(GetArenaForAllocation()); - compiler_version_ = p; + _impl_.compiler_version_ = p; } - return compiler_version_; + return _impl_.compiler_version_; } inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::mutable_compiler_version() { ::PROTOBUF_NAMESPACE_ID::compiler::Version* _msg = _internal_mutable_compiler_version(); @@ -1421,20 +1418,20 @@ inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::mutable inline void CodeGeneratorRequest::set_allocated_compiler_version(::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete compiler_version_; + delete _impl_.compiler_version_; } if (compiler_version) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::compiler::Version>::GetOwningArena(compiler_version); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(compiler_version); if (message_arena != submessage_arena) { compiler_version = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, compiler_version, submessage_arena); } - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - compiler_version_ = compiler_version; + _impl_.compiler_version_ = compiler_version; // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) } @@ -1444,15 +1441,15 @@ inline void CodeGeneratorRequest::set_allocated_compiler_version(::PROTOBUF_NAME // optional string name = 1; inline bool CodeGeneratorResponse_File::_internal_has_name() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool CodeGeneratorResponse_File::has_name() const { return _internal_has_name(); } inline void CodeGeneratorResponse_File::clear_name() { - name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& CodeGeneratorResponse_File::name() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.name) @@ -1461,8 +1458,8 @@ inline const std::string& CodeGeneratorResponse_File::name() const { template inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.name) } inline std::string* CodeGeneratorResponse_File::mutable_name() { @@ -1471,41 +1468,40 @@ inline std::string* CodeGeneratorResponse_File::mutable_name() { return _s; } inline const std::string& CodeGeneratorResponse_File::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void CodeGeneratorResponse_File::_internal_set_name(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* CodeGeneratorResponse_File::_internal_mutable_name() { - _has_bits_[0] |= 0x00000001u; - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* CodeGeneratorResponse_File::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.name) if (!_internal_has_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void CodeGeneratorResponse_File::set_allocated_name(std::string* name) { if (name != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.name) @@ -1513,15 +1509,15 @@ inline void CodeGeneratorResponse_File::set_allocated_name(std::string* name) { // optional string insertion_point = 2; inline bool CodeGeneratorResponse_File::_internal_has_insertion_point() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool CodeGeneratorResponse_File::has_insertion_point() const { return _internal_has_insertion_point(); } inline void CodeGeneratorResponse_File::clear_insertion_point() { - insertion_point_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000002u; + _impl_.insertion_point_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const std::string& CodeGeneratorResponse_File::insertion_point() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) @@ -1530,8 +1526,8 @@ inline const std::string& CodeGeneratorResponse_File::insertion_point() const { template inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_insertion_point(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000002u; - insertion_point_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.insertion_point_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) } inline std::string* CodeGeneratorResponse_File::mutable_insertion_point() { @@ -1540,41 +1536,40 @@ inline std::string* CodeGeneratorResponse_File::mutable_insertion_point() { return _s; } inline const std::string& CodeGeneratorResponse_File::_internal_insertion_point() const { - return insertion_point_.Get(); + return _impl_.insertion_point_.Get(); } inline void CodeGeneratorResponse_File::_internal_set_insertion_point(const std::string& value) { - _has_bits_[0] |= 0x00000002u; - insertion_point_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.insertion_point_.Set(value, GetArenaForAllocation()); } inline std::string* CodeGeneratorResponse_File::_internal_mutable_insertion_point() { - _has_bits_[0] |= 0x00000002u; - return insertion_point_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.insertion_point_.Mutable(GetArenaForAllocation()); } inline std::string* CodeGeneratorResponse_File::release_insertion_point() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) if (!_internal_has_insertion_point()) { return nullptr; } - _has_bits_[0] &= ~0x00000002u; - auto* p = insertion_point_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.insertion_point_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (insertion_point_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - insertion_point_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.insertion_point_.IsDefault()) { + _impl_.insertion_point_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void CodeGeneratorResponse_File::set_allocated_insertion_point(std::string* insertion_point) { if (insertion_point != nullptr) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - insertion_point_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), insertion_point, - GetArenaForAllocation()); + _impl_.insertion_point_.SetAllocated(insertion_point, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (insertion_point_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - insertion_point_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.insertion_point_.IsDefault()) { + _impl_.insertion_point_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) @@ -1582,15 +1577,15 @@ inline void CodeGeneratorResponse_File::set_allocated_insertion_point(std::strin // optional string content = 15; inline bool CodeGeneratorResponse_File::_internal_has_content() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool CodeGeneratorResponse_File::has_content() const { return _internal_has_content(); } inline void CodeGeneratorResponse_File::clear_content() { - content_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000004u; + _impl_.content_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } inline const std::string& CodeGeneratorResponse_File::content() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.content) @@ -1599,8 +1594,8 @@ inline const std::string& CodeGeneratorResponse_File::content() const { template inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse_File::set_content(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000004u; - content_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.content_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.content) } inline std::string* CodeGeneratorResponse_File::mutable_content() { @@ -1609,41 +1604,40 @@ inline std::string* CodeGeneratorResponse_File::mutable_content() { return _s; } inline const std::string& CodeGeneratorResponse_File::_internal_content() const { - return content_.Get(); + return _impl_.content_.Get(); } inline void CodeGeneratorResponse_File::_internal_set_content(const std::string& value) { - _has_bits_[0] |= 0x00000004u; - content_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.content_.Set(value, GetArenaForAllocation()); } inline std::string* CodeGeneratorResponse_File::_internal_mutable_content() { - _has_bits_[0] |= 0x00000004u; - return content_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.content_.Mutable(GetArenaForAllocation()); } inline std::string* CodeGeneratorResponse_File::release_content() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.content) if (!_internal_has_content()) { return nullptr; } - _has_bits_[0] &= ~0x00000004u; - auto* p = content_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.content_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (content_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.content_.IsDefault()) { + _impl_.content_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void CodeGeneratorResponse_File::set_allocated_content(std::string* content) { if (content != nullptr) { - _has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000004u; } else { - _has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000004u; } - content_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), content, - GetArenaForAllocation()); + _impl_.content_.SetAllocated(content, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (content_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.content_.IsDefault()) { + _impl_.content_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.content) @@ -1651,15 +1645,15 @@ inline void CodeGeneratorResponse_File::set_allocated_content(std::string* conte // optional .google.protobuf.GeneratedCodeInfo generated_code_info = 16; inline bool CodeGeneratorResponse_File::_internal_has_generated_code_info() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; - PROTOBUF_ASSUME(!value || generated_code_info_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + PROTOBUF_ASSUME(!value || _impl_.generated_code_info_ != nullptr); return value; } inline bool CodeGeneratorResponse_File::has_generated_code_info() const { return _internal_has_generated_code_info(); } inline const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& CodeGeneratorResponse_File::_internal_generated_code_info() const { - const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* p = generated_code_info_; + const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* p = _impl_.generated_code_info_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_GeneratedCodeInfo_default_instance_); } @@ -1670,20 +1664,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& CodeGeneratorResponse_F inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_generated_code_info( ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(generated_code_info_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.generated_code_info_); } - generated_code_info_ = generated_code_info; + _impl_.generated_code_info_ = generated_code_info; if (generated_code_info) { - _has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000008u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info) } inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::release_generated_code_info() { - _has_bits_[0] &= ~0x00000008u; - ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* temp = generated_code_info_; - generated_code_info_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000008u; + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* temp = _impl_.generated_code_info_; + _impl_.generated_code_info_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -1697,18 +1691,18 @@ inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::r } inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::unsafe_arena_release_generated_code_info() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info) - _has_bits_[0] &= ~0x00000008u; - ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* temp = generated_code_info_; - generated_code_info_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000008u; + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* temp = _impl_.generated_code_info_; + _impl_.generated_code_info_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::_internal_mutable_generated_code_info() { - _has_bits_[0] |= 0x00000008u; - if (generated_code_info_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000008u; + if (_impl_.generated_code_info_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo>(GetArenaForAllocation()); - generated_code_info_ = p; + _impl_.generated_code_info_ = p; } - return generated_code_info_; + return _impl_.generated_code_info_; } inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::mutable_generated_code_info() { ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* _msg = _internal_mutable_generated_code_info(); @@ -1718,22 +1712,21 @@ inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::m inline void CodeGeneratorResponse_File::set_allocated_generated_code_info(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(generated_code_info_); + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.generated_code_info_); } if (generated_code_info) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(generated_code_info)); if (message_arena != submessage_arena) { generated_code_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, generated_code_info, submessage_arena); } - _has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000008u; } - generated_code_info_ = generated_code_info; + _impl_.generated_code_info_ = generated_code_info; // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info) } @@ -1743,15 +1736,15 @@ inline void CodeGeneratorResponse_File::set_allocated_generated_code_info(::PROT // optional string error = 1; inline bool CodeGeneratorResponse::_internal_has_error() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool CodeGeneratorResponse::has_error() const { return _internal_has_error(); } inline void CodeGeneratorResponse::clear_error() { - error_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.error_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& CodeGeneratorResponse::error() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.error) @@ -1760,8 +1753,8 @@ inline const std::string& CodeGeneratorResponse::error() const { template inline PROTOBUF_ALWAYS_INLINE void CodeGeneratorResponse::set_error(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - error_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.error_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.error) } inline std::string* CodeGeneratorResponse::mutable_error() { @@ -1770,41 +1763,40 @@ inline std::string* CodeGeneratorResponse::mutable_error() { return _s; } inline const std::string& CodeGeneratorResponse::_internal_error() const { - return error_.Get(); + return _impl_.error_.Get(); } inline void CodeGeneratorResponse::_internal_set_error(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - error_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.error_.Set(value, GetArenaForAllocation()); } inline std::string* CodeGeneratorResponse::_internal_mutable_error() { - _has_bits_[0] |= 0x00000001u; - return error_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.error_.Mutable(GetArenaForAllocation()); } inline std::string* CodeGeneratorResponse::release_error() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.error) if (!_internal_has_error()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = error_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.error_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (error_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - error_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.error_.IsDefault()) { + _impl_.error_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void CodeGeneratorResponse::set_allocated_error(std::string* error) { if (error != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - error_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), error, - GetArenaForAllocation()); + _impl_.error_.SetAllocated(error, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (error_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - error_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.error_.IsDefault()) { + _impl_.error_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.error) @@ -1812,26 +1804,26 @@ inline void CodeGeneratorResponse::set_allocated_error(std::string* error) { // optional uint64 supported_features = 2; inline bool CodeGeneratorResponse::_internal_has_supported_features() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool CodeGeneratorResponse::has_supported_features() const { return _internal_has_supported_features(); } inline void CodeGeneratorResponse::clear_supported_features() { - supported_features_ = uint64_t{0u}; - _has_bits_[0] &= ~0x00000002u; + _impl_.supported_features_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000002u; } inline uint64_t CodeGeneratorResponse::_internal_supported_features() const { - return supported_features_; + return _impl_.supported_features_; } inline uint64_t CodeGeneratorResponse::supported_features() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.supported_features) return _internal_supported_features(); } inline void CodeGeneratorResponse::_internal_set_supported_features(uint64_t value) { - _has_bits_[0] |= 0x00000002u; - supported_features_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.supported_features_ = value; } inline void CodeGeneratorResponse::set_supported_features(uint64_t value) { _internal_set_supported_features(value); @@ -1840,32 +1832,32 @@ inline void CodeGeneratorResponse::set_supported_features(uint64_t value) { // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; inline int CodeGeneratorResponse::_internal_file_size() const { - return file_.size(); + return _impl_.file_.size(); } inline int CodeGeneratorResponse::file_size() const { return _internal_file_size(); } inline void CodeGeneratorResponse::clear_file() { - file_.Clear(); + _impl_.file_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::mutable_file(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.file) - return file_.Mutable(index); + return _impl_.file_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >* CodeGeneratorResponse::mutable_file() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorResponse.file) - return &file_; + return &_impl_.file_; } inline const ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File& CodeGeneratorResponse::_internal_file(int index) const { - return file_.Get(index); + return _impl_.file_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File& CodeGeneratorResponse::file(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.file) return _internal_file(index); } inline ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::_internal_add_file() { - return file_.Add(); + return _impl_.file_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::add_file() { ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* _add = _internal_add_file(); @@ -1875,7 +1867,7 @@ inline ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* CodeGenera inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >& CodeGeneratorResponse::file() const { // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorResponse.file) - return file_; + return _impl_.file_; } #ifdef __GNUC__ diff --git a/windows/include/google/protobuf/compiler/python/generator.h b/windows/include/google/protobuf/compiler/python/generator.h new file mode 100644 index 000000000..f1fecbc73 --- /dev/null +++ b/windows/include/google/protobuf/compiler/python/generator.h @@ -0,0 +1,185 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: robinson@google.com (Will Robinson) +// +// Generates Python code for a given .proto file. + +#ifndef GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__ +#define GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__ + +#include + +#include +#include + +// Must be included last. +#include + +namespace google { +namespace protobuf { + +class Descriptor; +class EnumDescriptor; +class EnumValueDescriptor; +class FieldDescriptor; +class OneofDescriptor; +class ServiceDescriptor; + +namespace io { +class Printer; +} + +namespace compiler { +namespace python { + +// CodeGenerator implementation for generated Python protocol buffer classes. +// If you create your own protocol compiler binary and you want it to support +// Python output, you can do so by registering an instance of this +// CodeGenerator with the CommandLineInterface in your main() function. +class PROTOC_EXPORT Generator : public CodeGenerator { + public: + Generator(); + ~Generator() override; + + // CodeGenerator methods. + bool Generate(const FileDescriptor* file, const std::string& parameter, + GeneratorContext* generator_context, + std::string* error) const override; + + uint64_t GetSupportedFeatures() const override; + + private: + void PrintImports() const; + void PrintFileDescriptor() const; + void PrintAllNestedEnumsInFile() const; + void PrintNestedEnums(const Descriptor& descriptor) const; + void PrintEnum(const EnumDescriptor& enum_descriptor) const; + + void PrintFieldDescriptor(const FieldDescriptor& field, + bool is_extension) const; + void PrintFieldDescriptorsInDescriptor( + const Descriptor& message_descriptor, bool is_extension, + const std::string& list_variable_name, int (Descriptor::*CountFn)() const, + const FieldDescriptor* (Descriptor::*GetterFn)(int)const) const; + void PrintFieldsInDescriptor(const Descriptor& message_descriptor) const; + void PrintExtensionsInDescriptor(const Descriptor& message_descriptor) const; + void PrintMessageDescriptors() const; + void PrintDescriptor(const Descriptor& message_descriptor) const; + void PrintNestedDescriptors(const Descriptor& containing_descriptor) const; + + void PrintMessages() const; + void PrintMessage(const Descriptor& message_descriptor, + const std::string& prefix, + std::vector* to_register, + bool is_nested) const; + void PrintNestedMessages(const Descriptor& containing_descriptor, + const std::string& prefix, + std::vector* to_register) const; + + void FixForeignFieldsInDescriptors() const; + void FixForeignFieldsInDescriptor( + const Descriptor& descriptor, + const Descriptor* containing_descriptor) const; + void FixForeignFieldsInField(const Descriptor* containing_type, + const FieldDescriptor& field, + const std::string& python_dict_name) const; + void AddMessageToFileDescriptor(const Descriptor& descriptor) const; + void AddEnumToFileDescriptor(const EnumDescriptor& descriptor) const; + void AddExtensionToFileDescriptor(const FieldDescriptor& descriptor) const; + void AddServiceToFileDescriptor(const ServiceDescriptor& descriptor) const; + std::string FieldReferencingExpression( + const Descriptor* containing_type, const FieldDescriptor& field, + const std::string& python_dict_name) const; + template + void FixContainingTypeInDescriptor( + const DescriptorT& descriptor, + const Descriptor* containing_descriptor) const; + + void FixForeignFieldsInExtensions() const; + void FixForeignFieldsInExtension( + const FieldDescriptor& extension_field) const; + void FixForeignFieldsInNestedExtensions(const Descriptor& descriptor) const; + + void PrintServices() const; + void PrintServiceDescriptors() const; + void PrintServiceDescriptor(const ServiceDescriptor& descriptor) const; + void PrintServiceClass(const ServiceDescriptor& descriptor) const; + void PrintServiceStub(const ServiceDescriptor& descriptor) const; + void PrintDescriptorKeyAndModuleName( + const ServiceDescriptor& descriptor) const; + + void PrintEnumValueDescriptor(const EnumValueDescriptor& descriptor) const; + std::string OptionsValue(const std::string& serialized_options) const; + bool GeneratingDescriptorProto() const; + + template + std::string ModuleLevelDescriptorName(const DescriptorT& descriptor) const; + std::string ModuleLevelMessageName(const Descriptor& descriptor) const; + std::string ModuleLevelServiceDescriptorName( + const ServiceDescriptor& descriptor) const; + + template + void PrintSerializedPbInterval(const DescriptorT& descriptor, + DescriptorProtoT& proto, + const std::string& name) const; + + void FixAllDescriptorOptions() const; + void FixOptionsForField(const FieldDescriptor& field) const; + void FixOptionsForOneof(const OneofDescriptor& oneof) const; + void FixOptionsForEnum(const EnumDescriptor& descriptor) const; + void FixOptionsForService(const ServiceDescriptor& descriptor) const; + void FixOptionsForMessage(const Descriptor& descriptor) const; + + void SetSerializedPbInterval() const; + void SetMessagePbInterval(const Descriptor& descriptor) const; + + void CopyPublicDependenciesAliases(const std::string& copy_from, + const FileDescriptor* file) const; + + // Very coarse-grained lock to ensure that Generate() is reentrant. + // Guards file_, printer_ and file_descriptor_serialized_. + mutable Mutex mutex_; + mutable const FileDescriptor* file_; // Set in Generate(). Under mutex_. + mutable std::string file_descriptor_serialized_; + mutable io::Printer* printer_; // Set in Generate(). Under mutex_. + mutable bool pure_python_workable_; + + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Generator); +}; + +} // namespace python +} // namespace compiler +} // namespace protobuf +} // namespace google + +#include + +#endif // GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__ diff --git a/windows/include/google/protobuf/compiler/python/pyi_generator.h b/windows/include/google/protobuf/compiler/python/pyi_generator.h new file mode 100644 index 000000000..9611ed43d --- /dev/null +++ b/windows/include/google/protobuf/compiler/python/pyi_generator.h @@ -0,0 +1,120 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: jieluo@google.com (Jie Luo) +// +// Generates Python stub (.pyi) for a given .proto file. + +#ifndef GOOGLE_PROTOBUF_COMPILER_PYTHON_PYI_GENERATOR_H__ +#define GOOGLE_PROTOBUF_COMPILER_PYTHON_PYI_GENERATOR_H__ + +#include +#include +#include + +#include +#include + +// Must be included last. +#include + +namespace google { +namespace protobuf { +class Descriptor; +class EnumDescriptor; +class FieldDescriptor; +class MethodDescriptor; +class ServiceDescriptor; + +namespace io { +class Printer; +} + +namespace compiler { +namespace python { + +class PROTOC_EXPORT PyiGenerator : public google::protobuf::compiler::CodeGenerator { + public: + PyiGenerator(); + ~PyiGenerator() override; + + // CodeGenerator methods. + uint64_t GetSupportedFeatures() const override { + // Code generators must explicitly support proto3 optional. + return CodeGenerator::FEATURE_PROTO3_OPTIONAL; + } + bool Generate(const FileDescriptor* file, const std::string& parameter, + GeneratorContext* generator_context, + std::string* error) const override; + + private: + void PrintImportForDescriptor(const FileDescriptor& desc, + std::map* import_map, + std::set* seen_aliases) const; + void PrintImports(std::map* item_map, + std::map* import_map) const; + void PrintEnum(const EnumDescriptor& enum_descriptor) const; + void AddEnumValue(const EnumDescriptor& enum_descriptor, + std::map* item_map, + const std::map& import_map) const; + void PrintTopLevelEnums() const; + template + void AddExtensions(const DescriptorT& descriptor, + std::map* item_map) const; + void PrintMessages( + const std::map& import_map) const; + void PrintMessage(const Descriptor& message_descriptor, bool is_nested, + const std::map& import_map) const; + void PrintServices() const; + void PrintItemMap(const std::map& item_map) const; + std::string GetFieldType( + const FieldDescriptor& field_des, const Descriptor& containing_des, + const std::map& import_map) const; + template + std::string ModuleLevelName( + const DescriptorT& descriptor, + const std::map& import_map) const; + + // Very coarse-grained lock to ensure that Generate() is reentrant. + // Guards file_ and printer_. + mutable Mutex mutex_; + mutable const FileDescriptor* file_; // Set in Generate(). Under mutex_. + mutable io::Printer* printer_; // Set in Generate(). Under mutex_. + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PyiGenerator); +}; + +} // namespace python +} // namespace compiler +} // namespace protobuf +} // namespace google + +#include + +#endif // GOOGLE_PROTOBUF_COMPILER_PYTHON_PYI_GENERATOR_H__ diff --git a/windows/include/google/protobuf/compiler/python/python_generator.h b/windows/include/google/protobuf/compiler/python/python_generator.h index 3b4c1323b..21d48cd9a 100644 --- a/windows/include/google/protobuf/compiler/python/python_generator.h +++ b/windows/include/google/protobuf/compiler/python/python_generator.h @@ -1,193 +1,6 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifndef GOOGLE_PROTOBUF_COMPILER_PYTHON_PYTHON_GENERATOR_H_ +#define GOOGLE_PROTOBUF_COMPILER_PYTHON_PYTHON_GENERATOR_H_ -// Author: robinson@google.com (Will Robinson) -// -// Generates Python code for a given .proto file. +#include -#ifndef GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__ -#define GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__ - -#include - -#include -#include - -#include - -namespace google { -namespace protobuf { - -class Descriptor; -class EnumDescriptor; -class EnumValueDescriptor; -class FieldDescriptor; -class OneofDescriptor; -class ServiceDescriptor; - -namespace io { -class Printer; -} - -namespace compiler { -namespace python { - -enum class StripPrintDescriptor { kCreate, kFind }; - -// CodeGenerator implementation for generated Python protocol buffer classes. -// If you create your own protocol compiler binary and you want it to support -// Python output, you can do so by registering an instance of this -// CodeGenerator with the CommandLineInterface in your main() function. -class PROTOC_EXPORT Generator : public CodeGenerator { - public: - Generator(); - virtual ~Generator(); - - // CodeGenerator methods. - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* generator_context, - std::string* error) const override; - - uint64_t GetSupportedFeatures() const override; - - private: - void PrintImports() const; - void PrintFileDescriptor() const; - void PrintTopLevelEnums() const; - void PrintAllNestedEnumsInFile(StripPrintDescriptor print_mode) const; - void PrintNestedEnums(const Descriptor& descriptor, - StripPrintDescriptor print_mode) const; - void PrintCreateEnum(const EnumDescriptor& enum_descriptor) const; - void PrintFindEnum(const EnumDescriptor& enum_descriptor) const; - - void PrintTopLevelExtensions() const; - - void PrintFieldDescriptor(const FieldDescriptor& field, - bool is_extension) const; - void PrintFieldDescriptorsInDescriptor( - const Descriptor& message_descriptor, bool is_extension, - const std::string& list_variable_name, int (Descriptor::*CountFn)() const, - const FieldDescriptor* (Descriptor::*GetterFn)(int)const) const; - void PrintFieldsInDescriptor(const Descriptor& message_descriptor) const; - void PrintExtensionsInDescriptor(const Descriptor& message_descriptor) const; - void PrintMessageDescriptors(StripPrintDescriptor print_mode) const; - void PrintCreateDescriptor(const Descriptor& message_descriptor) const; - void PrintFindDescriptor(const Descriptor& message_descriptor) const; - void PrintNestedDescriptors(const Descriptor& containing_descriptor, - StripPrintDescriptor print_mode) const; - - void PrintMessages() const; - void PrintMessage(const Descriptor& message_descriptor, - const std::string& prefix, - std::vector* to_register, - bool is_nested) const; - void PrintNestedMessages(const Descriptor& containing_descriptor, - const std::string& prefix, - std::vector* to_register) const; - - void FixForeignFieldsInDescriptors() const; - void FixForeignFieldsInDescriptor( - const Descriptor& descriptor, - const Descriptor* containing_descriptor) const; - void FixForeignFieldsInField(const Descriptor* containing_type, - const FieldDescriptor& field, - const std::string& python_dict_name) const; - void AddMessageToFileDescriptor(const Descriptor& descriptor) const; - void AddEnumToFileDescriptor(const EnumDescriptor& descriptor) const; - void AddExtensionToFileDescriptor(const FieldDescriptor& descriptor) const; - void AddServiceToFileDescriptor(const ServiceDescriptor& descriptor) const; - std::string FieldReferencingExpression( - const Descriptor* containing_type, const FieldDescriptor& field, - const std::string& python_dict_name) const; - template - void FixContainingTypeInDescriptor( - const DescriptorT& descriptor, - const Descriptor* containing_descriptor) const; - - void FixForeignFieldsInExtensions() const; - void FixForeignFieldsInExtension( - const FieldDescriptor& extension_field) const; - void FixForeignFieldsInNestedExtensions(const Descriptor& descriptor) const; - - void PrintServices() const; - void PrintServiceDescriptors() const; - void PrintServiceDescriptor(const ServiceDescriptor& descriptor) const; - void PrintServiceClass(const ServiceDescriptor& descriptor) const; - void PrintServiceStub(const ServiceDescriptor& descriptor) const; - void PrintDescriptorKeyAndModuleName( - const ServiceDescriptor& descriptor) const; - - void PrintEnumValueDescriptor(const EnumValueDescriptor& descriptor) const; - std::string OptionsValue(const std::string& serialized_options) const; - bool GeneratingDescriptorProto() const; - - template - std::string ModuleLevelDescriptorName(const DescriptorT& descriptor) const; - std::string ModuleLevelMessageName(const Descriptor& descriptor) const; - std::string ModuleLevelServiceDescriptorName( - const ServiceDescriptor& descriptor) const; - - template - void PrintSerializedPbInterval(const DescriptorT& descriptor, - DescriptorProtoT& proto, - const std::string& name) const; - - void FixAllDescriptorOptions() const; - void FixOptionsForField(const FieldDescriptor& field) const; - void FixOptionsForOneof(const OneofDescriptor& oneof) const; - void FixOptionsForEnum(const EnumDescriptor& descriptor) const; - void FixOptionsForService(const ServiceDescriptor& descriptor) const; - void FixOptionsForMessage(const Descriptor& descriptor) const; - - void SetSerializedPbInterval() const; - void SetMessagePbInterval(const Descriptor& descriptor) const; - - void CopyPublicDependenciesAliases(const std::string& copy_from, - const FileDescriptor* file) const; - - // Very coarse-grained lock to ensure that Generate() is reentrant. - // Guards file_, printer_ and file_descriptor_serialized_. - mutable Mutex mutex_; - mutable const FileDescriptor* file_; // Set in Generate(). Under mutex_. - mutable std::string file_descriptor_serialized_; - mutable io::Printer* printer_; // Set in Generate(). Under mutex_. - mutable bool pure_python_workable_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Generator); -}; - -} // namespace python -} // namespace compiler -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__ +#endif // GOOGLE_PROTOBUF_COMPILER_PYTHON_PYTHON_GENERATOR_H_ diff --git a/windows/include/google/protobuf/descriptor.h b/windows/include/google/protobuf/descriptor.h index e74e355b5..6e536e570 100644 --- a/windows/include/google/protobuf/descriptor.h +++ b/windows/include/google/protobuf/descriptor.h @@ -54,6 +54,7 @@ #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_H__ #define GOOGLE_PROTOBUF_DESCRIPTOR_H__ + #include #include #include @@ -66,6 +67,8 @@ #include #include #include + +// Must be included last. #include // TYPE_BOOL is defined in the MacOS's ConditionalMacros.h. @@ -184,6 +187,19 @@ struct DebugStringOptions { // Must be instantiated as mutable in a descriptor. namespace internal { +// The classes in this file represent a significant memory footprint for the +// library. We make sure we are not accidentally making them larger by +// hardcoding the struct size for a specific platform. Use as: +// +// PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(type, expected_size_in_x84-64); +// + +#if !defined(PROTOBUF_INTERNAL_CHECK_CLASS_SIZE) +#define PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(t, expected) +#endif + +class FlatAllocator; + class PROTOBUF_EXPORT LazyDescriptor { public: // Init function to be called at init time of a descriptor containing @@ -217,10 +233,8 @@ class PROTOBUF_EXPORT LazyDescriptor { private: void Once(const ServiceDescriptor* service); - union { - const Descriptor* descriptor_; - const char* lazy_name_; - }; + const Descriptor* descriptor_; + // The once_ flag is followed by a NUL terminated string for the type name. internal::once_flag* once_; }; @@ -598,6 +612,7 @@ class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Descriptor); }; +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(Descriptor, 136); // Describes a single field of a message. To get the descriptor for a given // field, first get the Descriptor for the message in which it is defined, @@ -881,7 +896,7 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { // formats the default value appropriately and returns it as a string. // Must have a default value to call this. If quote_string_type is true, then - // types of CPPTYPE_STRING whill be surrounded by quotes and CEscaped. + // types of CPPTYPE_STRING will be surrounded by quotes and CEscaped. std::string DefaultValueAsString(bool quote_string_type) const; // Helper function that returns the field type name for DebugString. @@ -924,6 +939,8 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { const std::string* all_names_; const FileDescriptor* file_; + // The once_flag is followed by a NUL terminated string for the type name and + // enum default value (or empty string if no default enum). internal::once_flag* type_once_; static void TypeOnceInit(const FieldDescriptor* to_init); void InternalTypeOnceInit() const; @@ -935,7 +952,6 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { union { mutable const Descriptor* message_type; mutable const EnumDescriptor* enum_type; - const char* lazy_type_name; } type_descriptor_; const FieldOptions* options_; // IMPORTANT: If you add a new field, make sure to search for all instances @@ -952,7 +968,6 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { bool default_value_bool_; mutable const EnumValueDescriptor* default_value_enum_; - const char* lazy_default_value_enum_name_; const std::string* default_value_string_; mutable std::atomic default_generated_instance_; }; @@ -974,6 +989,7 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldDescriptor); }; +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(FieldDescriptor, 72); // Describes a oneof defined in a message type. class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase { @@ -1054,6 +1070,8 @@ class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(OneofDescriptor); }; +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(OneofDescriptor, 40); + // Describes an enum type defined in a .proto file. To get the EnumDescriptor // for a generated enum type, call TypeName_descriptor(). Use DescriptorPool // to construct your own descriptors. @@ -1223,6 +1241,8 @@ class PROTOBUF_EXPORT EnumDescriptor : private internal::SymbolBase { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumDescriptor); }; +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(EnumDescriptor, 72); + // Describes an individual enum constant of a particular type. To get the // EnumValueDescriptor for a given enum value, first get the EnumDescriptor // for its type, then use EnumDescriptor::FindValueByName() or @@ -1306,6 +1326,8 @@ class PROTOBUF_EXPORT EnumValueDescriptor : private internal::SymbolBaseN<0>, GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumValueDescriptor); }; +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(EnumValueDescriptor, 32); + // Describes an RPC service. Use DescriptorPool to construct your own // descriptors. class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase { @@ -1336,6 +1358,7 @@ class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase { // Look up a MethodDescriptor by name. const MethodDescriptor* FindMethodByName(ConstStringParam name) const; + // See Descriptor::CopyTo(). void CopyTo(ServiceDescriptorProto* proto) const; @@ -1386,6 +1409,7 @@ class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceDescriptor); }; +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(ServiceDescriptor, 48); // Describes an individual service method. To obtain a MethodDescriptor given // a service, first get its ServiceDescriptor, then call @@ -1474,11 +1498,12 @@ class PROTOBUF_EXPORT MethodDescriptor : private internal::SymbolBase { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MethodDescriptor); }; +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(MethodDescriptor, 64); // Describes a whole .proto file. To get the FileDescriptor for a compiled-in // file, get the descriptor for something defined in that file and call // descriptor->file(). Use DescriptorPool to construct your own descriptors. -class PROTOBUF_EXPORT FileDescriptor { +class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase { public: typedef FileDescriptorProto Proto; @@ -1615,32 +1640,9 @@ class PROTOBUF_EXPORT FileDescriptor { SourceLocation* out_location) const; private: + friend class Symbol; typedef FileOptions OptionsType; - const std::string* name_; - const std::string* package_; - const DescriptorPool* pool_; - - // Data required to do lazy initialization. - struct PROTOBUF_EXPORT LazyInitData { -#ifndef SWIG - internal::once_flag once; -#endif - const char** dependencies_names; - }; - - LazyInitData* dependencies_once_; - static void DependenciesOnceInit(const FileDescriptor* to_init); - void InternalDependenciesOnceInit() const; - - // These are arranged to minimize padding on 64-bit. - int dependency_count_; - int public_dependency_count_; - int weak_dependency_count_; - int message_type_count_; - int enum_type_count_; - int service_count_; - bool is_placeholder_; // Indicates the FileDescriptor is completed building. Used to verify // that type accessor functions that can possibly build a dependent file @@ -1651,6 +1653,25 @@ class PROTOBUF_EXPORT FileDescriptor { // This one is here to fill the padding. int extension_count_; + const std::string* name_; + const std::string* package_; + const DescriptorPool* pool_; + + // dependencies_once_ contain a once_flag followed by N NUL terminated + // strings. Dependencies that do not need to be loaded will be empty. ie just + // {'\0'} + internal::once_flag* dependencies_once_; + static void DependenciesOnceInit(const FileDescriptor* to_init); + void InternalDependenciesOnceInit() const; + + // These are arranged to minimize padding on 64-bit. + int dependency_count_; + int public_dependency_count_; + int weak_dependency_count_; + int message_type_count_; + int enum_type_count_; + int service_count_; + mutable const FileDescriptor** dependencies_; int* public_dependencies_; int* weak_dependencies_; @@ -1681,6 +1702,7 @@ class PROTOBUF_EXPORT FileDescriptor { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileDescriptor); }; +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(FileDescriptor, 144); // =================================================================== @@ -1973,7 +1995,6 @@ class PROTOBUF_EXPORT DescriptorPool { friend class ServiceDescriptor; friend class MethodDescriptor; friend class FileDescriptor; - friend class StreamDescriptor; friend class DescriptorBuilder; friend class FileDescriptorTables; @@ -2013,7 +2034,8 @@ class PROTOBUF_EXPORT DescriptorPool { // Create a placeholder FileDescriptor of the specified name FileDescriptor* NewPlaceholderFile(StringPiece name) const; - FileDescriptor* NewPlaceholderFileWithMutexHeld(StringPiece name) const; + FileDescriptor* NewPlaceholderFileWithMutexHeld( + StringPiece name, internal::FlatAllocator& alloc) const; enum PlaceholderType { PLACEHOLDER_MESSAGE, @@ -2412,6 +2434,7 @@ inline FileDescriptor::Syntax FileDescriptor::syntax() const { } // namespace protobuf } // namespace google +#undef PROTOBUF_INTERNAL_CHECK_CLASS_SIZE #include #endif // GOOGLE_PROTOBUF_DESCRIPTOR_H__ diff --git a/windows/include/google/protobuf/descriptor.pb.h b/windows/include/google/protobuf/descriptor.pb.h index 66d7e264d..9ae046ab1 100644 --- a/windows/include/google/protobuf/descriptor.pb.h +++ b/windows/include/google/protobuf/descriptor.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -43,14 +42,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fdescriptor_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[27] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto; @@ -334,7 +325,7 @@ class PROTOBUF_EXPORT FileDescriptorSet final : public: inline FileDescriptorSet() : FileDescriptorSet(nullptr) {} ~FileDescriptorSet() override; - explicit constexpr FileDescriptorSet(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FileDescriptorSet(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FileDescriptorSet(const FileDescriptorSet& from); FileDescriptorSet(FileDescriptorSet&& from) noexcept @@ -416,9 +407,11 @@ class PROTOBUF_EXPORT FileDescriptorSet final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const FileDescriptorSet& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const FileDescriptorSet& from); + void MergeFrom( const FileDescriptorSet& from) { + FileDescriptorSet::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -427,10 +420,10 @@ class PROTOBUF_EXPORT FileDescriptorSet final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FileDescriptorSet* other); @@ -443,9 +436,6 @@ class PROTOBUF_EXPORT FileDescriptorSet final : protected: explicit FileDescriptorSet(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -485,8 +475,11 @@ class PROTOBUF_EXPORT FileDescriptorSet final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto > file_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto > file_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -496,7 +489,7 @@ class PROTOBUF_EXPORT FileDescriptorProto final : public: inline FileDescriptorProto() : FileDescriptorProto(nullptr) {} ~FileDescriptorProto() override; - explicit constexpr FileDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FileDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FileDescriptorProto(const FileDescriptorProto& from); FileDescriptorProto(FileDescriptorProto&& from) noexcept @@ -578,9 +571,11 @@ class PROTOBUF_EXPORT FileDescriptorProto final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const FileDescriptorProto& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const FileDescriptorProto& from); + void MergeFrom( const FileDescriptorProto& from) { + FileDescriptorProto::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -589,10 +584,10 @@ class PROTOBUF_EXPORT FileDescriptorProto final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FileDescriptorProto* other); @@ -605,9 +600,6 @@ class PROTOBUF_EXPORT FileDescriptorProto final : protected: explicit FileDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -870,20 +862,23 @@ class PROTOBUF_EXPORT FileDescriptorProto final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField dependency_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto > message_type_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto > enum_type_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto > service_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto > extension_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > public_dependency_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > weak_dependency_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr package_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr syntax_; - ::PROTOBUF_NAMESPACE_ID::FileOptions* options_; - ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* source_code_info_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField dependency_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto > message_type_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto > enum_type_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto > service_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto > extension_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > public_dependency_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > weak_dependency_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr package_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr syntax_; + ::PROTOBUF_NAMESPACE_ID::FileOptions* options_; + ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* source_code_info_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -893,7 +888,7 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : public: inline DescriptorProto_ExtensionRange() : DescriptorProto_ExtensionRange(nullptr) {} ~DescriptorProto_ExtensionRange() override; - explicit constexpr DescriptorProto_ExtensionRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR DescriptorProto_ExtensionRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from); DescriptorProto_ExtensionRange(DescriptorProto_ExtensionRange&& from) noexcept @@ -975,9 +970,11 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const DescriptorProto_ExtensionRange& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const DescriptorProto_ExtensionRange& from); + void MergeFrom( const DescriptorProto_ExtensionRange& from) { + DescriptorProto_ExtensionRange::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -986,10 +983,10 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(DescriptorProto_ExtensionRange* other); @@ -1002,9 +999,6 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : protected: explicit DescriptorProto_ExtensionRange(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1072,11 +1066,14 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* options_; - int32_t start_; - int32_t end_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* options_; + int32_t start_; + int32_t end_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -1086,7 +1083,7 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : public: inline DescriptorProto_ReservedRange() : DescriptorProto_ReservedRange(nullptr) {} ~DescriptorProto_ReservedRange() override; - explicit constexpr DescriptorProto_ReservedRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR DescriptorProto_ReservedRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange& from); DescriptorProto_ReservedRange(DescriptorProto_ReservedRange&& from) noexcept @@ -1168,9 +1165,11 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const DescriptorProto_ReservedRange& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const DescriptorProto_ReservedRange& from); + void MergeFrom( const DescriptorProto_ReservedRange& from) { + DescriptorProto_ReservedRange::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1179,10 +1178,10 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(DescriptorProto_ReservedRange* other); @@ -1195,9 +1194,6 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : protected: explicit DescriptorProto_ReservedRange(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1246,10 +1242,13 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - int32_t start_; - int32_t end_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + int32_t start_; + int32_t end_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -1259,7 +1258,7 @@ class PROTOBUF_EXPORT DescriptorProto final : public: inline DescriptorProto() : DescriptorProto(nullptr) {} ~DescriptorProto() override; - explicit constexpr DescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR DescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); DescriptorProto(const DescriptorProto& from); DescriptorProto(DescriptorProto&& from) noexcept @@ -1341,9 +1340,11 @@ class PROTOBUF_EXPORT DescriptorProto final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const DescriptorProto& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const DescriptorProto& from); + void MergeFrom( const DescriptorProto& from) { + DescriptorProto::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1352,10 +1353,10 @@ class PROTOBUF_EXPORT DescriptorProto final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(DescriptorProto* other); @@ -1368,9 +1369,6 @@ class PROTOBUF_EXPORT DescriptorProto final : protected: explicit DescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1590,18 +1588,21 @@ class PROTOBUF_EXPORT DescriptorProto final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto > field_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto > nested_type_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto > enum_type_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange > extension_range_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto > extension_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto > oneof_decl_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange > reserved_range_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField reserved_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::MessageOptions* options_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto > field_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto > nested_type_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto > enum_type_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange > extension_range_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto > extension_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto > oneof_decl_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange > reserved_range_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField reserved_name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::MessageOptions* options_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -1611,7 +1612,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : public: inline ExtensionRangeOptions() : ExtensionRangeOptions(nullptr) {} ~ExtensionRangeOptions() override; - explicit constexpr ExtensionRangeOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ExtensionRangeOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ExtensionRangeOptions(const ExtensionRangeOptions& from); ExtensionRangeOptions(ExtensionRangeOptions&& from) noexcept @@ -1693,9 +1694,11 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const ExtensionRangeOptions& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const ExtensionRangeOptions& from); + void MergeFrom( const ExtensionRangeOptions& from) { + ExtensionRangeOptions::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1704,10 +1707,10 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ExtensionRangeOptions* other); @@ -1720,9 +1723,6 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : protected: explicit ExtensionRangeOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1763,7 +1763,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.Has(id.number()); + return _impl_._extensions_.Has(id.number()); } template & id) { - _extensions_.ClearExtension(id.number()); + _impl_._extensions_.ClearExtension(id.number()); } @@ -1783,7 +1783,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.ExtensionSize(id.number()); + return _impl_._extensions_.ExtensionSize(id.number()); } template & id) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value()); } @@ -1805,7 +1805,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { return _proto_TypeTraits::Mutable(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::ConstType value) { - _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_); } @@ -1827,7 +1827,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, - value, &_extensions_); + value, &_impl_._extensions_); } template & id) { return _proto_TypeTraits::Release(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id) { return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, int index) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, index); + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index); } template & id, int index) { - return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); + return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_); } template & id, int index, typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_); } @@ -1905,7 +1905,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { typename _proto_TypeTraits::Repeated::MutableType to_add = - _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); + _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_); return to_add; } @@ -1918,7 +1918,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Repeated::ConstType value) { _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, - &_extensions_); + &_impl_._extensions_); } @@ -1930,7 +1930,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ExtensionRangeOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); + return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_); } template & id) { return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, - _is_packed, &_extensions_); + _is_packed, &_impl_._extensions_); } // @@protoc_insertion_point(class_scope:google.protobuf.ExtensionRangeOptions) private: class _Internal; - ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; + + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -1965,7 +1968,7 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : public: inline FieldDescriptorProto() : FieldDescriptorProto(nullptr) {} ~FieldDescriptorProto() override; - explicit constexpr FieldDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FieldDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FieldDescriptorProto(const FieldDescriptorProto& from); FieldDescriptorProto(FieldDescriptorProto&& from) noexcept @@ -2047,9 +2050,11 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const FieldDescriptorProto& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const FieldDescriptorProto& from); + void MergeFrom( const FieldDescriptorProto& from) { + FieldDescriptorProto::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2058,10 +2063,10 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FieldDescriptorProto* other); @@ -2074,9 +2079,6 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : protected: explicit FieldDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2375,19 +2377,22 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr extendee_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr default_value_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr json_name_; - ::PROTOBUF_NAMESPACE_ID::FieldOptions* options_; - int32_t number_; - int32_t oneof_index_; - bool proto3_optional_; - int label_; - int type_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr extendee_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr default_value_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr json_name_; + ::PROTOBUF_NAMESPACE_ID::FieldOptions* options_; + int32_t number_; + int32_t oneof_index_; + bool proto3_optional_; + int label_; + int type_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -2397,7 +2402,7 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : public: inline OneofDescriptorProto() : OneofDescriptorProto(nullptr) {} ~OneofDescriptorProto() override; - explicit constexpr OneofDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR OneofDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); OneofDescriptorProto(const OneofDescriptorProto& from); OneofDescriptorProto(OneofDescriptorProto&& from) noexcept @@ -2479,9 +2484,11 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const OneofDescriptorProto& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const OneofDescriptorProto& from); + void MergeFrom( const OneofDescriptorProto& from) { + OneofDescriptorProto::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2490,10 +2497,10 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(OneofDescriptorProto* other); @@ -2506,9 +2513,6 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : protected: explicit OneofDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2567,10 +2571,13 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::OneofOptions* options_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::OneofOptions* options_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -2580,7 +2587,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : public: inline EnumDescriptorProto_EnumReservedRange() : EnumDescriptorProto_EnumReservedRange(nullptr) {} ~EnumDescriptorProto_EnumReservedRange() override; - explicit constexpr EnumDescriptorProto_EnumReservedRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR EnumDescriptorProto_EnumReservedRange(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); EnumDescriptorProto_EnumReservedRange(const EnumDescriptorProto_EnumReservedRange& from); EnumDescriptorProto_EnumReservedRange(EnumDescriptorProto_EnumReservedRange&& from) noexcept @@ -2662,9 +2669,11 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const EnumDescriptorProto_EnumReservedRange& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const EnumDescriptorProto_EnumReservedRange& from); + void MergeFrom( const EnumDescriptorProto_EnumReservedRange& from) { + EnumDescriptorProto_EnumReservedRange::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2673,10 +2682,10 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(EnumDescriptorProto_EnumReservedRange* other); @@ -2689,9 +2698,6 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : protected: explicit EnumDescriptorProto_EnumReservedRange(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2740,10 +2746,13 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - int32_t start_; - int32_t end_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + int32_t start_; + int32_t end_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -2753,7 +2762,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : public: inline EnumDescriptorProto() : EnumDescriptorProto(nullptr) {} ~EnumDescriptorProto() override; - explicit constexpr EnumDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR EnumDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); EnumDescriptorProto(const EnumDescriptorProto& from); EnumDescriptorProto(EnumDescriptorProto&& from) noexcept @@ -2835,9 +2844,11 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const EnumDescriptorProto& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const EnumDescriptorProto& from); + void MergeFrom( const EnumDescriptorProto& from) { + EnumDescriptorProto::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -2846,10 +2857,10 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(EnumDescriptorProto* other); @@ -2862,9 +2873,6 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : protected: explicit EnumDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -2988,13 +2996,16 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto > value_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange > reserved_range_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField reserved_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::EnumOptions* options_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto > value_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange > reserved_range_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField reserved_name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::EnumOptions* options_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -3004,7 +3015,7 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : public: inline EnumValueDescriptorProto() : EnumValueDescriptorProto(nullptr) {} ~EnumValueDescriptorProto() override; - explicit constexpr EnumValueDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR EnumValueDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); EnumValueDescriptorProto(const EnumValueDescriptorProto& from); EnumValueDescriptorProto(EnumValueDescriptorProto&& from) noexcept @@ -3086,9 +3097,11 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const EnumValueDescriptorProto& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const EnumValueDescriptorProto& from); + void MergeFrom( const EnumValueDescriptorProto& from) { + EnumValueDescriptorProto::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3097,10 +3110,10 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(EnumValueDescriptorProto* other); @@ -3113,9 +3126,6 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : protected: explicit EnumValueDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3188,11 +3198,14 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* options_; - int32_t number_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* options_; + int32_t number_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -3202,7 +3215,7 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : public: inline ServiceDescriptorProto() : ServiceDescriptorProto(nullptr) {} ~ServiceDescriptorProto() override; - explicit constexpr ServiceDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ServiceDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ServiceDescriptorProto(const ServiceDescriptorProto& from); ServiceDescriptorProto(ServiceDescriptorProto&& from) noexcept @@ -3284,9 +3297,11 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const ServiceDescriptorProto& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const ServiceDescriptorProto& from); + void MergeFrom( const ServiceDescriptorProto& from) { + ServiceDescriptorProto::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3295,10 +3310,10 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ServiceDescriptorProto* other); @@ -3311,9 +3326,6 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : protected: explicit ServiceDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3391,11 +3403,14 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto > method_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::ServiceOptions* options_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto > method_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::ServiceOptions* options_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -3405,7 +3420,7 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : public: inline MethodDescriptorProto() : MethodDescriptorProto(nullptr) {} ~MethodDescriptorProto() override; - explicit constexpr MethodDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR MethodDescriptorProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); MethodDescriptorProto(const MethodDescriptorProto& from); MethodDescriptorProto(MethodDescriptorProto&& from) noexcept @@ -3487,9 +3502,11 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const MethodDescriptorProto& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const MethodDescriptorProto& from); + void MergeFrom( const MethodDescriptorProto& from) { + MethodDescriptorProto::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3498,10 +3515,10 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(MethodDescriptorProto* other); @@ -3514,9 +3531,6 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : protected: explicit MethodDescriptorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -3641,14 +3655,17 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr input_type_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr output_type_; - ::PROTOBUF_NAMESPACE_ID::MethodOptions* options_; - bool client_streaming_; - bool server_streaming_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr input_type_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr output_type_; + ::PROTOBUF_NAMESPACE_ID::MethodOptions* options_; + bool client_streaming_; + bool server_streaming_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -3658,7 +3675,7 @@ class PROTOBUF_EXPORT FileOptions final : public: inline FileOptions() : FileOptions(nullptr) {} ~FileOptions() override; - explicit constexpr FileOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FileOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FileOptions(const FileOptions& from); FileOptions(FileOptions&& from) noexcept @@ -3740,9 +3757,11 @@ class PROTOBUF_EXPORT FileOptions final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const FileOptions& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const FileOptions& from); + void MergeFrom( const FileOptions& from) { + FileOptions::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -3751,10 +3770,10 @@ class PROTOBUF_EXPORT FileOptions final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FileOptions* other); @@ -3767,9 +3786,6 @@ class PROTOBUF_EXPORT FileOptions final : protected: explicit FileOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4172,7 +4188,7 @@ class PROTOBUF_EXPORT FileOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.Has(id.number()); + return _impl_._extensions_.Has(id.number()); } template & id) { - _extensions_.ClearExtension(id.number()); + _impl_._extensions_.ClearExtension(id.number()); } @@ -4192,7 +4208,7 @@ class PROTOBUF_EXPORT FileOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.ExtensionSize(id.number()); + return _impl_._extensions_.ExtensionSize(id.number()); } template & id) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value()); } @@ -4214,7 +4230,7 @@ class PROTOBUF_EXPORT FileOptions final : FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { return _proto_TypeTraits::Mutable(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::ConstType value) { - _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_); } @@ -4236,7 +4252,7 @@ class PROTOBUF_EXPORT FileOptions final : FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, - value, &_extensions_); + value, &_impl_._extensions_); } template & id) { return _proto_TypeTraits::Release(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id) { return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, int index) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, index); + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index); } template & id, int index) { - return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); + return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_); } template & id, int index, typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_); } @@ -4314,7 +4330,7 @@ class PROTOBUF_EXPORT FileOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { typename _proto_TypeTraits::Repeated::MutableType to_add = - _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); + _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_); return to_add; } @@ -4327,7 +4343,7 @@ class PROTOBUF_EXPORT FileOptions final : FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Repeated::ConstType value) { _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, - &_extensions_); + &_impl_._extensions_); } @@ -4339,7 +4355,7 @@ class PROTOBUF_EXPORT FileOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< FileOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); + return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_); } template & id) { return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, - _is_packed, &_extensions_); + _is_packed, &_impl_._extensions_); } // @@protoc_insertion_point(class_scope:google.protobuf.FileOptions) private: class _Internal; - ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr java_package_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr java_outer_classname_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr go_package_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr objc_class_prefix_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr csharp_namespace_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr swift_prefix_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr php_class_prefix_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr php_namespace_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr php_metadata_namespace_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr ruby_package_; - bool java_multiple_files_; - bool java_generate_equals_and_hash_; - bool java_string_check_utf8_; - bool cc_generic_services_; - bool java_generic_services_; - bool py_generic_services_; - bool php_generic_services_; - bool deprecated_; - int optimize_for_; - bool cc_enable_arenas_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; + + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr java_package_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr java_outer_classname_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr go_package_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr objc_class_prefix_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr csharp_namespace_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr swift_prefix_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr php_class_prefix_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr php_namespace_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr php_metadata_namespace_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr ruby_package_; + bool java_multiple_files_; + bool java_generate_equals_and_hash_; + bool java_string_check_utf8_; + bool cc_generic_services_; + bool java_generic_services_; + bool py_generic_services_; + bool php_generic_services_; + bool deprecated_; + int optimize_for_; + bool cc_enable_arenas_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -4395,7 +4414,7 @@ class PROTOBUF_EXPORT MessageOptions final : public: inline MessageOptions() : MessageOptions(nullptr) {} ~MessageOptions() override; - explicit constexpr MessageOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR MessageOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); MessageOptions(const MessageOptions& from); MessageOptions(MessageOptions&& from) noexcept @@ -4477,9 +4496,11 @@ class PROTOBUF_EXPORT MessageOptions final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const MessageOptions& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const MessageOptions& from); + void MergeFrom( const MessageOptions& from) { + MessageOptions::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4488,10 +4509,10 @@ class PROTOBUF_EXPORT MessageOptions final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(MessageOptions* other); @@ -4504,9 +4525,6 @@ class PROTOBUF_EXPORT MessageOptions final : protected: explicit MessageOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -4603,7 +4621,7 @@ class PROTOBUF_EXPORT MessageOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.Has(id.number()); + return _impl_._extensions_.Has(id.number()); } template & id) { - _extensions_.ClearExtension(id.number()); + _impl_._extensions_.ClearExtension(id.number()); } @@ -4623,7 +4641,7 @@ class PROTOBUF_EXPORT MessageOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.ExtensionSize(id.number()); + return _impl_._extensions_.ExtensionSize(id.number()); } template & id) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value()); } @@ -4645,7 +4663,7 @@ class PROTOBUF_EXPORT MessageOptions final : MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { return _proto_TypeTraits::Mutable(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::ConstType value) { - _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_); } @@ -4667,7 +4685,7 @@ class PROTOBUF_EXPORT MessageOptions final : MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, - value, &_extensions_); + value, &_impl_._extensions_); } template & id) { return _proto_TypeTraits::Release(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id) { return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, int index) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, index); + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index); } template & id, int index) { - return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); + return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_); } template & id, int index, typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_); } @@ -4745,7 +4763,7 @@ class PROTOBUF_EXPORT MessageOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { typename _proto_TypeTraits::Repeated::MutableType to_add = - _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); + _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_); return to_add; } @@ -4758,7 +4776,7 @@ class PROTOBUF_EXPORT MessageOptions final : MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Repeated::ConstType value) { _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, - &_extensions_); + &_impl_._extensions_); } @@ -4770,7 +4788,7 @@ class PROTOBUF_EXPORT MessageOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< MessageOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); + return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_); } template & id) { return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, - _is_packed, &_extensions_); + _is_packed, &_impl_._extensions_); } // @@protoc_insertion_point(class_scope:google.protobuf.MessageOptions) private: class _Internal; - ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; - bool message_set_wire_format_; - bool no_standard_descriptor_accessor_; - bool deprecated_; - bool map_entry_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; + + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; + bool message_set_wire_format_; + bool no_standard_descriptor_accessor_; + bool deprecated_; + bool map_entry_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -4810,7 +4831,7 @@ class PROTOBUF_EXPORT FieldOptions final : public: inline FieldOptions() : FieldOptions(nullptr) {} ~FieldOptions() override; - explicit constexpr FieldOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FieldOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FieldOptions(const FieldOptions& from); FieldOptions(FieldOptions&& from) noexcept @@ -4892,9 +4913,11 @@ class PROTOBUF_EXPORT FieldOptions final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const FieldOptions& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const FieldOptions& from); + void MergeFrom( const FieldOptions& from) { + FieldOptions::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -4903,10 +4926,10 @@ class PROTOBUF_EXPORT FieldOptions final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FieldOptions* other); @@ -4919,9 +4942,6 @@ class PROTOBUF_EXPORT FieldOptions final : protected: explicit FieldOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -5000,11 +5020,12 @@ class PROTOBUF_EXPORT FieldOptions final : enum : int { kUninterpretedOptionFieldNumber = 999, kCtypeFieldNumber = 1, + kJstypeFieldNumber = 6, kPackedFieldNumber = 2, kLazyFieldNumber = 5, + kUnverifiedLazyFieldNumber = 15, kDeprecatedFieldNumber = 3, kWeakFieldNumber = 10, - kJstypeFieldNumber = 6, }; // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; int uninterpreted_option_size() const; @@ -5037,6 +5058,19 @@ class PROTOBUF_EXPORT FieldOptions final : void _internal_set_ctype(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType value); public: + // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + bool has_jstype() const; + private: + bool _internal_has_jstype() const; + public: + void clear_jstype(); + ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType jstype() const; + void set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType value); + private: + ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType _internal_jstype() const; + void _internal_set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType value); + public: + // optional bool packed = 2; bool has_packed() const; private: @@ -5063,6 +5097,19 @@ class PROTOBUF_EXPORT FieldOptions final : void _internal_set_lazy(bool value); public: + // optional bool unverified_lazy = 15 [default = false]; + bool has_unverified_lazy() const; + private: + bool _internal_has_unverified_lazy() const; + public: + void clear_unverified_lazy(); + bool unverified_lazy() const; + void set_unverified_lazy(bool value); + private: + bool _internal_unverified_lazy() const; + void _internal_set_unverified_lazy(bool value); + public: + // optional bool deprecated = 3 [default = false]; bool has_deprecated() const; private: @@ -5089,19 +5136,6 @@ class PROTOBUF_EXPORT FieldOptions final : void _internal_set_weak(bool value); public: - // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; - bool has_jstype() const; - private: - bool _internal_has_jstype() const; - public: - void clear_jstype(); - ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType jstype() const; - void set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType value); - private: - ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType _internal_jstype() const; - void _internal_set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType value); - public: - template & id) const { - return _extensions_.Has(id.number()); + return _impl_._extensions_.Has(id.number()); } template & id) { - _extensions_.ClearExtension(id.number()); + _impl_._extensions_.ClearExtension(id.number()); } @@ -5130,7 +5164,7 @@ class PROTOBUF_EXPORT FieldOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.ExtensionSize(id.number()); + return _impl_._extensions_.ExtensionSize(id.number()); } template & id) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value()); } @@ -5152,7 +5186,7 @@ class PROTOBUF_EXPORT FieldOptions final : FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { return _proto_TypeTraits::Mutable(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::ConstType value) { - _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_); } @@ -5174,7 +5208,7 @@ class PROTOBUF_EXPORT FieldOptions final : FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, - value, &_extensions_); + value, &_impl_._extensions_); } template & id) { return _proto_TypeTraits::Release(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id) { return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, int index) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, index); + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index); } template & id, int index) { - return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); + return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_); } template & id, int index, typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_); } @@ -5252,7 +5286,7 @@ class PROTOBUF_EXPORT FieldOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { typename _proto_TypeTraits::Repeated::MutableType to_add = - _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); + _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_); return to_add; } @@ -5265,7 +5299,7 @@ class PROTOBUF_EXPORT FieldOptions final : FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Repeated::ConstType value) { _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, - &_extensions_); + &_impl_._extensions_); } @@ -5277,7 +5311,7 @@ class PROTOBUF_EXPORT FieldOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< FieldOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); + return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_); } template & id) { return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, - _is_packed, &_extensions_); + _is_packed, &_impl_._extensions_); } // @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions) private: class _Internal; - ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; - int ctype_; - bool packed_; - bool lazy_; - bool deprecated_; - bool weak_; - int jstype_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; + + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; + int ctype_; + int jstype_; + bool packed_; + bool lazy_; + bool unverified_lazy_; + bool deprecated_; + bool weak_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -5319,7 +5357,7 @@ class PROTOBUF_EXPORT OneofOptions final : public: inline OneofOptions() : OneofOptions(nullptr) {} ~OneofOptions() override; - explicit constexpr OneofOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR OneofOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); OneofOptions(const OneofOptions& from); OneofOptions(OneofOptions&& from) noexcept @@ -5401,9 +5439,11 @@ class PROTOBUF_EXPORT OneofOptions final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const OneofOptions& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const OneofOptions& from); + void MergeFrom( const OneofOptions& from) { + OneofOptions::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5412,10 +5452,10 @@ class PROTOBUF_EXPORT OneofOptions final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(OneofOptions* other); @@ -5428,9 +5468,6 @@ class PROTOBUF_EXPORT OneofOptions final : protected: explicit OneofOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -5471,7 +5508,7 @@ class PROTOBUF_EXPORT OneofOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.Has(id.number()); + return _impl_._extensions_.Has(id.number()); } template & id) { - _extensions_.ClearExtension(id.number()); + _impl_._extensions_.ClearExtension(id.number()); } @@ -5491,7 +5528,7 @@ class PROTOBUF_EXPORT OneofOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.ExtensionSize(id.number()); + return _impl_._extensions_.ExtensionSize(id.number()); } template & id) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value()); } @@ -5513,7 +5550,7 @@ class PROTOBUF_EXPORT OneofOptions final : OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { return _proto_TypeTraits::Mutable(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::ConstType value) { - _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_); } @@ -5535,7 +5572,7 @@ class PROTOBUF_EXPORT OneofOptions final : OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, - value, &_extensions_); + value, &_impl_._extensions_); } template & id) { return _proto_TypeTraits::Release(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id) { return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, int index) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, index); + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index); } template & id, int index) { - return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); + return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_); } template & id, int index, typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_); } @@ -5613,7 +5650,7 @@ class PROTOBUF_EXPORT OneofOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { typename _proto_TypeTraits::Repeated::MutableType to_add = - _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); + _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_); return to_add; } @@ -5626,7 +5663,7 @@ class PROTOBUF_EXPORT OneofOptions final : OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Repeated::ConstType value) { _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, - &_extensions_); + &_impl_._extensions_); } @@ -5638,7 +5675,7 @@ class PROTOBUF_EXPORT OneofOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< OneofOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); + return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_); } template & id) { return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, - _is_packed, &_extensions_); + _is_packed, &_impl_._extensions_); } // @@protoc_insertion_point(class_scope:google.protobuf.OneofOptions) private: class _Internal; - ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; + + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -5673,7 +5713,7 @@ class PROTOBUF_EXPORT EnumOptions final : public: inline EnumOptions() : EnumOptions(nullptr) {} ~EnumOptions() override; - explicit constexpr EnumOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR EnumOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); EnumOptions(const EnumOptions& from); EnumOptions(EnumOptions&& from) noexcept @@ -5755,9 +5795,11 @@ class PROTOBUF_EXPORT EnumOptions final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const EnumOptions& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const EnumOptions& from); + void MergeFrom( const EnumOptions& from) { + EnumOptions::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -5766,10 +5808,10 @@ class PROTOBUF_EXPORT EnumOptions final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(EnumOptions* other); @@ -5782,9 +5824,6 @@ class PROTOBUF_EXPORT EnumOptions final : protected: explicit EnumOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -5853,7 +5892,7 @@ class PROTOBUF_EXPORT EnumOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.Has(id.number()); + return _impl_._extensions_.Has(id.number()); } template & id) { - _extensions_.ClearExtension(id.number()); + _impl_._extensions_.ClearExtension(id.number()); } @@ -5873,7 +5912,7 @@ class PROTOBUF_EXPORT EnumOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.ExtensionSize(id.number()); + return _impl_._extensions_.ExtensionSize(id.number()); } template & id) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value()); } @@ -5895,7 +5934,7 @@ class PROTOBUF_EXPORT EnumOptions final : EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { return _proto_TypeTraits::Mutable(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::ConstType value) { - _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_); } @@ -5917,7 +5956,7 @@ class PROTOBUF_EXPORT EnumOptions final : EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, - value, &_extensions_); + value, &_impl_._extensions_); } template & id) { return _proto_TypeTraits::Release(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id) { return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, int index) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, index); + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index); } template & id, int index) { - return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); + return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_); } template & id, int index, typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_); } @@ -5995,7 +6034,7 @@ class PROTOBUF_EXPORT EnumOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { typename _proto_TypeTraits::Repeated::MutableType to_add = - _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); + _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_); return to_add; } @@ -6008,7 +6047,7 @@ class PROTOBUF_EXPORT EnumOptions final : EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Repeated::ConstType value) { _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, - &_extensions_); + &_impl_._extensions_); } @@ -6020,7 +6059,7 @@ class PROTOBUF_EXPORT EnumOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< EnumOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); + return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_); } template & id) { return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, - _is_packed, &_extensions_); + _is_packed, &_impl_._extensions_); } // @@protoc_insertion_point(class_scope:google.protobuf.EnumOptions) private: class _Internal; - ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; - bool allow_alias_; - bool deprecated_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; + + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; + bool allow_alias_; + bool deprecated_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -6058,7 +6100,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : public: inline EnumValueOptions() : EnumValueOptions(nullptr) {} ~EnumValueOptions() override; - explicit constexpr EnumValueOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR EnumValueOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); EnumValueOptions(const EnumValueOptions& from); EnumValueOptions(EnumValueOptions&& from) noexcept @@ -6140,9 +6182,11 @@ class PROTOBUF_EXPORT EnumValueOptions final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const EnumValueOptions& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const EnumValueOptions& from); + void MergeFrom( const EnumValueOptions& from) { + EnumValueOptions::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -6151,10 +6195,10 @@ class PROTOBUF_EXPORT EnumValueOptions final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(EnumValueOptions* other); @@ -6167,9 +6211,6 @@ class PROTOBUF_EXPORT EnumValueOptions final : protected: explicit EnumValueOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6224,7 +6265,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.Has(id.number()); + return _impl_._extensions_.Has(id.number()); } template & id) { - _extensions_.ClearExtension(id.number()); + _impl_._extensions_.ClearExtension(id.number()); } @@ -6244,7 +6285,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.ExtensionSize(id.number()); + return _impl_._extensions_.ExtensionSize(id.number()); } template & id) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value()); } @@ -6266,7 +6307,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { return _proto_TypeTraits::Mutable(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::ConstType value) { - _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_); } @@ -6288,7 +6329,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, - value, &_extensions_); + value, &_impl_._extensions_); } template & id) { return _proto_TypeTraits::Release(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id) { return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, int index) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, index); + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index); } template & id, int index) { - return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); + return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_); } template & id, int index, typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_); } @@ -6366,7 +6407,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { typename _proto_TypeTraits::Repeated::MutableType to_add = - _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); + _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_); return to_add; } @@ -6379,7 +6420,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Repeated::ConstType value) { _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, - &_extensions_); + &_impl_._extensions_); } @@ -6391,7 +6432,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< EnumValueOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); + return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_); } template & id) { return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, - _is_packed, &_extensions_); + _is_packed, &_impl_._extensions_); } // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueOptions) private: class _Internal; - ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; - bool deprecated_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; + + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; + bool deprecated_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -6428,7 +6472,7 @@ class PROTOBUF_EXPORT ServiceOptions final : public: inline ServiceOptions() : ServiceOptions(nullptr) {} ~ServiceOptions() override; - explicit constexpr ServiceOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ServiceOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ServiceOptions(const ServiceOptions& from); ServiceOptions(ServiceOptions&& from) noexcept @@ -6510,9 +6554,11 @@ class PROTOBUF_EXPORT ServiceOptions final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const ServiceOptions& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const ServiceOptions& from); + void MergeFrom( const ServiceOptions& from) { + ServiceOptions::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -6521,10 +6567,10 @@ class PROTOBUF_EXPORT ServiceOptions final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ServiceOptions* other); @@ -6537,9 +6583,6 @@ class PROTOBUF_EXPORT ServiceOptions final : protected: explicit ServiceOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -6594,7 +6637,7 @@ class PROTOBUF_EXPORT ServiceOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.Has(id.number()); + return _impl_._extensions_.Has(id.number()); } template & id) { - _extensions_.ClearExtension(id.number()); + _impl_._extensions_.ClearExtension(id.number()); } @@ -6614,7 +6657,7 @@ class PROTOBUF_EXPORT ServiceOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.ExtensionSize(id.number()); + return _impl_._extensions_.ExtensionSize(id.number()); } template & id) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value()); } @@ -6636,7 +6679,7 @@ class PROTOBUF_EXPORT ServiceOptions final : ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { return _proto_TypeTraits::Mutable(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::ConstType value) { - _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_); } @@ -6658,7 +6701,7 @@ class PROTOBUF_EXPORT ServiceOptions final : ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, - value, &_extensions_); + value, &_impl_._extensions_); } template & id) { return _proto_TypeTraits::Release(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id) { return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, int index) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, index); + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index); } template & id, int index) { - return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); + return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_); } template & id, int index, typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_); } @@ -6736,7 +6779,7 @@ class PROTOBUF_EXPORT ServiceOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { typename _proto_TypeTraits::Repeated::MutableType to_add = - _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); + _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_); return to_add; } @@ -6749,7 +6792,7 @@ class PROTOBUF_EXPORT ServiceOptions final : ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Repeated::ConstType value) { _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, - &_extensions_); + &_impl_._extensions_); } @@ -6761,7 +6804,7 @@ class PROTOBUF_EXPORT ServiceOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ServiceOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); + return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_); } template & id) { return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, - _is_packed, &_extensions_); + _is_packed, &_impl_._extensions_); } // @@protoc_insertion_point(class_scope:google.protobuf.ServiceOptions) private: class _Internal; - ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; - bool deprecated_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; + + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; + bool deprecated_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -6798,7 +6844,7 @@ class PROTOBUF_EXPORT MethodOptions final : public: inline MethodOptions() : MethodOptions(nullptr) {} ~MethodOptions() override; - explicit constexpr MethodOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR MethodOptions(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); MethodOptions(const MethodOptions& from); MethodOptions(MethodOptions&& from) noexcept @@ -6880,9 +6926,11 @@ class PROTOBUF_EXPORT MethodOptions final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const MethodOptions& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const MethodOptions& from); + void MergeFrom( const MethodOptions& from) { + MethodOptions::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -6891,10 +6939,10 @@ class PROTOBUF_EXPORT MethodOptions final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(MethodOptions* other); @@ -6907,9 +6955,6 @@ class PROTOBUF_EXPORT MethodOptions final : protected: explicit MethodOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7010,7 +7055,7 @@ class PROTOBUF_EXPORT MethodOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.Has(id.number()); + return _impl_._extensions_.Has(id.number()); } template & id) { - _extensions_.ClearExtension(id.number()); + _impl_._extensions_.ClearExtension(id.number()); } @@ -7030,7 +7075,7 @@ class PROTOBUF_EXPORT MethodOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _extensions_.ExtensionSize(id.number()); + return _impl_._extensions_.ExtensionSize(id.number()); } template & id) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value()); } @@ -7052,7 +7097,7 @@ class PROTOBUF_EXPORT MethodOptions final : MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { return _proto_TypeTraits::Mutable(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::ConstType value) { - _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_); } @@ -7074,7 +7119,7 @@ class PROTOBUF_EXPORT MethodOptions final : MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, - &_extensions_); + &_impl_._extensions_); } template & id, typename _proto_TypeTraits::Singular::MutableType value) { _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, - value, &_extensions_); + value, &_impl_._extensions_); } template & id) { return _proto_TypeTraits::Release(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id) { return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, - &_extensions_); + &_impl_._extensions_); } template & id, int index) const { - return _proto_TypeTraits::Get(id.number(), _extensions_, index); + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index); } template & id, int index) { - return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); + return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_); } template & id, int index, typename _proto_TypeTraits::Repeated::ConstType value) { - _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); + _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_); } @@ -7152,7 +7197,7 @@ class PROTOBUF_EXPORT MethodOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) { typename _proto_TypeTraits::Repeated::MutableType to_add = - _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); + _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_); return to_add; } @@ -7165,7 +7210,7 @@ class PROTOBUF_EXPORT MethodOptions final : MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id, typename _proto_TypeTraits::Repeated::ConstType value) { _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, - &_extensions_); + &_impl_._extensions_); } @@ -7177,7 +7222,7 @@ class PROTOBUF_EXPORT MethodOptions final : const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< MethodOptions, _proto_TypeTraits, _field_type, _is_packed>& id) const { - return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); + return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_); } template & id) { return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, - _is_packed, &_extensions_); + _is_packed, &_impl_._extensions_); } // @@protoc_insertion_point(class_scope:google.protobuf.MethodOptions) private: class _Internal; - ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; - bool deprecated_; - int idempotency_level_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_; + + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption > uninterpreted_option_; + bool deprecated_; + int idempotency_level_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -7215,7 +7263,7 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : public: inline UninterpretedOption_NamePart() : UninterpretedOption_NamePart(nullptr) {} ~UninterpretedOption_NamePart() override; - explicit constexpr UninterpretedOption_NamePart(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UninterpretedOption_NamePart(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); UninterpretedOption_NamePart(const UninterpretedOption_NamePart& from); UninterpretedOption_NamePart(UninterpretedOption_NamePart&& from) noexcept @@ -7297,9 +7345,11 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const UninterpretedOption_NamePart& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const UninterpretedOption_NamePart& from); + void MergeFrom( const UninterpretedOption_NamePart& from) { + UninterpretedOption_NamePart::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -7308,10 +7358,10 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(UninterpretedOption_NamePart* other); @@ -7324,9 +7374,6 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : protected: explicit UninterpretedOption_NamePart(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7383,10 +7430,13 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_part_; - bool is_extension_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_part_; + bool is_extension_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -7396,7 +7446,7 @@ class PROTOBUF_EXPORT UninterpretedOption final : public: inline UninterpretedOption() : UninterpretedOption(nullptr) {} ~UninterpretedOption() override; - explicit constexpr UninterpretedOption(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UninterpretedOption(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); UninterpretedOption(const UninterpretedOption& from); UninterpretedOption(UninterpretedOption&& from) noexcept @@ -7478,9 +7528,11 @@ class PROTOBUF_EXPORT UninterpretedOption final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const UninterpretedOption& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const UninterpretedOption& from); + void MergeFrom( const UninterpretedOption& from) { + UninterpretedOption::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -7489,10 +7541,10 @@ class PROTOBUF_EXPORT UninterpretedOption final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(UninterpretedOption* other); @@ -7505,9 +7557,6 @@ class PROTOBUF_EXPORT UninterpretedOption final : protected: explicit UninterpretedOption(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7648,15 +7697,18 @@ class PROTOBUF_EXPORT UninterpretedOption final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart > name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr identifier_value_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr string_value_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr aggregate_value_; - uint64_t positive_int_value_; - int64_t negative_int_value_; - double double_value_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart > name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr identifier_value_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr string_value_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr aggregate_value_; + uint64_t positive_int_value_; + int64_t negative_int_value_; + double double_value_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -7666,7 +7718,7 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : public: inline SourceCodeInfo_Location() : SourceCodeInfo_Location(nullptr) {} ~SourceCodeInfo_Location() override; - explicit constexpr SourceCodeInfo_Location(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR SourceCodeInfo_Location(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); SourceCodeInfo_Location(const SourceCodeInfo_Location& from); SourceCodeInfo_Location(SourceCodeInfo_Location&& from) noexcept @@ -7748,9 +7800,11 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const SourceCodeInfo_Location& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const SourceCodeInfo_Location& from); + void MergeFrom( const SourceCodeInfo_Location& from) { + SourceCodeInfo_Location::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -7759,10 +7813,10 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(SourceCodeInfo_Location* other); @@ -7775,9 +7829,6 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : protected: explicit SourceCodeInfo_Location(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -7907,15 +7958,18 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > path_; - mutable std::atomic _path_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > span_; - mutable std::atomic _span_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField leading_detached_comments_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr leading_comments_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr trailing_comments_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > path_; + mutable std::atomic _path_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > span_; + mutable std::atomic _span_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField leading_detached_comments_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr leading_comments_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr trailing_comments_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -7925,7 +7979,7 @@ class PROTOBUF_EXPORT SourceCodeInfo final : public: inline SourceCodeInfo() : SourceCodeInfo(nullptr) {} ~SourceCodeInfo() override; - explicit constexpr SourceCodeInfo(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR SourceCodeInfo(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); SourceCodeInfo(const SourceCodeInfo& from); SourceCodeInfo(SourceCodeInfo&& from) noexcept @@ -8007,9 +8061,11 @@ class PROTOBUF_EXPORT SourceCodeInfo final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const SourceCodeInfo& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const SourceCodeInfo& from); + void MergeFrom( const SourceCodeInfo& from) { + SourceCodeInfo::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -8018,10 +8074,10 @@ class PROTOBUF_EXPORT SourceCodeInfo final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(SourceCodeInfo* other); @@ -8034,9 +8090,6 @@ class PROTOBUF_EXPORT SourceCodeInfo final : protected: explicit SourceCodeInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8078,8 +8131,11 @@ class PROTOBUF_EXPORT SourceCodeInfo final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location > location_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location > location_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -8089,7 +8145,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : public: inline GeneratedCodeInfo_Annotation() : GeneratedCodeInfo_Annotation(nullptr) {} ~GeneratedCodeInfo_Annotation() override; - explicit constexpr GeneratedCodeInfo_Annotation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR GeneratedCodeInfo_Annotation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); GeneratedCodeInfo_Annotation(const GeneratedCodeInfo_Annotation& from); GeneratedCodeInfo_Annotation(GeneratedCodeInfo_Annotation&& from) noexcept @@ -8171,9 +8227,11 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const GeneratedCodeInfo_Annotation& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const GeneratedCodeInfo_Annotation& from); + void MergeFrom( const GeneratedCodeInfo_Annotation& from) { + GeneratedCodeInfo_Annotation::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -8182,10 +8240,10 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(GeneratedCodeInfo_Annotation* other); @@ -8198,9 +8256,6 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : protected: explicit GeneratedCodeInfo_Annotation(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8291,13 +8346,16 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > path_; - mutable std::atomic _path_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr source_file_; - int32_t begin_; - int32_t end_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t > path_; + mutable std::atomic _path_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr source_file_; + int32_t begin_; + int32_t end_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // ------------------------------------------------------------------- @@ -8307,7 +8365,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : public: inline GeneratedCodeInfo() : GeneratedCodeInfo(nullptr) {} ~GeneratedCodeInfo() override; - explicit constexpr GeneratedCodeInfo(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR GeneratedCodeInfo(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); GeneratedCodeInfo(const GeneratedCodeInfo& from); GeneratedCodeInfo(GeneratedCodeInfo&& from) noexcept @@ -8389,9 +8447,11 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const GeneratedCodeInfo& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const GeneratedCodeInfo& from); + void MergeFrom( const GeneratedCodeInfo& from) { + GeneratedCodeInfo::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -8400,10 +8460,10 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(GeneratedCodeInfo* other); @@ -8416,9 +8476,6 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : protected: explicit GeneratedCodeInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -8460,8 +8517,11 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation > annotation_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation > annotation_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; }; // =================================================================== @@ -8477,32 +8537,32 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : // repeated .google.protobuf.FileDescriptorProto file = 1; inline int FileDescriptorSet::_internal_file_size() const { - return file_.size(); + return _impl_.file_.size(); } inline int FileDescriptorSet::file_size() const { return _internal_file_size(); } inline void FileDescriptorSet::clear_file() { - file_.Clear(); + _impl_.file_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* FileDescriptorSet::mutable_file(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorSet.file) - return file_.Mutable(index); + return _impl_.file_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >* FileDescriptorSet::mutable_file() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorSet.file) - return &file_; + return &_impl_.file_; } inline const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& FileDescriptorSet::_internal_file(int index) const { - return file_.Get(index); + return _impl_.file_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& FileDescriptorSet::file(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorSet.file) return _internal_file(index); } inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* FileDescriptorSet::_internal_add_file() { - return file_.Add(); + return _impl_.file_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* FileDescriptorSet::add_file() { ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* _add = _internal_add_file(); @@ -8512,7 +8572,7 @@ inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* FileDescriptorSet::add_file inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >& FileDescriptorSet::file() const { // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorSet.file) - return file_; + return _impl_.file_; } // ------------------------------------------------------------------- @@ -8521,15 +8581,15 @@ FileDescriptorSet::file() const { // optional string name = 1; inline bool FileDescriptorProto::_internal_has_name() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool FileDescriptorProto::has_name() const { return _internal_has_name(); } inline void FileDescriptorProto::clear_name() { - name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& FileDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.name) @@ -8538,8 +8598,8 @@ inline const std::string& FileDescriptorProto::name() const { template inline PROTOBUF_ALWAYS_INLINE void FileDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.name) } inline std::string* FileDescriptorProto::mutable_name() { @@ -8548,41 +8608,40 @@ inline std::string* FileDescriptorProto::mutable_name() { return _s; } inline const std::string& FileDescriptorProto::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void FileDescriptorProto::_internal_set_name(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* FileDescriptorProto::_internal_mutable_name() { - _has_bits_[0] |= 0x00000001u; - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* FileDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.name) if (!_internal_has_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileDescriptorProto::set_allocated_name(std::string* name) { if (name != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.name) @@ -8590,15 +8649,15 @@ inline void FileDescriptorProto::set_allocated_name(std::string* name) { // optional string package = 2; inline bool FileDescriptorProto::_internal_has_package() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool FileDescriptorProto::has_package() const { return _internal_has_package(); } inline void FileDescriptorProto::clear_package() { - package_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000002u; + _impl_.package_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const std::string& FileDescriptorProto::package() const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.package) @@ -8607,8 +8666,8 @@ inline const std::string& FileDescriptorProto::package() const { template inline PROTOBUF_ALWAYS_INLINE void FileDescriptorProto::set_package(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000002u; - package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.package_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.package) } inline std::string* FileDescriptorProto::mutable_package() { @@ -8617,41 +8676,40 @@ inline std::string* FileDescriptorProto::mutable_package() { return _s; } inline const std::string& FileDescriptorProto::_internal_package() const { - return package_.Get(); + return _impl_.package_.Get(); } inline void FileDescriptorProto::_internal_set_package(const std::string& value) { - _has_bits_[0] |= 0x00000002u; - package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.package_.Set(value, GetArenaForAllocation()); } inline std::string* FileDescriptorProto::_internal_mutable_package() { - _has_bits_[0] |= 0x00000002u; - return package_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.package_.Mutable(GetArenaForAllocation()); } inline std::string* FileDescriptorProto::release_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.package) if (!_internal_has_package()) { return nullptr; } - _has_bits_[0] &= ~0x00000002u; - auto* p = package_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.package_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.package_.IsDefault()) { + _impl_.package_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileDescriptorProto::set_allocated_package(std::string* package) { if (package != nullptr) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - package_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), package, - GetArenaForAllocation()); + _impl_.package_.SetAllocated(package, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.package_.IsDefault()) { + _impl_.package_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.package) @@ -8659,13 +8717,13 @@ inline void FileDescriptorProto::set_allocated_package(std::string* package) { // repeated string dependency = 3; inline int FileDescriptorProto::_internal_dependency_size() const { - return dependency_.size(); + return _impl_.dependency_.size(); } inline int FileDescriptorProto::dependency_size() const { return _internal_dependency_size(); } inline void FileDescriptorProto::clear_dependency() { - dependency_.Clear(); + _impl_.dependency_.Clear(); } inline std::string* FileDescriptorProto::add_dependency() { std::string* _s = _internal_add_dependency(); @@ -8673,7 +8731,7 @@ inline std::string* FileDescriptorProto::add_dependency() { return _s; } inline const std::string& FileDescriptorProto::_internal_dependency(int index) const { - return dependency_.Get(index); + return _impl_.dependency_.Get(index); } inline const std::string& FileDescriptorProto::dependency(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.dependency) @@ -8681,80 +8739,80 @@ inline const std::string& FileDescriptorProto::dependency(int index) const { } inline std::string* FileDescriptorProto::mutable_dependency(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.dependency) - return dependency_.Mutable(index); + return _impl_.dependency_.Mutable(index); } inline void FileDescriptorProto::set_dependency(int index, const std::string& value) { - dependency_.Mutable(index)->assign(value); + _impl_.dependency_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency) } inline void FileDescriptorProto::set_dependency(int index, std::string&& value) { - dependency_.Mutable(index)->assign(std::move(value)); + _impl_.dependency_.Mutable(index)->assign(std::move(value)); // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency) } inline void FileDescriptorProto::set_dependency(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); - dependency_.Mutable(index)->assign(value); + _impl_.dependency_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.dependency) } inline void FileDescriptorProto::set_dependency(int index, const char* value, size_t size) { - dependency_.Mutable(index)->assign( + _impl_.dependency_.Mutable(index)->assign( reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.dependency) } inline std::string* FileDescriptorProto::_internal_add_dependency() { - return dependency_.Add(); + return _impl_.dependency_.Add(); } inline void FileDescriptorProto::add_dependency(const std::string& value) { - dependency_.Add()->assign(value); + _impl_.dependency_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency) } inline void FileDescriptorProto::add_dependency(std::string&& value) { - dependency_.Add(std::move(value)); + _impl_.dependency_.Add(std::move(value)); // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency) } inline void FileDescriptorProto::add_dependency(const char* value) { GOOGLE_DCHECK(value != nullptr); - dependency_.Add()->assign(value); + _impl_.dependency_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.FileDescriptorProto.dependency) } inline void FileDescriptorProto::add_dependency(const char* value, size_t size) { - dependency_.Add()->assign(reinterpret_cast(value), size); + _impl_.dependency_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:google.protobuf.FileDescriptorProto.dependency) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& FileDescriptorProto::dependency() const { // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.dependency) - return dependency_; + return _impl_.dependency_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* FileDescriptorProto::mutable_dependency() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.dependency) - return &dependency_; + return &_impl_.dependency_; } // repeated int32 public_dependency = 10; inline int FileDescriptorProto::_internal_public_dependency_size() const { - return public_dependency_.size(); + return _impl_.public_dependency_.size(); } inline int FileDescriptorProto::public_dependency_size() const { return _internal_public_dependency_size(); } inline void FileDescriptorProto::clear_public_dependency() { - public_dependency_.Clear(); + _impl_.public_dependency_.Clear(); } inline int32_t FileDescriptorProto::_internal_public_dependency(int index) const { - return public_dependency_.Get(index); + return _impl_.public_dependency_.Get(index); } inline int32_t FileDescriptorProto::public_dependency(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.public_dependency) return _internal_public_dependency(index); } inline void FileDescriptorProto::set_public_dependency(int index, int32_t value) { - public_dependency_.Set(index, value); + _impl_.public_dependency_.Set(index, value); // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.public_dependency) } inline void FileDescriptorProto::_internal_add_public_dependency(int32_t value) { - public_dependency_.Add(value); + _impl_.public_dependency_.Add(value); } inline void FileDescriptorProto::add_public_dependency(int32_t value) { _internal_add_public_dependency(value); @@ -8762,7 +8820,7 @@ inline void FileDescriptorProto::add_public_dependency(int32_t value) { } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >& FileDescriptorProto::_internal_public_dependency() const { - return public_dependency_; + return _impl_.public_dependency_; } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >& FileDescriptorProto::public_dependency() const { @@ -8771,7 +8829,7 @@ FileDescriptorProto::public_dependency() const { } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >* FileDescriptorProto::_internal_mutable_public_dependency() { - return &public_dependency_; + return &_impl_.public_dependency_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >* FileDescriptorProto::mutable_public_dependency() { @@ -8781,27 +8839,27 @@ FileDescriptorProto::mutable_public_dependency() { // repeated int32 weak_dependency = 11; inline int FileDescriptorProto::_internal_weak_dependency_size() const { - return weak_dependency_.size(); + return _impl_.weak_dependency_.size(); } inline int FileDescriptorProto::weak_dependency_size() const { return _internal_weak_dependency_size(); } inline void FileDescriptorProto::clear_weak_dependency() { - weak_dependency_.Clear(); + _impl_.weak_dependency_.Clear(); } inline int32_t FileDescriptorProto::_internal_weak_dependency(int index) const { - return weak_dependency_.Get(index); + return _impl_.weak_dependency_.Get(index); } inline int32_t FileDescriptorProto::weak_dependency(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.weak_dependency) return _internal_weak_dependency(index); } inline void FileDescriptorProto::set_weak_dependency(int index, int32_t value) { - weak_dependency_.Set(index, value); + _impl_.weak_dependency_.Set(index, value); // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.weak_dependency) } inline void FileDescriptorProto::_internal_add_weak_dependency(int32_t value) { - weak_dependency_.Add(value); + _impl_.weak_dependency_.Add(value); } inline void FileDescriptorProto::add_weak_dependency(int32_t value) { _internal_add_weak_dependency(value); @@ -8809,7 +8867,7 @@ inline void FileDescriptorProto::add_weak_dependency(int32_t value) { } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >& FileDescriptorProto::_internal_weak_dependency() const { - return weak_dependency_; + return _impl_.weak_dependency_; } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >& FileDescriptorProto::weak_dependency() const { @@ -8818,7 +8876,7 @@ FileDescriptorProto::weak_dependency() const { } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >* FileDescriptorProto::_internal_mutable_weak_dependency() { - return &weak_dependency_; + return &_impl_.weak_dependency_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >* FileDescriptorProto::mutable_weak_dependency() { @@ -8828,32 +8886,32 @@ FileDescriptorProto::mutable_weak_dependency() { // repeated .google.protobuf.DescriptorProto message_type = 4; inline int FileDescriptorProto::_internal_message_type_size() const { - return message_type_.size(); + return _impl_.message_type_.size(); } inline int FileDescriptorProto::message_type_size() const { return _internal_message_type_size(); } inline void FileDescriptorProto::clear_message_type() { - message_type_.Clear(); + _impl_.message_type_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* FileDescriptorProto::mutable_message_type(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.message_type) - return message_type_.Mutable(index); + return _impl_.message_type_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >* FileDescriptorProto::mutable_message_type() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.message_type) - return &message_type_; + return &_impl_.message_type_; } inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& FileDescriptorProto::_internal_message_type(int index) const { - return message_type_.Get(index); + return _impl_.message_type_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& FileDescriptorProto::message_type(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.message_type) return _internal_message_type(index); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* FileDescriptorProto::_internal_add_message_type() { - return message_type_.Add(); + return _impl_.message_type_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* FileDescriptorProto::add_message_type() { ::PROTOBUF_NAMESPACE_ID::DescriptorProto* _add = _internal_add_message_type(); @@ -8863,37 +8921,37 @@ inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* FileDescriptorProto::add_messag inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >& FileDescriptorProto::message_type() const { // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.message_type) - return message_type_; + return _impl_.message_type_; } // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; inline int FileDescriptorProto::_internal_enum_type_size() const { - return enum_type_.size(); + return _impl_.enum_type_.size(); } inline int FileDescriptorProto::enum_type_size() const { return _internal_enum_type_size(); } inline void FileDescriptorProto::clear_enum_type() { - enum_type_.Clear(); + _impl_.enum_type_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* FileDescriptorProto::mutable_enum_type(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.enum_type) - return enum_type_.Mutable(index); + return _impl_.enum_type_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >* FileDescriptorProto::mutable_enum_type() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.enum_type) - return &enum_type_; + return &_impl_.enum_type_; } inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& FileDescriptorProto::_internal_enum_type(int index) const { - return enum_type_.Get(index); + return _impl_.enum_type_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& FileDescriptorProto::enum_type(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.enum_type) return _internal_enum_type(index); } inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* FileDescriptorProto::_internal_add_enum_type() { - return enum_type_.Add(); + return _impl_.enum_type_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* FileDescriptorProto::add_enum_type() { ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* _add = _internal_add_enum_type(); @@ -8903,37 +8961,37 @@ inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* FileDescriptorProto::add_en inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >& FileDescriptorProto::enum_type() const { // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.enum_type) - return enum_type_; + return _impl_.enum_type_; } // repeated .google.protobuf.ServiceDescriptorProto service = 6; inline int FileDescriptorProto::_internal_service_size() const { - return service_.size(); + return _impl_.service_.size(); } inline int FileDescriptorProto::service_size() const { return _internal_service_size(); } inline void FileDescriptorProto::clear_service() { - service_.Clear(); + _impl_.service_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* FileDescriptorProto::mutable_service(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.service) - return service_.Mutable(index); + return _impl_.service_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto >* FileDescriptorProto::mutable_service() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.service) - return &service_; + return &_impl_.service_; } inline const ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto& FileDescriptorProto::_internal_service(int index) const { - return service_.Get(index); + return _impl_.service_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto& FileDescriptorProto::service(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.service) return _internal_service(index); } inline ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* FileDescriptorProto::_internal_add_service() { - return service_.Add(); + return _impl_.service_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* FileDescriptorProto::add_service() { ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* _add = _internal_add_service(); @@ -8943,37 +9001,37 @@ inline ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto* FileDescriptorProto::add inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::ServiceDescriptorProto >& FileDescriptorProto::service() const { // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.service) - return service_; + return _impl_.service_; } // repeated .google.protobuf.FieldDescriptorProto extension = 7; inline int FileDescriptorProto::_internal_extension_size() const { - return extension_.size(); + return _impl_.extension_.size(); } inline int FileDescriptorProto::extension_size() const { return _internal_extension_size(); } inline void FileDescriptorProto::clear_extension() { - extension_.Clear(); + _impl_.extension_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* FileDescriptorProto::mutable_extension(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.extension) - return extension_.Mutable(index); + return _impl_.extension_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >* FileDescriptorProto::mutable_extension() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.extension) - return &extension_; + return &_impl_.extension_; } inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& FileDescriptorProto::_internal_extension(int index) const { - return extension_.Get(index); + return _impl_.extension_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& FileDescriptorProto::extension(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.extension) return _internal_extension(index); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* FileDescriptorProto::_internal_add_extension() { - return extension_.Add(); + return _impl_.extension_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* FileDescriptorProto::add_extension() { ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* _add = _internal_add_extension(); @@ -8983,24 +9041,24 @@ inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* FileDescriptorProto::add_e inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >& FileDescriptorProto::extension() const { // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.extension) - return extension_; + return _impl_.extension_; } // optional .google.protobuf.FileOptions options = 8; inline bool FileDescriptorProto::_internal_has_options() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; - PROTOBUF_ASSUME(!value || options_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + PROTOBUF_ASSUME(!value || _impl_.options_ != nullptr); return value; } inline bool FileDescriptorProto::has_options() const { return _internal_has_options(); } inline void FileDescriptorProto::clear_options() { - if (options_ != nullptr) options_->Clear(); - _has_bits_[0] &= ~0x00000008u; + if (_impl_.options_ != nullptr) _impl_.options_->Clear(); + _impl_._has_bits_[0] &= ~0x00000008u; } inline const ::PROTOBUF_NAMESPACE_ID::FileOptions& FileDescriptorProto::_internal_options() const { - const ::PROTOBUF_NAMESPACE_ID::FileOptions* p = options_; + const ::PROTOBUF_NAMESPACE_ID::FileOptions* p = _impl_.options_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_FileOptions_default_instance_); } @@ -9011,20 +9069,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::FileOptions& FileDescriptorProto::options( inline void FileDescriptorProto::unsafe_arena_set_allocated_options( ::PROTOBUF_NAMESPACE_ID::FileOptions* options) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.options_); } - options_ = options; + _impl_.options_ = options; if (options) { - _has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000008u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.options) } inline ::PROTOBUF_NAMESPACE_ID::FileOptions* FileDescriptorProto::release_options() { - _has_bits_[0] &= ~0x00000008u; - ::PROTOBUF_NAMESPACE_ID::FileOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000008u; + ::PROTOBUF_NAMESPACE_ID::FileOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -9038,18 +9096,18 @@ inline ::PROTOBUF_NAMESPACE_ID::FileOptions* FileDescriptorProto::release_option } inline ::PROTOBUF_NAMESPACE_ID::FileOptions* FileDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.options) - _has_bits_[0] &= ~0x00000008u; - ::PROTOBUF_NAMESPACE_ID::FileOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000008u; + ::PROTOBUF_NAMESPACE_ID::FileOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::FileOptions* FileDescriptorProto::_internal_mutable_options() { - _has_bits_[0] |= 0x00000008u; - if (options_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000008u; + if (_impl_.options_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FileOptions>(GetArenaForAllocation()); - options_ = p; + _impl_.options_ = p; } - return options_; + return _impl_.options_; } inline ::PROTOBUF_NAMESPACE_ID::FileOptions* FileDescriptorProto::mutable_options() { ::PROTOBUF_NAMESPACE_ID::FileOptions* _msg = _internal_mutable_options(); @@ -9059,38 +9117,38 @@ inline ::PROTOBUF_NAMESPACE_ID::FileOptions* FileDescriptorProto::mutable_option inline void FileDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::FileOptions* options) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete options_; + delete _impl_.options_; } if (options) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::FileOptions>::GetOwningArena(options); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(options); if (message_arena != submessage_arena) { options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, options, submessage_arena); } - _has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000008u; } - options_ = options; + _impl_.options_ = options; // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.options) } // optional .google.protobuf.SourceCodeInfo source_code_info = 9; inline bool FileDescriptorProto::_internal_has_source_code_info() const { - bool value = (_has_bits_[0] & 0x00000010u) != 0; - PROTOBUF_ASSUME(!value || source_code_info_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + PROTOBUF_ASSUME(!value || _impl_.source_code_info_ != nullptr); return value; } inline bool FileDescriptorProto::has_source_code_info() const { return _internal_has_source_code_info(); } inline void FileDescriptorProto::clear_source_code_info() { - if (source_code_info_ != nullptr) source_code_info_->Clear(); - _has_bits_[0] &= ~0x00000010u; + if (_impl_.source_code_info_ != nullptr) _impl_.source_code_info_->Clear(); + _impl_._has_bits_[0] &= ~0x00000010u; } inline const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo& FileDescriptorProto::_internal_source_code_info() const { - const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* p = source_code_info_; + const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* p = _impl_.source_code_info_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_SourceCodeInfo_default_instance_); } @@ -9101,20 +9159,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo& FileDescriptorProto::sourc inline void FileDescriptorProto::unsafe_arena_set_allocated_source_code_info( ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* source_code_info) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_code_info_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.source_code_info_); } - source_code_info_ = source_code_info; + _impl_.source_code_info_ = source_code_info; if (source_code_info) { - _has_bits_[0] |= 0x00000010u; + _impl_._has_bits_[0] |= 0x00000010u; } else { - _has_bits_[0] &= ~0x00000010u; + _impl_._has_bits_[0] &= ~0x00000010u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.source_code_info) } inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* FileDescriptorProto::release_source_code_info() { - _has_bits_[0] &= ~0x00000010u; - ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* temp = source_code_info_; - source_code_info_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000010u; + ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* temp = _impl_.source_code_info_; + _impl_.source_code_info_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -9128,18 +9186,18 @@ inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* FileDescriptorProto::release_sou } inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* FileDescriptorProto::unsafe_arena_release_source_code_info() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.source_code_info) - _has_bits_[0] &= ~0x00000010u; - ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* temp = source_code_info_; - source_code_info_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000010u; + ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* temp = _impl_.source_code_info_; + _impl_.source_code_info_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* FileDescriptorProto::_internal_mutable_source_code_info() { - _has_bits_[0] |= 0x00000010u; - if (source_code_info_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000010u; + if (_impl_.source_code_info_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceCodeInfo>(GetArenaForAllocation()); - source_code_info_ = p; + _impl_.source_code_info_ = p; } - return source_code_info_; + return _impl_.source_code_info_; } inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* FileDescriptorProto::mutable_source_code_info() { ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* _msg = _internal_mutable_source_code_info(); @@ -9149,34 +9207,34 @@ inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* FileDescriptorProto::mutable_sou inline void FileDescriptorProto::set_allocated_source_code_info(::PROTOBUF_NAMESPACE_ID::SourceCodeInfo* source_code_info) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete source_code_info_; + delete _impl_.source_code_info_; } if (source_code_info) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::SourceCodeInfo>::GetOwningArena(source_code_info); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source_code_info); if (message_arena != submessage_arena) { source_code_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, source_code_info, submessage_arena); } - _has_bits_[0] |= 0x00000010u; + _impl_._has_bits_[0] |= 0x00000010u; } else { - _has_bits_[0] &= ~0x00000010u; + _impl_._has_bits_[0] &= ~0x00000010u; } - source_code_info_ = source_code_info; + _impl_.source_code_info_ = source_code_info; // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.source_code_info) } // optional string syntax = 12; inline bool FileDescriptorProto::_internal_has_syntax() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool FileDescriptorProto::has_syntax() const { return _internal_has_syntax(); } inline void FileDescriptorProto::clear_syntax() { - syntax_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000004u; + _impl_.syntax_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } inline const std::string& FileDescriptorProto::syntax() const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.syntax) @@ -9185,8 +9243,8 @@ inline const std::string& FileDescriptorProto::syntax() const { template inline PROTOBUF_ALWAYS_INLINE void FileDescriptorProto::set_syntax(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000004u; - syntax_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.syntax_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.syntax) } inline std::string* FileDescriptorProto::mutable_syntax() { @@ -9195,41 +9253,40 @@ inline std::string* FileDescriptorProto::mutable_syntax() { return _s; } inline const std::string& FileDescriptorProto::_internal_syntax() const { - return syntax_.Get(); + return _impl_.syntax_.Get(); } inline void FileDescriptorProto::_internal_set_syntax(const std::string& value) { - _has_bits_[0] |= 0x00000004u; - syntax_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.syntax_.Set(value, GetArenaForAllocation()); } inline std::string* FileDescriptorProto::_internal_mutable_syntax() { - _has_bits_[0] |= 0x00000004u; - return syntax_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.syntax_.Mutable(GetArenaForAllocation()); } inline std::string* FileDescriptorProto::release_syntax() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.syntax) if (!_internal_has_syntax()) { return nullptr; } - _has_bits_[0] &= ~0x00000004u; - auto* p = syntax_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.syntax_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (syntax_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - syntax_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.syntax_.IsDefault()) { + _impl_.syntax_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileDescriptorProto::set_allocated_syntax(std::string* syntax) { if (syntax != nullptr) { - _has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000004u; } else { - _has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000004u; } - syntax_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), syntax, - GetArenaForAllocation()); + _impl_.syntax_.SetAllocated(syntax, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (syntax_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - syntax_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.syntax_.IsDefault()) { + _impl_.syntax_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.syntax) @@ -9241,26 +9298,26 @@ inline void FileDescriptorProto::set_allocated_syntax(std::string* syntax) { // optional int32 start = 1; inline bool DescriptorProto_ExtensionRange::_internal_has_start() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool DescriptorProto_ExtensionRange::has_start() const { return _internal_has_start(); } inline void DescriptorProto_ExtensionRange::clear_start() { - start_ = 0; - _has_bits_[0] &= ~0x00000002u; + _impl_.start_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; } inline int32_t DescriptorProto_ExtensionRange::_internal_start() const { - return start_; + return _impl_.start_; } inline int32_t DescriptorProto_ExtensionRange::start() const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.start) return _internal_start(); } inline void DescriptorProto_ExtensionRange::_internal_set_start(int32_t value) { - _has_bits_[0] |= 0x00000002u; - start_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.start_ = value; } inline void DescriptorProto_ExtensionRange::set_start(int32_t value) { _internal_set_start(value); @@ -9269,26 +9326,26 @@ inline void DescriptorProto_ExtensionRange::set_start(int32_t value) { // optional int32 end = 2; inline bool DescriptorProto_ExtensionRange::_internal_has_end() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool DescriptorProto_ExtensionRange::has_end() const { return _internal_has_end(); } inline void DescriptorProto_ExtensionRange::clear_end() { - end_ = 0; - _has_bits_[0] &= ~0x00000004u; + _impl_.end_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; } inline int32_t DescriptorProto_ExtensionRange::_internal_end() const { - return end_; + return _impl_.end_; } inline int32_t DescriptorProto_ExtensionRange::end() const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.end) return _internal_end(); } inline void DescriptorProto_ExtensionRange::_internal_set_end(int32_t value) { - _has_bits_[0] |= 0x00000004u; - end_ = value; + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.end_ = value; } inline void DescriptorProto_ExtensionRange::set_end(int32_t value) { _internal_set_end(value); @@ -9297,19 +9354,19 @@ inline void DescriptorProto_ExtensionRange::set_end(int32_t value) { // optional .google.protobuf.ExtensionRangeOptions options = 3; inline bool DescriptorProto_ExtensionRange::_internal_has_options() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || options_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.options_ != nullptr); return value; } inline bool DescriptorProto_ExtensionRange::has_options() const { return _internal_has_options(); } inline void DescriptorProto_ExtensionRange::clear_options() { - if (options_ != nullptr) options_->Clear(); - _has_bits_[0] &= ~0x00000001u; + if (_impl_.options_ != nullptr) _impl_.options_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions& DescriptorProto_ExtensionRange::_internal_options() const { - const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* p = options_; + const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* p = _impl_.options_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_ExtensionRangeOptions_default_instance_); } @@ -9320,20 +9377,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions& DescriptorProto_Ext inline void DescriptorProto_ExtensionRange::unsafe_arena_set_allocated_options( ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* options) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.options_); } - options_ = options; + _impl_.options_ = options; if (options) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options) } inline ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* DescriptorProto_ExtensionRange::release_options() { - _has_bits_[0] &= ~0x00000001u; - ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000001u; + ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -9347,18 +9404,18 @@ inline ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* DescriptorProto_Extension } inline ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* DescriptorProto_ExtensionRange::unsafe_arena_release_options() { // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.ExtensionRange.options) - _has_bits_[0] &= ~0x00000001u; - ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000001u; + ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* DescriptorProto_ExtensionRange::_internal_mutable_options() { - _has_bits_[0] |= 0x00000001u; - if (options_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.options_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions>(GetArenaForAllocation()); - options_ = p; + _impl_.options_ = p; } - return options_; + return _impl_.options_; } inline ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* DescriptorProto_ExtensionRange::mutable_options() { ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* _msg = _internal_mutable_options(); @@ -9368,20 +9425,20 @@ inline ::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* DescriptorProto_Extension inline void DescriptorProto_ExtensionRange::set_allocated_options(::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions* options) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete options_; + delete _impl_.options_; } if (options) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::ExtensionRangeOptions>::GetOwningArena(options); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(options); if (message_arena != submessage_arena) { options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, options, submessage_arena); } - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - options_ = options; + _impl_.options_ = options; // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options) } @@ -9391,26 +9448,26 @@ inline void DescriptorProto_ExtensionRange::set_allocated_options(::PROTOBUF_NAM // optional int32 start = 1; inline bool DescriptorProto_ReservedRange::_internal_has_start() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool DescriptorProto_ReservedRange::has_start() const { return _internal_has_start(); } inline void DescriptorProto_ReservedRange::clear_start() { - start_ = 0; - _has_bits_[0] &= ~0x00000001u; + _impl_.start_ = 0; + _impl_._has_bits_[0] &= ~0x00000001u; } inline int32_t DescriptorProto_ReservedRange::_internal_start() const { - return start_; + return _impl_.start_; } inline int32_t DescriptorProto_ReservedRange::start() const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.start) return _internal_start(); } inline void DescriptorProto_ReservedRange::_internal_set_start(int32_t value) { - _has_bits_[0] |= 0x00000001u; - start_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.start_ = value; } inline void DescriptorProto_ReservedRange::set_start(int32_t value) { _internal_set_start(value); @@ -9419,26 +9476,26 @@ inline void DescriptorProto_ReservedRange::set_start(int32_t value) { // optional int32 end = 2; inline bool DescriptorProto_ReservedRange::_internal_has_end() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool DescriptorProto_ReservedRange::has_end() const { return _internal_has_end(); } inline void DescriptorProto_ReservedRange::clear_end() { - end_ = 0; - _has_bits_[0] &= ~0x00000002u; + _impl_.end_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; } inline int32_t DescriptorProto_ReservedRange::_internal_end() const { - return end_; + return _impl_.end_; } inline int32_t DescriptorProto_ReservedRange::end() const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.end) return _internal_end(); } inline void DescriptorProto_ReservedRange::_internal_set_end(int32_t value) { - _has_bits_[0] |= 0x00000002u; - end_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.end_ = value; } inline void DescriptorProto_ReservedRange::set_end(int32_t value) { _internal_set_end(value); @@ -9451,15 +9508,15 @@ inline void DescriptorProto_ReservedRange::set_end(int32_t value) { // optional string name = 1; inline bool DescriptorProto::_internal_has_name() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool DescriptorProto::has_name() const { return _internal_has_name(); } inline void DescriptorProto::clear_name() { - name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& DescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.name) @@ -9468,8 +9525,8 @@ inline const std::string& DescriptorProto::name() const { template inline PROTOBUF_ALWAYS_INLINE void DescriptorProto::set_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.name) } inline std::string* DescriptorProto::mutable_name() { @@ -9478,41 +9535,40 @@ inline std::string* DescriptorProto::mutable_name() { return _s; } inline const std::string& DescriptorProto::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void DescriptorProto::_internal_set_name(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* DescriptorProto::_internal_mutable_name() { - _has_bits_[0] |= 0x00000001u; - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* DescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.name) if (!_internal_has_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void DescriptorProto::set_allocated_name(std::string* name) { if (name != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.name) @@ -9520,32 +9576,32 @@ inline void DescriptorProto::set_allocated_name(std::string* name) { // repeated .google.protobuf.FieldDescriptorProto field = 2; inline int DescriptorProto::_internal_field_size() const { - return field_.size(); + return _impl_.field_.size(); } inline int DescriptorProto::field_size() const { return _internal_field_size(); } inline void DescriptorProto::clear_field() { - field_.Clear(); + _impl_.field_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::mutable_field(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.field) - return field_.Mutable(index); + return _impl_.field_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >* DescriptorProto::mutable_field() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.field) - return &field_; + return &_impl_.field_; } inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& DescriptorProto::_internal_field(int index) const { - return field_.Get(index); + return _impl_.field_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& DescriptorProto::field(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.field) return _internal_field(index); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::_internal_add_field() { - return field_.Add(); + return _impl_.field_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::add_field() { ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* _add = _internal_add_field(); @@ -9555,37 +9611,37 @@ inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::add_field inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >& DescriptorProto::field() const { // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.field) - return field_; + return _impl_.field_; } // repeated .google.protobuf.FieldDescriptorProto extension = 6; inline int DescriptorProto::_internal_extension_size() const { - return extension_.size(); + return _impl_.extension_.size(); } inline int DescriptorProto::extension_size() const { return _internal_extension_size(); } inline void DescriptorProto::clear_extension() { - extension_.Clear(); + _impl_.extension_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::mutable_extension(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension) - return extension_.Mutable(index); + return _impl_.extension_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >* DescriptorProto::mutable_extension() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension) - return &extension_; + return &_impl_.extension_; } inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& DescriptorProto::_internal_extension(int index) const { - return extension_.Get(index); + return _impl_.extension_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto& DescriptorProto::extension(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension) return _internal_extension(index); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::_internal_add_extension() { - return extension_.Add(); + return _impl_.extension_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::add_extension() { ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* _add = _internal_add_extension(); @@ -9595,37 +9651,37 @@ inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto* DescriptorProto::add_exten inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto >& DescriptorProto::extension() const { // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension) - return extension_; + return _impl_.extension_; } // repeated .google.protobuf.DescriptorProto nested_type = 3; inline int DescriptorProto::_internal_nested_type_size() const { - return nested_type_.size(); + return _impl_.nested_type_.size(); } inline int DescriptorProto::nested_type_size() const { return _internal_nested_type_size(); } inline void DescriptorProto::clear_nested_type() { - nested_type_.Clear(); + _impl_.nested_type_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* DescriptorProto::mutable_nested_type(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.nested_type) - return nested_type_.Mutable(index); + return _impl_.nested_type_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >* DescriptorProto::mutable_nested_type() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.nested_type) - return &nested_type_; + return &_impl_.nested_type_; } inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& DescriptorProto::_internal_nested_type(int index) const { - return nested_type_.Get(index); + return _impl_.nested_type_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto& DescriptorProto::nested_type(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.nested_type) return _internal_nested_type(index); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* DescriptorProto::_internal_add_nested_type() { - return nested_type_.Add(); + return _impl_.nested_type_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* DescriptorProto::add_nested_type() { ::PROTOBUF_NAMESPACE_ID::DescriptorProto* _add = _internal_add_nested_type(); @@ -9635,37 +9691,37 @@ inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto* DescriptorProto::add_nested_typ inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto >& DescriptorProto::nested_type() const { // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.nested_type) - return nested_type_; + return _impl_.nested_type_; } // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; inline int DescriptorProto::_internal_enum_type_size() const { - return enum_type_.size(); + return _impl_.enum_type_.size(); } inline int DescriptorProto::enum_type_size() const { return _internal_enum_type_size(); } inline void DescriptorProto::clear_enum_type() { - enum_type_.Clear(); + _impl_.enum_type_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* DescriptorProto::mutable_enum_type(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.enum_type) - return enum_type_.Mutable(index); + return _impl_.enum_type_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >* DescriptorProto::mutable_enum_type() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.enum_type) - return &enum_type_; + return &_impl_.enum_type_; } inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& DescriptorProto::_internal_enum_type(int index) const { - return enum_type_.Get(index); + return _impl_.enum_type_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto& DescriptorProto::enum_type(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.enum_type) return _internal_enum_type(index); } inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* DescriptorProto::_internal_add_enum_type() { - return enum_type_.Add(); + return _impl_.enum_type_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* DescriptorProto::add_enum_type() { ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* _add = _internal_add_enum_type(); @@ -9675,37 +9731,37 @@ inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto* DescriptorProto::add_enum_t inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto >& DescriptorProto::enum_type() const { // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.enum_type) - return enum_type_; + return _impl_.enum_type_; } // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; inline int DescriptorProto::_internal_extension_range_size() const { - return extension_range_.size(); + return _impl_.extension_range_.size(); } inline int DescriptorProto::extension_range_size() const { return _internal_extension_range_size(); } inline void DescriptorProto::clear_extension_range() { - extension_range_.Clear(); + _impl_.extension_range_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* DescriptorProto::mutable_extension_range(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension_range) - return extension_range_.Mutable(index); + return _impl_.extension_range_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange >* DescriptorProto::mutable_extension_range() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension_range) - return &extension_range_; + return &_impl_.extension_range_; } inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange& DescriptorProto::_internal_extension_range(int index) const { - return extension_range_.Get(index); + return _impl_.extension_range_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange& DescriptorProto::extension_range(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension_range) return _internal_extension_range(index); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* DescriptorProto::_internal_add_extension_range() { - return extension_range_.Add(); + return _impl_.extension_range_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* DescriptorProto::add_extension_range() { ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* _add = _internal_add_extension_range(); @@ -9715,37 +9771,37 @@ inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange* DescriptorProto: inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ExtensionRange >& DescriptorProto::extension_range() const { // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension_range) - return extension_range_; + return _impl_.extension_range_; } // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; inline int DescriptorProto::_internal_oneof_decl_size() const { - return oneof_decl_.size(); + return _impl_.oneof_decl_.size(); } inline int DescriptorProto::oneof_decl_size() const { return _internal_oneof_decl_size(); } inline void DescriptorProto::clear_oneof_decl() { - oneof_decl_.Clear(); + _impl_.oneof_decl_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* DescriptorProto::mutable_oneof_decl(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.oneof_decl) - return oneof_decl_.Mutable(index); + return _impl_.oneof_decl_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto >* DescriptorProto::mutable_oneof_decl() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.oneof_decl) - return &oneof_decl_; + return &_impl_.oneof_decl_; } inline const ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto& DescriptorProto::_internal_oneof_decl(int index) const { - return oneof_decl_.Get(index); + return _impl_.oneof_decl_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto& DescriptorProto::oneof_decl(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.oneof_decl) return _internal_oneof_decl(index); } inline ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* DescriptorProto::_internal_add_oneof_decl() { - return oneof_decl_.Add(); + return _impl_.oneof_decl_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* DescriptorProto::add_oneof_decl() { ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* _add = _internal_add_oneof_decl(); @@ -9755,24 +9811,24 @@ inline ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto* DescriptorProto::add_oneof inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::OneofDescriptorProto >& DescriptorProto::oneof_decl() const { // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.oneof_decl) - return oneof_decl_; + return _impl_.oneof_decl_; } // optional .google.protobuf.MessageOptions options = 7; inline bool DescriptorProto::_internal_has_options() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || options_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.options_ != nullptr); return value; } inline bool DescriptorProto::has_options() const { return _internal_has_options(); } inline void DescriptorProto::clear_options() { - if (options_ != nullptr) options_->Clear(); - _has_bits_[0] &= ~0x00000002u; + if (_impl_.options_ != nullptr) _impl_.options_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const ::PROTOBUF_NAMESPACE_ID::MessageOptions& DescriptorProto::_internal_options() const { - const ::PROTOBUF_NAMESPACE_ID::MessageOptions* p = options_; + const ::PROTOBUF_NAMESPACE_ID::MessageOptions* p = _impl_.options_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_MessageOptions_default_instance_); } @@ -9783,20 +9839,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::MessageOptions& DescriptorProto::options() inline void DescriptorProto::unsafe_arena_set_allocated_options( ::PROTOBUF_NAMESPACE_ID::MessageOptions* options) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.options_); } - options_ = options; + _impl_.options_ = options; if (options) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.options) } inline ::PROTOBUF_NAMESPACE_ID::MessageOptions* DescriptorProto::release_options() { - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::MessageOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::MessageOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -9810,18 +9866,18 @@ inline ::PROTOBUF_NAMESPACE_ID::MessageOptions* DescriptorProto::release_options } inline ::PROTOBUF_NAMESPACE_ID::MessageOptions* DescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.options) - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::MessageOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::MessageOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::MessageOptions* DescriptorProto::_internal_mutable_options() { - _has_bits_[0] |= 0x00000002u; - if (options_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.options_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MessageOptions>(GetArenaForAllocation()); - options_ = p; + _impl_.options_ = p; } - return options_; + return _impl_.options_; } inline ::PROTOBUF_NAMESPACE_ID::MessageOptions* DescriptorProto::mutable_options() { ::PROTOBUF_NAMESPACE_ID::MessageOptions* _msg = _internal_mutable_options(); @@ -9831,51 +9887,51 @@ inline ::PROTOBUF_NAMESPACE_ID::MessageOptions* DescriptorProto::mutable_options inline void DescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::MessageOptions* options) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete options_; + delete _impl_.options_; } if (options) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::MessageOptions>::GetOwningArena(options); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(options); if (message_arena != submessage_arena) { options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, options, submessage_arena); } - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - options_ = options; + _impl_.options_ = options; // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.options) } // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; inline int DescriptorProto::_internal_reserved_range_size() const { - return reserved_range_.size(); + return _impl_.reserved_range_.size(); } inline int DescriptorProto::reserved_range_size() const { return _internal_reserved_range_size(); } inline void DescriptorProto::clear_reserved_range() { - reserved_range_.Clear(); + _impl_.reserved_range_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* DescriptorProto::mutable_reserved_range(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_range) - return reserved_range_.Mutable(index); + return _impl_.reserved_range_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange >* DescriptorProto::mutable_reserved_range() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_range) - return &reserved_range_; + return &_impl_.reserved_range_; } inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange& DescriptorProto::_internal_reserved_range(int index) const { - return reserved_range_.Get(index); + return _impl_.reserved_range_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange& DescriptorProto::reserved_range(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_range) return _internal_reserved_range(index); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* DescriptorProto::_internal_add_reserved_range() { - return reserved_range_.Add(); + return _impl_.reserved_range_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* DescriptorProto::add_reserved_range() { ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* _add = _internal_add_reserved_range(); @@ -9885,18 +9941,18 @@ inline ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange* DescriptorProto:: inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::DescriptorProto_ReservedRange >& DescriptorProto::reserved_range() const { // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_range) - return reserved_range_; + return _impl_.reserved_range_; } // repeated string reserved_name = 10; inline int DescriptorProto::_internal_reserved_name_size() const { - return reserved_name_.size(); + return _impl_.reserved_name_.size(); } inline int DescriptorProto::reserved_name_size() const { return _internal_reserved_name_size(); } inline void DescriptorProto::clear_reserved_name() { - reserved_name_.Clear(); + _impl_.reserved_name_.Clear(); } inline std::string* DescriptorProto::add_reserved_name() { std::string* _s = _internal_add_reserved_name(); @@ -9904,7 +9960,7 @@ inline std::string* DescriptorProto::add_reserved_name() { return _s; } inline const std::string& DescriptorProto::_internal_reserved_name(int index) const { - return reserved_name_.Get(index); + return _impl_.reserved_name_.Get(index); } inline const std::string& DescriptorProto::reserved_name(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_name) @@ -9912,55 +9968,55 @@ inline const std::string& DescriptorProto::reserved_name(int index) const { } inline std::string* DescriptorProto::mutable_reserved_name(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_name) - return reserved_name_.Mutable(index); + return _impl_.reserved_name_.Mutable(index); } inline void DescriptorProto::set_reserved_name(int index, const std::string& value) { - reserved_name_.Mutable(index)->assign(value); + _impl_.reserved_name_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name) } inline void DescriptorProto::set_reserved_name(int index, std::string&& value) { - reserved_name_.Mutable(index)->assign(std::move(value)); + _impl_.reserved_name_.Mutable(index)->assign(std::move(value)); // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name) } inline void DescriptorProto::set_reserved_name(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); - reserved_name_.Mutable(index)->assign(value); + _impl_.reserved_name_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.reserved_name) } inline void DescriptorProto::set_reserved_name(int index, const char* value, size_t size) { - reserved_name_.Mutable(index)->assign( + _impl_.reserved_name_.Mutable(index)->assign( reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.reserved_name) } inline std::string* DescriptorProto::_internal_add_reserved_name() { - return reserved_name_.Add(); + return _impl_.reserved_name_.Add(); } inline void DescriptorProto::add_reserved_name(const std::string& value) { - reserved_name_.Add()->assign(value); + _impl_.reserved_name_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name) } inline void DescriptorProto::add_reserved_name(std::string&& value) { - reserved_name_.Add(std::move(value)); + _impl_.reserved_name_.Add(std::move(value)); // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name) } inline void DescriptorProto::add_reserved_name(const char* value) { GOOGLE_DCHECK(value != nullptr); - reserved_name_.Add()->assign(value); + _impl_.reserved_name_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.DescriptorProto.reserved_name) } inline void DescriptorProto::add_reserved_name(const char* value, size_t size) { - reserved_name_.Add()->assign(reinterpret_cast(value), size); + _impl_.reserved_name_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:google.protobuf.DescriptorProto.reserved_name) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& DescriptorProto::reserved_name() const { // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_name) - return reserved_name_; + return _impl_.reserved_name_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* DescriptorProto::mutable_reserved_name() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_name) - return &reserved_name_; + return &_impl_.reserved_name_; } // ------------------------------------------------------------------- @@ -9969,32 +10025,32 @@ DescriptorProto::mutable_reserved_name() { // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int ExtensionRangeOptions::_internal_uninterpreted_option_size() const { - return uninterpreted_option_.size(); + return _impl_.uninterpreted_option_.size(); } inline int ExtensionRangeOptions::uninterpreted_option_size() const { return _internal_uninterpreted_option_size(); } inline void ExtensionRangeOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); + _impl_.uninterpreted_option_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ExtensionRangeOptions::mutable_uninterpreted_option(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.ExtensionRangeOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); + return _impl_.uninterpreted_option_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >* ExtensionRangeOptions::mutable_uninterpreted_option() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.ExtensionRangeOptions.uninterpreted_option) - return &uninterpreted_option_; + return &_impl_.uninterpreted_option_; } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& ExtensionRangeOptions::_internal_uninterpreted_option(int index) const { - return uninterpreted_option_.Get(index); + return _impl_.uninterpreted_option_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& ExtensionRangeOptions::uninterpreted_option(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.ExtensionRangeOptions.uninterpreted_option) return _internal_uninterpreted_option(index); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ExtensionRangeOptions::_internal_add_uninterpreted_option() { - return uninterpreted_option_.Add(); + return _impl_.uninterpreted_option_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ExtensionRangeOptions::add_uninterpreted_option() { ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option(); @@ -10004,7 +10060,7 @@ inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ExtensionRangeOptions::add_ inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >& ExtensionRangeOptions::uninterpreted_option() const { // @@protoc_insertion_point(field_list:google.protobuf.ExtensionRangeOptions.uninterpreted_option) - return uninterpreted_option_; + return _impl_.uninterpreted_option_; } // ------------------------------------------------------------------- @@ -10013,15 +10069,15 @@ ExtensionRangeOptions::uninterpreted_option() const { // optional string name = 1; inline bool FieldDescriptorProto::_internal_has_name() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool FieldDescriptorProto::has_name() const { return _internal_has_name(); } inline void FieldDescriptorProto::clear_name() { - name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& FieldDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.name) @@ -10030,8 +10086,8 @@ inline const std::string& FieldDescriptorProto::name() const { template inline PROTOBUF_ALWAYS_INLINE void FieldDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.name) } inline std::string* FieldDescriptorProto::mutable_name() { @@ -10040,41 +10096,40 @@ inline std::string* FieldDescriptorProto::mutable_name() { return _s; } inline const std::string& FieldDescriptorProto::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void FieldDescriptorProto::_internal_set_name(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* FieldDescriptorProto::_internal_mutable_name() { - _has_bits_[0] |= 0x00000001u; - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* FieldDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.name) if (!_internal_has_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FieldDescriptorProto::set_allocated_name(std::string* name) { if (name != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.name) @@ -10082,26 +10137,26 @@ inline void FieldDescriptorProto::set_allocated_name(std::string* name) { // optional int32 number = 3; inline bool FieldDescriptorProto::_internal_has_number() const { - bool value = (_has_bits_[0] & 0x00000040u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; return value; } inline bool FieldDescriptorProto::has_number() const { return _internal_has_number(); } inline void FieldDescriptorProto::clear_number() { - number_ = 0; - _has_bits_[0] &= ~0x00000040u; + _impl_.number_ = 0; + _impl_._has_bits_[0] &= ~0x00000040u; } inline int32_t FieldDescriptorProto::_internal_number() const { - return number_; + return _impl_.number_; } inline int32_t FieldDescriptorProto::number() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.number) return _internal_number(); } inline void FieldDescriptorProto::_internal_set_number(int32_t value) { - _has_bits_[0] |= 0x00000040u; - number_ = value; + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.number_ = value; } inline void FieldDescriptorProto::set_number(int32_t value) { _internal_set_number(value); @@ -10110,18 +10165,18 @@ inline void FieldDescriptorProto::set_number(int32_t value) { // optional .google.protobuf.FieldDescriptorProto.Label label = 4; inline bool FieldDescriptorProto::_internal_has_label() const { - bool value = (_has_bits_[0] & 0x00000200u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; return value; } inline bool FieldDescriptorProto::has_label() const { return _internal_has_label(); } inline void FieldDescriptorProto::clear_label() { - label_ = 1; - _has_bits_[0] &= ~0x00000200u; + _impl_.label_ = 1; + _impl_._has_bits_[0] &= ~0x00000200u; } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label FieldDescriptorProto::_internal_label() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label >(label_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label >(_impl_.label_); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label FieldDescriptorProto::label() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.label) @@ -10129,8 +10184,8 @@ inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label FieldDescriptorProto: } inline void FieldDescriptorProto::_internal_set_label(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label value) { assert(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label_IsValid(value)); - _has_bits_[0] |= 0x00000200u; - label_ = value; + _impl_._has_bits_[0] |= 0x00000200u; + _impl_.label_ = value; } inline void FieldDescriptorProto::set_label(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Label value) { _internal_set_label(value); @@ -10139,18 +10194,18 @@ inline void FieldDescriptorProto::set_label(::PROTOBUF_NAMESPACE_ID::FieldDescri // optional .google.protobuf.FieldDescriptorProto.Type type = 5; inline bool FieldDescriptorProto::_internal_has_type() const { - bool value = (_has_bits_[0] & 0x00000400u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; return value; } inline bool FieldDescriptorProto::has_type() const { return _internal_has_type(); } inline void FieldDescriptorProto::clear_type() { - type_ = 1; - _has_bits_[0] &= ~0x00000400u; + _impl_.type_ = 1; + _impl_._has_bits_[0] &= ~0x00000400u; } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type FieldDescriptorProto::_internal_type() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type >(type_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type >(_impl_.type_); } inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type FieldDescriptorProto::type() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type) @@ -10158,8 +10213,8 @@ inline ::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type FieldDescriptorProto:: } inline void FieldDescriptorProto::_internal_set_type(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type value) { assert(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type_IsValid(value)); - _has_bits_[0] |= 0x00000400u; - type_ = value; + _impl_._has_bits_[0] |= 0x00000400u; + _impl_.type_ = value; } inline void FieldDescriptorProto::set_type(::PROTOBUF_NAMESPACE_ID::FieldDescriptorProto_Type value) { _internal_set_type(value); @@ -10168,15 +10223,15 @@ inline void FieldDescriptorProto::set_type(::PROTOBUF_NAMESPACE_ID::FieldDescrip // optional string type_name = 6; inline bool FieldDescriptorProto::_internal_has_type_name() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool FieldDescriptorProto::has_type_name() const { return _internal_has_type_name(); } inline void FieldDescriptorProto::clear_type_name() { - type_name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000004u; + _impl_.type_name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } inline const std::string& FieldDescriptorProto::type_name() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type_name) @@ -10185,8 +10240,8 @@ inline const std::string& FieldDescriptorProto::type_name() const { template inline PROTOBUF_ALWAYS_INLINE void FieldDescriptorProto::set_type_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000004u; - type_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.type_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type_name) } inline std::string* FieldDescriptorProto::mutable_type_name() { @@ -10195,41 +10250,40 @@ inline std::string* FieldDescriptorProto::mutable_type_name() { return _s; } inline const std::string& FieldDescriptorProto::_internal_type_name() const { - return type_name_.Get(); + return _impl_.type_name_.Get(); } inline void FieldDescriptorProto::_internal_set_type_name(const std::string& value) { - _has_bits_[0] |= 0x00000004u; - type_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.type_name_.Set(value, GetArenaForAllocation()); } inline std::string* FieldDescriptorProto::_internal_mutable_type_name() { - _has_bits_[0] |= 0x00000004u; - return type_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.type_name_.Mutable(GetArenaForAllocation()); } inline std::string* FieldDescriptorProto::release_type_name() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.type_name) if (!_internal_has_type_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000004u; - auto* p = type_name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.type_name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (type_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - type_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.type_name_.IsDefault()) { + _impl_.type_name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FieldDescriptorProto::set_allocated_type_name(std::string* type_name) { if (type_name != nullptr) { - _has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000004u; } else { - _has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000004u; } - type_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type_name, - GetArenaForAllocation()); + _impl_.type_name_.SetAllocated(type_name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (type_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - type_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.type_name_.IsDefault()) { + _impl_.type_name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.type_name) @@ -10237,15 +10291,15 @@ inline void FieldDescriptorProto::set_allocated_type_name(std::string* type_name // optional string extendee = 2; inline bool FieldDescriptorProto::_internal_has_extendee() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool FieldDescriptorProto::has_extendee() const { return _internal_has_extendee(); } inline void FieldDescriptorProto::clear_extendee() { - extendee_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000002u; + _impl_.extendee_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const std::string& FieldDescriptorProto::extendee() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.extendee) @@ -10254,8 +10308,8 @@ inline const std::string& FieldDescriptorProto::extendee() const { template inline PROTOBUF_ALWAYS_INLINE void FieldDescriptorProto::set_extendee(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000002u; - extendee_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.extendee_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.extendee) } inline std::string* FieldDescriptorProto::mutable_extendee() { @@ -10264,41 +10318,40 @@ inline std::string* FieldDescriptorProto::mutable_extendee() { return _s; } inline const std::string& FieldDescriptorProto::_internal_extendee() const { - return extendee_.Get(); + return _impl_.extendee_.Get(); } inline void FieldDescriptorProto::_internal_set_extendee(const std::string& value) { - _has_bits_[0] |= 0x00000002u; - extendee_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.extendee_.Set(value, GetArenaForAllocation()); } inline std::string* FieldDescriptorProto::_internal_mutable_extendee() { - _has_bits_[0] |= 0x00000002u; - return extendee_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.extendee_.Mutable(GetArenaForAllocation()); } inline std::string* FieldDescriptorProto::release_extendee() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.extendee) if (!_internal_has_extendee()) { return nullptr; } - _has_bits_[0] &= ~0x00000002u; - auto* p = extendee_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.extendee_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (extendee_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - extendee_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.extendee_.IsDefault()) { + _impl_.extendee_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FieldDescriptorProto::set_allocated_extendee(std::string* extendee) { if (extendee != nullptr) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - extendee_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), extendee, - GetArenaForAllocation()); + _impl_.extendee_.SetAllocated(extendee, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (extendee_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - extendee_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.extendee_.IsDefault()) { + _impl_.extendee_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.extendee) @@ -10306,15 +10359,15 @@ inline void FieldDescriptorProto::set_allocated_extendee(std::string* extendee) // optional string default_value = 7; inline bool FieldDescriptorProto::_internal_has_default_value() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } inline bool FieldDescriptorProto::has_default_value() const { return _internal_has_default_value(); } inline void FieldDescriptorProto::clear_default_value() { - default_value_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000008u; + _impl_.default_value_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000008u; } inline const std::string& FieldDescriptorProto::default_value() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.default_value) @@ -10323,8 +10376,8 @@ inline const std::string& FieldDescriptorProto::default_value() const { template inline PROTOBUF_ALWAYS_INLINE void FieldDescriptorProto::set_default_value(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000008u; - default_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.default_value_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.default_value) } inline std::string* FieldDescriptorProto::mutable_default_value() { @@ -10333,41 +10386,40 @@ inline std::string* FieldDescriptorProto::mutable_default_value() { return _s; } inline const std::string& FieldDescriptorProto::_internal_default_value() const { - return default_value_.Get(); + return _impl_.default_value_.Get(); } inline void FieldDescriptorProto::_internal_set_default_value(const std::string& value) { - _has_bits_[0] |= 0x00000008u; - default_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.default_value_.Set(value, GetArenaForAllocation()); } inline std::string* FieldDescriptorProto::_internal_mutable_default_value() { - _has_bits_[0] |= 0x00000008u; - return default_value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000008u; + return _impl_.default_value_.Mutable(GetArenaForAllocation()); } inline std::string* FieldDescriptorProto::release_default_value() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.default_value) if (!_internal_has_default_value()) { return nullptr; } - _has_bits_[0] &= ~0x00000008u; - auto* p = default_value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000008u; + auto* p = _impl_.default_value_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (default_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - default_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.default_value_.IsDefault()) { + _impl_.default_value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FieldDescriptorProto::set_allocated_default_value(std::string* default_value) { if (default_value != nullptr) { - _has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000008u; } - default_value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), default_value, - GetArenaForAllocation()); + _impl_.default_value_.SetAllocated(default_value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (default_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - default_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.default_value_.IsDefault()) { + _impl_.default_value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.default_value) @@ -10375,26 +10427,26 @@ inline void FieldDescriptorProto::set_allocated_default_value(std::string* defau // optional int32 oneof_index = 9; inline bool FieldDescriptorProto::_internal_has_oneof_index() const { - bool value = (_has_bits_[0] & 0x00000080u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; return value; } inline bool FieldDescriptorProto::has_oneof_index() const { return _internal_has_oneof_index(); } inline void FieldDescriptorProto::clear_oneof_index() { - oneof_index_ = 0; - _has_bits_[0] &= ~0x00000080u; + _impl_.oneof_index_ = 0; + _impl_._has_bits_[0] &= ~0x00000080u; } inline int32_t FieldDescriptorProto::_internal_oneof_index() const { - return oneof_index_; + return _impl_.oneof_index_; } inline int32_t FieldDescriptorProto::oneof_index() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.oneof_index) return _internal_oneof_index(); } inline void FieldDescriptorProto::_internal_set_oneof_index(int32_t value) { - _has_bits_[0] |= 0x00000080u; - oneof_index_ = value; + _impl_._has_bits_[0] |= 0x00000080u; + _impl_.oneof_index_ = value; } inline void FieldDescriptorProto::set_oneof_index(int32_t value) { _internal_set_oneof_index(value); @@ -10403,15 +10455,15 @@ inline void FieldDescriptorProto::set_oneof_index(int32_t value) { // optional string json_name = 10; inline bool FieldDescriptorProto::_internal_has_json_name() const { - bool value = (_has_bits_[0] & 0x00000010u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; } inline bool FieldDescriptorProto::has_json_name() const { return _internal_has_json_name(); } inline void FieldDescriptorProto::clear_json_name() { - json_name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000010u; + _impl_.json_name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000010u; } inline const std::string& FieldDescriptorProto::json_name() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.json_name) @@ -10420,8 +10472,8 @@ inline const std::string& FieldDescriptorProto::json_name() const { template inline PROTOBUF_ALWAYS_INLINE void FieldDescriptorProto::set_json_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000010u; - json_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.json_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.json_name) } inline std::string* FieldDescriptorProto::mutable_json_name() { @@ -10430,41 +10482,40 @@ inline std::string* FieldDescriptorProto::mutable_json_name() { return _s; } inline const std::string& FieldDescriptorProto::_internal_json_name() const { - return json_name_.Get(); + return _impl_.json_name_.Get(); } inline void FieldDescriptorProto::_internal_set_json_name(const std::string& value) { - _has_bits_[0] |= 0x00000010u; - json_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.json_name_.Set(value, GetArenaForAllocation()); } inline std::string* FieldDescriptorProto::_internal_mutable_json_name() { - _has_bits_[0] |= 0x00000010u; - return json_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000010u; + return _impl_.json_name_.Mutable(GetArenaForAllocation()); } inline std::string* FieldDescriptorProto::release_json_name() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.json_name) if (!_internal_has_json_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000010u; - auto* p = json_name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000010u; + auto* p = _impl_.json_name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (json_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - json_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.json_name_.IsDefault()) { + _impl_.json_name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FieldDescriptorProto::set_allocated_json_name(std::string* json_name) { if (json_name != nullptr) { - _has_bits_[0] |= 0x00000010u; + _impl_._has_bits_[0] |= 0x00000010u; } else { - _has_bits_[0] &= ~0x00000010u; + _impl_._has_bits_[0] &= ~0x00000010u; } - json_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), json_name, - GetArenaForAllocation()); + _impl_.json_name_.SetAllocated(json_name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (json_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - json_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.json_name_.IsDefault()) { + _impl_.json_name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.json_name) @@ -10472,19 +10523,19 @@ inline void FieldDescriptorProto::set_allocated_json_name(std::string* json_name // optional .google.protobuf.FieldOptions options = 8; inline bool FieldDescriptorProto::_internal_has_options() const { - bool value = (_has_bits_[0] & 0x00000020u) != 0; - PROTOBUF_ASSUME(!value || options_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + PROTOBUF_ASSUME(!value || _impl_.options_ != nullptr); return value; } inline bool FieldDescriptorProto::has_options() const { return _internal_has_options(); } inline void FieldDescriptorProto::clear_options() { - if (options_ != nullptr) options_->Clear(); - _has_bits_[0] &= ~0x00000020u; + if (_impl_.options_ != nullptr) _impl_.options_->Clear(); + _impl_._has_bits_[0] &= ~0x00000020u; } inline const ::PROTOBUF_NAMESPACE_ID::FieldOptions& FieldDescriptorProto::_internal_options() const { - const ::PROTOBUF_NAMESPACE_ID::FieldOptions* p = options_; + const ::PROTOBUF_NAMESPACE_ID::FieldOptions* p = _impl_.options_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_FieldOptions_default_instance_); } @@ -10495,20 +10546,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::FieldOptions& FieldDescriptorProto::option inline void FieldDescriptorProto::unsafe_arena_set_allocated_options( ::PROTOBUF_NAMESPACE_ID::FieldOptions* options) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.options_); } - options_ = options; + _impl_.options_ = options; if (options) { - _has_bits_[0] |= 0x00000020u; + _impl_._has_bits_[0] |= 0x00000020u; } else { - _has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000020u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.options) } inline ::PROTOBUF_NAMESPACE_ID::FieldOptions* FieldDescriptorProto::release_options() { - _has_bits_[0] &= ~0x00000020u; - ::PROTOBUF_NAMESPACE_ID::FieldOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000020u; + ::PROTOBUF_NAMESPACE_ID::FieldOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -10522,18 +10573,18 @@ inline ::PROTOBUF_NAMESPACE_ID::FieldOptions* FieldDescriptorProto::release_opti } inline ::PROTOBUF_NAMESPACE_ID::FieldOptions* FieldDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.options) - _has_bits_[0] &= ~0x00000020u; - ::PROTOBUF_NAMESPACE_ID::FieldOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000020u; + ::PROTOBUF_NAMESPACE_ID::FieldOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::FieldOptions* FieldDescriptorProto::_internal_mutable_options() { - _has_bits_[0] |= 0x00000020u; - if (options_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000020u; + if (_impl_.options_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::FieldOptions>(GetArenaForAllocation()); - options_ = p; + _impl_.options_ = p; } - return options_; + return _impl_.options_; } inline ::PROTOBUF_NAMESPACE_ID::FieldOptions* FieldDescriptorProto::mutable_options() { ::PROTOBUF_NAMESPACE_ID::FieldOptions* _msg = _internal_mutable_options(); @@ -10543,45 +10594,45 @@ inline ::PROTOBUF_NAMESPACE_ID::FieldOptions* FieldDescriptorProto::mutable_opti inline void FieldDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::FieldOptions* options) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete options_; + delete _impl_.options_; } if (options) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::FieldOptions>::GetOwningArena(options); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(options); if (message_arena != submessage_arena) { options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, options, submessage_arena); } - _has_bits_[0] |= 0x00000020u; + _impl_._has_bits_[0] |= 0x00000020u; } else { - _has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000020u; } - options_ = options; + _impl_.options_ = options; // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.options) } // optional bool proto3_optional = 17; inline bool FieldDescriptorProto::_internal_has_proto3_optional() const { - bool value = (_has_bits_[0] & 0x00000100u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; return value; } inline bool FieldDescriptorProto::has_proto3_optional() const { return _internal_has_proto3_optional(); } inline void FieldDescriptorProto::clear_proto3_optional() { - proto3_optional_ = false; - _has_bits_[0] &= ~0x00000100u; + _impl_.proto3_optional_ = false; + _impl_._has_bits_[0] &= ~0x00000100u; } inline bool FieldDescriptorProto::_internal_proto3_optional() const { - return proto3_optional_; + return _impl_.proto3_optional_; } inline bool FieldDescriptorProto::proto3_optional() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.proto3_optional) return _internal_proto3_optional(); } inline void FieldDescriptorProto::_internal_set_proto3_optional(bool value) { - _has_bits_[0] |= 0x00000100u; - proto3_optional_ = value; + _impl_._has_bits_[0] |= 0x00000100u; + _impl_.proto3_optional_ = value; } inline void FieldDescriptorProto::set_proto3_optional(bool value) { _internal_set_proto3_optional(value); @@ -10594,15 +10645,15 @@ inline void FieldDescriptorProto::set_proto3_optional(bool value) { // optional string name = 1; inline bool OneofDescriptorProto::_internal_has_name() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool OneofDescriptorProto::has_name() const { return _internal_has_name(); } inline void OneofDescriptorProto::clear_name() { - name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& OneofDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.name) @@ -10611,8 +10662,8 @@ inline const std::string& OneofDescriptorProto::name() const { template inline PROTOBUF_ALWAYS_INLINE void OneofDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.OneofDescriptorProto.name) } inline std::string* OneofDescriptorProto::mutable_name() { @@ -10621,41 +10672,40 @@ inline std::string* OneofDescriptorProto::mutable_name() { return _s; } inline const std::string& OneofDescriptorProto::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void OneofDescriptorProto::_internal_set_name(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* OneofDescriptorProto::_internal_mutable_name() { - _has_bits_[0] |= 0x00000001u; - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* OneofDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.name) if (!_internal_has_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void OneofDescriptorProto::set_allocated_name(std::string* name) { if (name != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.name) @@ -10663,19 +10713,19 @@ inline void OneofDescriptorProto::set_allocated_name(std::string* name) { // optional .google.protobuf.OneofOptions options = 2; inline bool OneofDescriptorProto::_internal_has_options() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || options_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.options_ != nullptr); return value; } inline bool OneofDescriptorProto::has_options() const { return _internal_has_options(); } inline void OneofDescriptorProto::clear_options() { - if (options_ != nullptr) options_->Clear(); - _has_bits_[0] &= ~0x00000002u; + if (_impl_.options_ != nullptr) _impl_.options_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const ::PROTOBUF_NAMESPACE_ID::OneofOptions& OneofDescriptorProto::_internal_options() const { - const ::PROTOBUF_NAMESPACE_ID::OneofOptions* p = options_; + const ::PROTOBUF_NAMESPACE_ID::OneofOptions* p = _impl_.options_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_OneofOptions_default_instance_); } @@ -10686,20 +10736,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::OneofOptions& OneofDescriptorProto::option inline void OneofDescriptorProto::unsafe_arena_set_allocated_options( ::PROTOBUF_NAMESPACE_ID::OneofOptions* options) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.options_); } - options_ = options; + _impl_.options_ = options; if (options) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.OneofDescriptorProto.options) } inline ::PROTOBUF_NAMESPACE_ID::OneofOptions* OneofDescriptorProto::release_options() { - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::OneofOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::OneofOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -10713,18 +10763,18 @@ inline ::PROTOBUF_NAMESPACE_ID::OneofOptions* OneofDescriptorProto::release_opti } inline ::PROTOBUF_NAMESPACE_ID::OneofOptions* OneofDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.options) - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::OneofOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::OneofOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::OneofOptions* OneofDescriptorProto::_internal_mutable_options() { - _has_bits_[0] |= 0x00000002u; - if (options_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.options_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::OneofOptions>(GetArenaForAllocation()); - options_ = p; + _impl_.options_ = p; } - return options_; + return _impl_.options_; } inline ::PROTOBUF_NAMESPACE_ID::OneofOptions* OneofDescriptorProto::mutable_options() { ::PROTOBUF_NAMESPACE_ID::OneofOptions* _msg = _internal_mutable_options(); @@ -10734,20 +10784,20 @@ inline ::PROTOBUF_NAMESPACE_ID::OneofOptions* OneofDescriptorProto::mutable_opti inline void OneofDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::OneofOptions* options) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete options_; + delete _impl_.options_; } if (options) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::OneofOptions>::GetOwningArena(options); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(options); if (message_arena != submessage_arena) { options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, options, submessage_arena); } - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - options_ = options; + _impl_.options_ = options; // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.options) } @@ -10757,26 +10807,26 @@ inline void OneofDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID: // optional int32 start = 1; inline bool EnumDescriptorProto_EnumReservedRange::_internal_has_start() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool EnumDescriptorProto_EnumReservedRange::has_start() const { return _internal_has_start(); } inline void EnumDescriptorProto_EnumReservedRange::clear_start() { - start_ = 0; - _has_bits_[0] &= ~0x00000001u; + _impl_.start_ = 0; + _impl_._has_bits_[0] &= ~0x00000001u; } inline int32_t EnumDescriptorProto_EnumReservedRange::_internal_start() const { - return start_; + return _impl_.start_; } inline int32_t EnumDescriptorProto_EnumReservedRange::start() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.EnumReservedRange.start) return _internal_start(); } inline void EnumDescriptorProto_EnumReservedRange::_internal_set_start(int32_t value) { - _has_bits_[0] |= 0x00000001u; - start_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.start_ = value; } inline void EnumDescriptorProto_EnumReservedRange::set_start(int32_t value) { _internal_set_start(value); @@ -10785,26 +10835,26 @@ inline void EnumDescriptorProto_EnumReservedRange::set_start(int32_t value) { // optional int32 end = 2; inline bool EnumDescriptorProto_EnumReservedRange::_internal_has_end() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool EnumDescriptorProto_EnumReservedRange::has_end() const { return _internal_has_end(); } inline void EnumDescriptorProto_EnumReservedRange::clear_end() { - end_ = 0; - _has_bits_[0] &= ~0x00000002u; + _impl_.end_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; } inline int32_t EnumDescriptorProto_EnumReservedRange::_internal_end() const { - return end_; + return _impl_.end_; } inline int32_t EnumDescriptorProto_EnumReservedRange::end() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.EnumReservedRange.end) return _internal_end(); } inline void EnumDescriptorProto_EnumReservedRange::_internal_set_end(int32_t value) { - _has_bits_[0] |= 0x00000002u; - end_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.end_ = value; } inline void EnumDescriptorProto_EnumReservedRange::set_end(int32_t value) { _internal_set_end(value); @@ -10817,15 +10867,15 @@ inline void EnumDescriptorProto_EnumReservedRange::set_end(int32_t value) { // optional string name = 1; inline bool EnumDescriptorProto::_internal_has_name() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool EnumDescriptorProto::has_name() const { return _internal_has_name(); } inline void EnumDescriptorProto::clear_name() { - name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& EnumDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.name) @@ -10834,8 +10884,8 @@ inline const std::string& EnumDescriptorProto::name() const { template inline PROTOBUF_ALWAYS_INLINE void EnumDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.name) } inline std::string* EnumDescriptorProto::mutable_name() { @@ -10844,41 +10894,40 @@ inline std::string* EnumDescriptorProto::mutable_name() { return _s; } inline const std::string& EnumDescriptorProto::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void EnumDescriptorProto::_internal_set_name(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* EnumDescriptorProto::_internal_mutable_name() { - _has_bits_[0] |= 0x00000001u; - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* EnumDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.name) if (!_internal_has_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void EnumDescriptorProto::set_allocated_name(std::string* name) { if (name != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.name) @@ -10886,32 +10935,32 @@ inline void EnumDescriptorProto::set_allocated_name(std::string* name) { // repeated .google.protobuf.EnumValueDescriptorProto value = 2; inline int EnumDescriptorProto::_internal_value_size() const { - return value_.size(); + return _impl_.value_.size(); } inline int EnumDescriptorProto::value_size() const { return _internal_value_size(); } inline void EnumDescriptorProto::clear_value() { - value_.Clear(); + _impl_.value_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* EnumDescriptorProto::mutable_value(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.value) - return value_.Mutable(index); + return _impl_.value_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto >* EnumDescriptorProto::mutable_value() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.value) - return &value_; + return &_impl_.value_; } inline const ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto& EnumDescriptorProto::_internal_value(int index) const { - return value_.Get(index); + return _impl_.value_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto& EnumDescriptorProto::value(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.value) return _internal_value(index); } inline ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* EnumDescriptorProto::_internal_add_value() { - return value_.Add(); + return _impl_.value_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* EnumDescriptorProto::add_value() { ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* _add = _internal_add_value(); @@ -10921,24 +10970,24 @@ inline ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto* EnumDescriptorProto::a inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValueDescriptorProto >& EnumDescriptorProto::value() const { // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.value) - return value_; + return _impl_.value_; } // optional .google.protobuf.EnumOptions options = 3; inline bool EnumDescriptorProto::_internal_has_options() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || options_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.options_ != nullptr); return value; } inline bool EnumDescriptorProto::has_options() const { return _internal_has_options(); } inline void EnumDescriptorProto::clear_options() { - if (options_ != nullptr) options_->Clear(); - _has_bits_[0] &= ~0x00000002u; + if (_impl_.options_ != nullptr) _impl_.options_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const ::PROTOBUF_NAMESPACE_ID::EnumOptions& EnumDescriptorProto::_internal_options() const { - const ::PROTOBUF_NAMESPACE_ID::EnumOptions* p = options_; + const ::PROTOBUF_NAMESPACE_ID::EnumOptions* p = _impl_.options_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_EnumOptions_default_instance_); } @@ -10949,20 +10998,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::EnumOptions& EnumDescriptorProto::options( inline void EnumDescriptorProto::unsafe_arena_set_allocated_options( ::PROTOBUF_NAMESPACE_ID::EnumOptions* options) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.options_); } - options_ = options; + _impl_.options_ = options; if (options) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumDescriptorProto.options) } inline ::PROTOBUF_NAMESPACE_ID::EnumOptions* EnumDescriptorProto::release_options() { - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::EnumOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::EnumOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -10976,18 +11025,18 @@ inline ::PROTOBUF_NAMESPACE_ID::EnumOptions* EnumDescriptorProto::release_option } inline ::PROTOBUF_NAMESPACE_ID::EnumOptions* EnumDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.options) - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::EnumOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::EnumOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::EnumOptions* EnumDescriptorProto::_internal_mutable_options() { - _has_bits_[0] |= 0x00000002u; - if (options_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.options_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumOptions>(GetArenaForAllocation()); - options_ = p; + _impl_.options_ = p; } - return options_; + return _impl_.options_; } inline ::PROTOBUF_NAMESPACE_ID::EnumOptions* EnumDescriptorProto::mutable_options() { ::PROTOBUF_NAMESPACE_ID::EnumOptions* _msg = _internal_mutable_options(); @@ -10997,51 +11046,51 @@ inline ::PROTOBUF_NAMESPACE_ID::EnumOptions* EnumDescriptorProto::mutable_option inline void EnumDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::EnumOptions* options) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete options_; + delete _impl_.options_; } if (options) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::EnumOptions>::GetOwningArena(options); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(options); if (message_arena != submessage_arena) { options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, options, submessage_arena); } - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - options_ = options; + _impl_.options_ = options; // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.options) } // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; inline int EnumDescriptorProto::_internal_reserved_range_size() const { - return reserved_range_.size(); + return _impl_.reserved_range_.size(); } inline int EnumDescriptorProto::reserved_range_size() const { return _internal_reserved_range_size(); } inline void EnumDescriptorProto::clear_reserved_range() { - reserved_range_.Clear(); + _impl_.reserved_range_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto::mutable_reserved_range(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.reserved_range) - return reserved_range_.Mutable(index); + return _impl_.reserved_range_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange >* EnumDescriptorProto::mutable_reserved_range() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.reserved_range) - return &reserved_range_; + return &_impl_.reserved_range_; } inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange& EnumDescriptorProto::_internal_reserved_range(int index) const { - return reserved_range_.Get(index); + return _impl_.reserved_range_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange& EnumDescriptorProto::reserved_range(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.reserved_range) return _internal_reserved_range(index); } inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto::_internal_add_reserved_range() { - return reserved_range_.Add(); + return _impl_.reserved_range_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto::add_reserved_range() { ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* _add = _internal_add_reserved_range(); @@ -11051,18 +11100,18 @@ inline ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange* EnumDescr inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumDescriptorProto_EnumReservedRange >& EnumDescriptorProto::reserved_range() const { // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.reserved_range) - return reserved_range_; + return _impl_.reserved_range_; } // repeated string reserved_name = 5; inline int EnumDescriptorProto::_internal_reserved_name_size() const { - return reserved_name_.size(); + return _impl_.reserved_name_.size(); } inline int EnumDescriptorProto::reserved_name_size() const { return _internal_reserved_name_size(); } inline void EnumDescriptorProto::clear_reserved_name() { - reserved_name_.Clear(); + _impl_.reserved_name_.Clear(); } inline std::string* EnumDescriptorProto::add_reserved_name() { std::string* _s = _internal_add_reserved_name(); @@ -11070,7 +11119,7 @@ inline std::string* EnumDescriptorProto::add_reserved_name() { return _s; } inline const std::string& EnumDescriptorProto::_internal_reserved_name(int index) const { - return reserved_name_.Get(index); + return _impl_.reserved_name_.Get(index); } inline const std::string& EnumDescriptorProto::reserved_name(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.reserved_name) @@ -11078,55 +11127,55 @@ inline const std::string& EnumDescriptorProto::reserved_name(int index) const { } inline std::string* EnumDescriptorProto::mutable_reserved_name(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.reserved_name) - return reserved_name_.Mutable(index); + return _impl_.reserved_name_.Mutable(index); } inline void EnumDescriptorProto::set_reserved_name(int index, const std::string& value) { - reserved_name_.Mutable(index)->assign(value); + _impl_.reserved_name_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.reserved_name) } inline void EnumDescriptorProto::set_reserved_name(int index, std::string&& value) { - reserved_name_.Mutable(index)->assign(std::move(value)); + _impl_.reserved_name_.Mutable(index)->assign(std::move(value)); // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.reserved_name) } inline void EnumDescriptorProto::set_reserved_name(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); - reserved_name_.Mutable(index)->assign(value); + _impl_.reserved_name_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.EnumDescriptorProto.reserved_name) } inline void EnumDescriptorProto::set_reserved_name(int index, const char* value, size_t size) { - reserved_name_.Mutable(index)->assign( + _impl_.reserved_name_.Mutable(index)->assign( reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumDescriptorProto.reserved_name) } inline std::string* EnumDescriptorProto::_internal_add_reserved_name() { - return reserved_name_.Add(); + return _impl_.reserved_name_.Add(); } inline void EnumDescriptorProto::add_reserved_name(const std::string& value) { - reserved_name_.Add()->assign(value); + _impl_.reserved_name_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.reserved_name) } inline void EnumDescriptorProto::add_reserved_name(std::string&& value) { - reserved_name_.Add(std::move(value)); + _impl_.reserved_name_.Add(std::move(value)); // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.reserved_name) } inline void EnumDescriptorProto::add_reserved_name(const char* value) { GOOGLE_DCHECK(value != nullptr); - reserved_name_.Add()->assign(value); + _impl_.reserved_name_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.EnumDescriptorProto.reserved_name) } inline void EnumDescriptorProto::add_reserved_name(const char* value, size_t size) { - reserved_name_.Add()->assign(reinterpret_cast(value), size); + _impl_.reserved_name_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:google.protobuf.EnumDescriptorProto.reserved_name) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& EnumDescriptorProto::reserved_name() const { // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.reserved_name) - return reserved_name_; + return _impl_.reserved_name_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* EnumDescriptorProto::mutable_reserved_name() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.reserved_name) - return &reserved_name_; + return &_impl_.reserved_name_; } // ------------------------------------------------------------------- @@ -11135,15 +11184,15 @@ EnumDescriptorProto::mutable_reserved_name() { // optional string name = 1; inline bool EnumValueDescriptorProto::_internal_has_name() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool EnumValueDescriptorProto::has_name() const { return _internal_has_name(); } inline void EnumValueDescriptorProto::clear_name() { - name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& EnumValueDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.name) @@ -11152,8 +11201,8 @@ inline const std::string& EnumValueDescriptorProto::name() const { template inline PROTOBUF_ALWAYS_INLINE void EnumValueDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.name) } inline std::string* EnumValueDescriptorProto::mutable_name() { @@ -11162,41 +11211,40 @@ inline std::string* EnumValueDescriptorProto::mutable_name() { return _s; } inline const std::string& EnumValueDescriptorProto::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void EnumValueDescriptorProto::_internal_set_name(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* EnumValueDescriptorProto::_internal_mutable_name() { - _has_bits_[0] |= 0x00000001u; - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* EnumValueDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.name) if (!_internal_has_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void EnumValueDescriptorProto::set_allocated_name(std::string* name) { if (name != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.name) @@ -11204,26 +11252,26 @@ inline void EnumValueDescriptorProto::set_allocated_name(std::string* name) { // optional int32 number = 2; inline bool EnumValueDescriptorProto::_internal_has_number() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool EnumValueDescriptorProto::has_number() const { return _internal_has_number(); } inline void EnumValueDescriptorProto::clear_number() { - number_ = 0; - _has_bits_[0] &= ~0x00000004u; + _impl_.number_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; } inline int32_t EnumValueDescriptorProto::_internal_number() const { - return number_; + return _impl_.number_; } inline int32_t EnumValueDescriptorProto::number() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.number) return _internal_number(); } inline void EnumValueDescriptorProto::_internal_set_number(int32_t value) { - _has_bits_[0] |= 0x00000004u; - number_ = value; + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.number_ = value; } inline void EnumValueDescriptorProto::set_number(int32_t value) { _internal_set_number(value); @@ -11232,19 +11280,19 @@ inline void EnumValueDescriptorProto::set_number(int32_t value) { // optional .google.protobuf.EnumValueOptions options = 3; inline bool EnumValueDescriptorProto::_internal_has_options() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || options_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.options_ != nullptr); return value; } inline bool EnumValueDescriptorProto::has_options() const { return _internal_has_options(); } inline void EnumValueDescriptorProto::clear_options() { - if (options_ != nullptr) options_->Clear(); - _has_bits_[0] &= ~0x00000002u; + if (_impl_.options_ != nullptr) _impl_.options_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions& EnumValueDescriptorProto::_internal_options() const { - const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* p = options_; + const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* p = _impl_.options_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_EnumValueOptions_default_instance_); } @@ -11255,20 +11303,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::EnumValueOptions& EnumValueDescriptorProto inline void EnumValueDescriptorProto::unsafe_arena_set_allocated_options( ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* options) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.options_); } - options_ = options; + _impl_.options_ = options; if (options) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValueDescriptorProto.options) } inline ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* EnumValueDescriptorProto::release_options() { - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -11282,18 +11330,18 @@ inline ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* EnumValueDescriptorProto::rele } inline ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* EnumValueDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.options) - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* EnumValueDescriptorProto::_internal_mutable_options() { - _has_bits_[0] |= 0x00000002u; - if (options_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.options_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::EnumValueOptions>(GetArenaForAllocation()); - options_ = p; + _impl_.options_ = p; } - return options_; + return _impl_.options_; } inline ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* EnumValueDescriptorProto::mutable_options() { ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* _msg = _internal_mutable_options(); @@ -11303,20 +11351,20 @@ inline ::PROTOBUF_NAMESPACE_ID::EnumValueOptions* EnumValueDescriptorProto::muta inline void EnumValueDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::EnumValueOptions* options) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete options_; + delete _impl_.options_; } if (options) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::EnumValueOptions>::GetOwningArena(options); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(options); if (message_arena != submessage_arena) { options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, options, submessage_arena); } - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - options_ = options; + _impl_.options_ = options; // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.options) } @@ -11326,15 +11374,15 @@ inline void EnumValueDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE // optional string name = 1; inline bool ServiceDescriptorProto::_internal_has_name() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool ServiceDescriptorProto::has_name() const { return _internal_has_name(); } inline void ServiceDescriptorProto::clear_name() { - name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& ServiceDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.name) @@ -11343,8 +11391,8 @@ inline const std::string& ServiceDescriptorProto::name() const { template inline PROTOBUF_ALWAYS_INLINE void ServiceDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.ServiceDescriptorProto.name) } inline std::string* ServiceDescriptorProto::mutable_name() { @@ -11353,41 +11401,40 @@ inline std::string* ServiceDescriptorProto::mutable_name() { return _s; } inline const std::string& ServiceDescriptorProto::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void ServiceDescriptorProto::_internal_set_name(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* ServiceDescriptorProto::_internal_mutable_name() { - _has_bits_[0] |= 0x00000001u; - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* ServiceDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.name) if (!_internal_has_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void ServiceDescriptorProto::set_allocated_name(std::string* name) { if (name != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.name) @@ -11395,32 +11442,32 @@ inline void ServiceDescriptorProto::set_allocated_name(std::string* name) { // repeated .google.protobuf.MethodDescriptorProto method = 2; inline int ServiceDescriptorProto::_internal_method_size() const { - return method_.size(); + return _impl_.method_.size(); } inline int ServiceDescriptorProto::method_size() const { return _internal_method_size(); } inline void ServiceDescriptorProto::clear_method() { - method_.Clear(); + _impl_.method_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* ServiceDescriptorProto::mutable_method(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.method) - return method_.Mutable(index); + return _impl_.method_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto >* ServiceDescriptorProto::mutable_method() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceDescriptorProto.method) - return &method_; + return &_impl_.method_; } inline const ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto& ServiceDescriptorProto::_internal_method(int index) const { - return method_.Get(index); + return _impl_.method_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto& ServiceDescriptorProto::method(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.method) return _internal_method(index); } inline ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* ServiceDescriptorProto::_internal_add_method() { - return method_.Add(); + return _impl_.method_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* ServiceDescriptorProto::add_method() { ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* _add = _internal_add_method(); @@ -11430,24 +11477,24 @@ inline ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto* ServiceDescriptorProto::a inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::MethodDescriptorProto >& ServiceDescriptorProto::method() const { // @@protoc_insertion_point(field_list:google.protobuf.ServiceDescriptorProto.method) - return method_; + return _impl_.method_; } // optional .google.protobuf.ServiceOptions options = 3; inline bool ServiceDescriptorProto::_internal_has_options() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || options_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.options_ != nullptr); return value; } inline bool ServiceDescriptorProto::has_options() const { return _internal_has_options(); } inline void ServiceDescriptorProto::clear_options() { - if (options_ != nullptr) options_->Clear(); - _has_bits_[0] &= ~0x00000002u; + if (_impl_.options_ != nullptr) _impl_.options_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const ::PROTOBUF_NAMESPACE_ID::ServiceOptions& ServiceDescriptorProto::_internal_options() const { - const ::PROTOBUF_NAMESPACE_ID::ServiceOptions* p = options_; + const ::PROTOBUF_NAMESPACE_ID::ServiceOptions* p = _impl_.options_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_ServiceOptions_default_instance_); } @@ -11458,20 +11505,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::ServiceOptions& ServiceDescriptorProto::op inline void ServiceDescriptorProto::unsafe_arena_set_allocated_options( ::PROTOBUF_NAMESPACE_ID::ServiceOptions* options) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.options_); } - options_ = options; + _impl_.options_ = options; if (options) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.ServiceDescriptorProto.options) } inline ::PROTOBUF_NAMESPACE_ID::ServiceOptions* ServiceDescriptorProto::release_options() { - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::ServiceOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::ServiceOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -11485,18 +11532,18 @@ inline ::PROTOBUF_NAMESPACE_ID::ServiceOptions* ServiceDescriptorProto::release_ } inline ::PROTOBUF_NAMESPACE_ID::ServiceOptions* ServiceDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.options) - _has_bits_[0] &= ~0x00000002u; - ::PROTOBUF_NAMESPACE_ID::ServiceOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000002u; + ::PROTOBUF_NAMESPACE_ID::ServiceOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::ServiceOptions* ServiceDescriptorProto::_internal_mutable_options() { - _has_bits_[0] |= 0x00000002u; - if (options_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.options_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::ServiceOptions>(GetArenaForAllocation()); - options_ = p; + _impl_.options_ = p; } - return options_; + return _impl_.options_; } inline ::PROTOBUF_NAMESPACE_ID::ServiceOptions* ServiceDescriptorProto::mutable_options() { ::PROTOBUF_NAMESPACE_ID::ServiceOptions* _msg = _internal_mutable_options(); @@ -11506,20 +11553,20 @@ inline ::PROTOBUF_NAMESPACE_ID::ServiceOptions* ServiceDescriptorProto::mutable_ inline void ServiceDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::ServiceOptions* options) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete options_; + delete _impl_.options_; } if (options) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::ServiceOptions>::GetOwningArena(options); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(options); if (message_arena != submessage_arena) { options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, options, submessage_arena); } - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - options_ = options; + _impl_.options_ = options; // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.options) } @@ -11529,15 +11576,15 @@ inline void ServiceDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_I // optional string name = 1; inline bool MethodDescriptorProto::_internal_has_name() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool MethodDescriptorProto::has_name() const { return _internal_has_name(); } inline void MethodDescriptorProto::clear_name() { - name_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& MethodDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.name) @@ -11546,8 +11593,8 @@ inline const std::string& MethodDescriptorProto::name() const { template inline PROTOBUF_ALWAYS_INLINE void MethodDescriptorProto::set_name(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.name) } inline std::string* MethodDescriptorProto::mutable_name() { @@ -11556,41 +11603,40 @@ inline std::string* MethodDescriptorProto::mutable_name() { return _s; } inline const std::string& MethodDescriptorProto::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void MethodDescriptorProto::_internal_set_name(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* MethodDescriptorProto::_internal_mutable_name() { - _has_bits_[0] |= 0x00000001u; - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* MethodDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.name) if (!_internal_has_name()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void MethodDescriptorProto::set_allocated_name(std::string* name) { if (name != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.name) @@ -11598,15 +11644,15 @@ inline void MethodDescriptorProto::set_allocated_name(std::string* name) { // optional string input_type = 2; inline bool MethodDescriptorProto::_internal_has_input_type() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool MethodDescriptorProto::has_input_type() const { return _internal_has_input_type(); } inline void MethodDescriptorProto::clear_input_type() { - input_type_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000002u; + _impl_.input_type_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const std::string& MethodDescriptorProto::input_type() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.input_type) @@ -11615,8 +11661,8 @@ inline const std::string& MethodDescriptorProto::input_type() const { template inline PROTOBUF_ALWAYS_INLINE void MethodDescriptorProto::set_input_type(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000002u; - input_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.input_type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.input_type) } inline std::string* MethodDescriptorProto::mutable_input_type() { @@ -11625,41 +11671,40 @@ inline std::string* MethodDescriptorProto::mutable_input_type() { return _s; } inline const std::string& MethodDescriptorProto::_internal_input_type() const { - return input_type_.Get(); + return _impl_.input_type_.Get(); } inline void MethodDescriptorProto::_internal_set_input_type(const std::string& value) { - _has_bits_[0] |= 0x00000002u; - input_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.input_type_.Set(value, GetArenaForAllocation()); } inline std::string* MethodDescriptorProto::_internal_mutable_input_type() { - _has_bits_[0] |= 0x00000002u; - return input_type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.input_type_.Mutable(GetArenaForAllocation()); } inline std::string* MethodDescriptorProto::release_input_type() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.input_type) if (!_internal_has_input_type()) { return nullptr; } - _has_bits_[0] &= ~0x00000002u; - auto* p = input_type_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.input_type_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (input_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - input_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.input_type_.IsDefault()) { + _impl_.input_type_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void MethodDescriptorProto::set_allocated_input_type(std::string* input_type) { if (input_type != nullptr) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - input_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), input_type, - GetArenaForAllocation()); + _impl_.input_type_.SetAllocated(input_type, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (input_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - input_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.input_type_.IsDefault()) { + _impl_.input_type_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.input_type) @@ -11667,15 +11712,15 @@ inline void MethodDescriptorProto::set_allocated_input_type(std::string* input_t // optional string output_type = 3; inline bool MethodDescriptorProto::_internal_has_output_type() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool MethodDescriptorProto::has_output_type() const { return _internal_has_output_type(); } inline void MethodDescriptorProto::clear_output_type() { - output_type_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000004u; + _impl_.output_type_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } inline const std::string& MethodDescriptorProto::output_type() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.output_type) @@ -11684,8 +11729,8 @@ inline const std::string& MethodDescriptorProto::output_type() const { template inline PROTOBUF_ALWAYS_INLINE void MethodDescriptorProto::set_output_type(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000004u; - output_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.output_type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.output_type) } inline std::string* MethodDescriptorProto::mutable_output_type() { @@ -11694,41 +11739,40 @@ inline std::string* MethodDescriptorProto::mutable_output_type() { return _s; } inline const std::string& MethodDescriptorProto::_internal_output_type() const { - return output_type_.Get(); + return _impl_.output_type_.Get(); } inline void MethodDescriptorProto::_internal_set_output_type(const std::string& value) { - _has_bits_[0] |= 0x00000004u; - output_type_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.output_type_.Set(value, GetArenaForAllocation()); } inline std::string* MethodDescriptorProto::_internal_mutable_output_type() { - _has_bits_[0] |= 0x00000004u; - return output_type_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.output_type_.Mutable(GetArenaForAllocation()); } inline std::string* MethodDescriptorProto::release_output_type() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.output_type) if (!_internal_has_output_type()) { return nullptr; } - _has_bits_[0] &= ~0x00000004u; - auto* p = output_type_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.output_type_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (output_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - output_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.output_type_.IsDefault()) { + _impl_.output_type_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void MethodDescriptorProto::set_allocated_output_type(std::string* output_type) { if (output_type != nullptr) { - _has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000004u; } else { - _has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000004u; } - output_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), output_type, - GetArenaForAllocation()); + _impl_.output_type_.SetAllocated(output_type, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (output_type_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - output_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.output_type_.IsDefault()) { + _impl_.output_type_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.output_type) @@ -11736,19 +11780,19 @@ inline void MethodDescriptorProto::set_allocated_output_type(std::string* output // optional .google.protobuf.MethodOptions options = 4; inline bool MethodDescriptorProto::_internal_has_options() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; - PROTOBUF_ASSUME(!value || options_ != nullptr); + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + PROTOBUF_ASSUME(!value || _impl_.options_ != nullptr); return value; } inline bool MethodDescriptorProto::has_options() const { return _internal_has_options(); } inline void MethodDescriptorProto::clear_options() { - if (options_ != nullptr) options_->Clear(); - _has_bits_[0] &= ~0x00000008u; + if (_impl_.options_ != nullptr) _impl_.options_->Clear(); + _impl_._has_bits_[0] &= ~0x00000008u; } inline const ::PROTOBUF_NAMESPACE_ID::MethodOptions& MethodDescriptorProto::_internal_options() const { - const ::PROTOBUF_NAMESPACE_ID::MethodOptions* p = options_; + const ::PROTOBUF_NAMESPACE_ID::MethodOptions* p = _impl_.options_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_MethodOptions_default_instance_); } @@ -11759,20 +11803,20 @@ inline const ::PROTOBUF_NAMESPACE_ID::MethodOptions& MethodDescriptorProto::opti inline void MethodDescriptorProto::unsafe_arena_set_allocated_options( ::PROTOBUF_NAMESPACE_ID::MethodOptions* options) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(options_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.options_); } - options_ = options; + _impl_.options_ = options; if (options) { - _has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000008u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.options) } inline ::PROTOBUF_NAMESPACE_ID::MethodOptions* MethodDescriptorProto::release_options() { - _has_bits_[0] &= ~0x00000008u; - ::PROTOBUF_NAMESPACE_ID::MethodOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000008u; + ::PROTOBUF_NAMESPACE_ID::MethodOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -11786,18 +11830,18 @@ inline ::PROTOBUF_NAMESPACE_ID::MethodOptions* MethodDescriptorProto::release_op } inline ::PROTOBUF_NAMESPACE_ID::MethodOptions* MethodDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.options) - _has_bits_[0] &= ~0x00000008u; - ::PROTOBUF_NAMESPACE_ID::MethodOptions* temp = options_; - options_ = nullptr; + _impl_._has_bits_[0] &= ~0x00000008u; + ::PROTOBUF_NAMESPACE_ID::MethodOptions* temp = _impl_.options_; + _impl_.options_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::MethodOptions* MethodDescriptorProto::_internal_mutable_options() { - _has_bits_[0] |= 0x00000008u; - if (options_ == nullptr) { + _impl_._has_bits_[0] |= 0x00000008u; + if (_impl_.options_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::MethodOptions>(GetArenaForAllocation()); - options_ = p; + _impl_.options_ = p; } - return options_; + return _impl_.options_; } inline ::PROTOBUF_NAMESPACE_ID::MethodOptions* MethodDescriptorProto::mutable_options() { ::PROTOBUF_NAMESPACE_ID::MethodOptions* _msg = _internal_mutable_options(); @@ -11807,45 +11851,45 @@ inline ::PROTOBUF_NAMESPACE_ID::MethodOptions* MethodDescriptorProto::mutable_op inline void MethodDescriptorProto::set_allocated_options(::PROTOBUF_NAMESPACE_ID::MethodOptions* options) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete options_; + delete _impl_.options_; } if (options) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::MethodOptions>::GetOwningArena(options); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(options); if (message_arena != submessage_arena) { options = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, options, submessage_arena); } - _has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000008u; } - options_ = options; + _impl_.options_ = options; // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.options) } // optional bool client_streaming = 5 [default = false]; inline bool MethodDescriptorProto::_internal_has_client_streaming() const { - bool value = (_has_bits_[0] & 0x00000010u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; } inline bool MethodDescriptorProto::has_client_streaming() const { return _internal_has_client_streaming(); } inline void MethodDescriptorProto::clear_client_streaming() { - client_streaming_ = false; - _has_bits_[0] &= ~0x00000010u; + _impl_.client_streaming_ = false; + _impl_._has_bits_[0] &= ~0x00000010u; } inline bool MethodDescriptorProto::_internal_client_streaming() const { - return client_streaming_; + return _impl_.client_streaming_; } inline bool MethodDescriptorProto::client_streaming() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.client_streaming) return _internal_client_streaming(); } inline void MethodDescriptorProto::_internal_set_client_streaming(bool value) { - _has_bits_[0] |= 0x00000010u; - client_streaming_ = value; + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.client_streaming_ = value; } inline void MethodDescriptorProto::set_client_streaming(bool value) { _internal_set_client_streaming(value); @@ -11854,26 +11898,26 @@ inline void MethodDescriptorProto::set_client_streaming(bool value) { // optional bool server_streaming = 6 [default = false]; inline bool MethodDescriptorProto::_internal_has_server_streaming() const { - bool value = (_has_bits_[0] & 0x00000020u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; return value; } inline bool MethodDescriptorProto::has_server_streaming() const { return _internal_has_server_streaming(); } inline void MethodDescriptorProto::clear_server_streaming() { - server_streaming_ = false; - _has_bits_[0] &= ~0x00000020u; + _impl_.server_streaming_ = false; + _impl_._has_bits_[0] &= ~0x00000020u; } inline bool MethodDescriptorProto::_internal_server_streaming() const { - return server_streaming_; + return _impl_.server_streaming_; } inline bool MethodDescriptorProto::server_streaming() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.server_streaming) return _internal_server_streaming(); } inline void MethodDescriptorProto::_internal_set_server_streaming(bool value) { - _has_bits_[0] |= 0x00000020u; - server_streaming_ = value; + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.server_streaming_ = value; } inline void MethodDescriptorProto::set_server_streaming(bool value) { _internal_set_server_streaming(value); @@ -11886,15 +11930,15 @@ inline void MethodDescriptorProto::set_server_streaming(bool value) { // optional string java_package = 1; inline bool FileOptions::_internal_has_java_package() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool FileOptions::has_java_package() const { return _internal_has_java_package(); } inline void FileOptions::clear_java_package() { - java_package_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.java_package_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& FileOptions::java_package() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_package) @@ -11903,8 +11947,8 @@ inline const std::string& FileOptions::java_package() const { template inline PROTOBUF_ALWAYS_INLINE void FileOptions::set_java_package(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - java_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.java_package_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_package) } inline std::string* FileOptions::mutable_java_package() { @@ -11913,41 +11957,40 @@ inline std::string* FileOptions::mutable_java_package() { return _s; } inline const std::string& FileOptions::_internal_java_package() const { - return java_package_.Get(); + return _impl_.java_package_.Get(); } inline void FileOptions::_internal_set_java_package(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - java_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.java_package_.Set(value, GetArenaForAllocation()); } inline std::string* FileOptions::_internal_mutable_java_package() { - _has_bits_[0] |= 0x00000001u; - return java_package_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.java_package_.Mutable(GetArenaForAllocation()); } inline std::string* FileOptions::release_java_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_package) if (!_internal_has_java_package()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = java_package_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.java_package_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (java_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - java_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.java_package_.IsDefault()) { + _impl_.java_package_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileOptions::set_allocated_java_package(std::string* java_package) { if (java_package != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - java_package_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), java_package, - GetArenaForAllocation()); + _impl_.java_package_.SetAllocated(java_package, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (java_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - java_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.java_package_.IsDefault()) { + _impl_.java_package_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_package) @@ -11955,15 +11998,15 @@ inline void FileOptions::set_allocated_java_package(std::string* java_package) { // optional string java_outer_classname = 8; inline bool FileOptions::_internal_has_java_outer_classname() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool FileOptions::has_java_outer_classname() const { return _internal_has_java_outer_classname(); } inline void FileOptions::clear_java_outer_classname() { - java_outer_classname_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000002u; + _impl_.java_outer_classname_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const std::string& FileOptions::java_outer_classname() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_outer_classname) @@ -11972,8 +12015,8 @@ inline const std::string& FileOptions::java_outer_classname() const { template inline PROTOBUF_ALWAYS_INLINE void FileOptions::set_java_outer_classname(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000002u; - java_outer_classname_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.java_outer_classname_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_outer_classname) } inline std::string* FileOptions::mutable_java_outer_classname() { @@ -11982,41 +12025,40 @@ inline std::string* FileOptions::mutable_java_outer_classname() { return _s; } inline const std::string& FileOptions::_internal_java_outer_classname() const { - return java_outer_classname_.Get(); + return _impl_.java_outer_classname_.Get(); } inline void FileOptions::_internal_set_java_outer_classname(const std::string& value) { - _has_bits_[0] |= 0x00000002u; - java_outer_classname_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.java_outer_classname_.Set(value, GetArenaForAllocation()); } inline std::string* FileOptions::_internal_mutable_java_outer_classname() { - _has_bits_[0] |= 0x00000002u; - return java_outer_classname_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.java_outer_classname_.Mutable(GetArenaForAllocation()); } inline std::string* FileOptions::release_java_outer_classname() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_outer_classname) if (!_internal_has_java_outer_classname()) { return nullptr; } - _has_bits_[0] &= ~0x00000002u; - auto* p = java_outer_classname_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.java_outer_classname_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (java_outer_classname_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - java_outer_classname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.java_outer_classname_.IsDefault()) { + _impl_.java_outer_classname_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileOptions::set_allocated_java_outer_classname(std::string* java_outer_classname) { if (java_outer_classname != nullptr) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - java_outer_classname_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), java_outer_classname, - GetArenaForAllocation()); + _impl_.java_outer_classname_.SetAllocated(java_outer_classname, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (java_outer_classname_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - java_outer_classname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.java_outer_classname_.IsDefault()) { + _impl_.java_outer_classname_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_outer_classname) @@ -12024,26 +12066,26 @@ inline void FileOptions::set_allocated_java_outer_classname(std::string* java_ou // optional bool java_multiple_files = 10 [default = false]; inline bool FileOptions::_internal_has_java_multiple_files() const { - bool value = (_has_bits_[0] & 0x00000400u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; return value; } inline bool FileOptions::has_java_multiple_files() const { return _internal_has_java_multiple_files(); } inline void FileOptions::clear_java_multiple_files() { - java_multiple_files_ = false; - _has_bits_[0] &= ~0x00000400u; + _impl_.java_multiple_files_ = false; + _impl_._has_bits_[0] &= ~0x00000400u; } inline bool FileOptions::_internal_java_multiple_files() const { - return java_multiple_files_; + return _impl_.java_multiple_files_; } inline bool FileOptions::java_multiple_files() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_multiple_files) return _internal_java_multiple_files(); } inline void FileOptions::_internal_set_java_multiple_files(bool value) { - _has_bits_[0] |= 0x00000400u; - java_multiple_files_ = value; + _impl_._has_bits_[0] |= 0x00000400u; + _impl_.java_multiple_files_ = value; } inline void FileOptions::set_java_multiple_files(bool value) { _internal_set_java_multiple_files(value); @@ -12052,26 +12094,26 @@ inline void FileOptions::set_java_multiple_files(bool value) { // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; inline bool FileOptions::_internal_has_java_generate_equals_and_hash() const { - bool value = (_has_bits_[0] & 0x00000800u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; return value; } inline bool FileOptions::has_java_generate_equals_and_hash() const { return _internal_has_java_generate_equals_and_hash(); } inline void FileOptions::clear_java_generate_equals_and_hash() { - java_generate_equals_and_hash_ = false; - _has_bits_[0] &= ~0x00000800u; + _impl_.java_generate_equals_and_hash_ = false; + _impl_._has_bits_[0] &= ~0x00000800u; } inline bool FileOptions::_internal_java_generate_equals_and_hash() const { - return java_generate_equals_and_hash_; + return _impl_.java_generate_equals_and_hash_; } inline bool FileOptions::java_generate_equals_and_hash() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generate_equals_and_hash) return _internal_java_generate_equals_and_hash(); } inline void FileOptions::_internal_set_java_generate_equals_and_hash(bool value) { - _has_bits_[0] |= 0x00000800u; - java_generate_equals_and_hash_ = value; + _impl_._has_bits_[0] |= 0x00000800u; + _impl_.java_generate_equals_and_hash_ = value; } inline void FileOptions::set_java_generate_equals_and_hash(bool value) { _internal_set_java_generate_equals_and_hash(value); @@ -12080,26 +12122,26 @@ inline void FileOptions::set_java_generate_equals_and_hash(bool value) { // optional bool java_string_check_utf8 = 27 [default = false]; inline bool FileOptions::_internal_has_java_string_check_utf8() const { - bool value = (_has_bits_[0] & 0x00001000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00001000u) != 0; return value; } inline bool FileOptions::has_java_string_check_utf8() const { return _internal_has_java_string_check_utf8(); } inline void FileOptions::clear_java_string_check_utf8() { - java_string_check_utf8_ = false; - _has_bits_[0] &= ~0x00001000u; + _impl_.java_string_check_utf8_ = false; + _impl_._has_bits_[0] &= ~0x00001000u; } inline bool FileOptions::_internal_java_string_check_utf8() const { - return java_string_check_utf8_; + return _impl_.java_string_check_utf8_; } inline bool FileOptions::java_string_check_utf8() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_string_check_utf8) return _internal_java_string_check_utf8(); } inline void FileOptions::_internal_set_java_string_check_utf8(bool value) { - _has_bits_[0] |= 0x00001000u; - java_string_check_utf8_ = value; + _impl_._has_bits_[0] |= 0x00001000u; + _impl_.java_string_check_utf8_ = value; } inline void FileOptions::set_java_string_check_utf8(bool value) { _internal_set_java_string_check_utf8(value); @@ -12108,18 +12150,18 @@ inline void FileOptions::set_java_string_check_utf8(bool value) { // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; inline bool FileOptions::_internal_has_optimize_for() const { - bool value = (_has_bits_[0] & 0x00040000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00040000u) != 0; return value; } inline bool FileOptions::has_optimize_for() const { return _internal_has_optimize_for(); } inline void FileOptions::clear_optimize_for() { - optimize_for_ = 1; - _has_bits_[0] &= ~0x00040000u; + _impl_.optimize_for_ = 1; + _impl_._has_bits_[0] &= ~0x00040000u; } inline ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode FileOptions::_internal_optimize_for() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode >(optimize_for_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode >(_impl_.optimize_for_); } inline ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode FileOptions::optimize_for() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.optimize_for) @@ -12127,8 +12169,8 @@ inline ::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode FileOptions::optimize_f } inline void FileOptions::_internal_set_optimize_for(::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode value) { assert(::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode_IsValid(value)); - _has_bits_[0] |= 0x00040000u; - optimize_for_ = value; + _impl_._has_bits_[0] |= 0x00040000u; + _impl_.optimize_for_ = value; } inline void FileOptions::set_optimize_for(::PROTOBUF_NAMESPACE_ID::FileOptions_OptimizeMode value) { _internal_set_optimize_for(value); @@ -12137,15 +12179,15 @@ inline void FileOptions::set_optimize_for(::PROTOBUF_NAMESPACE_ID::FileOptions_O // optional string go_package = 11; inline bool FileOptions::_internal_has_go_package() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool FileOptions::has_go_package() const { return _internal_has_go_package(); } inline void FileOptions::clear_go_package() { - go_package_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000004u; + _impl_.go_package_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } inline const std::string& FileOptions::go_package() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.go_package) @@ -12154,8 +12196,8 @@ inline const std::string& FileOptions::go_package() const { template inline PROTOBUF_ALWAYS_INLINE void FileOptions::set_go_package(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000004u; - go_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.go_package_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.go_package) } inline std::string* FileOptions::mutable_go_package() { @@ -12164,41 +12206,40 @@ inline std::string* FileOptions::mutable_go_package() { return _s; } inline const std::string& FileOptions::_internal_go_package() const { - return go_package_.Get(); + return _impl_.go_package_.Get(); } inline void FileOptions::_internal_set_go_package(const std::string& value) { - _has_bits_[0] |= 0x00000004u; - go_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.go_package_.Set(value, GetArenaForAllocation()); } inline std::string* FileOptions::_internal_mutable_go_package() { - _has_bits_[0] |= 0x00000004u; - return go_package_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.go_package_.Mutable(GetArenaForAllocation()); } inline std::string* FileOptions::release_go_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.go_package) if (!_internal_has_go_package()) { return nullptr; } - _has_bits_[0] &= ~0x00000004u; - auto* p = go_package_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.go_package_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (go_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - go_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.go_package_.IsDefault()) { + _impl_.go_package_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileOptions::set_allocated_go_package(std::string* go_package) { if (go_package != nullptr) { - _has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000004u; } else { - _has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000004u; } - go_package_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), go_package, - GetArenaForAllocation()); + _impl_.go_package_.SetAllocated(go_package, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (go_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - go_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.go_package_.IsDefault()) { + _impl_.go_package_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.go_package) @@ -12206,26 +12247,26 @@ inline void FileOptions::set_allocated_go_package(std::string* go_package) { // optional bool cc_generic_services = 16 [default = false]; inline bool FileOptions::_internal_has_cc_generic_services() const { - bool value = (_has_bits_[0] & 0x00002000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00002000u) != 0; return value; } inline bool FileOptions::has_cc_generic_services() const { return _internal_has_cc_generic_services(); } inline void FileOptions::clear_cc_generic_services() { - cc_generic_services_ = false; - _has_bits_[0] &= ~0x00002000u; + _impl_.cc_generic_services_ = false; + _impl_._has_bits_[0] &= ~0x00002000u; } inline bool FileOptions::_internal_cc_generic_services() const { - return cc_generic_services_; + return _impl_.cc_generic_services_; } inline bool FileOptions::cc_generic_services() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_generic_services) return _internal_cc_generic_services(); } inline void FileOptions::_internal_set_cc_generic_services(bool value) { - _has_bits_[0] |= 0x00002000u; - cc_generic_services_ = value; + _impl_._has_bits_[0] |= 0x00002000u; + _impl_.cc_generic_services_ = value; } inline void FileOptions::set_cc_generic_services(bool value) { _internal_set_cc_generic_services(value); @@ -12234,26 +12275,26 @@ inline void FileOptions::set_cc_generic_services(bool value) { // optional bool java_generic_services = 17 [default = false]; inline bool FileOptions::_internal_has_java_generic_services() const { - bool value = (_has_bits_[0] & 0x00004000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00004000u) != 0; return value; } inline bool FileOptions::has_java_generic_services() const { return _internal_has_java_generic_services(); } inline void FileOptions::clear_java_generic_services() { - java_generic_services_ = false; - _has_bits_[0] &= ~0x00004000u; + _impl_.java_generic_services_ = false; + _impl_._has_bits_[0] &= ~0x00004000u; } inline bool FileOptions::_internal_java_generic_services() const { - return java_generic_services_; + return _impl_.java_generic_services_; } inline bool FileOptions::java_generic_services() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generic_services) return _internal_java_generic_services(); } inline void FileOptions::_internal_set_java_generic_services(bool value) { - _has_bits_[0] |= 0x00004000u; - java_generic_services_ = value; + _impl_._has_bits_[0] |= 0x00004000u; + _impl_.java_generic_services_ = value; } inline void FileOptions::set_java_generic_services(bool value) { _internal_set_java_generic_services(value); @@ -12262,26 +12303,26 @@ inline void FileOptions::set_java_generic_services(bool value) { // optional bool py_generic_services = 18 [default = false]; inline bool FileOptions::_internal_has_py_generic_services() const { - bool value = (_has_bits_[0] & 0x00008000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00008000u) != 0; return value; } inline bool FileOptions::has_py_generic_services() const { return _internal_has_py_generic_services(); } inline void FileOptions::clear_py_generic_services() { - py_generic_services_ = false; - _has_bits_[0] &= ~0x00008000u; + _impl_.py_generic_services_ = false; + _impl_._has_bits_[0] &= ~0x00008000u; } inline bool FileOptions::_internal_py_generic_services() const { - return py_generic_services_; + return _impl_.py_generic_services_; } inline bool FileOptions::py_generic_services() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.py_generic_services) return _internal_py_generic_services(); } inline void FileOptions::_internal_set_py_generic_services(bool value) { - _has_bits_[0] |= 0x00008000u; - py_generic_services_ = value; + _impl_._has_bits_[0] |= 0x00008000u; + _impl_.py_generic_services_ = value; } inline void FileOptions::set_py_generic_services(bool value) { _internal_set_py_generic_services(value); @@ -12290,26 +12331,26 @@ inline void FileOptions::set_py_generic_services(bool value) { // optional bool php_generic_services = 42 [default = false]; inline bool FileOptions::_internal_has_php_generic_services() const { - bool value = (_has_bits_[0] & 0x00010000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00010000u) != 0; return value; } inline bool FileOptions::has_php_generic_services() const { return _internal_has_php_generic_services(); } inline void FileOptions::clear_php_generic_services() { - php_generic_services_ = false; - _has_bits_[0] &= ~0x00010000u; + _impl_.php_generic_services_ = false; + _impl_._has_bits_[0] &= ~0x00010000u; } inline bool FileOptions::_internal_php_generic_services() const { - return php_generic_services_; + return _impl_.php_generic_services_; } inline bool FileOptions::php_generic_services() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_generic_services) return _internal_php_generic_services(); } inline void FileOptions::_internal_set_php_generic_services(bool value) { - _has_bits_[0] |= 0x00010000u; - php_generic_services_ = value; + _impl_._has_bits_[0] |= 0x00010000u; + _impl_.php_generic_services_ = value; } inline void FileOptions::set_php_generic_services(bool value) { _internal_set_php_generic_services(value); @@ -12318,26 +12359,26 @@ inline void FileOptions::set_php_generic_services(bool value) { // optional bool deprecated = 23 [default = false]; inline bool FileOptions::_internal_has_deprecated() const { - bool value = (_has_bits_[0] & 0x00020000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00020000u) != 0; return value; } inline bool FileOptions::has_deprecated() const { return _internal_has_deprecated(); } inline void FileOptions::clear_deprecated() { - deprecated_ = false; - _has_bits_[0] &= ~0x00020000u; + _impl_.deprecated_ = false; + _impl_._has_bits_[0] &= ~0x00020000u; } inline bool FileOptions::_internal_deprecated() const { - return deprecated_; + return _impl_.deprecated_; } inline bool FileOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.deprecated) return _internal_deprecated(); } inline void FileOptions::_internal_set_deprecated(bool value) { - _has_bits_[0] |= 0x00020000u; - deprecated_ = value; + _impl_._has_bits_[0] |= 0x00020000u; + _impl_.deprecated_ = value; } inline void FileOptions::set_deprecated(bool value) { _internal_set_deprecated(value); @@ -12346,26 +12387,26 @@ inline void FileOptions::set_deprecated(bool value) { // optional bool cc_enable_arenas = 31 [default = true]; inline bool FileOptions::_internal_has_cc_enable_arenas() const { - bool value = (_has_bits_[0] & 0x00080000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00080000u) != 0; return value; } inline bool FileOptions::has_cc_enable_arenas() const { return _internal_has_cc_enable_arenas(); } inline void FileOptions::clear_cc_enable_arenas() { - cc_enable_arenas_ = true; - _has_bits_[0] &= ~0x00080000u; + _impl_.cc_enable_arenas_ = true; + _impl_._has_bits_[0] &= ~0x00080000u; } inline bool FileOptions::_internal_cc_enable_arenas() const { - return cc_enable_arenas_; + return _impl_.cc_enable_arenas_; } inline bool FileOptions::cc_enable_arenas() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_enable_arenas) return _internal_cc_enable_arenas(); } inline void FileOptions::_internal_set_cc_enable_arenas(bool value) { - _has_bits_[0] |= 0x00080000u; - cc_enable_arenas_ = value; + _impl_._has_bits_[0] |= 0x00080000u; + _impl_.cc_enable_arenas_ = value; } inline void FileOptions::set_cc_enable_arenas(bool value) { _internal_set_cc_enable_arenas(value); @@ -12374,15 +12415,15 @@ inline void FileOptions::set_cc_enable_arenas(bool value) { // optional string objc_class_prefix = 36; inline bool FileOptions::_internal_has_objc_class_prefix() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } inline bool FileOptions::has_objc_class_prefix() const { return _internal_has_objc_class_prefix(); } inline void FileOptions::clear_objc_class_prefix() { - objc_class_prefix_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000008u; + _impl_.objc_class_prefix_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000008u; } inline const std::string& FileOptions::objc_class_prefix() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.objc_class_prefix) @@ -12391,8 +12432,8 @@ inline const std::string& FileOptions::objc_class_prefix() const { template inline PROTOBUF_ALWAYS_INLINE void FileOptions::set_objc_class_prefix(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000008u; - objc_class_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.objc_class_prefix_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.objc_class_prefix) } inline std::string* FileOptions::mutable_objc_class_prefix() { @@ -12401,41 +12442,40 @@ inline std::string* FileOptions::mutable_objc_class_prefix() { return _s; } inline const std::string& FileOptions::_internal_objc_class_prefix() const { - return objc_class_prefix_.Get(); + return _impl_.objc_class_prefix_.Get(); } inline void FileOptions::_internal_set_objc_class_prefix(const std::string& value) { - _has_bits_[0] |= 0x00000008u; - objc_class_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.objc_class_prefix_.Set(value, GetArenaForAllocation()); } inline std::string* FileOptions::_internal_mutable_objc_class_prefix() { - _has_bits_[0] |= 0x00000008u; - return objc_class_prefix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000008u; + return _impl_.objc_class_prefix_.Mutable(GetArenaForAllocation()); } inline std::string* FileOptions::release_objc_class_prefix() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.objc_class_prefix) if (!_internal_has_objc_class_prefix()) { return nullptr; } - _has_bits_[0] &= ~0x00000008u; - auto* p = objc_class_prefix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000008u; + auto* p = _impl_.objc_class_prefix_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (objc_class_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - objc_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.objc_class_prefix_.IsDefault()) { + _impl_.objc_class_prefix_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileOptions::set_allocated_objc_class_prefix(std::string* objc_class_prefix) { if (objc_class_prefix != nullptr) { - _has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000008u; } - objc_class_prefix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), objc_class_prefix, - GetArenaForAllocation()); + _impl_.objc_class_prefix_.SetAllocated(objc_class_prefix, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (objc_class_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - objc_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.objc_class_prefix_.IsDefault()) { + _impl_.objc_class_prefix_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.objc_class_prefix) @@ -12443,15 +12483,15 @@ inline void FileOptions::set_allocated_objc_class_prefix(std::string* objc_class // optional string csharp_namespace = 37; inline bool FileOptions::_internal_has_csharp_namespace() const { - bool value = (_has_bits_[0] & 0x00000010u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; } inline bool FileOptions::has_csharp_namespace() const { return _internal_has_csharp_namespace(); } inline void FileOptions::clear_csharp_namespace() { - csharp_namespace_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000010u; + _impl_.csharp_namespace_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000010u; } inline const std::string& FileOptions::csharp_namespace() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.csharp_namespace) @@ -12460,8 +12500,8 @@ inline const std::string& FileOptions::csharp_namespace() const { template inline PROTOBUF_ALWAYS_INLINE void FileOptions::set_csharp_namespace(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000010u; - csharp_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.csharp_namespace_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.csharp_namespace) } inline std::string* FileOptions::mutable_csharp_namespace() { @@ -12470,41 +12510,40 @@ inline std::string* FileOptions::mutable_csharp_namespace() { return _s; } inline const std::string& FileOptions::_internal_csharp_namespace() const { - return csharp_namespace_.Get(); + return _impl_.csharp_namespace_.Get(); } inline void FileOptions::_internal_set_csharp_namespace(const std::string& value) { - _has_bits_[0] |= 0x00000010u; - csharp_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.csharp_namespace_.Set(value, GetArenaForAllocation()); } inline std::string* FileOptions::_internal_mutable_csharp_namespace() { - _has_bits_[0] |= 0x00000010u; - return csharp_namespace_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000010u; + return _impl_.csharp_namespace_.Mutable(GetArenaForAllocation()); } inline std::string* FileOptions::release_csharp_namespace() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.csharp_namespace) if (!_internal_has_csharp_namespace()) { return nullptr; } - _has_bits_[0] &= ~0x00000010u; - auto* p = csharp_namespace_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000010u; + auto* p = _impl_.csharp_namespace_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (csharp_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - csharp_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.csharp_namespace_.IsDefault()) { + _impl_.csharp_namespace_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileOptions::set_allocated_csharp_namespace(std::string* csharp_namespace) { if (csharp_namespace != nullptr) { - _has_bits_[0] |= 0x00000010u; + _impl_._has_bits_[0] |= 0x00000010u; } else { - _has_bits_[0] &= ~0x00000010u; + _impl_._has_bits_[0] &= ~0x00000010u; } - csharp_namespace_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), csharp_namespace, - GetArenaForAllocation()); + _impl_.csharp_namespace_.SetAllocated(csharp_namespace, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (csharp_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - csharp_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.csharp_namespace_.IsDefault()) { + _impl_.csharp_namespace_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.csharp_namespace) @@ -12512,15 +12551,15 @@ inline void FileOptions::set_allocated_csharp_namespace(std::string* csharp_name // optional string swift_prefix = 39; inline bool FileOptions::_internal_has_swift_prefix() const { - bool value = (_has_bits_[0] & 0x00000020u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; return value; } inline bool FileOptions::has_swift_prefix() const { return _internal_has_swift_prefix(); } inline void FileOptions::clear_swift_prefix() { - swift_prefix_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000020u; + _impl_.swift_prefix_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000020u; } inline const std::string& FileOptions::swift_prefix() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.swift_prefix) @@ -12529,8 +12568,8 @@ inline const std::string& FileOptions::swift_prefix() const { template inline PROTOBUF_ALWAYS_INLINE void FileOptions::set_swift_prefix(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000020u; - swift_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.swift_prefix_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.swift_prefix) } inline std::string* FileOptions::mutable_swift_prefix() { @@ -12539,41 +12578,40 @@ inline std::string* FileOptions::mutable_swift_prefix() { return _s; } inline const std::string& FileOptions::_internal_swift_prefix() const { - return swift_prefix_.Get(); + return _impl_.swift_prefix_.Get(); } inline void FileOptions::_internal_set_swift_prefix(const std::string& value) { - _has_bits_[0] |= 0x00000020u; - swift_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.swift_prefix_.Set(value, GetArenaForAllocation()); } inline std::string* FileOptions::_internal_mutable_swift_prefix() { - _has_bits_[0] |= 0x00000020u; - return swift_prefix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000020u; + return _impl_.swift_prefix_.Mutable(GetArenaForAllocation()); } inline std::string* FileOptions::release_swift_prefix() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.swift_prefix) if (!_internal_has_swift_prefix()) { return nullptr; } - _has_bits_[0] &= ~0x00000020u; - auto* p = swift_prefix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000020u; + auto* p = _impl_.swift_prefix_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (swift_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - swift_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.swift_prefix_.IsDefault()) { + _impl_.swift_prefix_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileOptions::set_allocated_swift_prefix(std::string* swift_prefix) { if (swift_prefix != nullptr) { - _has_bits_[0] |= 0x00000020u; + _impl_._has_bits_[0] |= 0x00000020u; } else { - _has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000020u; } - swift_prefix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), swift_prefix, - GetArenaForAllocation()); + _impl_.swift_prefix_.SetAllocated(swift_prefix, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (swift_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - swift_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.swift_prefix_.IsDefault()) { + _impl_.swift_prefix_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.swift_prefix) @@ -12581,15 +12619,15 @@ inline void FileOptions::set_allocated_swift_prefix(std::string* swift_prefix) { // optional string php_class_prefix = 40; inline bool FileOptions::_internal_has_php_class_prefix() const { - bool value = (_has_bits_[0] & 0x00000040u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; return value; } inline bool FileOptions::has_php_class_prefix() const { return _internal_has_php_class_prefix(); } inline void FileOptions::clear_php_class_prefix() { - php_class_prefix_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000040u; + _impl_.php_class_prefix_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000040u; } inline const std::string& FileOptions::php_class_prefix() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_class_prefix) @@ -12598,8 +12636,8 @@ inline const std::string& FileOptions::php_class_prefix() const { template inline PROTOBUF_ALWAYS_INLINE void FileOptions::set_php_class_prefix(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000040u; - php_class_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.php_class_prefix_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_class_prefix) } inline std::string* FileOptions::mutable_php_class_prefix() { @@ -12608,41 +12646,40 @@ inline std::string* FileOptions::mutable_php_class_prefix() { return _s; } inline const std::string& FileOptions::_internal_php_class_prefix() const { - return php_class_prefix_.Get(); + return _impl_.php_class_prefix_.Get(); } inline void FileOptions::_internal_set_php_class_prefix(const std::string& value) { - _has_bits_[0] |= 0x00000040u; - php_class_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.php_class_prefix_.Set(value, GetArenaForAllocation()); } inline std::string* FileOptions::_internal_mutable_php_class_prefix() { - _has_bits_[0] |= 0x00000040u; - return php_class_prefix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000040u; + return _impl_.php_class_prefix_.Mutable(GetArenaForAllocation()); } inline std::string* FileOptions::release_php_class_prefix() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_class_prefix) if (!_internal_has_php_class_prefix()) { return nullptr; } - _has_bits_[0] &= ~0x00000040u; - auto* p = php_class_prefix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000040u; + auto* p = _impl_.php_class_prefix_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (php_class_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - php_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.php_class_prefix_.IsDefault()) { + _impl_.php_class_prefix_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileOptions::set_allocated_php_class_prefix(std::string* php_class_prefix) { if (php_class_prefix != nullptr) { - _has_bits_[0] |= 0x00000040u; + _impl_._has_bits_[0] |= 0x00000040u; } else { - _has_bits_[0] &= ~0x00000040u; + _impl_._has_bits_[0] &= ~0x00000040u; } - php_class_prefix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), php_class_prefix, - GetArenaForAllocation()); + _impl_.php_class_prefix_.SetAllocated(php_class_prefix, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (php_class_prefix_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - php_class_prefix_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.php_class_prefix_.IsDefault()) { + _impl_.php_class_prefix_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_class_prefix) @@ -12650,15 +12687,15 @@ inline void FileOptions::set_allocated_php_class_prefix(std::string* php_class_p // optional string php_namespace = 41; inline bool FileOptions::_internal_has_php_namespace() const { - bool value = (_has_bits_[0] & 0x00000080u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; return value; } inline bool FileOptions::has_php_namespace() const { return _internal_has_php_namespace(); } inline void FileOptions::clear_php_namespace() { - php_namespace_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000080u; + _impl_.php_namespace_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000080u; } inline const std::string& FileOptions::php_namespace() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_namespace) @@ -12667,8 +12704,8 @@ inline const std::string& FileOptions::php_namespace() const { template inline PROTOBUF_ALWAYS_INLINE void FileOptions::set_php_namespace(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000080u; - php_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000080u; + _impl_.php_namespace_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_namespace) } inline std::string* FileOptions::mutable_php_namespace() { @@ -12677,41 +12714,40 @@ inline std::string* FileOptions::mutable_php_namespace() { return _s; } inline const std::string& FileOptions::_internal_php_namespace() const { - return php_namespace_.Get(); + return _impl_.php_namespace_.Get(); } inline void FileOptions::_internal_set_php_namespace(const std::string& value) { - _has_bits_[0] |= 0x00000080u; - php_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000080u; + _impl_.php_namespace_.Set(value, GetArenaForAllocation()); } inline std::string* FileOptions::_internal_mutable_php_namespace() { - _has_bits_[0] |= 0x00000080u; - return php_namespace_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000080u; + return _impl_.php_namespace_.Mutable(GetArenaForAllocation()); } inline std::string* FileOptions::release_php_namespace() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_namespace) if (!_internal_has_php_namespace()) { return nullptr; } - _has_bits_[0] &= ~0x00000080u; - auto* p = php_namespace_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000080u; + auto* p = _impl_.php_namespace_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (php_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - php_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.php_namespace_.IsDefault()) { + _impl_.php_namespace_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileOptions::set_allocated_php_namespace(std::string* php_namespace) { if (php_namespace != nullptr) { - _has_bits_[0] |= 0x00000080u; + _impl_._has_bits_[0] |= 0x00000080u; } else { - _has_bits_[0] &= ~0x00000080u; + _impl_._has_bits_[0] &= ~0x00000080u; } - php_namespace_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), php_namespace, - GetArenaForAllocation()); + _impl_.php_namespace_.SetAllocated(php_namespace, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (php_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - php_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.php_namespace_.IsDefault()) { + _impl_.php_namespace_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_namespace) @@ -12719,15 +12755,15 @@ inline void FileOptions::set_allocated_php_namespace(std::string* php_namespace) // optional string php_metadata_namespace = 44; inline bool FileOptions::_internal_has_php_metadata_namespace() const { - bool value = (_has_bits_[0] & 0x00000100u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; return value; } inline bool FileOptions::has_php_metadata_namespace() const { return _internal_has_php_metadata_namespace(); } inline void FileOptions::clear_php_metadata_namespace() { - php_metadata_namespace_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000100u; + _impl_.php_metadata_namespace_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000100u; } inline const std::string& FileOptions::php_metadata_namespace() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_metadata_namespace) @@ -12736,8 +12772,8 @@ inline const std::string& FileOptions::php_metadata_namespace() const { template inline PROTOBUF_ALWAYS_INLINE void FileOptions::set_php_metadata_namespace(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000100u; - php_metadata_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000100u; + _impl_.php_metadata_namespace_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_metadata_namespace) } inline std::string* FileOptions::mutable_php_metadata_namespace() { @@ -12746,41 +12782,40 @@ inline std::string* FileOptions::mutable_php_metadata_namespace() { return _s; } inline const std::string& FileOptions::_internal_php_metadata_namespace() const { - return php_metadata_namespace_.Get(); + return _impl_.php_metadata_namespace_.Get(); } inline void FileOptions::_internal_set_php_metadata_namespace(const std::string& value) { - _has_bits_[0] |= 0x00000100u; - php_metadata_namespace_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000100u; + _impl_.php_metadata_namespace_.Set(value, GetArenaForAllocation()); } inline std::string* FileOptions::_internal_mutable_php_metadata_namespace() { - _has_bits_[0] |= 0x00000100u; - return php_metadata_namespace_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000100u; + return _impl_.php_metadata_namespace_.Mutable(GetArenaForAllocation()); } inline std::string* FileOptions::release_php_metadata_namespace() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_metadata_namespace) if (!_internal_has_php_metadata_namespace()) { return nullptr; } - _has_bits_[0] &= ~0x00000100u; - auto* p = php_metadata_namespace_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000100u; + auto* p = _impl_.php_metadata_namespace_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (php_metadata_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - php_metadata_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.php_metadata_namespace_.IsDefault()) { + _impl_.php_metadata_namespace_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileOptions::set_allocated_php_metadata_namespace(std::string* php_metadata_namespace) { if (php_metadata_namespace != nullptr) { - _has_bits_[0] |= 0x00000100u; + _impl_._has_bits_[0] |= 0x00000100u; } else { - _has_bits_[0] &= ~0x00000100u; + _impl_._has_bits_[0] &= ~0x00000100u; } - php_metadata_namespace_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), php_metadata_namespace, - GetArenaForAllocation()); + _impl_.php_metadata_namespace_.SetAllocated(php_metadata_namespace, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (php_metadata_namespace_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - php_metadata_namespace_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.php_metadata_namespace_.IsDefault()) { + _impl_.php_metadata_namespace_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_metadata_namespace) @@ -12788,15 +12823,15 @@ inline void FileOptions::set_allocated_php_metadata_namespace(std::string* php_m // optional string ruby_package = 45; inline bool FileOptions::_internal_has_ruby_package() const { - bool value = (_has_bits_[0] & 0x00000200u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; return value; } inline bool FileOptions::has_ruby_package() const { return _internal_has_ruby_package(); } inline void FileOptions::clear_ruby_package() { - ruby_package_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000200u; + _impl_.ruby_package_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000200u; } inline const std::string& FileOptions::ruby_package() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.ruby_package) @@ -12805,8 +12840,8 @@ inline const std::string& FileOptions::ruby_package() const { template inline PROTOBUF_ALWAYS_INLINE void FileOptions::set_ruby_package(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000200u; - ruby_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000200u; + _impl_.ruby_package_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.ruby_package) } inline std::string* FileOptions::mutable_ruby_package() { @@ -12815,41 +12850,40 @@ inline std::string* FileOptions::mutable_ruby_package() { return _s; } inline const std::string& FileOptions::_internal_ruby_package() const { - return ruby_package_.Get(); + return _impl_.ruby_package_.Get(); } inline void FileOptions::_internal_set_ruby_package(const std::string& value) { - _has_bits_[0] |= 0x00000200u; - ruby_package_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000200u; + _impl_.ruby_package_.Set(value, GetArenaForAllocation()); } inline std::string* FileOptions::_internal_mutable_ruby_package() { - _has_bits_[0] |= 0x00000200u; - return ruby_package_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000200u; + return _impl_.ruby_package_.Mutable(GetArenaForAllocation()); } inline std::string* FileOptions::release_ruby_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.ruby_package) if (!_internal_has_ruby_package()) { return nullptr; } - _has_bits_[0] &= ~0x00000200u; - auto* p = ruby_package_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000200u; + auto* p = _impl_.ruby_package_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (ruby_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - ruby_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.ruby_package_.IsDefault()) { + _impl_.ruby_package_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void FileOptions::set_allocated_ruby_package(std::string* ruby_package) { if (ruby_package != nullptr) { - _has_bits_[0] |= 0x00000200u; + _impl_._has_bits_[0] |= 0x00000200u; } else { - _has_bits_[0] &= ~0x00000200u; + _impl_._has_bits_[0] &= ~0x00000200u; } - ruby_package_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ruby_package, - GetArenaForAllocation()); + _impl_.ruby_package_.SetAllocated(ruby_package, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (ruby_package_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - ruby_package_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.ruby_package_.IsDefault()) { + _impl_.ruby_package_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.ruby_package) @@ -12857,32 +12891,32 @@ inline void FileOptions::set_allocated_ruby_package(std::string* ruby_package) { // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int FileOptions::_internal_uninterpreted_option_size() const { - return uninterpreted_option_.size(); + return _impl_.uninterpreted_option_.size(); } inline int FileOptions::uninterpreted_option_size() const { return _internal_uninterpreted_option_size(); } inline void FileOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); + _impl_.uninterpreted_option_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FileOptions::mutable_uninterpreted_option(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); + return _impl_.uninterpreted_option_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >* FileOptions::mutable_uninterpreted_option() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileOptions.uninterpreted_option) - return &uninterpreted_option_; + return &_impl_.uninterpreted_option_; } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& FileOptions::_internal_uninterpreted_option(int index) const { - return uninterpreted_option_.Get(index); + return _impl_.uninterpreted_option_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& FileOptions::uninterpreted_option(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.uninterpreted_option) return _internal_uninterpreted_option(index); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FileOptions::_internal_add_uninterpreted_option() { - return uninterpreted_option_.Add(); + return _impl_.uninterpreted_option_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FileOptions::add_uninterpreted_option() { ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option(); @@ -12892,7 +12926,7 @@ inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FileOptions::add_uninterpre inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >& FileOptions::uninterpreted_option() const { // @@protoc_insertion_point(field_list:google.protobuf.FileOptions.uninterpreted_option) - return uninterpreted_option_; + return _impl_.uninterpreted_option_; } // ------------------------------------------------------------------- @@ -12901,26 +12935,26 @@ FileOptions::uninterpreted_option() const { // optional bool message_set_wire_format = 1 [default = false]; inline bool MessageOptions::_internal_has_message_set_wire_format() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool MessageOptions::has_message_set_wire_format() const { return _internal_has_message_set_wire_format(); } inline void MessageOptions::clear_message_set_wire_format() { - message_set_wire_format_ = false; - _has_bits_[0] &= ~0x00000001u; + _impl_.message_set_wire_format_ = false; + _impl_._has_bits_[0] &= ~0x00000001u; } inline bool MessageOptions::_internal_message_set_wire_format() const { - return message_set_wire_format_; + return _impl_.message_set_wire_format_; } inline bool MessageOptions::message_set_wire_format() const { // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.message_set_wire_format) return _internal_message_set_wire_format(); } inline void MessageOptions::_internal_set_message_set_wire_format(bool value) { - _has_bits_[0] |= 0x00000001u; - message_set_wire_format_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.message_set_wire_format_ = value; } inline void MessageOptions::set_message_set_wire_format(bool value) { _internal_set_message_set_wire_format(value); @@ -12929,26 +12963,26 @@ inline void MessageOptions::set_message_set_wire_format(bool value) { // optional bool no_standard_descriptor_accessor = 2 [default = false]; inline bool MessageOptions::_internal_has_no_standard_descriptor_accessor() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool MessageOptions::has_no_standard_descriptor_accessor() const { return _internal_has_no_standard_descriptor_accessor(); } inline void MessageOptions::clear_no_standard_descriptor_accessor() { - no_standard_descriptor_accessor_ = false; - _has_bits_[0] &= ~0x00000002u; + _impl_.no_standard_descriptor_accessor_ = false; + _impl_._has_bits_[0] &= ~0x00000002u; } inline bool MessageOptions::_internal_no_standard_descriptor_accessor() const { - return no_standard_descriptor_accessor_; + return _impl_.no_standard_descriptor_accessor_; } inline bool MessageOptions::no_standard_descriptor_accessor() const { // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.no_standard_descriptor_accessor) return _internal_no_standard_descriptor_accessor(); } inline void MessageOptions::_internal_set_no_standard_descriptor_accessor(bool value) { - _has_bits_[0] |= 0x00000002u; - no_standard_descriptor_accessor_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.no_standard_descriptor_accessor_ = value; } inline void MessageOptions::set_no_standard_descriptor_accessor(bool value) { _internal_set_no_standard_descriptor_accessor(value); @@ -12957,26 +12991,26 @@ inline void MessageOptions::set_no_standard_descriptor_accessor(bool value) { // optional bool deprecated = 3 [default = false]; inline bool MessageOptions::_internal_has_deprecated() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool MessageOptions::has_deprecated() const { return _internal_has_deprecated(); } inline void MessageOptions::clear_deprecated() { - deprecated_ = false; - _has_bits_[0] &= ~0x00000004u; + _impl_.deprecated_ = false; + _impl_._has_bits_[0] &= ~0x00000004u; } inline bool MessageOptions::_internal_deprecated() const { - return deprecated_; + return _impl_.deprecated_; } inline bool MessageOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.deprecated) return _internal_deprecated(); } inline void MessageOptions::_internal_set_deprecated(bool value) { - _has_bits_[0] |= 0x00000004u; - deprecated_ = value; + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.deprecated_ = value; } inline void MessageOptions::set_deprecated(bool value) { _internal_set_deprecated(value); @@ -12985,26 +13019,26 @@ inline void MessageOptions::set_deprecated(bool value) { // optional bool map_entry = 7; inline bool MessageOptions::_internal_has_map_entry() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } inline bool MessageOptions::has_map_entry() const { return _internal_has_map_entry(); } inline void MessageOptions::clear_map_entry() { - map_entry_ = false; - _has_bits_[0] &= ~0x00000008u; + _impl_.map_entry_ = false; + _impl_._has_bits_[0] &= ~0x00000008u; } inline bool MessageOptions::_internal_map_entry() const { - return map_entry_; + return _impl_.map_entry_; } inline bool MessageOptions::map_entry() const { // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.map_entry) return _internal_map_entry(); } inline void MessageOptions::_internal_set_map_entry(bool value) { - _has_bits_[0] |= 0x00000008u; - map_entry_ = value; + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.map_entry_ = value; } inline void MessageOptions::set_map_entry(bool value) { _internal_set_map_entry(value); @@ -13013,32 +13047,32 @@ inline void MessageOptions::set_map_entry(bool value) { // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int MessageOptions::_internal_uninterpreted_option_size() const { - return uninterpreted_option_.size(); + return _impl_.uninterpreted_option_.size(); } inline int MessageOptions::uninterpreted_option_size() const { return _internal_uninterpreted_option_size(); } inline void MessageOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); + _impl_.uninterpreted_option_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MessageOptions::mutable_uninterpreted_option(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.MessageOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); + return _impl_.uninterpreted_option_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >* MessageOptions::mutable_uninterpreted_option() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.MessageOptions.uninterpreted_option) - return &uninterpreted_option_; + return &_impl_.uninterpreted_option_; } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& MessageOptions::_internal_uninterpreted_option(int index) const { - return uninterpreted_option_.Get(index); + return _impl_.uninterpreted_option_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& MessageOptions::uninterpreted_option(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.uninterpreted_option) return _internal_uninterpreted_option(index); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MessageOptions::_internal_add_uninterpreted_option() { - return uninterpreted_option_.Add(); + return _impl_.uninterpreted_option_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MessageOptions::add_uninterpreted_option() { ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option(); @@ -13048,7 +13082,7 @@ inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MessageOptions::add_uninter inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >& MessageOptions::uninterpreted_option() const { // @@protoc_insertion_point(field_list:google.protobuf.MessageOptions.uninterpreted_option) - return uninterpreted_option_; + return _impl_.uninterpreted_option_; } // ------------------------------------------------------------------- @@ -13057,18 +13091,18 @@ MessageOptions::uninterpreted_option() const { // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; inline bool FieldOptions::_internal_has_ctype() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool FieldOptions::has_ctype() const { return _internal_has_ctype(); } inline void FieldOptions::clear_ctype() { - ctype_ = 0; - _has_bits_[0] &= ~0x00000001u; + _impl_.ctype_ = 0; + _impl_._has_bits_[0] &= ~0x00000001u; } inline ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType FieldOptions::_internal_ctype() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType >(ctype_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType >(_impl_.ctype_); } inline ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType FieldOptions::ctype() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.ctype) @@ -13076,8 +13110,8 @@ inline ::PROTOBUF_NAMESPACE_ID::FieldOptions_CType FieldOptions::ctype() const { } inline void FieldOptions::_internal_set_ctype(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType value) { assert(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType_IsValid(value)); - _has_bits_[0] |= 0x00000001u; - ctype_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.ctype_ = value; } inline void FieldOptions::set_ctype(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType value) { _internal_set_ctype(value); @@ -13086,26 +13120,26 @@ inline void FieldOptions::set_ctype(::PROTOBUF_NAMESPACE_ID::FieldOptions_CType // optional bool packed = 2; inline bool FieldOptions::_internal_has_packed() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool FieldOptions::has_packed() const { return _internal_has_packed(); } inline void FieldOptions::clear_packed() { - packed_ = false; - _has_bits_[0] &= ~0x00000002u; + _impl_.packed_ = false; + _impl_._has_bits_[0] &= ~0x00000004u; } inline bool FieldOptions::_internal_packed() const { - return packed_; + return _impl_.packed_; } inline bool FieldOptions::packed() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.packed) return _internal_packed(); } inline void FieldOptions::_internal_set_packed(bool value) { - _has_bits_[0] |= 0x00000002u; - packed_ = value; + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.packed_ = value; } inline void FieldOptions::set_packed(bool value) { _internal_set_packed(value); @@ -13114,18 +13148,18 @@ inline void FieldOptions::set_packed(bool value) { // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; inline bool FieldOptions::_internal_has_jstype() const { - bool value = (_has_bits_[0] & 0x00000020u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool FieldOptions::has_jstype() const { return _internal_has_jstype(); } inline void FieldOptions::clear_jstype() { - jstype_ = 0; - _has_bits_[0] &= ~0x00000020u; + _impl_.jstype_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; } inline ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType FieldOptions::_internal_jstype() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType >(jstype_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType >(_impl_.jstype_); } inline ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType FieldOptions::jstype() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.jstype) @@ -13133,8 +13167,8 @@ inline ::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType FieldOptions::jstype() const } inline void FieldOptions::_internal_set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType value) { assert(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType_IsValid(value)); - _has_bits_[0] |= 0x00000020u; - jstype_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.jstype_ = value; } inline void FieldOptions::set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSType value) { _internal_set_jstype(value); @@ -13143,54 +13177,82 @@ inline void FieldOptions::set_jstype(::PROTOBUF_NAMESPACE_ID::FieldOptions_JSTyp // optional bool lazy = 5 [default = false]; inline bool FieldOptions::_internal_has_lazy() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } inline bool FieldOptions::has_lazy() const { return _internal_has_lazy(); } inline void FieldOptions::clear_lazy() { - lazy_ = false; - _has_bits_[0] &= ~0x00000004u; + _impl_.lazy_ = false; + _impl_._has_bits_[0] &= ~0x00000008u; } inline bool FieldOptions::_internal_lazy() const { - return lazy_; + return _impl_.lazy_; } inline bool FieldOptions::lazy() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.lazy) return _internal_lazy(); } inline void FieldOptions::_internal_set_lazy(bool value) { - _has_bits_[0] |= 0x00000004u; - lazy_ = value; + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.lazy_ = value; } inline void FieldOptions::set_lazy(bool value) { _internal_set_lazy(value); // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.lazy) } +// optional bool unverified_lazy = 15 [default = false]; +inline bool FieldOptions::_internal_has_unverified_lazy() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + return value; +} +inline bool FieldOptions::has_unverified_lazy() const { + return _internal_has_unverified_lazy(); +} +inline void FieldOptions::clear_unverified_lazy() { + _impl_.unverified_lazy_ = false; + _impl_._has_bits_[0] &= ~0x00000010u; +} +inline bool FieldOptions::_internal_unverified_lazy() const { + return _impl_.unverified_lazy_; +} +inline bool FieldOptions::unverified_lazy() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.unverified_lazy) + return _internal_unverified_lazy(); +} +inline void FieldOptions::_internal_set_unverified_lazy(bool value) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.unverified_lazy_ = value; +} +inline void FieldOptions::set_unverified_lazy(bool value) { + _internal_set_unverified_lazy(value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.unverified_lazy) +} + // optional bool deprecated = 3 [default = false]; inline bool FieldOptions::_internal_has_deprecated() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; return value; } inline bool FieldOptions::has_deprecated() const { return _internal_has_deprecated(); } inline void FieldOptions::clear_deprecated() { - deprecated_ = false; - _has_bits_[0] &= ~0x00000008u; + _impl_.deprecated_ = false; + _impl_._has_bits_[0] &= ~0x00000020u; } inline bool FieldOptions::_internal_deprecated() const { - return deprecated_; + return _impl_.deprecated_; } inline bool FieldOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.deprecated) return _internal_deprecated(); } inline void FieldOptions::_internal_set_deprecated(bool value) { - _has_bits_[0] |= 0x00000008u; - deprecated_ = value; + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.deprecated_ = value; } inline void FieldOptions::set_deprecated(bool value) { _internal_set_deprecated(value); @@ -13199,26 +13261,26 @@ inline void FieldOptions::set_deprecated(bool value) { // optional bool weak = 10 [default = false]; inline bool FieldOptions::_internal_has_weak() const { - bool value = (_has_bits_[0] & 0x00000010u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; return value; } inline bool FieldOptions::has_weak() const { return _internal_has_weak(); } inline void FieldOptions::clear_weak() { - weak_ = false; - _has_bits_[0] &= ~0x00000010u; + _impl_.weak_ = false; + _impl_._has_bits_[0] &= ~0x00000040u; } inline bool FieldOptions::_internal_weak() const { - return weak_; + return _impl_.weak_; } inline bool FieldOptions::weak() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.weak) return _internal_weak(); } inline void FieldOptions::_internal_set_weak(bool value) { - _has_bits_[0] |= 0x00000010u; - weak_ = value; + _impl_._has_bits_[0] |= 0x00000040u; + _impl_.weak_ = value; } inline void FieldOptions::set_weak(bool value) { _internal_set_weak(value); @@ -13227,32 +13289,32 @@ inline void FieldOptions::set_weak(bool value) { // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int FieldOptions::_internal_uninterpreted_option_size() const { - return uninterpreted_option_.size(); + return _impl_.uninterpreted_option_.size(); } inline int FieldOptions::uninterpreted_option_size() const { return _internal_uninterpreted_option_size(); } inline void FieldOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); + _impl_.uninterpreted_option_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FieldOptions::mutable_uninterpreted_option(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.FieldOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); + return _impl_.uninterpreted_option_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >* FieldOptions::mutable_uninterpreted_option() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldOptions.uninterpreted_option) - return &uninterpreted_option_; + return &_impl_.uninterpreted_option_; } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& FieldOptions::_internal_uninterpreted_option(int index) const { - return uninterpreted_option_.Get(index); + return _impl_.uninterpreted_option_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& FieldOptions::uninterpreted_option(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.uninterpreted_option) return _internal_uninterpreted_option(index); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FieldOptions::_internal_add_uninterpreted_option() { - return uninterpreted_option_.Add(); + return _impl_.uninterpreted_option_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FieldOptions::add_uninterpreted_option() { ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option(); @@ -13262,7 +13324,7 @@ inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* FieldOptions::add_uninterpr inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >& FieldOptions::uninterpreted_option() const { // @@protoc_insertion_point(field_list:google.protobuf.FieldOptions.uninterpreted_option) - return uninterpreted_option_; + return _impl_.uninterpreted_option_; } // ------------------------------------------------------------------- @@ -13271,32 +13333,32 @@ FieldOptions::uninterpreted_option() const { // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int OneofOptions::_internal_uninterpreted_option_size() const { - return uninterpreted_option_.size(); + return _impl_.uninterpreted_option_.size(); } inline int OneofOptions::uninterpreted_option_size() const { return _internal_uninterpreted_option_size(); } inline void OneofOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); + _impl_.uninterpreted_option_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* OneofOptions::mutable_uninterpreted_option(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.OneofOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); + return _impl_.uninterpreted_option_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >* OneofOptions::mutable_uninterpreted_option() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.OneofOptions.uninterpreted_option) - return &uninterpreted_option_; + return &_impl_.uninterpreted_option_; } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& OneofOptions::_internal_uninterpreted_option(int index) const { - return uninterpreted_option_.Get(index); + return _impl_.uninterpreted_option_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& OneofOptions::uninterpreted_option(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.OneofOptions.uninterpreted_option) return _internal_uninterpreted_option(index); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* OneofOptions::_internal_add_uninterpreted_option() { - return uninterpreted_option_.Add(); + return _impl_.uninterpreted_option_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* OneofOptions::add_uninterpreted_option() { ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option(); @@ -13306,7 +13368,7 @@ inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* OneofOptions::add_uninterpr inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >& OneofOptions::uninterpreted_option() const { // @@protoc_insertion_point(field_list:google.protobuf.OneofOptions.uninterpreted_option) - return uninterpreted_option_; + return _impl_.uninterpreted_option_; } // ------------------------------------------------------------------- @@ -13315,26 +13377,26 @@ OneofOptions::uninterpreted_option() const { // optional bool allow_alias = 2; inline bool EnumOptions::_internal_has_allow_alias() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool EnumOptions::has_allow_alias() const { return _internal_has_allow_alias(); } inline void EnumOptions::clear_allow_alias() { - allow_alias_ = false; - _has_bits_[0] &= ~0x00000001u; + _impl_.allow_alias_ = false; + _impl_._has_bits_[0] &= ~0x00000001u; } inline bool EnumOptions::_internal_allow_alias() const { - return allow_alias_; + return _impl_.allow_alias_; } inline bool EnumOptions::allow_alias() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.allow_alias) return _internal_allow_alias(); } inline void EnumOptions::_internal_set_allow_alias(bool value) { - _has_bits_[0] |= 0x00000001u; - allow_alias_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.allow_alias_ = value; } inline void EnumOptions::set_allow_alias(bool value) { _internal_set_allow_alias(value); @@ -13343,26 +13405,26 @@ inline void EnumOptions::set_allow_alias(bool value) { // optional bool deprecated = 3 [default = false]; inline bool EnumOptions::_internal_has_deprecated() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool EnumOptions::has_deprecated() const { return _internal_has_deprecated(); } inline void EnumOptions::clear_deprecated() { - deprecated_ = false; - _has_bits_[0] &= ~0x00000002u; + _impl_.deprecated_ = false; + _impl_._has_bits_[0] &= ~0x00000002u; } inline bool EnumOptions::_internal_deprecated() const { - return deprecated_; + return _impl_.deprecated_; } inline bool EnumOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.deprecated) return _internal_deprecated(); } inline void EnumOptions::_internal_set_deprecated(bool value) { - _has_bits_[0] |= 0x00000002u; - deprecated_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.deprecated_ = value; } inline void EnumOptions::set_deprecated(bool value) { _internal_set_deprecated(value); @@ -13371,32 +13433,32 @@ inline void EnumOptions::set_deprecated(bool value) { // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int EnumOptions::_internal_uninterpreted_option_size() const { - return uninterpreted_option_.size(); + return _impl_.uninterpreted_option_.size(); } inline int EnumOptions::uninterpreted_option_size() const { return _internal_uninterpreted_option_size(); } inline void EnumOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); + _impl_.uninterpreted_option_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumOptions::mutable_uninterpreted_option(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.EnumOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); + return _impl_.uninterpreted_option_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >* EnumOptions::mutable_uninterpreted_option() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumOptions.uninterpreted_option) - return &uninterpreted_option_; + return &_impl_.uninterpreted_option_; } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& EnumOptions::_internal_uninterpreted_option(int index) const { - return uninterpreted_option_.Get(index); + return _impl_.uninterpreted_option_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& EnumOptions::uninterpreted_option(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.uninterpreted_option) return _internal_uninterpreted_option(index); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumOptions::_internal_add_uninterpreted_option() { - return uninterpreted_option_.Add(); + return _impl_.uninterpreted_option_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumOptions::add_uninterpreted_option() { ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option(); @@ -13406,7 +13468,7 @@ inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumOptions::add_uninterpre inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >& EnumOptions::uninterpreted_option() const { // @@protoc_insertion_point(field_list:google.protobuf.EnumOptions.uninterpreted_option) - return uninterpreted_option_; + return _impl_.uninterpreted_option_; } // ------------------------------------------------------------------- @@ -13415,26 +13477,26 @@ EnumOptions::uninterpreted_option() const { // optional bool deprecated = 1 [default = false]; inline bool EnumValueOptions::_internal_has_deprecated() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool EnumValueOptions::has_deprecated() const { return _internal_has_deprecated(); } inline void EnumValueOptions::clear_deprecated() { - deprecated_ = false; - _has_bits_[0] &= ~0x00000001u; + _impl_.deprecated_ = false; + _impl_._has_bits_[0] &= ~0x00000001u; } inline bool EnumValueOptions::_internal_deprecated() const { - return deprecated_; + return _impl_.deprecated_; } inline bool EnumValueOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.deprecated) return _internal_deprecated(); } inline void EnumValueOptions::_internal_set_deprecated(bool value) { - _has_bits_[0] |= 0x00000001u; - deprecated_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.deprecated_ = value; } inline void EnumValueOptions::set_deprecated(bool value) { _internal_set_deprecated(value); @@ -13443,32 +13505,32 @@ inline void EnumValueOptions::set_deprecated(bool value) { // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int EnumValueOptions::_internal_uninterpreted_option_size() const { - return uninterpreted_option_.size(); + return _impl_.uninterpreted_option_.size(); } inline int EnumValueOptions::uninterpreted_option_size() const { return _internal_uninterpreted_option_size(); } inline void EnumValueOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); + _impl_.uninterpreted_option_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumValueOptions::mutable_uninterpreted_option(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); + return _impl_.uninterpreted_option_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >* EnumValueOptions::mutable_uninterpreted_option() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValueOptions.uninterpreted_option) - return &uninterpreted_option_; + return &_impl_.uninterpreted_option_; } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& EnumValueOptions::_internal_uninterpreted_option(int index) const { - return uninterpreted_option_.Get(index); + return _impl_.uninterpreted_option_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& EnumValueOptions::uninterpreted_option(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.uninterpreted_option) return _internal_uninterpreted_option(index); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumValueOptions::_internal_add_uninterpreted_option() { - return uninterpreted_option_.Add(); + return _impl_.uninterpreted_option_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumValueOptions::add_uninterpreted_option() { ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option(); @@ -13478,7 +13540,7 @@ inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* EnumValueOptions::add_unint inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >& EnumValueOptions::uninterpreted_option() const { // @@protoc_insertion_point(field_list:google.protobuf.EnumValueOptions.uninterpreted_option) - return uninterpreted_option_; + return _impl_.uninterpreted_option_; } // ------------------------------------------------------------------- @@ -13487,26 +13549,26 @@ EnumValueOptions::uninterpreted_option() const { // optional bool deprecated = 33 [default = false]; inline bool ServiceOptions::_internal_has_deprecated() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool ServiceOptions::has_deprecated() const { return _internal_has_deprecated(); } inline void ServiceOptions::clear_deprecated() { - deprecated_ = false; - _has_bits_[0] &= ~0x00000001u; + _impl_.deprecated_ = false; + _impl_._has_bits_[0] &= ~0x00000001u; } inline bool ServiceOptions::_internal_deprecated() const { - return deprecated_; + return _impl_.deprecated_; } inline bool ServiceOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.deprecated) return _internal_deprecated(); } inline void ServiceOptions::_internal_set_deprecated(bool value) { - _has_bits_[0] |= 0x00000001u; - deprecated_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.deprecated_ = value; } inline void ServiceOptions::set_deprecated(bool value) { _internal_set_deprecated(value); @@ -13515,32 +13577,32 @@ inline void ServiceOptions::set_deprecated(bool value) { // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int ServiceOptions::_internal_uninterpreted_option_size() const { - return uninterpreted_option_.size(); + return _impl_.uninterpreted_option_.size(); } inline int ServiceOptions::uninterpreted_option_size() const { return _internal_uninterpreted_option_size(); } inline void ServiceOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); + _impl_.uninterpreted_option_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ServiceOptions::mutable_uninterpreted_option(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); + return _impl_.uninterpreted_option_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >* ServiceOptions::mutable_uninterpreted_option() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceOptions.uninterpreted_option) - return &uninterpreted_option_; + return &_impl_.uninterpreted_option_; } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& ServiceOptions::_internal_uninterpreted_option(int index) const { - return uninterpreted_option_.Get(index); + return _impl_.uninterpreted_option_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& ServiceOptions::uninterpreted_option(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.uninterpreted_option) return _internal_uninterpreted_option(index); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ServiceOptions::_internal_add_uninterpreted_option() { - return uninterpreted_option_.Add(); + return _impl_.uninterpreted_option_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ServiceOptions::add_uninterpreted_option() { ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option(); @@ -13550,7 +13612,7 @@ inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* ServiceOptions::add_uninter inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >& ServiceOptions::uninterpreted_option() const { // @@protoc_insertion_point(field_list:google.protobuf.ServiceOptions.uninterpreted_option) - return uninterpreted_option_; + return _impl_.uninterpreted_option_; } // ------------------------------------------------------------------- @@ -13559,26 +13621,26 @@ ServiceOptions::uninterpreted_option() const { // optional bool deprecated = 33 [default = false]; inline bool MethodOptions::_internal_has_deprecated() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool MethodOptions::has_deprecated() const { return _internal_has_deprecated(); } inline void MethodOptions::clear_deprecated() { - deprecated_ = false; - _has_bits_[0] &= ~0x00000001u; + _impl_.deprecated_ = false; + _impl_._has_bits_[0] &= ~0x00000001u; } inline bool MethodOptions::_internal_deprecated() const { - return deprecated_; + return _impl_.deprecated_; } inline bool MethodOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.deprecated) return _internal_deprecated(); } inline void MethodOptions::_internal_set_deprecated(bool value) { - _has_bits_[0] |= 0x00000001u; - deprecated_ = value; + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.deprecated_ = value; } inline void MethodOptions::set_deprecated(bool value) { _internal_set_deprecated(value); @@ -13587,18 +13649,18 @@ inline void MethodOptions::set_deprecated(bool value) { // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; inline bool MethodOptions::_internal_has_idempotency_level() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool MethodOptions::has_idempotency_level() const { return _internal_has_idempotency_level(); } inline void MethodOptions::clear_idempotency_level() { - idempotency_level_ = 0; - _has_bits_[0] &= ~0x00000002u; + _impl_.idempotency_level_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; } inline ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel MethodOptions::_internal_idempotency_level() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel >(idempotency_level_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel >(_impl_.idempotency_level_); } inline ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel MethodOptions::idempotency_level() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.idempotency_level) @@ -13606,8 +13668,8 @@ inline ::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel MethodOptions::id } inline void MethodOptions::_internal_set_idempotency_level(::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel value) { assert(::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel_IsValid(value)); - _has_bits_[0] |= 0x00000002u; - idempotency_level_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.idempotency_level_ = value; } inline void MethodOptions::set_idempotency_level(::PROTOBUF_NAMESPACE_ID::MethodOptions_IdempotencyLevel value) { _internal_set_idempotency_level(value); @@ -13616,32 +13678,32 @@ inline void MethodOptions::set_idempotency_level(::PROTOBUF_NAMESPACE_ID::Method // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int MethodOptions::_internal_uninterpreted_option_size() const { - return uninterpreted_option_.size(); + return _impl_.uninterpreted_option_.size(); } inline int MethodOptions::uninterpreted_option_size() const { return _internal_uninterpreted_option_size(); } inline void MethodOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); + _impl_.uninterpreted_option_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MethodOptions::mutable_uninterpreted_option(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.MethodOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); + return _impl_.uninterpreted_option_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >* MethodOptions::mutable_uninterpreted_option() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.MethodOptions.uninterpreted_option) - return &uninterpreted_option_; + return &_impl_.uninterpreted_option_; } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& MethodOptions::_internal_uninterpreted_option(int index) const { - return uninterpreted_option_.Get(index); + return _impl_.uninterpreted_option_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption& MethodOptions::uninterpreted_option(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.uninterpreted_option) return _internal_uninterpreted_option(index); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MethodOptions::_internal_add_uninterpreted_option() { - return uninterpreted_option_.Add(); + return _impl_.uninterpreted_option_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MethodOptions::add_uninterpreted_option() { ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* _add = _internal_add_uninterpreted_option(); @@ -13651,7 +13713,7 @@ inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption* MethodOptions::add_uninterp inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption >& MethodOptions::uninterpreted_option() const { // @@protoc_insertion_point(field_list:google.protobuf.MethodOptions.uninterpreted_option) - return uninterpreted_option_; + return _impl_.uninterpreted_option_; } // ------------------------------------------------------------------- @@ -13660,15 +13722,15 @@ MethodOptions::uninterpreted_option() const { // required string name_part = 1; inline bool UninterpretedOption_NamePart::_internal_has_name_part() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool UninterpretedOption_NamePart::has_name_part() const { return _internal_has_name_part(); } inline void UninterpretedOption_NamePart::clear_name_part() { - name_part_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.name_part_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& UninterpretedOption_NamePart::name_part() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.name_part) @@ -13677,8 +13739,8 @@ inline const std::string& UninterpretedOption_NamePart::name_part() const { template inline PROTOBUF_ALWAYS_INLINE void UninterpretedOption_NamePart::set_name_part(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - name_part_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_part_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.name_part) } inline std::string* UninterpretedOption_NamePart::mutable_name_part() { @@ -13687,41 +13749,40 @@ inline std::string* UninterpretedOption_NamePart::mutable_name_part() { return _s; } inline const std::string& UninterpretedOption_NamePart::_internal_name_part() const { - return name_part_.Get(); + return _impl_.name_part_.Get(); } inline void UninterpretedOption_NamePart::_internal_set_name_part(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - name_part_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_part_.Set(value, GetArenaForAllocation()); } inline std::string* UninterpretedOption_NamePart::_internal_mutable_name_part() { - _has_bits_[0] |= 0x00000001u; - return name_part_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_part_.Mutable(GetArenaForAllocation()); } inline std::string* UninterpretedOption_NamePart::release_name_part() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.NamePart.name_part) if (!_internal_has_name_part()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = name_part_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_part_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_part_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_part_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_part_.IsDefault()) { + _impl_.name_part_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void UninterpretedOption_NamePart::set_allocated_name_part(std::string* name_part) { if (name_part != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - name_part_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name_part, - GetArenaForAllocation()); + _impl_.name_part_.SetAllocated(name_part, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_part_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_part_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_part_.IsDefault()) { + _impl_.name_part_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part) @@ -13729,26 +13790,26 @@ inline void UninterpretedOption_NamePart::set_allocated_name_part(std::string* n // required bool is_extension = 2; inline bool UninterpretedOption_NamePart::_internal_has_is_extension() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool UninterpretedOption_NamePart::has_is_extension() const { return _internal_has_is_extension(); } inline void UninterpretedOption_NamePart::clear_is_extension() { - is_extension_ = false; - _has_bits_[0] &= ~0x00000002u; + _impl_.is_extension_ = false; + _impl_._has_bits_[0] &= ~0x00000002u; } inline bool UninterpretedOption_NamePart::_internal_is_extension() const { - return is_extension_; + return _impl_.is_extension_; } inline bool UninterpretedOption_NamePart::is_extension() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.is_extension) return _internal_is_extension(); } inline void UninterpretedOption_NamePart::_internal_set_is_extension(bool value) { - _has_bits_[0] |= 0x00000002u; - is_extension_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.is_extension_ = value; } inline void UninterpretedOption_NamePart::set_is_extension(bool value) { _internal_set_is_extension(value); @@ -13761,32 +13822,32 @@ inline void UninterpretedOption_NamePart::set_is_extension(bool value) { // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; inline int UninterpretedOption::_internal_name_size() const { - return name_.size(); + return _impl_.name_.size(); } inline int UninterpretedOption::name_size() const { return _internal_name_size(); } inline void UninterpretedOption::clear_name() { - name_.Clear(); + _impl_.name_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* UninterpretedOption::mutable_name(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.name) - return name_.Mutable(index); + return _impl_.name_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart >* UninterpretedOption::mutable_name() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.UninterpretedOption.name) - return &name_; + return &_impl_.name_; } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart& UninterpretedOption::_internal_name(int index) const { - return name_.Get(index); + return _impl_.name_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart& UninterpretedOption::name(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.name) return _internal_name(index); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* UninterpretedOption::_internal_add_name() { - return name_.Add(); + return _impl_.name_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* UninterpretedOption::add_name() { ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* _add = _internal_add_name(); @@ -13796,20 +13857,20 @@ inline ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart* UninterpretedOptio inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::UninterpretedOption_NamePart >& UninterpretedOption::name() const { // @@protoc_insertion_point(field_list:google.protobuf.UninterpretedOption.name) - return name_; + return _impl_.name_; } // optional string identifier_value = 3; inline bool UninterpretedOption::_internal_has_identifier_value() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool UninterpretedOption::has_identifier_value() const { return _internal_has_identifier_value(); } inline void UninterpretedOption::clear_identifier_value() { - identifier_value_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.identifier_value_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& UninterpretedOption::identifier_value() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.identifier_value) @@ -13818,8 +13879,8 @@ inline const std::string& UninterpretedOption::identifier_value() const { template inline PROTOBUF_ALWAYS_INLINE void UninterpretedOption::set_identifier_value(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - identifier_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.identifier_value_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.identifier_value) } inline std::string* UninterpretedOption::mutable_identifier_value() { @@ -13828,41 +13889,40 @@ inline std::string* UninterpretedOption::mutable_identifier_value() { return _s; } inline const std::string& UninterpretedOption::_internal_identifier_value() const { - return identifier_value_.Get(); + return _impl_.identifier_value_.Get(); } inline void UninterpretedOption::_internal_set_identifier_value(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - identifier_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.identifier_value_.Set(value, GetArenaForAllocation()); } inline std::string* UninterpretedOption::_internal_mutable_identifier_value() { - _has_bits_[0] |= 0x00000001u; - return identifier_value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.identifier_value_.Mutable(GetArenaForAllocation()); } inline std::string* UninterpretedOption::release_identifier_value() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.identifier_value) if (!_internal_has_identifier_value()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = identifier_value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.identifier_value_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (identifier_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - identifier_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.identifier_value_.IsDefault()) { + _impl_.identifier_value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void UninterpretedOption::set_allocated_identifier_value(std::string* identifier_value) { if (identifier_value != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - identifier_value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), identifier_value, - GetArenaForAllocation()); + _impl_.identifier_value_.SetAllocated(identifier_value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (identifier_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - identifier_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.identifier_value_.IsDefault()) { + _impl_.identifier_value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.identifier_value) @@ -13870,26 +13930,26 @@ inline void UninterpretedOption::set_allocated_identifier_value(std::string* ide // optional uint64 positive_int_value = 4; inline bool UninterpretedOption::_internal_has_positive_int_value() const { - bool value = (_has_bits_[0] & 0x00000008u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } inline bool UninterpretedOption::has_positive_int_value() const { return _internal_has_positive_int_value(); } inline void UninterpretedOption::clear_positive_int_value() { - positive_int_value_ = uint64_t{0u}; - _has_bits_[0] &= ~0x00000008u; + _impl_.positive_int_value_ = uint64_t{0u}; + _impl_._has_bits_[0] &= ~0x00000008u; } inline uint64_t UninterpretedOption::_internal_positive_int_value() const { - return positive_int_value_; + return _impl_.positive_int_value_; } inline uint64_t UninterpretedOption::positive_int_value() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.positive_int_value) return _internal_positive_int_value(); } inline void UninterpretedOption::_internal_set_positive_int_value(uint64_t value) { - _has_bits_[0] |= 0x00000008u; - positive_int_value_ = value; + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.positive_int_value_ = value; } inline void UninterpretedOption::set_positive_int_value(uint64_t value) { _internal_set_positive_int_value(value); @@ -13898,26 +13958,26 @@ inline void UninterpretedOption::set_positive_int_value(uint64_t value) { // optional int64 negative_int_value = 5; inline bool UninterpretedOption::_internal_has_negative_int_value() const { - bool value = (_has_bits_[0] & 0x00000010u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; } inline bool UninterpretedOption::has_negative_int_value() const { return _internal_has_negative_int_value(); } inline void UninterpretedOption::clear_negative_int_value() { - negative_int_value_ = int64_t{0}; - _has_bits_[0] &= ~0x00000010u; + _impl_.negative_int_value_ = int64_t{0}; + _impl_._has_bits_[0] &= ~0x00000010u; } inline int64_t UninterpretedOption::_internal_negative_int_value() const { - return negative_int_value_; + return _impl_.negative_int_value_; } inline int64_t UninterpretedOption::negative_int_value() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.negative_int_value) return _internal_negative_int_value(); } inline void UninterpretedOption::_internal_set_negative_int_value(int64_t value) { - _has_bits_[0] |= 0x00000010u; - negative_int_value_ = value; + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.negative_int_value_ = value; } inline void UninterpretedOption::set_negative_int_value(int64_t value) { _internal_set_negative_int_value(value); @@ -13926,26 +13986,26 @@ inline void UninterpretedOption::set_negative_int_value(int64_t value) { // optional double double_value = 6; inline bool UninterpretedOption::_internal_has_double_value() const { - bool value = (_has_bits_[0] & 0x00000020u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; return value; } inline bool UninterpretedOption::has_double_value() const { return _internal_has_double_value(); } inline void UninterpretedOption::clear_double_value() { - double_value_ = 0; - _has_bits_[0] &= ~0x00000020u; + _impl_.double_value_ = 0; + _impl_._has_bits_[0] &= ~0x00000020u; } inline double UninterpretedOption::_internal_double_value() const { - return double_value_; + return _impl_.double_value_; } inline double UninterpretedOption::double_value() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.double_value) return _internal_double_value(); } inline void UninterpretedOption::_internal_set_double_value(double value) { - _has_bits_[0] |= 0x00000020u; - double_value_ = value; + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.double_value_ = value; } inline void UninterpretedOption::set_double_value(double value) { _internal_set_double_value(value); @@ -13954,15 +14014,15 @@ inline void UninterpretedOption::set_double_value(double value) { // optional bytes string_value = 7; inline bool UninterpretedOption::_internal_has_string_value() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool UninterpretedOption::has_string_value() const { return _internal_has_string_value(); } inline void UninterpretedOption::clear_string_value() { - string_value_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000002u; + _impl_.string_value_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const std::string& UninterpretedOption::string_value() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.string_value) @@ -13971,8 +14031,8 @@ inline const std::string& UninterpretedOption::string_value() const { template inline PROTOBUF_ALWAYS_INLINE void UninterpretedOption::set_string_value(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000002u; - string_value_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.string_value_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.string_value) } inline std::string* UninterpretedOption::mutable_string_value() { @@ -13981,41 +14041,40 @@ inline std::string* UninterpretedOption::mutable_string_value() { return _s; } inline const std::string& UninterpretedOption::_internal_string_value() const { - return string_value_.Get(); + return _impl_.string_value_.Get(); } inline void UninterpretedOption::_internal_set_string_value(const std::string& value) { - _has_bits_[0] |= 0x00000002u; - string_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.string_value_.Set(value, GetArenaForAllocation()); } inline std::string* UninterpretedOption::_internal_mutable_string_value() { - _has_bits_[0] |= 0x00000002u; - return string_value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.string_value_.Mutable(GetArenaForAllocation()); } inline std::string* UninterpretedOption::release_string_value() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.string_value) if (!_internal_has_string_value()) { return nullptr; } - _has_bits_[0] &= ~0x00000002u; - auto* p = string_value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.string_value_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (string_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - string_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.string_value_.IsDefault()) { + _impl_.string_value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void UninterpretedOption::set_allocated_string_value(std::string* string_value) { if (string_value != nullptr) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - string_value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), string_value, - GetArenaForAllocation()); + _impl_.string_value_.SetAllocated(string_value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (string_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - string_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.string_value_.IsDefault()) { + _impl_.string_value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.string_value) @@ -14023,15 +14082,15 @@ inline void UninterpretedOption::set_allocated_string_value(std::string* string_ // optional string aggregate_value = 8; inline bool UninterpretedOption::_internal_has_aggregate_value() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool UninterpretedOption::has_aggregate_value() const { return _internal_has_aggregate_value(); } inline void UninterpretedOption::clear_aggregate_value() { - aggregate_value_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000004u; + _impl_.aggregate_value_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000004u; } inline const std::string& UninterpretedOption::aggregate_value() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.aggregate_value) @@ -14040,8 +14099,8 @@ inline const std::string& UninterpretedOption::aggregate_value() const { template inline PROTOBUF_ALWAYS_INLINE void UninterpretedOption::set_aggregate_value(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000004u; - aggregate_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.aggregate_value_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.aggregate_value) } inline std::string* UninterpretedOption::mutable_aggregate_value() { @@ -14050,41 +14109,40 @@ inline std::string* UninterpretedOption::mutable_aggregate_value() { return _s; } inline const std::string& UninterpretedOption::_internal_aggregate_value() const { - return aggregate_value_.Get(); + return _impl_.aggregate_value_.Get(); } inline void UninterpretedOption::_internal_set_aggregate_value(const std::string& value) { - _has_bits_[0] |= 0x00000004u; - aggregate_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.aggregate_value_.Set(value, GetArenaForAllocation()); } inline std::string* UninterpretedOption::_internal_mutable_aggregate_value() { - _has_bits_[0] |= 0x00000004u; - return aggregate_value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000004u; + return _impl_.aggregate_value_.Mutable(GetArenaForAllocation()); } inline std::string* UninterpretedOption::release_aggregate_value() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.aggregate_value) if (!_internal_has_aggregate_value()) { return nullptr; } - _has_bits_[0] &= ~0x00000004u; - auto* p = aggregate_value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000004u; + auto* p = _impl_.aggregate_value_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (aggregate_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - aggregate_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.aggregate_value_.IsDefault()) { + _impl_.aggregate_value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void UninterpretedOption::set_allocated_aggregate_value(std::string* aggregate_value) { if (aggregate_value != nullptr) { - _has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000004u; } else { - _has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000004u; } - aggregate_value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), aggregate_value, - GetArenaForAllocation()); + _impl_.aggregate_value_.SetAllocated(aggregate_value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (aggregate_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - aggregate_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.aggregate_value_.IsDefault()) { + _impl_.aggregate_value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.aggregate_value) @@ -14096,27 +14154,27 @@ inline void UninterpretedOption::set_allocated_aggregate_value(std::string* aggr // repeated int32 path = 1 [packed = true]; inline int SourceCodeInfo_Location::_internal_path_size() const { - return path_.size(); + return _impl_.path_.size(); } inline int SourceCodeInfo_Location::path_size() const { return _internal_path_size(); } inline void SourceCodeInfo_Location::clear_path() { - path_.Clear(); + _impl_.path_.Clear(); } inline int32_t SourceCodeInfo_Location::_internal_path(int index) const { - return path_.Get(index); + return _impl_.path_.Get(index); } inline int32_t SourceCodeInfo_Location::path(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.path) return _internal_path(index); } inline void SourceCodeInfo_Location::set_path(int index, int32_t value) { - path_.Set(index, value); + _impl_.path_.Set(index, value); // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.path) } inline void SourceCodeInfo_Location::_internal_add_path(int32_t value) { - path_.Add(value); + _impl_.path_.Add(value); } inline void SourceCodeInfo_Location::add_path(int32_t value) { _internal_add_path(value); @@ -14124,7 +14182,7 @@ inline void SourceCodeInfo_Location::add_path(int32_t value) { } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >& SourceCodeInfo_Location::_internal_path() const { - return path_; + return _impl_.path_; } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >& SourceCodeInfo_Location::path() const { @@ -14133,7 +14191,7 @@ SourceCodeInfo_Location::path() const { } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >* SourceCodeInfo_Location::_internal_mutable_path() { - return &path_; + return &_impl_.path_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >* SourceCodeInfo_Location::mutable_path() { @@ -14143,27 +14201,27 @@ SourceCodeInfo_Location::mutable_path() { // repeated int32 span = 2 [packed = true]; inline int SourceCodeInfo_Location::_internal_span_size() const { - return span_.size(); + return _impl_.span_.size(); } inline int SourceCodeInfo_Location::span_size() const { return _internal_span_size(); } inline void SourceCodeInfo_Location::clear_span() { - span_.Clear(); + _impl_.span_.Clear(); } inline int32_t SourceCodeInfo_Location::_internal_span(int index) const { - return span_.Get(index); + return _impl_.span_.Get(index); } inline int32_t SourceCodeInfo_Location::span(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.span) return _internal_span(index); } inline void SourceCodeInfo_Location::set_span(int index, int32_t value) { - span_.Set(index, value); + _impl_.span_.Set(index, value); // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.span) } inline void SourceCodeInfo_Location::_internal_add_span(int32_t value) { - span_.Add(value); + _impl_.span_.Add(value); } inline void SourceCodeInfo_Location::add_span(int32_t value) { _internal_add_span(value); @@ -14171,7 +14229,7 @@ inline void SourceCodeInfo_Location::add_span(int32_t value) { } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >& SourceCodeInfo_Location::_internal_span() const { - return span_; + return _impl_.span_; } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >& SourceCodeInfo_Location::span() const { @@ -14180,7 +14238,7 @@ SourceCodeInfo_Location::span() const { } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >* SourceCodeInfo_Location::_internal_mutable_span() { - return &span_; + return &_impl_.span_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >* SourceCodeInfo_Location::mutable_span() { @@ -14190,15 +14248,15 @@ SourceCodeInfo_Location::mutable_span() { // optional string leading_comments = 3; inline bool SourceCodeInfo_Location::_internal_has_leading_comments() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool SourceCodeInfo_Location::has_leading_comments() const { return _internal_has_leading_comments(); } inline void SourceCodeInfo_Location::clear_leading_comments() { - leading_comments_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.leading_comments_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& SourceCodeInfo_Location::leading_comments() const { // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_comments) @@ -14207,8 +14265,8 @@ inline const std::string& SourceCodeInfo_Location::leading_comments() const { template inline PROTOBUF_ALWAYS_INLINE void SourceCodeInfo_Location::set_leading_comments(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - leading_comments_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.leading_comments_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_comments) } inline std::string* SourceCodeInfo_Location::mutable_leading_comments() { @@ -14217,41 +14275,40 @@ inline std::string* SourceCodeInfo_Location::mutable_leading_comments() { return _s; } inline const std::string& SourceCodeInfo_Location::_internal_leading_comments() const { - return leading_comments_.Get(); + return _impl_.leading_comments_.Get(); } inline void SourceCodeInfo_Location::_internal_set_leading_comments(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - leading_comments_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.leading_comments_.Set(value, GetArenaForAllocation()); } inline std::string* SourceCodeInfo_Location::_internal_mutable_leading_comments() { - _has_bits_[0] |= 0x00000001u; - return leading_comments_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.leading_comments_.Mutable(GetArenaForAllocation()); } inline std::string* SourceCodeInfo_Location::release_leading_comments() { // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.leading_comments) if (!_internal_has_leading_comments()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = leading_comments_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.leading_comments_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (leading_comments_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - leading_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.leading_comments_.IsDefault()) { + _impl_.leading_comments_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void SourceCodeInfo_Location::set_allocated_leading_comments(std::string* leading_comments) { if (leading_comments != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - leading_comments_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), leading_comments, - GetArenaForAllocation()); + _impl_.leading_comments_.SetAllocated(leading_comments, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (leading_comments_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - leading_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.leading_comments_.IsDefault()) { + _impl_.leading_comments_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments) @@ -14259,15 +14316,15 @@ inline void SourceCodeInfo_Location::set_allocated_leading_comments(std::string* // optional string trailing_comments = 4; inline bool SourceCodeInfo_Location::_internal_has_trailing_comments() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool SourceCodeInfo_Location::has_trailing_comments() const { return _internal_has_trailing_comments(); } inline void SourceCodeInfo_Location::clear_trailing_comments() { - trailing_comments_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000002u; + _impl_.trailing_comments_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; } inline const std::string& SourceCodeInfo_Location::trailing_comments() const { // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.trailing_comments) @@ -14276,8 +14333,8 @@ inline const std::string& SourceCodeInfo_Location::trailing_comments() const { template inline PROTOBUF_ALWAYS_INLINE void SourceCodeInfo_Location::set_trailing_comments(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000002u; - trailing_comments_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.trailing_comments_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.trailing_comments) } inline std::string* SourceCodeInfo_Location::mutable_trailing_comments() { @@ -14286,41 +14343,40 @@ inline std::string* SourceCodeInfo_Location::mutable_trailing_comments() { return _s; } inline const std::string& SourceCodeInfo_Location::_internal_trailing_comments() const { - return trailing_comments_.Get(); + return _impl_.trailing_comments_.Get(); } inline void SourceCodeInfo_Location::_internal_set_trailing_comments(const std::string& value) { - _has_bits_[0] |= 0x00000002u; - trailing_comments_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.trailing_comments_.Set(value, GetArenaForAllocation()); } inline std::string* SourceCodeInfo_Location::_internal_mutable_trailing_comments() { - _has_bits_[0] |= 0x00000002u; - return trailing_comments_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.trailing_comments_.Mutable(GetArenaForAllocation()); } inline std::string* SourceCodeInfo_Location::release_trailing_comments() { // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.trailing_comments) if (!_internal_has_trailing_comments()) { return nullptr; } - _has_bits_[0] &= ~0x00000002u; - auto* p = trailing_comments_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.trailing_comments_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (trailing_comments_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - trailing_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.trailing_comments_.IsDefault()) { + _impl_.trailing_comments_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void SourceCodeInfo_Location::set_allocated_trailing_comments(std::string* trailing_comments) { if (trailing_comments != nullptr) { - _has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000002u; } else { - _has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000002u; } - trailing_comments_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), trailing_comments, - GetArenaForAllocation()); + _impl_.trailing_comments_.SetAllocated(trailing_comments, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (trailing_comments_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - trailing_comments_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.trailing_comments_.IsDefault()) { + _impl_.trailing_comments_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments) @@ -14328,13 +14384,13 @@ inline void SourceCodeInfo_Location::set_allocated_trailing_comments(std::string // repeated string leading_detached_comments = 6; inline int SourceCodeInfo_Location::_internal_leading_detached_comments_size() const { - return leading_detached_comments_.size(); + return _impl_.leading_detached_comments_.size(); } inline int SourceCodeInfo_Location::leading_detached_comments_size() const { return _internal_leading_detached_comments_size(); } inline void SourceCodeInfo_Location::clear_leading_detached_comments() { - leading_detached_comments_.Clear(); + _impl_.leading_detached_comments_.Clear(); } inline std::string* SourceCodeInfo_Location::add_leading_detached_comments() { std::string* _s = _internal_add_leading_detached_comments(); @@ -14342,7 +14398,7 @@ inline std::string* SourceCodeInfo_Location::add_leading_detached_comments() { return _s; } inline const std::string& SourceCodeInfo_Location::_internal_leading_detached_comments(int index) const { - return leading_detached_comments_.Get(index); + return _impl_.leading_detached_comments_.Get(index); } inline const std::string& SourceCodeInfo_Location::leading_detached_comments(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) @@ -14350,55 +14406,55 @@ inline const std::string& SourceCodeInfo_Location::leading_detached_comments(int } inline std::string* SourceCodeInfo_Location::mutable_leading_detached_comments(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) - return leading_detached_comments_.Mutable(index); + return _impl_.leading_detached_comments_.Mutable(index); } inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const std::string& value) { - leading_detached_comments_.Mutable(index)->assign(value); + _impl_.leading_detached_comments_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, std::string&& value) { - leading_detached_comments_.Mutable(index)->assign(std::move(value)); + _impl_.leading_detached_comments_.Mutable(index)->assign(std::move(value)); // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); - leading_detached_comments_.Mutable(index)->assign(value); + _impl_.leading_detached_comments_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value, size_t size) { - leading_detached_comments_.Mutable(index)->assign( + _impl_.leading_detached_comments_.Mutable(index)->assign( reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } inline std::string* SourceCodeInfo_Location::_internal_add_leading_detached_comments() { - return leading_detached_comments_.Add(); + return _impl_.leading_detached_comments_.Add(); } inline void SourceCodeInfo_Location::add_leading_detached_comments(const std::string& value) { - leading_detached_comments_.Add()->assign(value); + _impl_.leading_detached_comments_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } inline void SourceCodeInfo_Location::add_leading_detached_comments(std::string&& value) { - leading_detached_comments_.Add(std::move(value)); + _impl_.leading_detached_comments_.Add(std::move(value)); // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } inline void SourceCodeInfo_Location::add_leading_detached_comments(const char* value) { GOOGLE_DCHECK(value != nullptr); - leading_detached_comments_.Add()->assign(value); + _impl_.leading_detached_comments_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } inline void SourceCodeInfo_Location::add_leading_detached_comments(const char* value, size_t size) { - leading_detached_comments_.Add()->assign(reinterpret_cast(value), size); + _impl_.leading_detached_comments_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& SourceCodeInfo_Location::leading_detached_comments() const { // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) - return leading_detached_comments_; + return _impl_.leading_detached_comments_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* SourceCodeInfo_Location::mutable_leading_detached_comments() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) - return &leading_detached_comments_; + return &_impl_.leading_detached_comments_; } // ------------------------------------------------------------------- @@ -14407,32 +14463,32 @@ SourceCodeInfo_Location::mutable_leading_detached_comments() { // repeated .google.protobuf.SourceCodeInfo.Location location = 1; inline int SourceCodeInfo::_internal_location_size() const { - return location_.size(); + return _impl_.location_.size(); } inline int SourceCodeInfo::location_size() const { return _internal_location_size(); } inline void SourceCodeInfo::clear_location() { - location_.Clear(); + _impl_.location_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* SourceCodeInfo::mutable_location(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.location) - return location_.Mutable(index); + return _impl_.location_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location >* SourceCodeInfo::mutable_location() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.location) - return &location_; + return &_impl_.location_; } inline const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location& SourceCodeInfo::_internal_location(int index) const { - return location_.Get(index); + return _impl_.location_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location& SourceCodeInfo::location(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.location) return _internal_location(index); } inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* SourceCodeInfo::_internal_add_location() { - return location_.Add(); + return _impl_.location_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* SourceCodeInfo::add_location() { ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* _add = _internal_add_location(); @@ -14442,7 +14498,7 @@ inline ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location* SourceCodeInfo::add_loc inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::SourceCodeInfo_Location >& SourceCodeInfo::location() const { // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.location) - return location_; + return _impl_.location_; } // ------------------------------------------------------------------- @@ -14451,27 +14507,27 @@ SourceCodeInfo::location() const { // repeated int32 path = 1 [packed = true]; inline int GeneratedCodeInfo_Annotation::_internal_path_size() const { - return path_.size(); + return _impl_.path_.size(); } inline int GeneratedCodeInfo_Annotation::path_size() const { return _internal_path_size(); } inline void GeneratedCodeInfo_Annotation::clear_path() { - path_.Clear(); + _impl_.path_.Clear(); } inline int32_t GeneratedCodeInfo_Annotation::_internal_path(int index) const { - return path_.Get(index); + return _impl_.path_.Get(index); } inline int32_t GeneratedCodeInfo_Annotation::path(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.path) return _internal_path(index); } inline void GeneratedCodeInfo_Annotation::set_path(int index, int32_t value) { - path_.Set(index, value); + _impl_.path_.Set(index, value); // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.path) } inline void GeneratedCodeInfo_Annotation::_internal_add_path(int32_t value) { - path_.Add(value); + _impl_.path_.Add(value); } inline void GeneratedCodeInfo_Annotation::add_path(int32_t value) { _internal_add_path(value); @@ -14479,7 +14535,7 @@ inline void GeneratedCodeInfo_Annotation::add_path(int32_t value) { } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >& GeneratedCodeInfo_Annotation::_internal_path() const { - return path_; + return _impl_.path_; } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >& GeneratedCodeInfo_Annotation::path() const { @@ -14488,7 +14544,7 @@ GeneratedCodeInfo_Annotation::path() const { } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >* GeneratedCodeInfo_Annotation::_internal_mutable_path() { - return &path_; + return &_impl_.path_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int32_t >* GeneratedCodeInfo_Annotation::mutable_path() { @@ -14498,15 +14554,15 @@ GeneratedCodeInfo_Annotation::mutable_path() { // optional string source_file = 2; inline bool GeneratedCodeInfo_Annotation::_internal_has_source_file() const { - bool value = (_has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; return value; } inline bool GeneratedCodeInfo_Annotation::has_source_file() const { return _internal_has_source_file(); } inline void GeneratedCodeInfo_Annotation::clear_source_file() { - source_file_.ClearToEmpty(); - _has_bits_[0] &= ~0x00000001u; + _impl_.source_file_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const std::string& GeneratedCodeInfo_Annotation::source_file() const { // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.source_file) @@ -14515,8 +14571,8 @@ inline const std::string& GeneratedCodeInfo_Annotation::source_file() const { template inline PROTOBUF_ALWAYS_INLINE void GeneratedCodeInfo_Annotation::set_source_file(ArgT0&& arg0, ArgT... args) { - _has_bits_[0] |= 0x00000001u; - source_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.source_file_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.source_file) } inline std::string* GeneratedCodeInfo_Annotation::mutable_source_file() { @@ -14525,41 +14581,40 @@ inline std::string* GeneratedCodeInfo_Annotation::mutable_source_file() { return _s; } inline const std::string& GeneratedCodeInfo_Annotation::_internal_source_file() const { - return source_file_.Get(); + return _impl_.source_file_.Get(); } inline void GeneratedCodeInfo_Annotation::_internal_set_source_file(const std::string& value) { - _has_bits_[0] |= 0x00000001u; - source_file_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.source_file_.Set(value, GetArenaForAllocation()); } inline std::string* GeneratedCodeInfo_Annotation::_internal_mutable_source_file() { - _has_bits_[0] |= 0x00000001u; - return source_file_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.source_file_.Mutable(GetArenaForAllocation()); } inline std::string* GeneratedCodeInfo_Annotation::release_source_file() { // @@protoc_insertion_point(field_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file) if (!_internal_has_source_file()) { return nullptr; } - _has_bits_[0] &= ~0x00000001u; - auto* p = source_file_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.source_file_.Release(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (source_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - source_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.source_file_.IsDefault()) { + _impl_.source_file_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING return p; } inline void GeneratedCodeInfo_Annotation::set_allocated_source_file(std::string* source_file) { if (source_file != nullptr) { - _has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000001u; } else { - _has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000001u; } - source_file_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), source_file, - GetArenaForAllocation()); + _impl_.source_file_.SetAllocated(source_file, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (source_file_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - source_file_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.source_file_.IsDefault()) { + _impl_.source_file_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file) @@ -14567,26 +14622,26 @@ inline void GeneratedCodeInfo_Annotation::set_allocated_source_file(std::string* // optional int32 begin = 3; inline bool GeneratedCodeInfo_Annotation::_internal_has_begin() const { - bool value = (_has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline bool GeneratedCodeInfo_Annotation::has_begin() const { return _internal_has_begin(); } inline void GeneratedCodeInfo_Annotation::clear_begin() { - begin_ = 0; - _has_bits_[0] &= ~0x00000002u; + _impl_.begin_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; } inline int32_t GeneratedCodeInfo_Annotation::_internal_begin() const { - return begin_; + return _impl_.begin_; } inline int32_t GeneratedCodeInfo_Annotation::begin() const { // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.begin) return _internal_begin(); } inline void GeneratedCodeInfo_Annotation::_internal_set_begin(int32_t value) { - _has_bits_[0] |= 0x00000002u; - begin_ = value; + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.begin_ = value; } inline void GeneratedCodeInfo_Annotation::set_begin(int32_t value) { _internal_set_begin(value); @@ -14595,26 +14650,26 @@ inline void GeneratedCodeInfo_Annotation::set_begin(int32_t value) { // optional int32 end = 4; inline bool GeneratedCodeInfo_Annotation::_internal_has_end() const { - bool value = (_has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline bool GeneratedCodeInfo_Annotation::has_end() const { return _internal_has_end(); } inline void GeneratedCodeInfo_Annotation::clear_end() { - end_ = 0; - _has_bits_[0] &= ~0x00000004u; + _impl_.end_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; } inline int32_t GeneratedCodeInfo_Annotation::_internal_end() const { - return end_; + return _impl_.end_; } inline int32_t GeneratedCodeInfo_Annotation::end() const { // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.end) return _internal_end(); } inline void GeneratedCodeInfo_Annotation::_internal_set_end(int32_t value) { - _has_bits_[0] |= 0x00000004u; - end_ = value; + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.end_ = value; } inline void GeneratedCodeInfo_Annotation::set_end(int32_t value) { _internal_set_end(value); @@ -14627,32 +14682,32 @@ inline void GeneratedCodeInfo_Annotation::set_end(int32_t value) { // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; inline int GeneratedCodeInfo::_internal_annotation_size() const { - return annotation_.size(); + return _impl_.annotation_.size(); } inline int GeneratedCodeInfo::annotation_size() const { return _internal_annotation_size(); } inline void GeneratedCodeInfo::clear_annotation() { - annotation_.Clear(); + _impl_.annotation_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::mutable_annotation(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.annotation) - return annotation_.Mutable(index); + return _impl_.annotation_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation >* GeneratedCodeInfo::mutable_annotation() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.annotation) - return &annotation_; + return &_impl_.annotation_; } inline const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation& GeneratedCodeInfo::_internal_annotation(int index) const { - return annotation_.Get(index); + return _impl_.annotation_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation& GeneratedCodeInfo::annotation(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.annotation) return _internal_annotation(index); } inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::_internal_add_annotation() { - return annotation_.Add(); + return _impl_.annotation_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::add_annotation() { ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* _add = _internal_add_annotation(); @@ -14662,7 +14717,7 @@ inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation* GeneratedCodeInfo: inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation >& GeneratedCodeInfo::annotation() const { // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.annotation) - return annotation_; + return _impl_.annotation_; } #ifdef __GNUC__ diff --git a/windows/include/google/protobuf/descriptor.proto b/windows/include/google/protobuf/descriptor.proto index 156e410ae..f8eb216cd 100644 --- a/windows/include/google/protobuf/descriptor.proto +++ b/windows/include/google/protobuf/descriptor.proto @@ -199,7 +199,6 @@ message FieldDescriptorProto { // For booleans, "true" or "false". // For strings, contains the default text contents (not escaped in any way). // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? optional string default_value = 7; // If set, gives the index of a oneof in the containing type's oneof_decl @@ -604,8 +603,19 @@ message FieldOptions { // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. + // + // As of 2021, lazy does no correctness checks on the byte stream during + // parsing. This may lead to crashes if and when an invalid byte stream is + // finally parsed upon access. + // + // TODO(b/211906113): Enable validation on lazy fields. optional bool lazy = 5 [default = false]; + // unverified_lazy does no correctness checks on the byte stream. This should + // only be used where lazy with verification is prohibitive for performance + // reasons. + optional bool unverified_lazy = 15 [default = false]; + // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this @@ -730,8 +740,8 @@ message UninterpretedOption { // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - // "foo.(bar.baz).qux". + // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + // "foo.(bar.baz).moo". message NamePart { required string name_part = 1; required bool is_extension = 2; @@ -803,8 +813,8 @@ message SourceCodeInfo { // location. // // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition. For - // example, this path: + // the root FileDescriptorProto to the place where the definition occurs. + // For example, this path: // [ 4, 3, 2, 7, 1 ] // refers to: // file.message_type(3) // 4, 3 @@ -858,13 +868,13 @@ message SourceCodeInfo { // // Comment attached to baz. // // Another line attached to baz. // - // // Comment attached to qux. + // // Comment attached to moo. // // - // // Another line attached to qux. - // optional double qux = 4; + // // Another line attached to moo. + // optional double moo = 4; // // // Detached comment for corge. This is not leading or trailing comments - // // to qux or corge because there are blank lines separating it from + // // to moo or corge because there are blank lines separating it from // // both. // // // Detached comment for corge paragraph 2. diff --git a/windows/include/google/protobuf/descriptor_database.h b/windows/include/google/protobuf/descriptor_database.h index f2d144da5..f4f06bbfa 100644 --- a/windows/include/google/protobuf/descriptor_database.h +++ b/windows/include/google/protobuf/descriptor_database.h @@ -37,13 +37,16 @@ #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_DATABASE_H__ #define GOOGLE_PROTOBUF_DESCRIPTOR_DATABASE_H__ + #include #include #include #include + #include #include +// Must be included last. #include #ifdef SWIG @@ -378,6 +381,10 @@ class PROTOBUF_EXPORT MergedDescriptorDatabase : public DescriptorDatabase { std::vector* output) override; + // This function is best-effort. Returns true if at least one underlying + // DescriptorDatabase returns true. + bool FindAllFileNames(std::vector* output) override; + private: std::vector sources_; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MergedDescriptorDatabase); diff --git a/windows/include/google/protobuf/duration.pb.h b/windows/include/google/protobuf/duration.pb.h index 6440e9d33..a5272c811 100644 --- a/windows/include/google/protobuf/duration.pb.h +++ b/windows/include/google/protobuf/duration.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -42,14 +41,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fduration_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fduration_2eproto; @@ -70,7 +61,7 @@ class PROTOBUF_EXPORT Duration final : public: inline Duration() : Duration(nullptr) {} ~Duration() override; - explicit constexpr Duration(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Duration(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Duration(const Duration& from); Duration(Duration&& from) noexcept @@ -145,9 +136,11 @@ class PROTOBUF_EXPORT Duration final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Duration& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Duration& from); + void MergeFrom( const Duration& from) { + Duration::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -156,10 +149,10 @@ class PROTOBUF_EXPORT Duration final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Duration* other); @@ -172,9 +165,6 @@ class PROTOBUF_EXPORT Duration final : protected: explicit Duration(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -215,9 +205,12 @@ class PROTOBUF_EXPORT Duration final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - int64_t seconds_; - int32_t nanos_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + int64_t seconds_; + int32_t nanos_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fduration_2eproto; }; // =================================================================== @@ -233,10 +226,10 @@ class PROTOBUF_EXPORT Duration final : // int64 seconds = 1; inline void Duration::clear_seconds() { - seconds_ = int64_t{0}; + _impl_.seconds_ = int64_t{0}; } inline int64_t Duration::_internal_seconds() const { - return seconds_; + return _impl_.seconds_; } inline int64_t Duration::seconds() const { // @@protoc_insertion_point(field_get:google.protobuf.Duration.seconds) @@ -244,7 +237,7 @@ inline int64_t Duration::seconds() const { } inline void Duration::_internal_set_seconds(int64_t value) { - seconds_ = value; + _impl_.seconds_ = value; } inline void Duration::set_seconds(int64_t value) { _internal_set_seconds(value); @@ -253,10 +246,10 @@ inline void Duration::set_seconds(int64_t value) { // int32 nanos = 2; inline void Duration::clear_nanos() { - nanos_ = 0; + _impl_.nanos_ = 0; } inline int32_t Duration::_internal_nanos() const { - return nanos_; + return _impl_.nanos_; } inline int32_t Duration::nanos() const { // @@protoc_insertion_point(field_get:google.protobuf.Duration.nanos) @@ -264,7 +257,7 @@ inline int32_t Duration::nanos() const { } inline void Duration::_internal_set_nanos(int32_t value) { - nanos_ = value; + _impl_.nanos_ = value; } inline void Duration::set_nanos(int32_t value) { _internal_set_nanos(value); diff --git a/windows/include/google/protobuf/dynamic_message.h b/windows/include/google/protobuf/dynamic_message.h index d0af57c9a..6fa64259e 100644 --- a/windows/include/google/protobuf/dynamic_message.h +++ b/windows/include/google/protobuf/dynamic_message.h @@ -38,14 +38,15 @@ #ifndef GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__ #define GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__ + #include #include #include #include #include -#include #include +#include #include #include @@ -53,6 +54,7 @@ #error "You cannot SWIG proto headers" #endif +// Must be included last. #include namespace google { @@ -94,7 +96,7 @@ class PROTOBUF_EXPORT DynamicMessageFactory : public MessageFactory { // the zero-arg constructor. DynamicMessageFactory(const DescriptorPool* pool); - ~DynamicMessageFactory(); + ~DynamicMessageFactory() override; // Call this to tell the DynamicMessageFactory that if it is given a // Descriptor d for which: diff --git a/windows/include/google/protobuf/empty.pb.h b/windows/include/google/protobuf/empty.pb.h index ba97255ed..bcb647863 100644 --- a/windows/include/google/protobuf/empty.pb.h +++ b/windows/include/google/protobuf/empty.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -43,14 +42,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fempty_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fempty_2eproto; @@ -70,7 +61,7 @@ class PROTOBUF_EXPORT Empty final : public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:google.protobuf.Empty) */ { public: inline Empty() : Empty(nullptr) {} - explicit constexpr Empty(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Empty(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Empty(const Empty& from); Empty(Empty&& from) noexcept @@ -144,11 +135,11 @@ class PROTOBUF_EXPORT Empty final : } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; inline void CopyFrom(const Empty& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(this, from); + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; void MergeFrom(const Empty& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(this, from); + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); } public: @@ -160,7 +151,6 @@ class PROTOBUF_EXPORT Empty final : protected: explicit Empty(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: public: static const ClassData _class_data_; @@ -179,7 +169,8 @@ class PROTOBUF_EXPORT Empty final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + }; friend struct ::TableStruct_google_2fprotobuf_2fempty_2eproto; }; // =================================================================== diff --git a/windows/include/google/protobuf/empty.proto b/windows/include/google/protobuf/empty.proto index 5f992de94..222746219 100644 --- a/windows/include/google/protobuf/empty.proto +++ b/windows/include/google/protobuf/empty.proto @@ -48,5 +48,4 @@ option cc_enable_arenas = true; // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); // } // -// The JSON representation for `Empty` is empty JSON object `{}`. message Empty {} diff --git a/windows/include/google/protobuf/endian.h b/windows/include/google/protobuf/endian.h new file mode 100644 index 000000000..e0ee6cdf2 --- /dev/null +++ b/windows/include/google/protobuf/endian.h @@ -0,0 +1,198 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef GOOGLE_PROTOBUF_ENDIAN_H__ +#define GOOGLE_PROTOBUF_ENDIAN_H__ + +#if defined(_MSC_VER) +#include +#endif + +#include + +// Must be included last. +#include + +namespace google { +namespace protobuf { +namespace internal { + +inline uint64_t BSwap64(uint64_t host_int) { +#if defined(PROTOBUF_BUILTIN_BSWAP64) + return PROTOBUF_BUILTIN_BSWAP64(host_int); +#elif defined(_MSC_VER) + return _byteswap_uint64(host_int); +#else + return (((host_int & uint64_t{0xFF}) << 56) | + ((host_int & uint64_t{0xFF00}) << 40) | + ((host_int & uint64_t{0xFF0000}) << 24) | + ((host_int & uint64_t{0xFF000000}) << 8) | + ((host_int & uint64_t{0xFF00000000}) >> 8) | + ((host_int & uint64_t{0xFF0000000000}) >> 24) | + ((host_int & uint64_t{0xFF000000000000}) >> 40) | + ((host_int & uint64_t{0xFF00000000000000}) >> 56)); +#endif +} + +inline uint32_t BSwap32(uint32_t host_int) { +#if defined(PROTOBUF_BUILTIN_BSWAP32) + return PROTOBUF_BUILTIN_BSWAP32(host_int); +#elif defined(_MSC_VER) + return _byteswap_ulong(host_int); +#else + return (((host_int & uint32_t{0xFF}) << 24) | + ((host_int & uint32_t{0xFF00}) << 8) | + ((host_int & uint32_t{0xFF0000}) >> 8) | + ((host_int & uint32_t{0xFF000000}) >> 24)); +#endif +} + +inline uint16_t BSwap16(uint16_t host_int) { +#if defined(PROTOBUF_BUILTIN_BSWAP16) + return PROTOBUF_BUILTIN_BSWAP16(host_int); +#elif defined(_MSC_VER) + return _byteswap_ushort(host_int); +#else + return (((host_int & uint16_t{0xFF}) << 8) | + ((host_int & uint16_t{0xFF00}) >> 8)); +#endif +} + +namespace little_endian { + +inline uint16_t FromHost(uint16_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return BSwap16(value); +#else + return value; +#endif +} + +inline uint32_t FromHost(uint32_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return BSwap32(value); +#else + return value; +#endif +} + +inline uint64_t FromHost(uint64_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return BSwap64(value); +#else + return value; +#endif +} + +inline uint16_t ToHost(uint16_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return BSwap16(value); +#else + return value; +#endif +} + +inline uint32_t ToHost(uint32_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return BSwap32(value); +#else + return value; +#endif +} + +inline uint64_t ToHost(uint64_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return BSwap64(value); +#else + return value; +#endif +} + +} // namespace little_endian + +namespace big_endian { + +inline uint16_t FromHost(uint16_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return value; +#else + return BSwap16(value); +#endif +} + +inline uint32_t FromHost(uint32_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return value; +#else + return BSwap32(value); +#endif +} + +inline uint64_t FromHost(uint64_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return value; +#else + return BSwap64(value); +#endif +} + +inline uint16_t ToHost(uint16_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return value; +#else + return BSwap16(value); +#endif +} + +inline uint32_t ToHost(uint32_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return value; +#else + return BSwap32(value); +#endif +} + +inline uint64_t ToHost(uint64_t value) { +#if defined(PROTOBUF_BIG_ENDIAN) + return value; +#else + return BSwap64(value); +#endif +} + +} // namespace big_endian + +} // namespace internal +} // namespace protobuf +} // namespace google + +#include + +#endif // GOOGLE_PROTOBUF_ENDIAN_H__ diff --git a/windows/include/google/protobuf/explicitly_constructed.h b/windows/include/google/protobuf/explicitly_constructed.h index e4a6d07d5..174c59ab4 100644 --- a/windows/include/google/protobuf/explicitly_constructed.h +++ b/windows/include/google/protobuf/explicitly_constructed.h @@ -59,7 +59,7 @@ namespace internal { // 3. Call get() and get_mutable() only if the object is initialized. // 4. Call Destruct() only if the object is initialized. // After the call, the object becomes uninitialized. -template +template class ExplicitlyConstructed { public: void DefaultConstruct() { new (&union_) T(); } @@ -76,12 +76,18 @@ class ExplicitlyConstructed { private: union AlignedUnion { - alignas(T) char space[sizeof(T)]; + alignas(min_align > alignof(T) ? min_align + : alignof(T)) char space[sizeof(T)]; int64_t align_to_int64; void* align_to_ptr; } union_; }; +// ArenaStringPtr compatible explicitly constructed string type. +// This empty string type is aligned with a minimum alignment of 8 bytes +// which is the minimum requirement of ArenaStringPtr +using ExplicitlyConstructedArenaString = ExplicitlyConstructed; + } // namespace internal } // namespace protobuf } // namespace google diff --git a/windows/include/google/protobuf/extension_set.h b/windows/include/google/protobuf/extension_set.h index beb4202ae..0e6d05211 100644 --- a/windows/include/google/protobuf/extension_set.h +++ b/windows/include/google/protobuf/extension_set.h @@ -38,6 +38,7 @@ #ifndef GOOGLE_PROTOBUF_EXTENSION_SET_H__ #define GOOGLE_PROTOBUF_EXTENSION_SET_H__ + #include #include #include @@ -47,9 +48,9 @@ #include #include -#include #include #include +#include #include #include @@ -74,6 +75,7 @@ class Reflection; // message.h class UnknownFieldSet; // unknown_field_set.h namespace internal { class FieldSkipper; // wire_format_lite.h +enum class LazyVerifyOption; } // namespace internal } // namespace protobuf } // namespace google @@ -103,13 +105,15 @@ typedef bool EnumValidityFuncWithArg(const void* arg, int number); struct ExtensionInfo { constexpr ExtensionInfo() : enum_validity_check() {} constexpr ExtensionInfo(const MessageLite* extendee, int param_number, - FieldType type_param, bool isrepeated, bool ispacked) + FieldType type_param, bool isrepeated, bool ispacked, + LazyEagerVerifyFnType verify_func) : message(extendee), number(param_number), type(type_param), is_repeated(isrepeated), is_packed(ispacked), - enum_validity_check() {} + enum_validity_check(), + lazy_eager_verify_func(verify_func) {} const MessageLite* message = nullptr; int number = 0; @@ -136,36 +140,32 @@ struct ExtensionInfo { // nullptr. Must not be nullptr if the descriptor for the extension does not // live in the same pool as the descriptor for the containing type. const FieldDescriptor* descriptor = nullptr; + + // If this field is potentially lazy this function can be used as a cheap + // verification of the raw bytes. + // If nullptr then no verification is performed. + LazyEagerVerifyFnType lazy_eager_verify_func = nullptr; }; -// Abstract interface for an object which looks up extension definitions. Used -// when parsing. -class PROTOBUF_EXPORT ExtensionFinder { - public: - virtual ~ExtensionFinder(); +// An ExtensionFinder is an object which looks up extension definitions. It +// must implement this method: +// +// bool Find(int number, ExtensionInfo* output); - // Find the extension with the given containing type and number. - virtual bool Find(int number, ExtensionInfo* output) = 0; -}; - -// Implementation of ExtensionFinder which finds extensions defined in .proto -// files which have been compiled into the binary. -class PROTOBUF_EXPORT GeneratedExtensionFinder : public ExtensionFinder { +// GeneratedExtensionFinder is an ExtensionFinder which finds extensions +// defined in .proto files which have been compiled into the binary. +class PROTOBUF_EXPORT GeneratedExtensionFinder { public: explicit GeneratedExtensionFinder(const MessageLite* extendee) : extendee_(extendee) {} - ~GeneratedExtensionFinder() override {} // Returns true and fills in *output if found, otherwise returns false. - bool Find(int number, ExtensionInfo* output) override; + bool Find(int number, ExtensionInfo* output); private: const MessageLite* extendee_; }; -// A FieldSkipper used for parsing MessageSet. -class MessageSetFieldSkipper; - // Note: extension_set_heavy.cc defines DescriptorPoolExtensionFinder for // finding extensions from a DescriptorPool. @@ -184,6 +184,7 @@ class PROTOBUF_EXPORT ExtensionSet { public: constexpr ExtensionSet(); explicit ExtensionSet(Arena* arena); + ExtensionSet(ArenaInitialized, Arena* arena) : ExtensionSet(arena) {} ~ExtensionSet(); // These are called at startup by protocol-compiler-generated code to @@ -193,14 +194,16 @@ class PROTOBUF_EXPORT ExtensionSet { // methods do. static void RegisterExtension(const MessageLite* extendee, int number, FieldType type, bool is_repeated, - bool is_packed); + bool is_packed, + LazyEagerVerifyFnType verify_func); static void RegisterEnumExtension(const MessageLite* extendee, int number, FieldType type, bool is_repeated, bool is_packed, EnumValidityFunc* is_valid); static void RegisterMessageExtension(const MessageLite* extendee, int number, FieldType type, bool is_repeated, bool is_packed, - const MessageLite* prototype); + const MessageLite* prototype, + LazyEagerVerifyFnType verify_func); // ================================================================= @@ -368,9 +371,6 @@ class PROTOBUF_EXPORT ExtensionSet { MessageLite* UnsafeArenaReleaseLast(int number); void SwapElements(int number, int index1, int index2); - // ----------------------------------------------------------------- - // TODO(kenton): Hardcore memory management accessors - // ================================================================= // convenience methods for implementing methods of Message // @@ -386,26 +386,6 @@ class PROTOBUF_EXPORT ExtensionSet { void UnsafeShallowSwapExtension(ExtensionSet* other, int number); bool IsInitialized() const; - // Parses a single extension from the input. The input should start out - // positioned immediately after the tag. - bool ParseField(uint32_t tag, io::CodedInputStream* input, - ExtensionFinder* extension_finder, - FieldSkipper* field_skipper); - - // Specific versions for lite or full messages (constructs the appropriate - // FieldSkipper automatically). |extendee| is the default - // instance for the containing message; it is used only to look up the - // extension by number. See RegisterExtension(), above. Unlike the other - // methods of ExtensionSet, this only works for generated message types -- - // it looks up extensions registered using RegisterExtension(). - bool ParseField(uint32_t tag, io::CodedInputStream* input, - const MessageLite* extendee); - bool ParseField(uint32_t tag, io::CodedInputStream* input, - const Message* extendee, UnknownFieldSet* unknown_fields); - bool ParseField(uint32_t tag, io::CodedInputStream* input, - const MessageLite* extendee, - io::CodedOutputStream* unknown_fields); - // Lite parser const char* ParseField(uint64_t tag, const char* ptr, const MessageLite* extendee, @@ -446,22 +426,6 @@ class PROTOBUF_EXPORT ExtensionSet { return ptr; } - // Parse an entire message in MessageSet format. Such messages have no - // fields, only extensions. - bool ParseMessageSetLite(io::CodedInputStream* input, - ExtensionFinder* extension_finder, - FieldSkipper* field_skipper); - bool ParseMessageSet(io::CodedInputStream* input, - ExtensionFinder* extension_finder, - MessageSetFieldSkipper* field_skipper); - - // Specific versions for lite or full messages (constructs the appropriate - // FieldSkipper automatically). - bool ParseMessageSet(io::CodedInputStream* input, const MessageLite* extendee, - std::string* unknown_fields); - bool ParseMessageSet(io::CodedInputStream* input, const Message* extendee, - UnknownFieldSet* unknown_fields); - // Write all extension fields with field numbers in the range // [start_field_number, end_field_number) // to the output stream, using the cached sizes computed when ByteSize() was @@ -601,10 +565,9 @@ class PROTOBUF_EXPORT ExtensionSet { virtual void MergeFromMessage(const MessageLite& msg, Arena* arena) = 0; virtual void Clear() = 0; - virtual bool ReadMessage(const MessageLite& prototype, - io::CodedInputStream* input) = 0; virtual const char* _InternalParse(const Message& prototype, Arena* arena, - const char* ptr, ParseContext* ctx) = 0; + LazyVerifyOption option, const char* ptr, + ParseContext* ctx) = 0; virtual uint8_t* WriteMessageToArray( const MessageLite* prototype, int number, uint8_t* target, io::EpsCopyOutputStream* stream) const = 0; @@ -777,44 +740,77 @@ class PROTOBUF_EXPORT ExtensionSet { const Extension& other_extension, Arena* other_arena); + inline static bool is_packable(WireFormatLite::WireType type) { + switch (type) { + case WireFormatLite::WIRETYPE_VARINT: + case WireFormatLite::WIRETYPE_FIXED64: + case WireFormatLite::WIRETYPE_FIXED32: + return true; + case WireFormatLite::WIRETYPE_LENGTH_DELIMITED: + case WireFormatLite::WIRETYPE_START_GROUP: + case WireFormatLite::WIRETYPE_END_GROUP: + return false; + + // Do not add a default statement. Let the compiler complain when + // someone + // adds a new wire type. + } + PROTOBUF_ASSUME(false); // switch handles all possible enum values + return false; + } + // Returns true and fills field_number and extension if extension is found. // Note to support packed repeated field compatibility, it also fills whether // the tag on wire is packed, which can be different from // extension->is_packed (whether packed=true is specified). + template bool FindExtensionInfoFromTag(uint32_t tag, ExtensionFinder* extension_finder, int* field_number, ExtensionInfo* extension, - bool* was_packed_on_wire); + bool* was_packed_on_wire) { + *field_number = WireFormatLite::GetTagFieldNumber(tag); + WireFormatLite::WireType wire_type = WireFormatLite::GetTagWireType(tag); + return FindExtensionInfoFromFieldNumber(wire_type, *field_number, + extension_finder, extension, + was_packed_on_wire); + } // Returns true and fills extension if extension is found. // Note to support packed repeated field compatibility, it also fills whether // the tag on wire is packed, which can be different from // extension->is_packed (whether packed=true is specified). + template bool FindExtensionInfoFromFieldNumber(int wire_type, int field_number, ExtensionFinder* extension_finder, ExtensionInfo* extension, - bool* was_packed_on_wire) const; + bool* was_packed_on_wire) const { + if (!extension_finder->Find(field_number, extension)) { + return false; + } + + GOOGLE_DCHECK(extension->type > 0 && + extension->type <= WireFormatLite::MAX_FIELD_TYPE); + auto real_type = static_cast(extension->type); + + WireFormatLite::WireType expected_wire_type = + WireFormatLite::WireTypeForFieldType(real_type); + + // Check if this is a packed field. + *was_packed_on_wire = false; + if (extension->is_repeated && + wire_type == WireFormatLite::WIRETYPE_LENGTH_DELIMITED && + is_packable(expected_wire_type)) { + *was_packed_on_wire = true; + return true; + } + // Otherwise the wire type must match. + return expected_wire_type == wire_type; + } // Find the prototype for a LazyMessage from the extension registry. Returns // null if the extension is not found. const MessageLite* GetPrototypeForLazyMessage(const MessageLite* extendee, int number) const; - // Parses a single extension from the input. The input should start out - // positioned immediately after the wire tag. This method is called in - // ParseField() after field number and was_packed_on_wire is extracted from - // the wire tag and ExtensionInfo is found by the field number. - bool ParseFieldWithExtensionInfo(int field_number, bool was_packed_on_wire, - const ExtensionInfo& extension, - io::CodedInputStream* input, - FieldSkipper* field_skipper); - - // Like ParseField(), but this method may parse singular message extensions - // lazily depending on the value of FLAGS_eagerly_parse_message_sets. - bool ParseFieldMaybeLazily(int wire_type, int field_number, - io::CodedInputStream* input, - ExtensionFinder* extension_finder, - MessageSetFieldSkipper* field_skipper); - // Returns true if extension is present and lazy. bool HasLazy(int number) const; @@ -827,17 +823,6 @@ class PROTOBUF_EXPORT ExtensionSet { // it does not exist. Extension* MaybeNewRepeatedExtension(const FieldDescriptor* descriptor); - // Parse a single MessageSet item -- called just after the item group start - // tag has been read. - bool ParseMessageSetItemLite(io::CodedInputStream* input, - ExtensionFinder* extension_finder, - FieldSkipper* field_skipper); - // Parse a single MessageSet item -- called just after the item group start - // tag has been read. - bool ParseMessageSetItem(io::CodedInputStream* input, - ExtensionFinder* extension_finder, - MessageSetFieldSkipper* field_skipper); - bool FindExtension(int wire_type, uint32_t field, const MessageLite* extendee, const internal::ParseContext* /*ctx*/, ExtensionInfo* extension, bool* was_packed_on_wire) { @@ -1023,9 +1008,10 @@ class PrimitiveTypeTraits { static inline void Set(int number, FieldType field_type, ConstType value, ExtensionSet* set); template - static void Register(int number, FieldType type, bool is_packed) { + static void Register(int number, FieldType type, bool is_packed, + LazyEagerVerifyFnType verify_func) { ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number, - type, false, is_packed); + type, false, is_packed, verify_func); } }; @@ -1056,9 +1042,10 @@ class RepeatedPrimitiveTypeTraits { static const RepeatedFieldType* GetDefaultRepeatedField(); template - static void Register(int number, FieldType type, bool is_packed) { + static void Register(int number, FieldType type, bool is_packed, + LazyEagerVerifyFnType verify_func) { ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number, - type, true, is_packed); + type, true, is_packed, verify_func); } }; @@ -1178,9 +1165,10 @@ class PROTOBUF_EXPORT StringTypeTraits { return set->MutableString(number, field_type, nullptr); } template - static void Register(int number, FieldType type, bool is_packed) { + static void Register(int number, FieldType type, bool is_packed, + LazyEagerVerifyFnType verify_func) { ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number, - type, false, is_packed); + type, false, is_packed, verify_func); } }; @@ -1234,9 +1222,10 @@ class PROTOBUF_EXPORT RepeatedStringTypeTraits { static const RepeatedFieldType* GetDefaultRepeatedField(); template - static void Register(int number, FieldType type, bool is_packed) { + static void Register(int number, FieldType type, bool is_packed, + LazyEagerVerifyFnType fn) { ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number, - type, true, is_packed); + type, true, is_packed, fn); } private: @@ -1271,7 +1260,8 @@ class EnumTypeTraits { set->SetEnum(number, field_type, value, nullptr); } template - static void Register(int number, FieldType type, bool is_packed) { + static void Register(int number, FieldType type, bool is_packed, + LazyEagerVerifyFnType fn) { ExtensionSet::RegisterEnumExtension(&ExtendeeT::default_instance(), number, type, false, is_packed, IsValid); } @@ -1336,7 +1326,8 @@ class RepeatedEnumTypeTraits { RepeatedPrimitiveTypeTraits::GetDefaultRepeatedField()); } template - static void Register(int number, FieldType type, bool is_packed) { + static void Register(int number, FieldType type, bool is_packed, + LazyEagerVerifyFnType fn) { ExtensionSet::RegisterEnumExtension(&ExtendeeT::default_instance(), number, type, true, is_packed, IsValid); } @@ -1359,7 +1350,8 @@ class MessageTypeTraits { ConstType default_value) { return static_cast(set.GetMessage(number, default_value)); } - static inline std::nullptr_t GetPtr(int /* number */, const ExtensionSet& /* set */, + static inline std::nullptr_t GetPtr(int /* number */, + const ExtensionSet& /* set */, ConstType /* default_value */) { // Cannot be implemented because of forward declared messages? return nullptr; @@ -1390,13 +1382,18 @@ class MessageTypeTraits { set->UnsafeArenaReleaseMessage(number, Type::default_instance())); } template - static void Register(int number, FieldType type, bool is_packed) { + static void Register(int number, FieldType type, bool is_packed, + LazyEagerVerifyFnType fn) { ExtensionSet::RegisterMessageExtension(&ExtendeeT::default_instance(), number, type, false, is_packed, - &Type::default_instance()); + &Type::default_instance(), fn); } }; +// Used by WireFormatVerify to extract the verify function from the registry. +LazyEagerVerifyFnType FindExtensionLazyEagerVerifyFn( + const MessageLite* extendee, int number); + // forward declaration. class RepeatedMessageGenericTypeTraits; @@ -1412,7 +1409,8 @@ class RepeatedMessageTypeTraits { static inline ConstType Get(int number, const ExtensionSet& set, int index) { return static_cast(set.GetRepeatedMessage(number, index)); } - static inline std::nullptr_t GetPtr(int /* number */, const ExtensionSet& /* set */, + static inline std::nullptr_t GetPtr(int /* number */, + const ExtensionSet& /* set */, int /* index */) { // Cannot be implemented because of forward declared messages? return nullptr; @@ -1450,10 +1448,11 @@ class RepeatedMessageTypeTraits { static const RepeatedFieldType* GetDefaultRepeatedField(); template - static void Register(int number, FieldType type, bool is_packed) { + static void Register(int number, FieldType type, bool is_packed, + LazyEagerVerifyFnType fn) { ExtensionSet::RegisterMessageExtension(&ExtendeeT::default_instance(), number, type, true, is_packed, - &Type::default_instance()); + &Type::default_instance(), fn); } }; @@ -1490,17 +1489,19 @@ class ExtensionIdentifier { typedef TypeTraitsType TypeTraits; typedef ExtendeeType Extendee; - ExtensionIdentifier(int number, typename TypeTraits::ConstType default_value) + ExtensionIdentifier(int number, typename TypeTraits::ConstType default_value, + LazyEagerVerifyFnType verify_func = nullptr) : number_(number), default_value_(default_value) { - Register(number); + Register(number, verify_func); } inline int number() const { return number_; } typename TypeTraits::ConstType default_value() const { return default_value_; } - static void Register(int number) { - TypeTraits::template Register(number, field_type, is_packed); + static void Register(int number, LazyEagerVerifyFnType verify_func) { + TypeTraits::template Register(number, field_type, is_packed, + verify_func); } typename TypeTraits::ConstType const& default_value_ref() const { diff --git a/windows/include/google/protobuf/extension_set_inl.h b/windows/include/google/protobuf/extension_set_inl.h index 291990f8b..e4e711721 100644 --- a/windows/include/google/protobuf/extension_set_inl.h +++ b/windows/include/google/protobuf/extension_set_inl.h @@ -31,9 +31,9 @@ #ifndef GOOGLE_PROTOBUF_EXTENSION_SET_INL_H__ #define GOOGLE_PROTOBUF_EXTENSION_SET_INL_H__ -#include #include #include +#include namespace google { namespace protobuf { @@ -206,16 +206,21 @@ const char* ExtensionSet::ParseMessageSetItemTmpl( const char* ptr, const Msg* extendee, internal::InternalMetadata* metadata, internal::ParseContext* ctx) { std::string payload; - uint32_t type_id = 0; - bool payload_read = false; + uint32_t type_id; + enum class State { kNoTag, kHasType, kHasPayload, kDone }; + State state = State::kNoTag; + while (!ctx->Done(&ptr)) { uint32_t tag = static_cast(*ptr++); if (tag == WireFormatLite::kMessageSetTypeIdTag) { uint64_t tmp; ptr = ParseBigVarint(ptr, &tmp); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - type_id = tmp; - if (payload_read) { + if (state == State::kNoTag) { + type_id = tmp; + state = State::kHasType; + } else if (state == State::kHasPayload) { + type_id = tmp; ExtensionInfo extension; bool was_packed_on_wire; if (!FindExtension(2, type_id, extendee, ctx, &extension, @@ -241,20 +246,24 @@ const char* ExtensionSet::ParseMessageSetItemTmpl( GOOGLE_PROTOBUF_PARSER_ASSERT(value->_InternalParse(p, &tmp_ctx) && tmp_ctx.EndedAtLimit()); } - type_id = 0; + state = State::kDone; } } else if (tag == WireFormatLite::kMessageSetMessageTag) { - if (type_id != 0) { + if (state == State::kHasType) { ptr = ParseFieldMaybeLazily(static_cast(type_id) * 8 + 2, ptr, extendee, metadata, ctx); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); - type_id = 0; + state = State::kDone; } else { + std::string tmp; int32_t size = ReadSize(&ptr); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - ptr = ctx->ReadString(ptr, size, &payload); + ptr = ctx->ReadString(ptr, size, &tmp); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - payload_read = true; + if (state == State::kNoTag) { + payload = std::move(tmp); + state = State::kHasPayload; + } } } else { ptr = ReadTag(ptr - 1, &tag); diff --git a/windows/include/google/protobuf/field_mask.pb.h b/windows/include/google/protobuf/field_mask.pb.h index 4114740bb..8f90e4c04 100644 --- a/windows/include/google/protobuf/field_mask.pb.h +++ b/windows/include/google/protobuf/field_mask.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -42,14 +41,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2ffield_5fmask_2eproto; @@ -70,7 +61,7 @@ class PROTOBUF_EXPORT FieldMask final : public: inline FieldMask() : FieldMask(nullptr) {} ~FieldMask() override; - explicit constexpr FieldMask(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FieldMask(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FieldMask(const FieldMask& from); FieldMask(FieldMask&& from) noexcept @@ -145,9 +136,11 @@ class PROTOBUF_EXPORT FieldMask final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const FieldMask& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const FieldMask& from); + void MergeFrom( const FieldMask& from) { + FieldMask::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -156,10 +149,10 @@ class PROTOBUF_EXPORT FieldMask final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FieldMask* other); @@ -172,9 +165,6 @@ class PROTOBUF_EXPORT FieldMask final : protected: explicit FieldMask(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -220,8 +210,11 @@ class PROTOBUF_EXPORT FieldMask final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField paths_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField paths_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto; }; // =================================================================== @@ -237,13 +230,13 @@ class PROTOBUF_EXPORT FieldMask final : // repeated string paths = 1; inline int FieldMask::_internal_paths_size() const { - return paths_.size(); + return _impl_.paths_.size(); } inline int FieldMask::paths_size() const { return _internal_paths_size(); } inline void FieldMask::clear_paths() { - paths_.Clear(); + _impl_.paths_.Clear(); } inline std::string* FieldMask::add_paths() { std::string* _s = _internal_add_paths(); @@ -251,7 +244,7 @@ inline std::string* FieldMask::add_paths() { return _s; } inline const std::string& FieldMask::_internal_paths(int index) const { - return paths_.Get(index); + return _impl_.paths_.Get(index); } inline const std::string& FieldMask::paths(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.FieldMask.paths) @@ -259,55 +252,55 @@ inline const std::string& FieldMask::paths(int index) const { } inline std::string* FieldMask::mutable_paths(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.FieldMask.paths) - return paths_.Mutable(index); + return _impl_.paths_.Mutable(index); } inline void FieldMask::set_paths(int index, const std::string& value) { - paths_.Mutable(index)->assign(value); + _impl_.paths_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths) } inline void FieldMask::set_paths(int index, std::string&& value) { - paths_.Mutable(index)->assign(std::move(value)); + _impl_.paths_.Mutable(index)->assign(std::move(value)); // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths) } inline void FieldMask::set_paths(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); - paths_.Mutable(index)->assign(value); + _impl_.paths_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.FieldMask.paths) } inline void FieldMask::set_paths(int index, const char* value, size_t size) { - paths_.Mutable(index)->assign( + _impl_.paths_.Mutable(index)->assign( reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldMask.paths) } inline std::string* FieldMask::_internal_add_paths() { - return paths_.Add(); + return _impl_.paths_.Add(); } inline void FieldMask::add_paths(const std::string& value) { - paths_.Add()->assign(value); + _impl_.paths_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths) } inline void FieldMask::add_paths(std::string&& value) { - paths_.Add(std::move(value)); + _impl_.paths_.Add(std::move(value)); // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths) } inline void FieldMask::add_paths(const char* value) { GOOGLE_DCHECK(value != nullptr); - paths_.Add()->assign(value); + _impl_.paths_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.FieldMask.paths) } inline void FieldMask::add_paths(const char* value, size_t size) { - paths_.Add()->assign(reinterpret_cast(value), size); + _impl_.paths_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:google.protobuf.FieldMask.paths) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& FieldMask::paths() const { // @@protoc_insertion_point(field_list:google.protobuf.FieldMask.paths) - return paths_; + return _impl_.paths_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* FieldMask::mutable_paths() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldMask.paths) - return &paths_; + return &_impl_.paths_; } #ifdef __GNUC__ diff --git a/windows/include/google/protobuf/generated_enum_reflection.h b/windows/include/google/protobuf/generated_enum_reflection.h index 5debc0a25..b96a9c61f 100644 --- a/windows/include/google/protobuf/generated_enum_reflection.h +++ b/windows/include/google/protobuf/generated_enum_reflection.h @@ -39,16 +39,18 @@ #ifndef GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__ #define GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__ + #include -#include #include #include +#include #ifdef SWIG #error "You cannot SWIG proto headers" #endif +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/generated_enum_util.h b/windows/include/google/protobuf/generated_enum_util.h index f1002e2d1..5d10ac010 100644 --- a/windows/include/google/protobuf/generated_enum_util.h +++ b/windows/include/google/protobuf/generated_enum_util.h @@ -31,11 +31,13 @@ #ifndef GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__ #define GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__ + #include -#include #include +#include +// Must be included last. #include #ifdef SWIG diff --git a/windows/include/google/protobuf/generated_message_bases.h b/windows/include/google/protobuf/generated_message_bases.h index 29ab66bd4..b295218a7 100644 --- a/windows/include/google/protobuf/generated_message_bases.h +++ b/windows/include/google/protobuf/generated_message_bases.h @@ -35,11 +35,11 @@ #ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__ #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__ -#include #include #include #include #include +#include // Must come last: #include @@ -71,8 +71,8 @@ class PROTOBUF_EXPORT ZeroFieldsBase : public Message { void SetCachedSize(int size) const final { _cached_size_.Set(size); } - static void MergeImpl(Message* to, const Message& from); - static void CopyImpl(Message* to, const Message& from); + static void MergeImpl(Message& to, const Message& from); + static void CopyImpl(Message& to, const Message& from); void InternalSwap(ZeroFieldsBase* other); mutable internal::CachedSize _cached_size_; diff --git a/windows/include/google/protobuf/generated_message_reflection.h b/windows/include/google/protobuf/generated_message_reflection.h index 6a570ff60..334b2ccf1 100644 --- a/windows/include/google/protobuf/generated_message_reflection.h +++ b/windows/include/google/protobuf/generated_message_reflection.h @@ -38,17 +38,16 @@ #ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__ #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__ -#include -#include #include #include -#include -#include #include #include +#include +#include #include +// Must be included last. #include #ifdef SWIG @@ -137,8 +136,8 @@ struct ReflectionSchema { uint32_t GetFieldOffset(const FieldDescriptor* field) const { if (InRealOneof(field)) { size_t offset = - static_cast(field->containing_type()->field_count() + - field->containing_oneof()->index()); + static_cast(field->containing_type()->field_count()) + + field->containing_oneof()->index(); return OffsetValue(offsets_[offset], field->type()); } else { return GetFieldOffsetNonOneof(field); @@ -225,13 +224,6 @@ struct ReflectionSchema { return false; } - // Returns true if the field's accessor is called by any external code (aka, - // non proto library code). - bool IsFieldUsed(const FieldDescriptor* field) const { - (void)field; - return true; - } - bool IsFieldStripped(const FieldDescriptor* field) const { (void)field; return false; @@ -269,9 +261,9 @@ struct ReflectionSchema { if (type == FieldDescriptor::TYPE_MESSAGE || type == FieldDescriptor::TYPE_STRING || type == FieldDescriptor::TYPE_BYTES) { - return v & 0x7FFFFFFEu; + return v & 0xFFFFFFFEu; } - return v & 0x7FFFFFFFu; + return v; } static bool Inlined(uint32_t v, FieldDescriptor::Type type) { diff --git a/windows/include/google/protobuf/generated_message_table_driven.h b/windows/include/google/protobuf/generated_message_table_driven.h deleted file mode 100644 index 15eebcbf8..000000000 --- a/windows/include/google/protobuf/generated_message_table_driven.h +++ /dev/null @@ -1,351 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_H__ -#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_H__ - -#include -#include -#include -#include -#include - -// We require C++11 and Clang to use constexpr for variables, as GCC 4.8 -// requires constexpr to be consistent between declarations of variables -// unnecessarily (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58541). -// VS 2017 Update 3 also supports this usage of constexpr. -#if defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1911) -#define PROTOBUF_CONSTEXPR_VAR constexpr -#else // !__clang__ -#define PROTOBUF_CONSTEXPR_VAR -#endif // !_clang - -#ifdef SWIG -#error "You cannot SWIG proto headers" -#endif - -#include - -namespace google { -namespace protobuf { -namespace internal { - -// Processing-type masks. -static constexpr const unsigned char kOneofMask = 0x40; -static constexpr const unsigned char kRepeatedMask = 0x20; -// Mask for the raw type: either a WireFormatLite::FieldType or one of the -// ProcessingTypes below, without the oneof or repeated flag. -static constexpr const unsigned char kTypeMask = 0x1f; - -// Wire type masks. -static constexpr const unsigned char kNotPackedMask = 0x10; -static constexpr const unsigned char kInvalidMask = 0x20; - -enum ProcessingTypes { - TYPE_STRING_CORD = 19, - TYPE_STRING_STRING_PIECE = 20, - TYPE_BYTES_CORD = 21, - TYPE_BYTES_STRING_PIECE = 22, - TYPE_STRING_INLINED = 23, - TYPE_BYTES_INLINED = 24, - TYPE_MAP = 25, -}; - -static_assert(TYPE_MAP < kRepeatedMask, "Invalid enum"); - -struct PROTOBUF_EXPORT FieldMetadata { - uint32_t offset; // offset of this field in the struct - uint32_t tag; // field * 8 + wire_type - // byte offset * 8 + bit_offset; - // if the high bit is set then this is the byte offset of the oneof_case - // for this field. - uint32_t has_offset; - uint32_t type; // the type of this field. - const void* ptr; // auxiliary data - - // From the serializer point of view each fundamental type can occur in - // 4 different ways. For simplicity we treat all combinations as a cartesion - // product although not all combinations are allowed. - enum FieldTypeClass { - kPresence, - kNoPresence, - kRepeated, - kPacked, - kOneOf, - kNumTypeClasses // must be last enum - }; - // C++ protobuf has 20 fundamental types, were we added Cord and StringPiece - // and also distinguish the same types if they have different wire format. - enum { - kCordType = 19, - kStringPieceType = 20, - kInlinedType = 21, - kNumTypes = 21, - kSpecial = kNumTypes * kNumTypeClasses, - }; - - static int CalculateType(int fundamental_type, FieldTypeClass type_class); -}; - -// TODO(ckennelly): Add a static assertion to ensure that these masks do not -// conflict with wiretypes. - -// ParseTableField is kept small to help simplify instructions for computing -// offsets, as we will always need this information to parse a field. -// Additional data, needed for some types, is stored in -// AuxiliaryParseTableField. -struct ParseTableField { - uint32_t offset; - // The presence_index ordinarily represents a has_bit index, but for fields - // inside a oneof it represents the index in _oneof_case_. - uint32_t presence_index; - unsigned char normal_wiretype; - unsigned char packed_wiretype; - - // processing_type is given by: - // (FieldDescriptor->type() << 1) | FieldDescriptor->is_packed() - unsigned char processing_type; - - unsigned char tag_size; -}; - -struct ParseTable; - -union AuxiliaryParseTableField { - typedef bool (*EnumValidator)(int); - - // Enums - struct enum_aux { - EnumValidator validator; - }; - enum_aux enums; - // Group, messages - struct message_aux { - // ExplicitlyInitialized -> T requires a reinterpret_cast, which prevents - // the tables from being constructed as a constexpr. We use void to avoid - // the cast. - const void* default_message_void; - const MessageLite* default_message() const { - return static_cast(default_message_void); - } - }; - message_aux messages; - // Strings - struct string_aux { - const void* default_ptr; - const char* field_name; - }; - string_aux strings; - - struct map_aux { - bool (*parse_map)(io::CodedInputStream*, void*); - }; - map_aux maps; - - AuxiliaryParseTableField() = default; - constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::enum_aux e) - : enums(e) {} - constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::message_aux m) - : messages(m) {} - constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::string_aux s) - : strings(s) {} - constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::map_aux m) - : maps(m) {} -}; - -struct ParseTable { - const ParseTableField* fields; - const AuxiliaryParseTableField* aux; - int max_field_number; - // TODO(ckennelly): Do something with this padding. - - // TODO(ckennelly): Vet these for sign extension. - int64_t has_bits_offset; - int64_t oneof_case_offset; - int64_t extension_offset; - int64_t arena_offset; - - // ExplicitlyInitialized -> T requires a reinterpret_cast, which prevents - // the tables from being constructed as a constexpr. We use void to avoid - // the cast. - const void* default_instance_void; - const MessageLite* default_instance() const { - return static_cast(default_instance_void); - } - - bool unknown_field_set; -}; - -static_assert(sizeof(ParseTableField) <= 16, "ParseTableField is too large"); -// The tables must be composed of POD components to ensure link-time -// initialization. -static_assert(std::is_standard_layout::value, ""); -static_assert(std::is_trivial::value, ""); -static_assert(std::is_standard_layout::value, ""); -static_assert(std::is_trivial::value, ""); -static_assert( - std::is_standard_layout::value, ""); -static_assert(std::is_trivial::value, ""); -static_assert( - std::is_standard_layout::value, ""); -static_assert(std::is_trivial::value, - ""); -static_assert( - std::is_standard_layout::value, ""); -static_assert(std::is_trivial::value, ""); -static_assert(std::is_standard_layout::value, ""); -static_assert(std::is_trivial::value, ""); - -// TODO(ckennelly): Consolidate these implementations into a single one, using -// dynamic dispatch to the appropriate unknown field handler. -bool MergePartialFromCodedStream(MessageLite* msg, const ParseTable& table, - io::CodedInputStream* input); -bool MergePartialFromCodedStreamLite(MessageLite* msg, const ParseTable& table, - io::CodedInputStream* input); - -template -bool ParseMap(io::CodedInputStream* input, void* map_field) { - typedef typename MapEntryToMapField::MapFieldType MapFieldType; - typedef Map - MapType; - typedef typename Entry::template Parser ParserType; - - ParserType parser(static_cast(map_field)); - return WireFormatLite::ReadMessageNoVirtual(input, &parser); -} - -struct SerializationTable { - int num_fields; - const FieldMetadata* field_table; -}; - -PROTOBUF_EXPORT void SerializeInternal(const uint8_t* base, - const FieldMetadata* table, - int32_t num_fields, - io::CodedOutputStream* output); - -inline void TableSerialize(const MessageLite& msg, - const SerializationTable* table, - io::CodedOutputStream* output) { - const FieldMetadata* field_table = table->field_table; - int num_fields = table->num_fields - 1; - const uint8_t* base = reinterpret_cast(&msg); - // TODO(gerbens) This skips the first test if we could use the fast - // array serialization path, we should make this - // int cached_size = - // *reinterpret_cast(base + field_table->offset); - // SerializeWithCachedSize(msg, field_table + 1, num_fields, cached_size, ...) - // But we keep conformance with the old way for now. - SerializeInternal(base, field_table + 1, num_fields, output); -} - -PROTOBUF_EXPORT uint8_t* SerializeInternalToArray(const uint8_t* base, - const FieldMetadata* table, - int32_t num_fields, - bool is_deterministic, - uint8_t* buffer); - -inline uint8_t* TableSerializeToArray(const MessageLite& msg, - const SerializationTable* table, - bool is_deterministic, uint8_t* buffer) { - const uint8_t* base = reinterpret_cast(&msg); - const FieldMetadata* field_table = table->field_table + 1; - int num_fields = table->num_fields - 1; - return SerializeInternalToArray(base, field_table, num_fields, - is_deterministic, buffer); -} - -template -struct CompareHelper { - bool operator()(const T& a, const T& b) const { return a < b; } -}; - -template <> -struct CompareHelper { - bool operator()(const ArenaStringPtr& a, const ArenaStringPtr& b) const { - return a.Get() < b.Get(); - } -}; - -struct CompareMapKey { - template - bool operator()(const MapEntryHelper& a, - const MapEntryHelper& b) const { - return Compare(a.key_, b.key_); - } - template - bool Compare(const T& a, const T& b) const { - return CompareHelper()(a, b); - } -}; - -template -void MapFieldSerializer(const uint8_t* base, uint32_t offset, uint32_t tag, - uint32_t has_offset, io::CodedOutputStream* output) { - typedef MapEntryHelper Entry; - typedef typename MapFieldType::MapType::const_iterator Iter; - - const MapFieldType& map_field = - *reinterpret_cast(base + offset); - const SerializationTable* t = - table + - has_offset; // has_offset is overloaded for maps to mean table offset - if (!output->IsSerializationDeterministic()) { - for (Iter it = map_field.GetMap().begin(); it != map_field.GetMap().end(); - ++it) { - Entry map_entry(*it); - output->WriteVarint32(tag); - output->WriteVarint32(map_entry._cached_size_); - SerializeInternal(reinterpret_cast(&map_entry), - t->field_table, t->num_fields, output); - } - } else { - std::vector v; - for (Iter it = map_field.GetMap().begin(); it != map_field.GetMap().end(); - ++it) { - v.push_back(Entry(*it)); - } - std::sort(v.begin(), v.end(), CompareMapKey()); - for (int i = 0; i < v.size(); i++) { - output->WriteVarint32(tag); - output->WriteVarint32(v[i]._cached_size_); - SerializeInternal(reinterpret_cast(&v[i]), t->field_table, - t->num_fields, output); - } - } -} - -} // namespace internal -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_H__ diff --git a/windows/include/google/protobuf/generated_message_table_driven_lite.h b/windows/include/google/protobuf/generated_message_table_driven_lite.h deleted file mode 100644 index a05afc002..000000000 --- a/windows/include/google/protobuf/generated_message_table_driven_lite.h +++ /dev/null @@ -1,874 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_LITE_H__ -#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_LITE_H__ - -#include -#include -#include -#include -#include -#include -#include -#include - - -#include - -namespace google { -namespace protobuf { -namespace internal { - - -enum StringType { - StringType_STRING = 0, - StringType_INLINED = 3 -}; - -// Logically a superset of StringType, consisting of all field types that -// require special initialization. -enum ProcessingType { - ProcessingType_STRING = 0, - ProcessingType_CORD = 1, - ProcessingType_STRING_PIECE = 2, - ProcessingType_INLINED = 3, - ProcessingType_MESSAGE = 4, -}; - -enum Cardinality { - Cardinality_SINGULAR = 0, - Cardinality_REPEATED = 1, - Cardinality_ONEOF = 3 -}; - -template -inline Type* Raw(MessageLite* msg, int64_t offset) { - return reinterpret_cast(reinterpret_cast(msg) + offset); -} - -template -inline const Type* Raw(const MessageLite* msg, int64_t offset) { - return reinterpret_cast(reinterpret_cast(msg) + - offset); -} - -inline ExtensionSet* GetExtensionSet(MessageLite* msg, - int64_t extension_offset) { - if (extension_offset == -1) { - return nullptr; - } - - return Raw(msg, extension_offset); -} - -template -inline Type* AddField(MessageLite* msg, int64_t offset) { - static_assert(std::is_trivial::value || - std::is_same::value, - "Do not assign"); - - RepeatedField* repeated = Raw>(msg, offset); - return repeated->Add(); -} - -template <> -inline std::string* AddField(MessageLite* msg, int64_t offset) { - RepeatedPtrField* repeated = - Raw>(msg, offset); - return repeated->Add(); -} - - -template -inline void AddField(MessageLite* msg, int64_t offset, Type value) { - static_assert(std::is_trivial::value, "Do not assign"); - *AddField(msg, offset) = value; -} - -inline void SetBit(uint32_t* has_bits, uint32_t has_bit_index) { - GOOGLE_DCHECK(has_bits != nullptr); - - uint32_t mask = static_cast(1u) << (has_bit_index % 32); - has_bits[has_bit_index / 32u] |= mask; -} - -template -inline Type* MutableField(MessageLite* msg, uint32_t* has_bits, - uint32_t has_bit_index, int64_t offset) { - SetBit(has_bits, has_bit_index); - return Raw(msg, offset); -} - -template -inline void SetField(MessageLite* msg, uint32_t* has_bits, - uint32_t has_bit_index, int64_t offset, Type value) { - static_assert(std::is_trivial::value, "Do not assign"); - *MutableField(msg, has_bits, has_bit_index, offset) = value; -} - -template -inline void SetOneofField(MessageLite* msg, uint32_t* oneof_case, - uint32_t oneof_case_index, int64_t offset, - int field_number, Type value) { - oneof_case[oneof_case_index] = field_number; - *Raw(msg, offset) = value; -} - -// Clears a oneof field. The field argument should correspond to the particular -// field that is currently set in the oneof. -inline void ClearOneofField(const ParseTableField& field, Arena* arena, - MessageLite* msg) { - switch (field.processing_type & kTypeMask) { - case WireFormatLite::TYPE_MESSAGE: - if (arena == nullptr) { - delete *Raw(msg, field.offset); - } - break; - - case WireFormatLite::TYPE_STRING: - case WireFormatLite::TYPE_BYTES: - Raw(msg, field.offset) - ->Destroy(ArenaStringPtr::EmptyDefault{}, arena); - break; - - case TYPE_STRING_INLINED: - case TYPE_BYTES_INLINED: - Raw(msg, field.offset)->DestroyNoArena(nullptr); - break; - - default: - // No cleanup needed. - break; - } -} - -// Clears and reinitializes a oneof field as necessary, in preparation for -// parsing a new value with type field_type and field number field_number. -// -// Note: the oneof_case argument should point directly to the _oneof_case_ -// element corresponding to this particular oneof, not to the beginning of the -// _oneof_case_ array. -template -inline void ResetOneofField(const ParseTable& table, int field_number, - Arena* arena, MessageLite* msg, - uint32_t* oneof_case, int64_t offset, - const void* default_ptr) { - if (static_cast(*oneof_case) == field_number) { - // The oneof is already set to the right type, so there is no need to clear - // it. - return; - } - - if (*oneof_case != 0) { - ClearOneofField(table.fields[*oneof_case], arena, msg); - } - *oneof_case = field_number; - - switch (field_type) { - case ProcessingType_STRING: - Raw(msg, offset) - ->UnsafeSetDefault(static_cast(default_ptr)); - break; - case ProcessingType_INLINED: - new (Raw(msg, offset)) - InlinedStringField(*static_cast(default_ptr)); - break; - case ProcessingType_MESSAGE: - MessageLite** submessage = Raw(msg, offset); - const MessageLite* prototype = - table.aux[field_number].messages.default_message(); - *submessage = prototype->New(arena); - break; - } -} - -template -static inline bool HandleString(io::CodedInputStream* input, MessageLite* msg, - Arena* arena, uint32_t* has_bits, - uint32_t has_bit_index, int64_t offset, - const void* default_ptr, - const char* field_name) { - StringPiece utf8_string_data; -#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - constexpr bool kValidateUtf8 = is_string_type; -#else - constexpr bool kValidateUtf8 = false; -#endif // GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - - switch (ctype) { - case StringType_INLINED: { - std::string* value = nullptr; - switch (cardinality) { - case Cardinality_SINGULAR: { - // TODO(ckennelly): Is this optimal? - InlinedStringField* s = MutableField( - msg, has_bits, has_bit_index, offset); - value = s->UnsafeMutablePointer(); - } break; - case Cardinality_REPEATED: { - value = AddField(msg, offset); - } break; - case Cardinality_ONEOF: { - InlinedStringField* s = Raw(msg, offset); - value = s->UnsafeMutablePointer(); - } break; - } - GOOGLE_DCHECK(value != nullptr); - if (PROTOBUF_PREDICT_FALSE(!WireFormatLite::ReadString(input, value))) { - return false; - } - utf8_string_data = *value; - break; - } - case StringType_STRING: { - switch (cardinality) { - case Cardinality_SINGULAR: { - ArenaStringPtr* field = MutableField( - msg, has_bits, has_bit_index, offset); - std::string* value = field->MutableNoCopy( - static_cast(default_ptr), arena); - if (PROTOBUF_PREDICT_FALSE( - !WireFormatLite::ReadString(input, value))) { - return false; - } - utf8_string_data = field->Get(); - } break; - case Cardinality_REPEATED: { - std::string* value = AddField(msg, offset); - if (PROTOBUF_PREDICT_FALSE( - !WireFormatLite::ReadString(input, value))) { - return false; - } - utf8_string_data = *value; - } break; - case Cardinality_ONEOF: { - ArenaStringPtr* field = Raw(msg, offset); - std::string* value = field->MutableNoCopy( - static_cast(default_ptr), arena); - if (PROTOBUF_PREDICT_FALSE( - !WireFormatLite::ReadString(input, value))) { - return false; - } - utf8_string_data = field->Get(); - } break; - default: - PROTOBUF_ASSUME(false); - } - break; - } - default: - PROTOBUF_ASSUME(false); - } - - if (kValidateUtf8) { - // TODO(b/118759213): fail if proto3 - WireFormatLite::VerifyUtf8String(utf8_string_data.data(), - utf8_string_data.length(), - WireFormatLite::PARSE, field_name); - } - return true; -} - -template -inline bool HandleEnum(const ParseTable& table, io::CodedInputStream* input, - MessageLite* msg, uint32_t* presence, - uint32_t presence_index, int64_t offset, uint32_t tag, - int field_number) { - int value; - if (PROTOBUF_PREDICT_FALSE( - (!WireFormatLite::ReadPrimitive( - input, &value)))) { - return false; - } - - AuxiliaryParseTableField::EnumValidator validator = - table.aux[field_number].enums.validator; - if (validator == nullptr || validator(value)) { - switch (cardinality) { - case Cardinality_SINGULAR: - SetField(msg, presence, presence_index, offset, value); - break; - case Cardinality_REPEATED: - AddField(msg, offset, value); - break; - case Cardinality_ONEOF: - ClearOneofField(table.fields[presence[presence_index]], msg->GetArena(), - msg); - SetOneofField(msg, presence, presence_index, offset, field_number, - value); - break; - default: - PROTOBUF_ASSUME(false); - } - } else { - UnknownFieldHandler::Varint(msg, table, tag, value); - } - - return true; -} - -// RepeatedMessageTypeHandler allows us to operate on RepeatedPtrField fields -// without instantiating the specific template. -class RepeatedMessageTypeHandler { - public: - typedef MessageLite Type; - typedef MessageLite WeakType; - static Arena* GetArena(Type* t) { return t->GetArena(); } - static inline Type* NewFromPrototype(const Type* prototype, - Arena* arena = nullptr) { - return prototype->New(arena); - } - static void Delete(Type* t, Arena* arena = nullptr) { - if (arena == nullptr) { - delete t; - } - } -}; - -class MergePartialFromCodedStreamHelper { - public: - static MessageLite* Add(RepeatedPtrFieldBase* field, - const MessageLite* prototype) { - return field->Add( - const_cast(prototype)); - } -}; - -template -bool MergePartialFromCodedStreamInlined(MessageLite* msg, - const ParseTable& table, - io::CodedInputStream* input) { - // We require that has_bits are present, as to avoid having to check for them - // for every field. - // - // TODO(ckennelly): Make this a compile-time parameter with templates. - GOOGLE_DCHECK_GE(table.has_bits_offset, 0); - uint32_t* has_bits = Raw(msg, table.has_bits_offset); - GOOGLE_DCHECK(has_bits != nullptr); - - while (true) { - uint32_t tag = input->ReadTagWithCutoffNoLastTag(kMaxTag).first; - const WireFormatLite::WireType wire_type = - WireFormatLite::GetTagWireType(tag); - const int field_number = WireFormatLite::GetTagFieldNumber(tag); - - if (PROTOBUF_PREDICT_FALSE(field_number > table.max_field_number)) { - // check for possible extensions - if (UnknownFieldHandler::ParseExtension(msg, table, input, tag)) { - // successfully parsed - continue; - } - - if (PROTOBUF_PREDICT_FALSE( - !UnknownFieldHandler::Skip(msg, table, input, tag))) { - return false; - } - - continue; - } - - // We implicitly verify that data points to a valid field as we check the - // wire types. Entries in table.fields[i] that do not correspond to valid - // field numbers have their normal_wiretype and packed_wiretype fields set - // with the kInvalidMask value. As wire_type cannot take on that value, we - // will never match. - const ParseTableField* data = table.fields + field_number; - - // TODO(ckennelly): Avoid sign extension - const int64_t presence_index = data->presence_index; - const int64_t offset = data->offset; - const unsigned char processing_type = data->processing_type; - - if (data->normal_wiretype == static_cast(wire_type)) { - switch (processing_type) { -#define HANDLE_TYPE(TYPE, CPPTYPE) \ - case (WireFormatLite::TYPE_##TYPE): { \ - CPPTYPE value; \ - if (PROTOBUF_PREDICT_FALSE( \ - (!WireFormatLite::ReadPrimitive< \ - CPPTYPE, WireFormatLite::TYPE_##TYPE>(input, &value)))) { \ - return false; \ - } \ - SetField(msg, has_bits, presence_index, offset, value); \ - break; \ - } \ - case (WireFormatLite::TYPE_##TYPE) | kRepeatedMask: { \ - RepeatedField* values = Raw>(msg, offset); \ - if (PROTOBUF_PREDICT_FALSE((!WireFormatLite::ReadRepeatedPrimitive< \ - CPPTYPE, WireFormatLite::TYPE_##TYPE>( \ - data->tag_size, tag, input, values)))) { \ - return false; \ - } \ - break; \ - } \ - case (WireFormatLite::TYPE_##TYPE) | kOneofMask: { \ - uint32_t* oneof_case = Raw(msg, table.oneof_case_offset); \ - CPPTYPE value; \ - if (PROTOBUF_PREDICT_FALSE( \ - (!WireFormatLite::ReadPrimitive< \ - CPPTYPE, WireFormatLite::TYPE_##TYPE>(input, &value)))) { \ - return false; \ - } \ - ClearOneofField(table.fields[oneof_case[presence_index]], msg->GetArena(), \ - msg); \ - SetOneofField(msg, oneof_case, presence_index, offset, field_number, \ - value); \ - break; \ - } - - HANDLE_TYPE(INT32, int32_t) - HANDLE_TYPE(INT64, int64_t) - HANDLE_TYPE(SINT32, int32_t) - HANDLE_TYPE(SINT64, int64_t) - HANDLE_TYPE(UINT32, uint32_t) - HANDLE_TYPE(UINT64, uint64_t) - - HANDLE_TYPE(FIXED32, uint32_t) - HANDLE_TYPE(FIXED64, uint64_t) - HANDLE_TYPE(SFIXED32, int32_t) - HANDLE_TYPE(SFIXED64, int64_t) - - HANDLE_TYPE(FLOAT, float) - HANDLE_TYPE(DOUBLE, double) - - HANDLE_TYPE(BOOL, bool) -#undef HANDLE_TYPE - case WireFormatLite::TYPE_BYTES: -#ifndef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - case WireFormatLite::TYPE_STRING: -#endif // GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - { - Arena* const arena = msg->GetArena(); - const void* default_ptr = table.aux[field_number].strings.default_ptr; - - if (PROTOBUF_PREDICT_FALSE( - (!HandleString( - input, msg, arena, has_bits, presence_index, offset, - default_ptr, nullptr)))) { - return false; - } - break; - } - case TYPE_BYTES_INLINED: -#ifndef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - case TYPE_STRING_INLINED: -#endif // !GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - { - Arena* const arena = msg->GetArena(); - const void* default_ptr = table.aux[field_number].strings.default_ptr; - - if (PROTOBUF_PREDICT_FALSE( - (!HandleString( - input, msg, arena, has_bits, presence_index, offset, - default_ptr, nullptr)))) { - return false; - } - break; - } - case WireFormatLite::TYPE_BYTES | kOneofMask: -#ifndef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - case WireFormatLite::TYPE_STRING | kOneofMask: -#endif // !GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - { - Arena* const arena = msg->GetArena(); - uint32_t* oneof_case = Raw(msg, table.oneof_case_offset); - const void* default_ptr = table.aux[field_number].strings.default_ptr; - - ResetOneofField( - table, field_number, arena, msg, oneof_case + presence_index, - offset, default_ptr); - - if (PROTOBUF_PREDICT_FALSE( - (!HandleString(input, msg, arena, has_bits, - presence_index, offset, - default_ptr, nullptr)))) { - return false; - } - break; - } - case (WireFormatLite::TYPE_BYTES) | kRepeatedMask: - case TYPE_BYTES_INLINED | kRepeatedMask: -#ifndef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - case (WireFormatLite::TYPE_STRING) | kRepeatedMask: - case TYPE_STRING_INLINED | kRepeatedMask: -#endif // !GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - { - Arena* const arena = msg->GetArena(); - const void* default_ptr = table.aux[field_number].strings.default_ptr; - - if (PROTOBUF_PREDICT_FALSE( - (!HandleString( - input, msg, arena, has_bits, presence_index, offset, - default_ptr, nullptr)))) { - return false; - } - break; - } -#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - case (WireFormatLite::TYPE_STRING): { - Arena* const arena = msg->GetArena(); - const void* default_ptr = table.aux[field_number].strings.default_ptr; - const char* field_name = table.aux[field_number].strings.field_name; - - if (PROTOBUF_PREDICT_FALSE( - (!HandleString( - input, msg, arena, has_bits, presence_index, offset, - default_ptr, field_name)))) { - return false; - } - break; - } - case TYPE_STRING_INLINED | kRepeatedMask: - case (WireFormatLite::TYPE_STRING) | kRepeatedMask: { - Arena* const arena = msg->GetArena(); - const void* default_ptr = table.aux[field_number].strings.default_ptr; - const char* field_name = table.aux[field_number].strings.field_name; - - if (PROTOBUF_PREDICT_FALSE( - (!HandleString( - input, msg, arena, has_bits, presence_index, offset, - default_ptr, field_name)))) { - return false; - } - break; - } - case (WireFormatLite::TYPE_STRING) | kOneofMask: { - Arena* const arena = msg->GetArena(); - uint32_t* oneof_case = Raw(msg, table.oneof_case_offset); - const void* default_ptr = table.aux[field_number].strings.default_ptr; - const char* field_name = table.aux[field_number].strings.field_name; - - ResetOneofField( - table, field_number, arena, msg, oneof_case + presence_index, - offset, default_ptr); - - if (PROTOBUF_PREDICT_FALSE( - (!HandleString( - input, msg, arena, has_bits, presence_index, offset, - default_ptr, field_name)))) { - return false; - } - break; - } -#endif // GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - case WireFormatLite::TYPE_ENUM: { - if (PROTOBUF_PREDICT_FALSE( - (!HandleEnum( - table, input, msg, has_bits, presence_index, offset, tag, - field_number)))) { - return false; - } - break; - } - case WireFormatLite::TYPE_ENUM | kRepeatedMask: { - if (PROTOBUF_PREDICT_FALSE( - (!HandleEnum( - table, input, msg, has_bits, presence_index, offset, tag, - field_number)))) { - return false; - } - break; - } - case WireFormatLite::TYPE_ENUM | kOneofMask: { - uint32_t* oneof_case = Raw(msg, table.oneof_case_offset); - if (PROTOBUF_PREDICT_FALSE( - (!HandleEnum( - table, input, msg, oneof_case, presence_index, offset, - tag, field_number)))) { - return false; - } - break; - } - case WireFormatLite::TYPE_GROUP: { - MessageLite** submsg_holder = - MutableField(msg, has_bits, presence_index, offset); - MessageLite* submsg = *submsg_holder; - - if (submsg == nullptr) { - Arena* const arena = msg->GetArena(); - const MessageLite* prototype = - table.aux[field_number].messages.default_message(); - submsg = prototype->New(arena); - *submsg_holder = submsg; - } - - if (PROTOBUF_PREDICT_FALSE( - !WireFormatLite::ReadGroup(field_number, input, submsg))) { - return false; - } - - break; - } - case WireFormatLite::TYPE_GROUP | kRepeatedMask: { - RepeatedPtrFieldBase* field = Raw(msg, offset); - const MessageLite* prototype = - table.aux[field_number].messages.default_message(); - GOOGLE_DCHECK(prototype != nullptr); - - MessageLite* submsg = - MergePartialFromCodedStreamHelper::Add(field, prototype); - - if (PROTOBUF_PREDICT_FALSE( - !WireFormatLite::ReadGroup(field_number, input, submsg))) { - return false; - } - - break; - } - case WireFormatLite::TYPE_MESSAGE: { - MessageLite** submsg_holder = - MutableField(msg, has_bits, presence_index, offset); - MessageLite* submsg = *submsg_holder; - - if (submsg == nullptr) { - Arena* const arena = msg->GetArena(); - const MessageLite* prototype = - table.aux[field_number].messages.default_message(); - if (prototype == nullptr) { - prototype = ImplicitWeakMessage::default_instance(); - } - submsg = prototype->New(arena); - *submsg_holder = submsg; - } - - if (PROTOBUF_PREDICT_FALSE( - !WireFormatLite::ReadMessage(input, submsg))) { - return false; - } - - break; - } - // TODO(ckennelly): Adapt ReadMessageNoVirtualNoRecursionDepth and - // manage input->IncrementRecursionDepth() here. - case WireFormatLite::TYPE_MESSAGE | kRepeatedMask: { - RepeatedPtrFieldBase* field = Raw(msg, offset); - const MessageLite* prototype = - table.aux[field_number].messages.default_message(); - if (prototype == nullptr) { - prototype = ImplicitWeakMessage::default_instance(); - } - - MessageLite* submsg = - MergePartialFromCodedStreamHelper::Add(field, prototype); - - if (PROTOBUF_PREDICT_FALSE( - !WireFormatLite::ReadMessage(input, submsg))) { - return false; - } - - break; - } - case WireFormatLite::TYPE_MESSAGE | kOneofMask: { - Arena* const arena = msg->GetArena(); - uint32_t* oneof_case = Raw(msg, table.oneof_case_offset); - MessageLite** submsg_holder = Raw(msg, offset); - ResetOneofField( - table, field_number, arena, msg, oneof_case + presence_index, - offset, nullptr); - MessageLite* submsg = *submsg_holder; - - if (PROTOBUF_PREDICT_FALSE( - !WireFormatLite::ReadMessage(input, submsg))) { - return false; - } - - break; - } -#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - case TYPE_STRING_INLINED: { - Arena* const arena = msg->GetArena(); - const void* default_ptr = table.aux[field_number].strings.default_ptr; - const char* field_name = table.aux[field_number].strings.field_name; - - if (PROTOBUF_PREDICT_FALSE( - (!HandleString( - input, msg, arena, has_bits, presence_index, offset, - default_ptr, field_name)))) { - return false; - } - break; - } -#endif // GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED - case TYPE_MAP: { - if (PROTOBUF_PREDICT_FALSE(!(*table.aux[field_number].maps.parse_map)( - input, Raw(msg, offset)))) { - return false; - } - break; - } - case 0: { - // Done. - input->SetLastTag(tag); - return true; - } - default: - PROTOBUF_ASSUME(false); - } - } else if (data->packed_wiretype == static_cast(wire_type)) { - // Non-packable fields have their packed_wiretype masked with - // kNotPackedMask, which is impossible to match here. - GOOGLE_DCHECK(processing_type & kRepeatedMask); - GOOGLE_DCHECK_NE(processing_type, kRepeatedMask); - GOOGLE_DCHECK_EQ(0, processing_type & kOneofMask); - - GOOGLE_DCHECK_NE(TYPE_BYTES_INLINED | kRepeatedMask, processing_type); - GOOGLE_DCHECK_NE(TYPE_STRING_INLINED | kRepeatedMask, processing_type); - - // Mask out kRepeatedMask bit, allowing the jump table to be smaller. - switch (static_cast(processing_type ^ - kRepeatedMask)) { -#define HANDLE_PACKED_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD) \ - case WireFormatLite::TYPE_##TYPE: { \ - RepeatedField* values = Raw>(msg, offset); \ - if (PROTOBUF_PREDICT_FALSE( \ - (!WireFormatLite::ReadPackedPrimitive< \ - CPPTYPE, WireFormatLite::TYPE_##TYPE>(input, values)))) { \ - return false; \ - } \ - break; \ - } - - HANDLE_PACKED_TYPE(INT32, int32_t, Int32) - HANDLE_PACKED_TYPE(INT64, int64_t, Int64) - HANDLE_PACKED_TYPE(SINT32, int32_t, Int32) - HANDLE_PACKED_TYPE(SINT64, int64_t, Int64) - HANDLE_PACKED_TYPE(UINT32, uint32_t, UInt32) - HANDLE_PACKED_TYPE(UINT64, uint64_t, UInt64) - - HANDLE_PACKED_TYPE(FIXED32, uint32_t, UInt32) - HANDLE_PACKED_TYPE(FIXED64, uint64_t, UInt64) - HANDLE_PACKED_TYPE(SFIXED32, int32_t, Int32) - HANDLE_PACKED_TYPE(SFIXED64, int64_t, Int64) - - HANDLE_PACKED_TYPE(FLOAT, float, Float) - HANDLE_PACKED_TYPE(DOUBLE, double, Double) - - HANDLE_PACKED_TYPE(BOOL, bool, Bool) -#undef HANDLE_PACKED_TYPE - case WireFormatLite::TYPE_ENUM: { - // To avoid unnecessarily calling MutableUnknownFields (which mutates - // InternalMetadata) when all inputs in the repeated series - // are valid, we implement our own parser rather than call - // WireFormat::ReadPackedEnumPreserveUnknowns. - uint32_t length; - if (PROTOBUF_PREDICT_FALSE(!input->ReadVarint32(&length))) { - return false; - } - - AuxiliaryParseTableField::EnumValidator validator = - table.aux[field_number].enums.validator; - RepeatedField* values = Raw>(msg, offset); - - io::CodedInputStream::Limit limit = input->PushLimit(length); - while (input->BytesUntilLimit() > 0) { - int value; - if (PROTOBUF_PREDICT_FALSE( - (!WireFormatLite::ReadPrimitive< - int, WireFormatLite::TYPE_ENUM>(input, &value)))) { - return false; - } - - if (validator == nullptr || validator(value)) { - values->Add(value); - } else { - // TODO(ckennelly): Consider caching here. - UnknownFieldHandler::Varint(msg, table, tag, value); - } - } - input->PopLimit(limit); - - break; - } - case WireFormatLite::TYPE_STRING: - case WireFormatLite::TYPE_GROUP: - case WireFormatLite::TYPE_MESSAGE: - case WireFormatLite::TYPE_BYTES: - GOOGLE_DCHECK(false); - return false; - default: - PROTOBUF_ASSUME(false); - } - } else { - if (wire_type == WireFormatLite::WIRETYPE_END_GROUP) { - // Must be the end of the message. - input->SetLastTag(tag); - return true; - } - - // check for possible extensions - if (UnknownFieldHandler::ParseExtension(msg, table, input, tag)) { - // successfully parsed - continue; - } - - // process unknown field. - if (PROTOBUF_PREDICT_FALSE( - !UnknownFieldHandler::Skip(msg, table, input, tag))) { - return false; - } - } - } -} // NOLINT(readability/fn_size) - -template -bool MergePartialFromCodedStreamImpl(MessageLite* msg, const ParseTable& table, - io::CodedInputStream* input) { - // The main beneficial cutoff values are 1 and 2 byte tags. - // Instantiate calls with the appropriate upper tag range - if (table.max_field_number <= (0x7F >> 3)) { - return MergePartialFromCodedStreamInlined( - msg, table, input); - } else if (table.max_field_number <= (0x3FFF >> 3)) { - return MergePartialFromCodedStreamInlined( - msg, table, input); - } else { - return MergePartialFromCodedStreamInlined< - UnknownFieldHandler, std::numeric_limits::max()>(msg, table, - input); - } -} - -} // namespace internal -} // namespace protobuf -} // namespace google - -#include - -#endif // GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_LITE_H__ diff --git a/windows/include/google/protobuf/generated_message_tctable_decl.h b/windows/include/google/protobuf/generated_message_tctable_decl.h index 4e5c1eaba..b1bb1def7 100644 --- a/windows/include/google/protobuf/generated_message_tctable_decl.h +++ b/windows/include/google/protobuf/generated_message_tctable_decl.h @@ -35,11 +35,13 @@ #ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_DECL_H__ #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_DECL_H__ +#include +#include #include #include -#include #include +#include // Must come last: #include @@ -51,17 +53,53 @@ namespace internal { // Additional information about this field: struct TcFieldData { constexpr TcFieldData() : data(0) {} - constexpr TcFieldData(uint16_t coded_tag, uint8_t hasbit_idx, uint16_t offset) - : data(static_cast(offset) << 48 | - static_cast(hasbit_idx) << 16 | coded_tag) {} + + // Fast table entry constructor: + constexpr TcFieldData(uint16_t coded_tag, uint8_t hasbit_idx, uint8_t aux_idx, + uint16_t offset) + : data(uint64_t{offset} << 48 | // + uint64_t{aux_idx} << 24 | // + uint64_t{hasbit_idx} << 16 | // + uint64_t{coded_tag}) {} + + // Fields used in fast table parsing: + // + // Bit: + // +-----------+-------------------+ + // |63 .. 32|31 .. 0| + // +---------------+---------------+ + // : . : . : . 16|=======| [16] coded_tag() + // : . : . : 24|===| . : [ 8] hasbit_idx() + // : . : . 32|===| : . : [ 8] aux_idx() + // : . 48:---.---: . : . : [16] (unused) + // |=======| . : . : . : [16] offset() + // +-----------+-------------------+ + // |63 .. 32|31 .. 0| + // +---------------+---------------+ template TagType coded_tag() const { return static_cast(data); } uint8_t hasbit_idx() const { return static_cast(data >> 16); } + uint8_t aux_idx() const { return static_cast(data >> 24); } uint16_t offset() const { return static_cast(data >> 48); } + // Fields used in mini table parsing: + // + // Bit: + // +-----------+-------------------+ + // |63 .. 32|31 .. 0| + // +---------------+---------------+ + // : . : . |===============| [32] tag() (decoded) + // |===============| . : . : [32] entry_offset() + // +-----------+-------------------+ + // |63 .. 32|31 .. 0| + // +---------------+---------------+ + + uint32_t tag() const { return static_cast(data); } + uint32_t entry_offset() const { return static_cast(data >> 32); } + uint64_t data; }; @@ -70,6 +108,12 @@ struct TcParseTableBase; // TailCallParseFunc is the function pointer type used in the tailcall table. typedef const char* (*TailCallParseFunc)(PROTOBUF_TC_PARAM_DECL); +namespace field_layout { +struct Offset { + uint32_t off; +}; +} // namespace field_layout + #if defined(_MSC_VER) && !defined(_WIN64) #pragma warning(push) // TcParseTableBase is intentionally overaligned on 32 bit targets. @@ -83,14 +127,49 @@ struct alignas(uint64_t) TcParseTableBase { uint16_t extension_offset; uint32_t extension_range_low; uint32_t extension_range_high; + uint32_t max_field_number; uint8_t fast_idx_mask; - uint8_t reserved; - uint16_t num_fields; + uint16_t lookup_table_offset; + uint32_t skipmap32; + uint32_t field_entries_offset; + uint16_t num_field_entries; + + uint16_t num_aux_entries; + uint32_t aux_offset; + const MessageLite* default_instance; // Handler for fields which are not handled by table dispatch. TailCallParseFunc fallback; + // This constructor exactly follows the field layout, so it's technically + // not necessary. However, it makes it much much easier to add or re-arrange + // fields, because it can be overloaded with an additional constructor, + // temporarily allowing both old and new protocol buffer headers to be + // compiled. + constexpr TcParseTableBase( + uint16_t has_bits_offset, uint16_t extension_offset, + uint32_t extension_range_low, uint32_t extension_range_high, + uint32_t max_field_number, uint8_t fast_idx_mask, + uint16_t lookup_table_offset, uint32_t skipmap32, + uint32_t field_entries_offset, uint16_t num_field_entries, + uint16_t num_aux_entries, uint32_t aux_offset, + const MessageLite* default_instance, TailCallParseFunc fallback) + : has_bits_offset(has_bits_offset), + extension_offset(extension_offset), + extension_range_low(extension_range_low), + extension_range_high(extension_range_high), + max_field_number(max_field_number), + fast_idx_mask(fast_idx_mask), + lookup_table_offset(lookup_table_offset), + skipmap32(skipmap32), + field_entries_offset(field_entries_offset), + num_field_entries(num_field_entries), + num_aux_entries(num_aux_entries), + aux_offset(aux_offset), + default_instance(default_instance), + fallback(fallback) {} + // Table entry for fast-path tailcall dispatch handling. struct FastFieldEntry { // Target function for dispatch: @@ -102,6 +181,59 @@ struct alignas(uint64_t) TcParseTableBase { const FastFieldEntry* fast_entry(size_t idx) const { return reinterpret_cast(this + 1) + idx; } + + // Returns a begin iterator (pointer) to the start of the field lookup table. + const uint16_t* field_lookup_begin() const { + return reinterpret_cast(reinterpret_cast(this) + + lookup_table_offset); + } + + // Field entry for all fields. + struct FieldEntry { + uint32_t offset; // offset in the message object + int32_t has_idx; // has-bit index + uint16_t aux_idx; // index for `field_aux`. + uint16_t type_card; // `FieldType` and `Cardinality` (see _impl.h) + }; + + // Returns a begin iterator (pointer) to the start of the field entries array. + const FieldEntry* field_entries_begin() const { + return reinterpret_cast( + reinterpret_cast(this) + field_entries_offset); + } + + // Auxiliary entries for field types that need extra information. + union FieldAux { + constexpr FieldAux() : message_default(nullptr) {} + constexpr FieldAux(bool (*enum_validator)(int)) + : enum_validator(enum_validator) {} + constexpr FieldAux(field_layout::Offset off) : offset(off.off) {} + constexpr FieldAux(int16_t range_start, uint16_t range_length) + : enum_range{range_start, range_length} {} + constexpr FieldAux(const MessageLite* msg) : message_default(msg) {} + bool (*enum_validator)(int); + struct { + int16_t start; // minimum enum number (if it fits) + uint16_t length; // length of range (i.e., max = start + length - 1) + } enum_range; + uint32_t offset; + const MessageLite* message_default; + }; + const FieldAux* field_aux(uint32_t idx) const { + return reinterpret_cast(reinterpret_cast(this) + + aux_offset) + + idx; + } + const FieldAux* field_aux(const FieldEntry* entry) const { + return field_aux(entry->aux_idx); + } + + // Field name data + const char* name_data() const { + return reinterpret_cast(reinterpret_cast(this) + + aux_offset + + num_aux_entries * sizeof(FieldAux)); + } }; #if defined(_MSC_VER) && !defined(_WIN64) @@ -109,9 +241,13 @@ struct alignas(uint64_t) TcParseTableBase { #endif static_assert(sizeof(TcParseTableBase::FastFieldEntry) <= 16, + "Fast field entry is too big."); +static_assert(sizeof(TcParseTableBase::FieldEntry) <= 16, "Field entry is too big."); -template +template struct TcParseTable { TcParseTableBase header; @@ -119,15 +255,52 @@ struct TcParseTable { // // Fields are indexed by the lowest bits of their field number. The field // number is masked to fit inside the table. Note that the parsing logic - // generally calls `TailCallParseTableBase::table()` instead of accessing + // generally calls `TailCallParseTableBase::fast_entry()` instead of accessing // this field directly. - TcParseTableBase::FastFieldEntry entries[(1 << kFastTableSizeLog2)]; + std::array + fast_entries; + + // Just big enough to find all the field entries. + std::array field_lookup_table; + // Entries for all fields: + std::array field_entries; + std::array aux_entries; + std::array field_names; +}; + +// Partial specialization: if there are no aux entries, there will be no array. +// In C++, arrays cannot have length 0, but (C++11) std::array is valid. +// However, different implementations have different sizeof(std::array). +// Skipping the member makes offset computations portable. +template +struct TcParseTable { + TcParseTableBase header; + std::array + fast_entries; + std::array field_lookup_table; + std::array field_entries; + std::array field_names; +}; + +// Partial specialization: if there are no fields at all, then we can save space +// by skipping the field numbers and entries. +template +struct TcParseTable<0, 0, 0, kNameTableSize, kFieldLookupSize> { + TcParseTableBase header; + // N.B.: the fast entries are sized by log2, so 2**0 fields = 1 entry. + // The fast parsing loop will always use this entry, so it must be present. + std::array fast_entries; + std::array field_lookup_table; + std::array field_names; }; static_assert(std::is_standard_layout>::value, "TcParseTable must be standard layout."); -static_assert(offsetof(TcParseTable<1>, entries) == sizeof(TcParseTableBase), +static_assert(offsetof(TcParseTable<1>, fast_entries) == + sizeof(TcParseTableBase), "Table entries must be laid out after TcParseTableBase."); } // namespace internal diff --git a/windows/include/google/protobuf/generated_message_tctable_impl.h b/windows/include/google/protobuf/generated_message_tctable_impl.h index 3f2b1cabd..21fa5332d 100644 --- a/windows/include/google/protobuf/generated_message_tctable_impl.h +++ b/windows/include/google/protobuf/generated_message_tctable_impl.h @@ -34,12 +34,12 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include // Must come last: @@ -53,6 +53,189 @@ class UnknownFieldSet; namespace internal { +// Field layout enums. +// +// Structural information about fields is packed into a 16-bit value. The enum +// types below represent bitwise fields, along with their respective widths, +// shifts, and masks. +// +// Bit: +// +-----------------------+-----------------------+ +// |15 .. 8|7 .. 0| +// +-----------------------+-----------------------+ +// : . : . : . : . : . : . : 3|========| [3] FieldType +// : : : : : : 5|=====| : : [2] FieldCardinality +// : . : . : . : . 8|========| : . : . : [3] FieldRep +// : : : 10|=====| : : : : [2] TransformValidation +// : . : .12|=====| . : . : . : . : . : [2] FormatDiscriminator +// +-----------------------+-----------------------+ +// |15 .. 8|7 .. 0| +// +-----------------------+-----------------------+ +// +namespace field_layout { +// clang-format off + +// Field kind (3 bits): +// These values broadly represent a wire type and an in-memory storage class. +enum FieldKind : uint16_t { + kFkShift = 0, + kFkBits = 3, + kFkMask = ((1 << kFkBits) - 1) << kFkShift, + + kFkNone = 0, + kFkVarint, // WT=0 rep=8,32,64 bits + kFkPackedVarint, // WT=2 rep=8,32,64 bits + kFkFixed, // WT=1,5 rep=32,64 bits + kFkPackedFixed, // WT=2 rep=32,64 bits + kFkString, // WT=2 rep=various + kFkMessage, // WT=2,3,4 rep=MessageLite* + // Maps are a special case of Message, but use different parsing logic. + kFkMap, // WT=2 rep=Map(Lite) +}; + +static_assert(kFkMap < (1 << kFkBits), "too many types"); + +// Cardinality (2 bits): +// These values determine how many values a field can have and its presence. +// Packed fields are represented in FieldType. +enum Cardinality : uint16_t { + kFcShift = kFkShift + kFkBits, + kFcBits = 2, + kFcMask = ((1 << kFcBits) - 1) << kFcShift, + + kFcSingular = 0, + kFcOptional = 1 << kFcShift, + kFcRepeated = 2 << kFcShift, + kFcOneof = 3 << kFcShift, +}; + +// Field representation (3 bits): +// These values are the specific refinements of storage classes in FieldType. +enum FieldRep : uint16_t { + kRepShift = kFcShift + kFcBits, + kRepBits = 3, + kRepMask = ((1 << kRepBits) - 1) << kRepShift, + + // Numeric types (used for optional and repeated fields): + kRep8Bits = 0, + kRep32Bits = 2 << kRepShift, + kRep64Bits = 3 << kRepShift, + // String types: + kRepAString = 0, // ArenaStringPtr + kRepIString = 1 << kRepShift, // InlinedString + kRepCord = 2 << kRepShift, // absl::Cord + kRepSPiece = 3 << kRepShift, // StringPieceField + kRepSString = 4 << kRepShift, // std::string* + // Message types (WT=2 unless otherwise noted): + kRepMessage = 0, // MessageLite* + kRepGroup = 1 << kRepShift, // MessageLite* (WT=3,4) + kRepLazy = 2 << kRepShift, // LazyField* + kRepIWeak = 3 << kRepShift, // ImplicitWeak +}; + +// Transform/validation (2 bits): +// These values determine transforms or validation to/from wire format. +enum TransformValidation : uint16_t { + kTvShift = kRepShift + kRepBits, + kTvBits = 2, + kTvMask = ((1 << kTvBits) - 1) << kTvShift, + + // Varint fields: + kTvZigZag = 1 << kTvShift, + kTvEnum = 2 << kTvShift, // validate using generated _IsValid() + kTvRange = 3 << kTvShift, // validate using FieldAux::enum_range + // String fields: + kTvUtf8Debug = 1 << kTvShift, // proto2 + kTvUtf8 = 2 << kTvShift, // proto3 +}; + +static_assert((kTvEnum & kTvRange) != 0, + "enum validation types must share a bit"); +static_assert((kTvEnum & kTvRange & kTvZigZag) == 0, + "zigzag encoding is not enum validation"); + +// Format discriminators (2 bits): +enum FormatDiscriminator : uint16_t { + kFmtShift = kTvShift + kTvBits, + kFmtBits = 2, + kFmtMask = ((1 << kFmtBits) - 1) << kFmtShift, + + // Numeric: + kFmtUnsigned = 1 << kFmtShift, // fixed, varint + kFmtSigned = 2 << kFmtShift, // fixed, varint + kFmtFloating = 3 << kFmtShift, // fixed + kFmtEnum = 3 << kFmtShift, // varint + // Strings: + kFmtUtf8 = 1 << kFmtShift, // string (proto3, enforce_utf8=true) + kFmtUtf8Escape = 2 << kFmtShift, // string (proto2, enforce_utf8=false) + // Bytes: + kFmtArray = 1 << kFmtShift, // bytes + // Messages: + kFmtShow = 1 << kFmtShift, // message, map +}; + +// Update this assertion (and comments above) when adding or removing bits: +static_assert(kFmtShift + kFmtBits == 12, "number of bits changed"); + +// This assertion should not change unless the storage width changes: +static_assert(kFmtShift + kFmtBits <= 16, "too many bits"); + +// Convenience aliases (16 bits, with format): +enum FieldType : uint16_t { + // Numeric types: + kBool = kFkVarint | kRep8Bits, + + kFixed32 = kFkFixed | kRep32Bits | kFmtUnsigned, + kUInt32 = kFkVarint | kRep32Bits | kFmtUnsigned, + kSFixed32 = kFkFixed | kRep32Bits | kFmtSigned, + kInt32 = kFkVarint | kRep32Bits | kFmtSigned, + kSInt32 = kFkVarint | kRep32Bits | kFmtSigned | kTvZigZag, + kFloat = kFkFixed | kRep32Bits | kFmtFloating, + kEnum = kFkVarint | kRep32Bits | kFmtEnum | kTvEnum, + kEnumRange = kFkVarint | kRep32Bits | kFmtEnum | kTvRange, + kOpenEnum = kFkVarint | kRep32Bits | kFmtEnum, + + kFixed64 = kFkFixed | kRep64Bits | kFmtUnsigned, + kUInt64 = kFkVarint | kRep64Bits | kFmtUnsigned, + kSFixed64 = kFkFixed | kRep64Bits | kFmtSigned, + kInt64 = kFkVarint | kRep64Bits | kFmtSigned, + kSInt64 = kFkVarint | kRep64Bits | kFmtSigned | kTvZigZag, + kDouble = kFkFixed | kRep64Bits | kFmtFloating, + + kPackedBool = kFkPackedVarint | kRep8Bits, + + kPackedFixed32 = kFkPackedFixed | kRep32Bits | kFmtUnsigned, + kPackedUInt32 = kFkPackedVarint | kRep32Bits | kFmtUnsigned, + kPackedSFixed32 = kFkPackedFixed | kRep32Bits | kFmtSigned, + kPackedInt32 = kFkPackedVarint | kRep32Bits | kFmtSigned, + kPackedSInt32 = kFkPackedVarint | kRep32Bits | kFmtSigned | kTvZigZag, + kPackedFloat = kFkPackedFixed | kRep32Bits | kFmtFloating, + kPackedEnum = kFkPackedVarint | kRep32Bits | kFmtEnum | kTvEnum, + kPackedEnumRange = kFkPackedVarint | kRep32Bits | kFmtEnum | kTvRange, + kPackedOpenEnum = kFkPackedVarint | kRep32Bits | kFmtEnum, + + kPackedFixed64 = kFkPackedFixed | kRep64Bits | kFmtUnsigned, + kPackedUInt64 = kFkPackedVarint | kRep64Bits | kFmtUnsigned, + kPackedSFixed64 = kFkPackedFixed | kRep64Bits | kFmtSigned, + kPackedInt64 = kFkPackedVarint | kRep64Bits | kFmtSigned, + kPackedSInt64 = kFkPackedVarint | kRep64Bits | kFmtSigned | kTvZigZag, + kPackedDouble = kFkPackedFixed | kRep64Bits | kFmtFloating, + + // String types: + kBytes = kFkString | kFmtArray, + kRawString = kFkString | kFmtUtf8 | kTvUtf8Debug, + kUtf8String = kFkString | kFmtUtf8 | kTvUtf8, + + // Message types: + kMessage = kFkMessage, + + // Map types: + kMap = kFkMap, +}; + +// clang-format on +} // namespace field_layout + // PROTOBUF_TC_PARAM_DECL are the parameters for tailcall functions, it is // defined in port_def.inc. // @@ -63,36 +246,6 @@ namespace internal { // PROTOBUF_TC_PARAM_PASS passes values to match PROTOBUF_TC_PARAM_DECL. #define PROTOBUF_TC_PARAM_PASS msg, ptr, ctx, table, hasbits, data -// PROTOBUF_TC_PARSE_* decide which function is used to parse message-typed -// fields. The guard macros are defined in port_def.inc. -#if PROTOBUF_TC_STATIC_PARSE_SINGULAR1 -#define PROTOBUF_TC_PARSE_SINGULAR1(MESSAGE) MESSAGE::Tct_ParseS1 -#else -#define PROTOBUF_TC_PARSE_SINGULAR1(MESSAGE) \ - ::google::protobuf::internal::TcParser::SingularParseMessage -#endif // PROTOBUF_TC_STATIC_PARSE_SINGULAR1 - -#if PROTOBUF_TC_STATIC_PARSE_SINGULAR2 -#define PROTOBUF_TC_PARSE_SINGULAR2(MESSAGE) MESSAGE::Tct_ParseS2 -#else -#define PROTOBUF_TC_PARSE_SINGULAR2(MESSAGE) \ - ::google::protobuf::internal::TcParser::SingularParseMessage -#endif // PROTOBUF_TC_STATIC_PARSE_SINGULAR2 - -#if PROTOBUF_TC_STATIC_PARSE_REPEATED1 -#define PROTOBUF_TC_PARSE_REPEATED1(MESSAGE) MESSAGE::Tct_ParseR1 -#else -#define PROTOBUF_TC_PARSE_REPEATED1(MESSAGE) \ - ::google::protobuf::internal::TcParser::RepeatedParseMessage -#endif // PROTOBUF_TC_STATIC_PARSE_REPEATED1 - -#if PROTOBUF_TC_STATIC_PARSE_REPEATED2 -#define PROTOBUF_TC_PARSE_REPEATED2(MESSAGE) MESSAGE::Tct_ParseR2 -#else -#define PROTOBUF_TC_PARSE_REPEATED2(MESSAGE) \ - ::google::protobuf::internal::TcParser::RepeatedParseMessage -#endif // PROTOBUF_TC_STATIC_PARSE_REPEATED2 - #ifndef NDEBUG template #ifndef _MSC_VER @@ -107,105 +260,120 @@ extern template void AlignFail<8>(uintptr_t); #endif // TcParser implements most of the parsing logic for tailcall tables. -class TcParser final { +class PROTOBUF_EXPORT TcParser final { public: static const char* GenericFallback(PROTOBUF_TC_PARAM_DECL); static const char* GenericFallbackLite(PROTOBUF_TC_PARAM_DECL); - // Dispatch to the designated parse function - inline PROTOBUF_ALWAYS_INLINE static const char* TagDispatch( - PROTOBUF_TC_PARAM_DECL) { - const auto coded_tag = UnalignedLoad(ptr); - const size_t idx = coded_tag & table->fast_idx_mask; - PROTOBUF_ASSUME((idx & 7) == 0); - auto* fast_entry = table->fast_entry(idx >> 3); - data = fast_entry->bits; - data.data ^= coded_tag; - PROTOBUF_MUSTTAIL return fast_entry->target(PROTOBUF_TC_PARAM_PASS); - } - - // We can only safely call from field to next field if the call is optimized - // to a proper tail call. Otherwise we blow through stack. Clang and gcc - // reliably do this optimization in opt mode, but do not perform this in debug - // mode. Luckily the structure of the algorithm is such that it's always - // possible to just return and use the enclosing parse loop as a trampoline. - static const char* ToTagDispatch(PROTOBUF_TC_PARAM_DECL) { - constexpr bool always_return = !PROTOBUF_TAILCALL; - if (always_return || !ctx->DataAvailable(ptr)) { - PROTOBUF_MUSTTAIL return ToParseLoop(PROTOBUF_TC_PARAM_PASS); - } - PROTOBUF_MUSTTAIL return TagDispatch(PROTOBUF_TC_PARAM_PASS); - } - static const char* ParseLoop(MessageLite* msg, const char* ptr, ParseContext* ctx, - const TcParseTableBase* table) { - ScopedArenaSwap saved(msg, ctx); - const uint32_t has_bits_offset = table->has_bits_offset; - while (!ctx->Done(&ptr)) { - uint64_t hasbits = 0; - if (has_bits_offset) hasbits = RefAt(msg, has_bits_offset); - ptr = TagDispatch(msg, ptr, ctx, table, hasbits, {}); - if (ptr == nullptr) break; - if (ctx->LastTag() != 1) break; // Ended on terminating tag - } - return ptr; - } + const TcParseTableBase* table); - template - PROTOBUF_NOINLINE static const char* SingularParseMessage( - PROTOBUF_TC_PARAM_DECL) { - if (PROTOBUF_PREDICT_FALSE(data.coded_tag() != 0)) { - return table->fallback(PROTOBUF_TC_PARAM_PASS); - } - ptr += sizeof(TagType); - hasbits |= (uint64_t{1} << data.hasbit_idx()); - auto& field = RefAt(msg, data.offset()); - if (field == nullptr) { - auto arena = ctx->data().arena; - if (Arena::is_arena_constructable::value) { - field = Arena::CreateMessage(arena); - } else { - field = Arena::Create(arena); - } - } - SyncHasbits(msg, hasbits, table); - return ctx->ParseMessage(field, ptr); - } + // Functions referenced by generated fast tables (numeric types): + // F: fixed V: varint Z: zigzag + // 8/32/64: storage type width (bits) + // S: singular R: repeated P: packed + // 1/2: tag length (bytes) - template - PROTOBUF_NOINLINE static const char* RepeatedParseMessage( - PROTOBUF_TC_PARAM_DECL) { - if (PROTOBUF_PREDICT_FALSE(data.coded_tag() != 0)) { - return table->fallback(PROTOBUF_TC_PARAM_PASS); - } - ptr += sizeof(TagType); - auto& field = RefAt>(msg, data.offset()); - SyncHasbits(msg, hasbits, table); - ptr = ctx->ParseMessage(field.Add(), ptr); - return ptr; - } + // Fixed: + static const char* FastF32S1(PROTOBUF_TC_PARAM_DECL); + static const char* FastF32S2(PROTOBUF_TC_PARAM_DECL); + static const char* FastF32R1(PROTOBUF_TC_PARAM_DECL); + static const char* FastF32R2(PROTOBUF_TC_PARAM_DECL); + static const char* FastF32P1(PROTOBUF_TC_PARAM_DECL); + static const char* FastF32P2(PROTOBUF_TC_PARAM_DECL); + static const char* FastF64S1(PROTOBUF_TC_PARAM_DECL); + static const char* FastF64S2(PROTOBUF_TC_PARAM_DECL); + static const char* FastF64R1(PROTOBUF_TC_PARAM_DECL); + static const char* FastF64R2(PROTOBUF_TC_PARAM_DECL); + static const char* FastF64P1(PROTOBUF_TC_PARAM_DECL); + static const char* FastF64P2(PROTOBUF_TC_PARAM_DECL); - template - static const char* SingularFixed(PROTOBUF_TC_PARAM_DECL); - template - static const char* RepeatedFixed(PROTOBUF_TC_PARAM_DECL); - template - static const char* PackedFixed(PROTOBUF_TC_PARAM_DECL); + // Varint: + static const char* FastV8S1(PROTOBUF_TC_PARAM_DECL); + static const char* FastV8S2(PROTOBUF_TC_PARAM_DECL); + static const char* FastV8R1(PROTOBUF_TC_PARAM_DECL); + static const char* FastV8R2(PROTOBUF_TC_PARAM_DECL); + static const char* FastV8P1(PROTOBUF_TC_PARAM_DECL); + static const char* FastV8P2(PROTOBUF_TC_PARAM_DECL); + static const char* FastV32S1(PROTOBUF_TC_PARAM_DECL); + static const char* FastV32S2(PROTOBUF_TC_PARAM_DECL); + static const char* FastV32R1(PROTOBUF_TC_PARAM_DECL); + static const char* FastV32R2(PROTOBUF_TC_PARAM_DECL); + static const char* FastV32P1(PROTOBUF_TC_PARAM_DECL); + static const char* FastV32P2(PROTOBUF_TC_PARAM_DECL); + static const char* FastV64S1(PROTOBUF_TC_PARAM_DECL); + static const char* FastV64S2(PROTOBUF_TC_PARAM_DECL); + static const char* FastV64R1(PROTOBUF_TC_PARAM_DECL); + static const char* FastV64R2(PROTOBUF_TC_PARAM_DECL); + static const char* FastV64P1(PROTOBUF_TC_PARAM_DECL); + static const char* FastV64P2(PROTOBUF_TC_PARAM_DECL); - enum VarintDecode { kNoConversion = 0, kZigZag = 1 }; - template - static const char* SingularVarint(PROTOBUF_TC_PARAM_DECL); - template - static const char* RepeatedVarint(PROTOBUF_TC_PARAM_DECL); - template - static const char* PackedVarint(PROTOBUF_TC_PARAM_DECL); + // Varint (with zigzag): + static const char* FastZ32S1(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ32S2(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ32R1(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ32R2(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ32P1(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ32P2(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ64S1(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ64S2(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ64R1(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ64R2(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ64P1(PROTOBUF_TC_PARAM_DECL); + static const char* FastZ64P2(PROTOBUF_TC_PARAM_DECL); - enum Utf8Type { kNoUtf8 = 0, kUtf8 = 1, kUtf8ValidateOnly = 2 }; - template - static const char* SingularString(PROTOBUF_TC_PARAM_DECL); - template - static const char* RepeatedString(PROTOBUF_TC_PARAM_DECL); + // Functions referenced by generated fast tables (closed enum): + // E: closed enum (N.B.: open enums use V32, above) + // r: enum range v: enum validator (_IsValid function) + // S: singular R: repeated + // 1/2: tag length (bytes) + static const char* FastErS1(PROTOBUF_TC_PARAM_DECL); + static const char* FastErS2(PROTOBUF_TC_PARAM_DECL); + static const char* FastErR1(PROTOBUF_TC_PARAM_DECL); + static const char* FastErR2(PROTOBUF_TC_PARAM_DECL); + static const char* FastEvS1(PROTOBUF_TC_PARAM_DECL); + static const char* FastEvS2(PROTOBUF_TC_PARAM_DECL); + static const char* FastEvR1(PROTOBUF_TC_PARAM_DECL); + static const char* FastEvR2(PROTOBUF_TC_PARAM_DECL); + + // Functions referenced by generated fast tables (string types): + // B: bytes S: string U: UTF-8 string + // (empty): ArenaStringPtr i: InlinedString + // S: singular R: repeated + // 1/2: tag length (bytes) + static const char* FastBS1(PROTOBUF_TC_PARAM_DECL); + static const char* FastBS2(PROTOBUF_TC_PARAM_DECL); + static const char* FastBR1(PROTOBUF_TC_PARAM_DECL); + static const char* FastBR2(PROTOBUF_TC_PARAM_DECL); + static const char* FastSS1(PROTOBUF_TC_PARAM_DECL); + static const char* FastSS2(PROTOBUF_TC_PARAM_DECL); + static const char* FastSR1(PROTOBUF_TC_PARAM_DECL); + static const char* FastSR2(PROTOBUF_TC_PARAM_DECL); + static const char* FastUS1(PROTOBUF_TC_PARAM_DECL); + static const char* FastUS2(PROTOBUF_TC_PARAM_DECL); + static const char* FastUR1(PROTOBUF_TC_PARAM_DECL); + static const char* FastUR2(PROTOBUF_TC_PARAM_DECL); + + static const char* FastBiS1(PROTOBUF_TC_PARAM_DECL); + static const char* FastBiS2(PROTOBUF_TC_PARAM_DECL); + static const char* FastSiS1(PROTOBUF_TC_PARAM_DECL); + static const char* FastSiS2(PROTOBUF_TC_PARAM_DECL); + static const char* FastUiS1(PROTOBUF_TC_PARAM_DECL); + static const char* FastUiS2(PROTOBUF_TC_PARAM_DECL); + + // Functions referenced by generated fast tables (message types): + // M: message G: group + // S: singular R: repeated + // 1/2: tag length (bytes) + static const char* FastMS1(PROTOBUF_TC_PARAM_DECL); + static const char* FastMS2(PROTOBUF_TC_PARAM_DECL); + static const char* FastMR1(PROTOBUF_TC_PARAM_DECL); + static const char* FastMR2(PROTOBUF_TC_PARAM_DECL); + static const char* FastGS1(PROTOBUF_TC_PARAM_DECL); + static const char* FastGS2(PROTOBUF_TC_PARAM_DECL); + static const char* FastGR1(PROTOBUF_TC_PARAM_DECL); + static const char* FastGR2(PROTOBUF_TC_PARAM_DECL); template static inline T& RefAt(void* x, size_t offset) { @@ -219,6 +387,45 @@ class TcParser final { return *target; } + template + static inline const T& RefAt(const void* x, size_t offset) { + const T* target = + reinterpret_cast(static_cast(x) + offset); +#ifndef NDEBUG + if (PROTOBUF_PREDICT_FALSE( + reinterpret_cast(target) % alignof(T) != 0)) { + AlignFail(reinterpret_cast(target)); + } +#endif + return *target; + } + + template + static inline T ReadAt(const void* x, size_t offset) { + T out; + memcpy(&out, static_cast(x) + offset, sizeof(T)); + return out; + } + + // Mini parsing: + // + // This function parses a field from incoming data based on metadata stored in + // the message definition. If the field is not defined in the message, it is + // stored in either the ExtensionSet (if applicable) or the UnknownFieldSet. + // + // NOTE: Currently, this function only calls the table-level fallback + // function, so it should only be called as the fallback from fast table + // parsing. + static const char* MiniParse(PROTOBUF_TC_PARAM_DECL); + + private: + friend class GeneratedTcTableLiteTest; + + template + static inline const char* SingularParseMessageAuxImpl(PROTOBUF_TC_PARAM_DECL); + template + static inline const char* RepeatedParseMessageAuxImpl(PROTOBUF_TC_PARAM_DECL); + static inline PROTOBUF_ALWAYS_INLINE void SyncHasbits( MessageLite* msg, uint64_t hasbits, const TcParseTableBase* table) { const uint32_t has_bits_offset = table->has_bits_offset; @@ -229,37 +436,14 @@ class TcParser final { } } - protected: - static inline PROTOBUF_ALWAYS_INLINE const char* ToParseLoop( - PROTOBUF_TC_PARAM_DECL) { - (void)data; - (void)ctx; - SyncHasbits(msg, hasbits, table); - return ptr; - } + static const char* TagDispatch(PROTOBUF_TC_PARAM_DECL); + static const char* ToTagDispatch(PROTOBUF_TC_PARAM_DECL); + static const char* ToParseLoop(PROTOBUF_TC_PARAM_DECL); + static const char* Error(PROTOBUF_TC_PARAM_DECL); - static inline PROTOBUF_ALWAYS_INLINE const char* Error( - PROTOBUF_TC_PARAM_DECL) { - (void)data; - (void)ctx; - (void)ptr; - SyncHasbits(msg, hasbits, table); - return nullptr; - } + static const char* FastUnknownEnumFallback(PROTOBUF_TC_PARAM_DECL); - class ScopedArenaSwap final { - public: - ScopedArenaSwap(MessageLite* msg, ParseContext* ctx) - : ctx_(ctx), saved_(ctx->data().arena) { - ctx_->data().arena = msg->GetArenaForAllocation(); - } - ScopedArenaSwap(const ScopedArenaSwap&) = delete; - ~ScopedArenaSwap() { ctx_->data().arena = saved_; } - - private: - ParseContext* const ctx_; - Arena* const saved_; - }; + class ScopedArenaSwap; template static const char* GenericFallbackImpl(PROTOBUF_TC_PARAM_DECL) { @@ -267,14 +451,12 @@ class TcParser final { if (PROTOBUF_PREDICT_FALSE(!(x))) return nullptr /* NOLINT */ SyncHasbits(msg, hasbits, table); - uint32_t tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); CHK_(ptr); + uint32_t tag = data.tag(); if ((tag & 7) == WireFormatLite::WIRETYPE_END_GROUP || tag == 0) { ctx->SetLastTag(tag); return ptr; } - (void)data; uint32_t num = tag >> 3; if (table->extension_range_low <= num && num <= table->extension_range_high) { @@ -288,10 +470,79 @@ class TcParser final { ptr, ctx); #undef CHK_ } -}; -// Declare helper functions: -#include + // Note: `inline` is needed on template function declarations below to avoid + // -Wattributes diagnostic in GCC. + + // Implementations for fast fixed field parsing functions: + template + static inline const char* SingularFixed(PROTOBUF_TC_PARAM_DECL); + template + static inline const char* RepeatedFixed(PROTOBUF_TC_PARAM_DECL); + template + static inline const char* PackedFixed(PROTOBUF_TC_PARAM_DECL); + + // Implementations for fast varint field parsing functions: + template + static inline const char* SingularVarint(PROTOBUF_TC_PARAM_DECL); + template + static inline const char* RepeatedVarint(PROTOBUF_TC_PARAM_DECL); + template + static inline const char* PackedVarint(PROTOBUF_TC_PARAM_DECL); + + // Helper for ints > 127: + template + static const char* SingularVarBigint(PROTOBUF_TC_PARAM_DECL); + + // Implementations for fast enum field parsing functions: + template + static inline const char* SingularEnum(PROTOBUF_TC_PARAM_DECL); + template + static inline const char* RepeatedEnum(PROTOBUF_TC_PARAM_DECL); + + // Implementations for fast string field parsing functions: + enum Utf8Type { kNoUtf8 = 0, kUtf8 = 1, kUtf8ValidateOnly = 2 }; + template + static inline const char* SingularString(PROTOBUF_TC_PARAM_DECL); + template + static inline const char* RepeatedString(PROTOBUF_TC_PARAM_DECL); + + // Mini field lookup: + static const TcParseTableBase::FieldEntry* FindFieldEntry( + const TcParseTableBase* table, uint32_t field_num); + static StringPiece MessageName(const TcParseTableBase* table); + static StringPiece FieldName(const TcParseTableBase* table, + const TcParseTableBase::FieldEntry*); + static bool ChangeOneof(const TcParseTableBase* table, + const TcParseTableBase::FieldEntry& entry, + uint32_t field_num, ParseContext* ctx, + MessageLite* msg); + + // UTF-8 validation: + static void ReportFastUtf8Error(uint32_t decoded_tag, + const TcParseTableBase* table); + static bool MpVerifyUtf8(StringPiece wire_bytes, + const TcParseTableBase* table, + const TcParseTableBase::FieldEntry& entry, + uint16_t xform_val); + + // For FindFieldEntry tests: + friend class FindFieldEntryTest; + static constexpr const uint32_t kMtSmallScanSize = 4; + + // Mini parsing: + static const char* MpVarint(PROTOBUF_TC_PARAM_DECL); + static const char* MpRepeatedVarint(PROTOBUF_TC_PARAM_DECL); + static const char* MpPackedVarint(PROTOBUF_TC_PARAM_DECL); + static const char* MpFixed(PROTOBUF_TC_PARAM_DECL); + static const char* MpRepeatedFixed(PROTOBUF_TC_PARAM_DECL); + static const char* MpPackedFixed(PROTOBUF_TC_PARAM_DECL); + static const char* MpString(PROTOBUF_TC_PARAM_DECL); + static const char* MpRepeatedString(PROTOBUF_TC_PARAM_DECL); + static const char* MpMessage(PROTOBUF_TC_PARAM_DECL); + static const char* MpRepeatedMessage(PROTOBUF_TC_PARAM_DECL); + static const char* MpMap(PROTOBUF_TC_PARAM_DECL); +}; } // namespace internal } // namespace protobuf diff --git a/windows/include/google/protobuf/generated_message_tctable_impl.inc b/windows/include/google/protobuf/generated_message_tctable_impl.inc deleted file mode 100644 index a6831b53f..000000000 --- a/windows/include/google/protobuf/generated_message_tctable_impl.inc +++ /dev/null @@ -1,92 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// clang-format off -#ifdef PROTOBUF_TCT_SOURCE -#define PROTOBUF_TCT_EXTERN -#else -#define PROTOBUF_TCT_EXTERN extern -#endif -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedFixed(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::PackedVarint(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::SingularString(PROTOBUF_TC_PARAM_DECL); -PROTOBUF_TCT_EXTERN template const char* TcParser::RepeatedString(PROTOBUF_TC_PARAM_DECL); -#undef PROTOBUF_TCT_EXTERN -// clang-format on diff --git a/windows/include/google/protobuf/generated_message_util.h b/windows/include/google/protobuf/generated_message_util.h index 336234c96..71d15cdeb 100644 --- a/windows/include/google/protobuf/generated_message_util.h +++ b/windows/include/google/protobuf/generated_message_util.h @@ -46,17 +46,18 @@ #include #include +#include // Add direct dep on port for pb.cc +#include +#include #include #include #include #include -#include // Add direct dep on port for pb.cc -#include #include #include -#include #include +// Must be included last. #include #ifdef SWIG diff --git a/windows/include/google/protobuf/has_bits.h b/windows/include/google/protobuf/has_bits.h index acbca689e..f8a45879f 100644 --- a/windows/include/google/protobuf/has_bits.h +++ b/windows/include/google/protobuf/has_bits.h @@ -34,6 +34,7 @@ #include #include +// Must be included last. #include #ifdef SWIG diff --git a/windows/include/google/protobuf/implicit_weak_message.h b/windows/include/google/protobuf/implicit_weak_message.h index 5db8b9ca4..b894ab480 100644 --- a/windows/include/google/protobuf/implicit_weak_message.h +++ b/windows/include/google/protobuf/implicit_weak_message.h @@ -42,6 +42,7 @@ #error "You cannot SWIG proto headers" #endif +// Must be included last. #include // This file is logically internal-only and should only be used by protobuf @@ -56,8 +57,17 @@ namespace internal { // message type does not get linked into the binary. class PROTOBUF_EXPORT ImplicitWeakMessage : public MessageLite { public: - ImplicitWeakMessage() {} - explicit ImplicitWeakMessage(Arena* arena) : MessageLite(arena) {} + ImplicitWeakMessage() : data_(new std::string) {} + explicit constexpr ImplicitWeakMessage(ConstantInitialized) + : data_(nullptr) {} + explicit ImplicitWeakMessage(Arena* arena) + : MessageLite(arena), data_(new std::string) {} + + ~ImplicitWeakMessage() override { + // data_ will be null in the default instance, but we can safely call delete + // here because the default instance will never be destroyed. + delete data_; + } static const ImplicitWeakMessage* default_instance(); @@ -67,33 +77,50 @@ class PROTOBUF_EXPORT ImplicitWeakMessage : public MessageLite { return Arena::CreateMessage(arena); } - void Clear() override { data_.clear(); } + void Clear() override { data_->clear(); } bool IsInitialized() const override { return true; } void CheckTypeAndMergeFrom(const MessageLite& other) override { - data_.append(static_cast(other).data_); + const std::string* other_data = + static_cast(other).data_; + if (other_data != nullptr) { + data_->append(*other_data); + } } const char* _InternalParse(const char* ptr, ParseContext* ctx) final; - size_t ByteSizeLong() const override { return data_.size(); } + size_t ByteSizeLong() const override { + return data_ == nullptr ? 0 : data_->size(); + } uint8_t* _InternalSerialize(uint8_t* target, io::EpsCopyOutputStream* stream) const final { - return stream->WriteRaw(data_.data(), static_cast(data_.size()), + if (data_ == nullptr) { + return target; + } + return stream->WriteRaw(data_->data(), static_cast(data_->size()), target); } - int GetCachedSize() const override { return static_cast(data_.size()); } + int GetCachedSize() const override { + return data_ == nullptr ? 0 : static_cast(data_->size()); + } typedef void InternalArenaConstructable_; private: - std::string data_; + // This std::string is allocated on the heap, but we use a raw pointer so that + // the default instance can be constant-initialized. In the const methods, we + // have to handle the possibility of data_ being null. + std::string* data_; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImplicitWeakMessage); }; +struct ImplicitWeakMessageDefaultType; +extern ImplicitWeakMessageDefaultType implicit_weak_message_default_instance; + // A type handler for use with implicit weak repeated message fields. template class ImplicitWeakTypeHandler { diff --git a/windows/include/google/protobuf/inlined_string_field.h b/windows/include/google/protobuf/inlined_string_field.h index 1fe639f06..79e37d414 100644 --- a/windows/include/google/protobuf/inlined_string_field.h +++ b/windows/include/google/protobuf/inlined_string_field.h @@ -36,10 +36,10 @@ #include #include -#include -#include #include #include +#include +#include // Must be included last. #include @@ -130,60 +130,45 @@ class PROTOBUF_EXPORT InlinedStringField { // `donated == ((donating_states & ~mask) != 0)` // // This method never changes the `donating_states`. - void Set(const std::string* default_value, ConstStringParam value, - Arena* arena, bool donated, uint32_t* /*donating_states*/, - uint32_t /*mask*/) { - (void)arena; - (void)donated; - SetNoArena(default_value, value); - } + void Set(ConstStringParam value, Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, MessageLite* msg); // Rvalue Set. If this field is donated, this method will undonate this field // by mutating the `donating_states` according to `mask`. - void Set(const std::string* default_value, std::string&& value, Arena* arena, - bool donated, uint32_t* donating_states, uint32_t mask); + void Set(std::string&& value, Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, MessageLite* msg); - template - void Set(FirstParam p1, const char* str, ::google::protobuf::Arena* arena, bool donated, - uint32_t* donating_states, uint32_t mask) { - Set(p1, ConstStringParam(str), arena, donated, donating_states, mask); - } + void Set(const char* str, ::google::protobuf::Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, MessageLite* msg); - template - void Set(FirstParam p1, const char* str, size_t size, ::google::protobuf::Arena* arena, - bool donated, uint32_t* donating_states, uint32_t mask) { - ConstStringParam sp{str, size}; // for string_view and `const string &` - Set(p1, sp, arena, donated, donating_states, mask); - } + void Set(const char* str, size_t size, ::google::protobuf::Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, MessageLite* msg); - template - void Set(FirstParam p1, - std::reference_wrapper const_string_ref, + template + void Set(std::reference_wrapper const_string_ref, ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states, - uint32_t mask) { - Set(p1, const_string_ref.get(), arena, donated, donating_states, mask); - } + uint32_t mask, MessageLite* msg); - template - void SetBytes(FirstParam p1, SecondParam&& p2, ::google::protobuf::Arena* arena, - bool donated, uint32_t* donating_states, uint32_t mask) { - Set(p1, static_cast(p2), arena, donated, donating_states, - mask); - } + void SetBytes(ConstStringParam value, Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, MessageLite* msg); - template - void SetBytes(FirstParam p1, const void* str, size_t size, + void SetBytes(std::string&& value, Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, MessageLite* msg); + + void SetBytes(const char* str, ::google::protobuf::Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, MessageLite* msg); + + void SetBytes(const void* p, size_t size, ::google::protobuf::Arena* arena, + bool donated, uint32_t* donating_states, uint32_t mask, + MessageLite* msg); + + template + void SetBytes(std::reference_wrapper const_string_ref, ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states, - uint32_t mask) { - // Must work whether ConstStringParam is string_view or `const string &` - ConstStringParam sp{static_cast(str), size}; - Set(p1, sp, arena, donated, donating_states, mask); - } + uint32_t mask, MessageLite* msg); - PROTOBUF_NDEBUG_INLINE void SetNoArena(const std::string* default_value, - StringPiece value); - PROTOBUF_NDEBUG_INLINE void SetNoArena(const std::string* default_value, - std::string&& value); + PROTOBUF_NDEBUG_INLINE void SetNoArena(StringPiece value); + PROTOBUF_NDEBUG_INLINE void SetNoArena(std::string&& value); // Basic accessors. PROTOBUF_NDEBUG_INLINE const std::string& Get() const { return GetNoArena(); } @@ -193,20 +178,17 @@ class PROTOBUF_EXPORT InlinedStringField { // field is donated, this method undonates this field by mutating the // `donating_states` according to `mask`, and copies the content of the // original string to the returning string. + std::string* Mutable(Arena* arena, bool donated, uint32_t* donating_states, + uint32_t mask, MessageLite* msg); std::string* Mutable(const LazyString& default_value, Arena* arena, - bool donated, uint32_t* donating_states, uint32_t mask); - std::string* Mutable(ArenaStringPtr::EmptyDefault, Arena* arena, bool donated, - uint32_t* donating_states, uint32_t mask); + bool donated, uint32_t* donating_states, uint32_t mask, + MessageLite* msg); - // Release returns a std::string* instance that is heap-allocated and is not - // Own()'d by any arena. If the field is not set, this returns nullptr. The - // caller retains ownership. Clears this field back to nullptr state. Used to - // implement release_() methods on generated classes. - PROTOBUF_NODISCARD std::string* Release(const std::string* default_value, - Arena* arena, bool donated); - PROTOBUF_NODISCARD std::string* ReleaseNonDefault( - const std::string* default_value, Arena* arena); - std::string* ReleaseNonDefaultNoArena(const std::string* default_value); + // Mutable(nullptr_t) is an overload to explicitly support Mutable(nullptr) + // calls used by the internal parser logic. This provides API equivalence with + // ArenaStringPtr, while still protecting against calls with arena pointers. + std::string* Mutable(std::nullptr_t); + std::string* MutableNoCopy(std::nullptr_t); // Takes a std::string that is heap-allocated, and takes ownership. The // std::string's destructor is registered with the arena. Used to implement @@ -216,20 +198,133 @@ class PROTOBUF_EXPORT InlinedStringField { // `donating_states` according to `mask`. void SetAllocated(const std::string* default_value, std::string* value, Arena* arena, bool donated, uint32_t* donating_states, - uint32_t mask); + uint32_t mask, MessageLite* msg); void SetAllocatedNoArena(const std::string* default_value, std::string* value); - // When one of `this` and `from` is donated and the other is not donated, this - // method will undonate the donated one and swap the two heap-allocated - // strings. - PROTOBUF_NDEBUG_INLINE void Swap(InlinedStringField* from, - const std::string* default_value, - Arena* arena, bool donated, - bool from_donated, uint32_t* donating_states, - uint32_t* from_donating_states, - uint32_t mask); + // Release returns a std::string* instance that is heap-allocated and is not + // Own()'d by any arena. If the field is not set, this returns nullptr. The + // caller retains ownership. Clears this field back to nullptr state. Used to + // implement release_() methods on generated classes. + PROTOBUF_NODISCARD std::string* Release(Arena* arena, bool donated); + PROTOBUF_NODISCARD std::string* Release(); + + // -------------------------------------------------------- + // Below functions will be removed in subsequent code change + // -------------------------------------------------------- +#ifdef DEPRECATED_METHODS_TO_BE_DELETED + PROTOBUF_NODISCARD std::string* Release(const std::string*, Arena* arena, + bool donated) { + return Release(arena, donated); + } + + PROTOBUF_NODISCARD std::string* ReleaseNonDefault(const std::string*, + Arena* arena) { + return Release(); + } + + std::string* ReleaseNonDefaultNoArena(const std::string* default_value) { + return Release(); + } + + void Set(const std::string*, ConstStringParam value, Arena* arena, + bool donated, uint32_t* donating_states, uint32_t mask, + MessageLite* msg) { + Set(value, arena, donated, donating_states, mask, msg); + } + + void Set(const std::string*, std::string&& value, Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, MessageLite* msg) { + Set(std::move(value), arena, donated, donating_states, mask, msg); + } + + + template + void Set(FirstParam, const char* str, ::google::protobuf::Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, MessageLite* msg) { + Set(str, arena, donated, donating_states, mask, msg); + } + + template + void Set(FirstParam p1, const char* str, size_t size, ::google::protobuf::Arena* arena, + bool donated, uint32_t* donating_states, uint32_t mask, + MessageLite* msg) { + Set(str, size, arena, donated, donating_states, mask, msg); + } + + template + void Set(FirstParam p1, + std::reference_wrapper const_string_ref, + ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states, + uint32_t mask, MessageLite* msg) { + Set(const_string_ref, arena, donated, donating_states, mask, msg); + } + + void SetBytes(const std::string*, ConstStringParam value, Arena* arena, + bool donated, uint32_t* donating_states, uint32_t mask, + MessageLite* msg) { + Set(value, arena, donated, donating_states, mask, msg); + } + + + void SetBytes(const std::string*, std::string&& value, Arena* arena, + bool donated, uint32_t* donating_states, uint32_t mask, + MessageLite* msg) { + Set(std::move(value), arena, donated, donating_states, mask, msg); + } + + template + void SetBytes(FirstParam p1, const char* str, ::google::protobuf::Arena* arena, + bool donated, uint32_t* donating_states, uint32_t mask, + MessageLite* msg) { + SetBytes(str, arena, donated, donating_states, mask, msg); + } + + template + void SetBytes(FirstParam p1, const void* p, size_t size, + ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states, + uint32_t mask, MessageLite* msg) { + SetBytes(p, size, arena, donated, donating_states, mask, msg); + } + + template + void SetBytes(FirstParam p1, + std::reference_wrapper const_string_ref, + ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states, + uint32_t mask, MessageLite* msg) { + SetBytes(const_string_ref.get(), arena, donated, donating_states, mask, + msg); + } + + void SetNoArena(const std::string*, StringPiece value) { + SetNoArena(value); + } + void SetNoArena(const std::string*, std::string&& value) { + SetNoArena(std::move(value)); + } + + std::string* Mutable(ArenaStringPtr::EmptyDefault, Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, + MessageLite* msg) { + return Mutable(arena, donated, donating_states, mask, msg); + } + + PROTOBUF_NDEBUG_INLINE std::string* MutableNoArenaNoDefault( + const std::string* /*default_value*/) { + return MutableNoCopy(nullptr); + } + +#endif // DEPRECATED_METHODS_TO_BE_DELETED + + // Arena-safety semantics: this is guarded by the logic in + // Swap()/UnsafeArenaSwap() at the message level, so this method is + // 'unsafe' if called directly. + inline PROTOBUF_NDEBUG_INLINE static void InternalSwap( + InlinedStringField* lhs, Arena* lhs_arena, bool lhs_arena_dtor_registered, + MessageLite* lhs_msg, // + InlinedStringField* rhs, Arena* rhs_arena, bool rhs_arena_dtor_registered, + MessageLite* rhs_msg); // Frees storage (if not on an arena). PROTOBUF_NDEBUG_INLINE void Destroy(const std::string* default_value, @@ -254,17 +349,13 @@ class PROTOBUF_EXPORT InlinedStringField { void ClearToDefault(const LazyString& default_value, Arena* arena, bool donated); - // Returns a mutable pointer, but doesn't initialize the string to the - // default value. - PROTOBUF_NDEBUG_INLINE std::string* MutableNoArenaNoDefault( - const std::string* /*default_value*/); - // Generated code / reflection only! Returns a mutable pointer to the string. PROTOBUF_NDEBUG_INLINE std::string* UnsafeMutablePointer(); // InlinedStringField doesn't have things like the `default_value` pointer in // ArenaStringPtr. - bool IsDefault(const std::string* /*default_value*/) const { return false; } + static constexpr bool IsDefault() { return false; } + static constexpr bool IsDefault(const std::string*) { return false; } private: void Destruct() { get_mutable()->~basic_string(); } @@ -275,7 +366,8 @@ class PROTOBUF_EXPORT InlinedStringField { alignas(std::string) char value_[sizeof(std::string)]; std::string* MutableSlow(::google::protobuf::Arena* arena, bool donated, - uint32_t* donating_states, uint32_t mask); + uint32_t* donating_states, uint32_t mask, + MessageLite* msg); // When constructed in an Arena, we want our destructor to be skipped. @@ -297,12 +389,8 @@ inline InlinedStringField::InlinedStringField( new (get_mutable()) std::string(default_value); } -inline InlinedStringField::InlinedStringField(Arena* arena) { - Init(); - if (arena != nullptr) { - arena->OwnDestructor(get_mutable()); - } -} + +inline InlinedStringField::InlinedStringField(Arena* /*arena*/) { Init(); } inline const std::string& InlinedStringField::GetNoArena() const { return *get_const(); @@ -325,56 +413,116 @@ inline void InlinedStringField::DestroyNoArena(const std::string*) { this->~InlinedStringField(); } -inline std::string* InlinedStringField::ReleaseNonDefaultNoArena( - const std::string* /*default_value*/) { - // Currently, inlined string field can't have non empty default. - auto* released = new std::string(); - get_mutable()->swap(*released); - return released; -} - -inline void InlinedStringField::SetNoArena(const std::string* /*default_value*/, - StringPiece value) { +inline void InlinedStringField::SetNoArena(StringPiece value) { get_mutable()->assign(value.data(), value.length()); } -inline void InlinedStringField::SetNoArena(const std::string* /*default_value*/, - std::string&& value) { +inline void InlinedStringField::SetNoArena(std::string&& value) { get_mutable()->assign(std::move(value)); } -inline void InlinedStringField::Swap( - InlinedStringField* from, const std::string* /*default_value*/, - Arena* arena, bool donated, bool from_donated, uint32_t* donating_states, - uint32_t* from_donating_states, uint32_t mask) { +// Caller should make sure rhs_arena allocated rhs, and lhs_arena allocated lhs. +inline PROTOBUF_NDEBUG_INLINE void InlinedStringField::InternalSwap( + InlinedStringField* lhs, Arena* lhs_arena, bool lhs_arena_dtor_registered, + MessageLite* lhs_msg, // + InlinedStringField* rhs, Arena* rhs_arena, bool rhs_arena_dtor_registered, + MessageLite* rhs_msg) { #if GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE - // If one is donated and the other is not, undonate the donated one. - if (donated && !from_donated) { - MutableSlow(arena, donated, donating_states, mask); - } else if (!donated && from_donated) { - from->MutableSlow(arena, from_donated, from_donating_states, mask); + lhs->get_mutable()->swap(*rhs->get_mutable()); + if (!lhs_arena_dtor_registered && rhs_arena_dtor_registered) { + lhs_msg->OnDemandRegisterArenaDtor(lhs_arena); + } else if (lhs_arena_dtor_registered && !rhs_arena_dtor_registered) { + rhs_msg->OnDemandRegisterArenaDtor(rhs_arena); } - // Then, swap the two undonated strings. #else - (void)arena; - (void)donated; - (void)from_donated; - (void)donating_states; - (void)from_donating_states; - (void)mask; + (void)lhs_arena; + (void)rhs_arena; + (void)lhs_arena_dtor_registered; + (void)rhs_arena_dtor_registered; + (void)lhs_msg; + (void)rhs_msg; + lhs->get_mutable()->swap(*rhs->get_mutable()); #endif - get_mutable()->swap(*from->get_mutable()); } -inline std::string* InlinedStringField::MutableNoArenaNoDefault( - const std::string*) { - return get_mutable(); +inline void InlinedStringField::Set(ConstStringParam value, Arena* arena, + bool donated, uint32_t* /*donating_states*/, + uint32_t /*mask*/, MessageLite* /*msg*/) { + (void)arena; + (void)donated; + SetNoArena(value); +} + +inline void InlinedStringField::Set(const char* str, ::google::protobuf::Arena* arena, + bool donated, uint32_t* donating_states, + uint32_t mask, MessageLite* msg) { + Set(ConstStringParam(str), arena, donated, donating_states, mask, msg); +} + +inline void InlinedStringField::Set(const char* str, size_t size, + ::google::protobuf::Arena* arena, bool donated, + uint32_t* donating_states, uint32_t mask, + MessageLite* msg) { + Set(ConstStringParam{str, size}, arena, donated, donating_states, mask, msg); +} + +inline void InlinedStringField::SetBytes(ConstStringParam value, Arena* arena, + bool donated, + uint32_t* donating_states, + uint32_t mask, MessageLite* msg) { + Set(value, arena, donated, donating_states, mask, msg); +} + +inline void InlinedStringField::SetBytes(std::string&& value, Arena* arena, + bool donated, + uint32_t* donating_states, + uint32_t mask, MessageLite* msg) { + Set(std::move(value), arena, donated, donating_states, mask, msg); +} + +inline void InlinedStringField::SetBytes(const char* str, + ::google::protobuf::Arena* arena, bool donated, + uint32_t* donating_states, + uint32_t mask, MessageLite* msg) { + Set(str, arena, donated, donating_states, mask, msg); +} + +inline void InlinedStringField::SetBytes(const void* p, size_t size, + ::google::protobuf::Arena* arena, bool donated, + uint32_t* donating_states, + uint32_t mask, MessageLite* msg) { + Set(static_cast(p), size, arena, donated, donating_states, mask, + msg); +} + +template +inline void InlinedStringField::Set( + std::reference_wrapper const_string_ref, + ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states, + uint32_t mask, MessageLite* msg) { + Set(const_string_ref.get(), arena, donated, donating_states, mask, msg); +} + +template +inline void InlinedStringField::SetBytes( + std::reference_wrapper const_string_ref, + ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states, + uint32_t mask, MessageLite* msg) { + Set(const_string_ref.get(), arena, donated, donating_states, mask, msg); } inline std::string* InlinedStringField::UnsafeMutablePointer() { return get_mutable(); } +inline std::string* InlinedStringField::Mutable(std::nullptr_t) { + return get_mutable(); +} + +inline std::string* InlinedStringField::MutableNoCopy(std::nullptr_t) { + return get_mutable(); +} + } // namespace internal } // namespace protobuf } // namespace google diff --git a/windows/include/google/protobuf/io/coded_stream.h b/windows/include/google/protobuf/io/coded_stream.h index 45963ef86..c8fc994f9 100644 --- a/windows/include/google/protobuf/io/coded_stream.h +++ b/windows/include/google/protobuf/io/coded_stream.h @@ -121,36 +121,13 @@ #include #include -#ifdef _WIN32 -// Assuming windows is always little-endian. -#if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) -#define PROTOBUF_LITTLE_ENDIAN 1 -#endif #if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(__INTEL_COMPILER) // If MSVC has "/RTCc" set, it will complain about truncating casts at // runtime. This file contains some intentional truncating casts. #pragma runtime_checks("c", off) #endif -#else -#ifdef __APPLE__ -#include // __BYTE_ORDER -#elif defined(__FreeBSD__) -#include // __BYTE_ORDER -#elif (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)) -#include // __BYTE_ORDER -#elif defined(_AIX) || defined(__TOS_AIX__) -#include // BYTE_ORDER -#else -#if !defined(__QNX__) -#include // __BYTE_ORDER -#endif -#endif -#if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ - (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)) && \ - !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) -#define PROTOBUF_LITTLE_ENDIAN 1 -#endif -#endif + + #include #include #include @@ -158,6 +135,7 @@ #include +// Must be included last. #include namespace google { @@ -848,6 +826,7 @@ class PROTOBUF_EXPORT EpsCopyOutputStream { bool had_error_ = false; bool aliasing_enabled_ = false; // See EnableAliasing(). bool is_serialization_deterministic_; + bool skip_check_consistency = false; uint8_t* EnsureSpaceFallback(uint8_t* ptr); inline uint8_t* Next(); @@ -955,7 +934,8 @@ class PROTOBUF_EXPORT EpsCopyOutputStream { template uint8_t* WriteRawLittleEndian(const void* data, int size, uint8_t* ptr); -#ifndef PROTOBUF_LITTLE_ENDIAN +#if !defined(PROTOBUF_LITTLE_ENDIAN) || \ + defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) uint8_t* WriteRawLittleEndian32(const void* data, int size, uint8_t* ptr); uint8_t* WriteRawLittleEndian64(const void* data, int size, uint8_t* ptr); #endif @@ -1002,7 +982,8 @@ template <> inline uint8_t* EpsCopyOutputStream::WriteRawLittleEndian<4>(const void* data, int size, uint8_t* ptr) { -#ifdef PROTOBUF_LITTLE_ENDIAN +#if defined(PROTOBUF_LITTLE_ENDIAN) && \ + !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) return WriteRaw(data, size, ptr); #else return WriteRawLittleEndian32(data, size, ptr); @@ -1012,7 +993,8 @@ template <> inline uint8_t* EpsCopyOutputStream::WriteRawLittleEndian<8>(const void* data, int size, uint8_t* ptr) { -#ifdef PROTOBUF_LITTLE_ENDIAN +#if defined(PROTOBUF_LITTLE_ENDIAN) && \ + !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) return WriteRaw(data, size, ptr); #else return WriteRawLittleEndian64(data, size, ptr); @@ -1067,10 +1049,18 @@ inline uint8_t* EpsCopyOutputStream::WriteRawLittleEndian<8>(const void* data, // delete coded_output; class PROTOBUF_EXPORT CodedOutputStream { public: - // Create an CodedOutputStream that writes to the given ZeroCopyOutputStream. - explicit CodedOutputStream(ZeroCopyOutputStream* stream) - : CodedOutputStream(stream, true) {} - CodedOutputStream(ZeroCopyOutputStream* stream, bool do_eager_refresh); + // Creates a CodedOutputStream that writes to the given `stream`. + // The provided stream must publicly derive from `ZeroCopyOutputStream`. + template ::value>::type> + explicit CodedOutputStream(Stream* stream); + + // Creates a CodedOutputStream that writes to the given `stream`, and does + // an 'eager initialization' of the internal state if `eager_init` is true. + // The provided stream must publicly derive from `ZeroCopyOutputStream`. + template ::value>::type> + CodedOutputStream(Stream* stream, bool eager_init); // Destroy the CodedOutputStream and position the underlying // ZeroCopyOutputStream immediately after the last byte written. @@ -1233,7 +1223,7 @@ class PROTOBUF_EXPORT CodedOutputStream { // remains live until all of the data has been consumed from the stream. void EnableAliasing(bool enabled) { impl_.EnableAliasing(enabled); } - // Indicate to the serializer whether the user wants derministic + // Indicate to the serializer whether the user wants deterministic // serialization. The default when this is not called comes from the global // default, controlled by SetDefaultSerializationDeterministic. // @@ -1276,6 +1266,9 @@ class PROTOBUF_EXPORT CodedOutputStream { EpsCopyOutputStream* EpsCopy() { return &impl_; } private: + template + void InitEagerly(Stream* stream); + EpsCopyOutputStream impl_; uint8_t* cur_; int64_t start_count_; @@ -1344,7 +1337,8 @@ inline bool CodedInputStream::ReadVarintSizeAsInt(int* value) { // static inline const uint8_t* CodedInputStream::ReadLittleEndian32FromArray( const uint8_t* buffer, uint32_t* value) { -#if defined(PROTOBUF_LITTLE_ENDIAN) +#if defined(PROTOBUF_LITTLE_ENDIAN) && \ + !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) memcpy(value, buffer, sizeof(*value)); return buffer + sizeof(*value); #else @@ -1358,7 +1352,8 @@ inline const uint8_t* CodedInputStream::ReadLittleEndian32FromArray( // static inline const uint8_t* CodedInputStream::ReadLittleEndian64FromArray( const uint8_t* buffer, uint64_t* value) { -#if defined(PROTOBUF_LITTLE_ENDIAN) +#if defined(PROTOBUF_LITTLE_ENDIAN) && \ + !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) memcpy(value, buffer, sizeof(*value)); return buffer + sizeof(*value); #else @@ -1376,7 +1371,8 @@ inline const uint8_t* CodedInputStream::ReadLittleEndian64FromArray( } inline bool CodedInputStream::ReadLittleEndian32(uint32_t* value) { -#if defined(PROTOBUF_LITTLE_ENDIAN) +#if defined(PROTOBUF_LITTLE_ENDIAN) && \ + !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) if (PROTOBUF_PREDICT_TRUE(BufferSize() >= static_cast(sizeof(*value)))) { buffer_ = ReadLittleEndian32FromArray(buffer_, value); return true; @@ -1389,7 +1385,8 @@ inline bool CodedInputStream::ReadLittleEndian32(uint32_t* value) { } inline bool CodedInputStream::ReadLittleEndian64(uint64_t* value) { -#if defined(PROTOBUF_LITTLE_ENDIAN) +#if defined(PROTOBUF_LITTLE_ENDIAN) && \ + !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) if (PROTOBUF_PREDICT_TRUE(BufferSize() >= static_cast(sizeof(*value)))) { buffer_ = ReadLittleEndian64FromArray(buffer_, value); return true; @@ -1620,6 +1617,31 @@ inline bool CodedInputStream::Skip(int count) { return SkipFallback(count, original_buffer_size); } +template +inline CodedOutputStream::CodedOutputStream(Stream* stream) + : impl_(stream, IsDefaultSerializationDeterministic(), &cur_), + start_count_(stream->ByteCount()) { + InitEagerly(stream); +} + +template +inline CodedOutputStream::CodedOutputStream(Stream* stream, bool eager_init) + : impl_(stream, IsDefaultSerializationDeterministic(), &cur_), + start_count_(stream->ByteCount()) { + if (eager_init) { + InitEagerly(stream); + } +} + +template +inline void CodedOutputStream::InitEagerly(Stream* stream) { + void* data; + int size; + if (PROTOBUF_PREDICT_TRUE(stream->Next(&data, &size) && size > 0)) { + cur_ = impl_.SetInitialBuffer(data, size); + } +} + inline uint8_t* CodedOutputStream::WriteVarint32ToArray(uint32_t value, uint8_t* target) { return EpsCopyOutputStream::UnsafeVarint(value, target); @@ -1651,7 +1673,8 @@ inline uint8_t* CodedOutputStream::WriteVarint32SignExtendedToArray( inline uint8_t* CodedOutputStream::WriteLittleEndian32ToArray(uint32_t value, uint8_t* target) { -#if defined(PROTOBUF_LITTLE_ENDIAN) +#if defined(PROTOBUF_LITTLE_ENDIAN) && \ + !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) memcpy(target, &value, sizeof(value)); #else target[0] = static_cast(value); @@ -1664,7 +1687,8 @@ inline uint8_t* CodedOutputStream::WriteLittleEndian32ToArray(uint32_t value, inline uint8_t* CodedOutputStream::WriteLittleEndian64ToArray(uint64_t value, uint8_t* target) { -#if defined(PROTOBUF_LITTLE_ENDIAN) +#if defined(PROTOBUF_LITTLE_ENDIAN) && \ + !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) memcpy(target, &value, sizeof(value)); #else uint32_t part0 = static_cast(value); diff --git a/windows/include/google/protobuf/io/gzip_stream.h b/windows/include/google/protobuf/io/gzip_stream.h index f0283e86f..4cf71b6c3 100644 --- a/windows/include/google/protobuf/io/gzip_stream.h +++ b/windows/include/google/protobuf/io/gzip_stream.h @@ -47,8 +47,9 @@ #include #include #include -#include +#include "zlib.h" +// Must be included last. #include namespace google { @@ -56,7 +57,8 @@ namespace protobuf { namespace io { // A ZeroCopyInputStream that reads compressed data through zlib -class PROTOBUF_EXPORT GzipInputStream : public ZeroCopyInputStream { +class PROTOBUF_EXPORT GzipInputStream PROTOBUF_FUTURE_FINAL + : public ZeroCopyInputStream { public: // Format key for constructor enum Format { @@ -104,7 +106,8 @@ class PROTOBUF_EXPORT GzipInputStream : public ZeroCopyInputStream { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GzipInputStream); }; -class PROTOBUF_EXPORT GzipOutputStream : public ZeroCopyOutputStream { +class PROTOBUF_EXPORT GzipOutputStream PROTOBUF_FUTURE_FINAL + : public ZeroCopyOutputStream { public: // Format key for constructor enum Format { diff --git a/windows/include/google/protobuf/io/io_win32.h b/windows/include/google/protobuf/io/io_win32.h index 7d11dc2b3..a72b4ea3c 100644 --- a/windows/include/google/protobuf/io/io_win32.h +++ b/windows/include/google/protobuf/io/io_win32.h @@ -53,6 +53,8 @@ #include #include + +// Must be included last. #include // Compilers on Windows other than MSVC (e.g. Cygwin, MinGW32) define the diff --git a/windows/include/google/protobuf/io/printer.h b/windows/include/google/protobuf/io/printer.h index e857cf08a..92a4321c0 100644 --- a/windows/include/google/protobuf/io/printer.h +++ b/windows/include/google/protobuf/io/printer.h @@ -43,6 +43,8 @@ #include #include + +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/io/tokenizer.h b/windows/include/google/protobuf/io/tokenizer.h index f7b693e8a..4abab7e30 100644 --- a/windows/include/google/protobuf/io/tokenizer.h +++ b/windows/include/google/protobuf/io/tokenizer.h @@ -43,6 +43,8 @@ #include #include + +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/io/zero_copy_stream.h b/windows/include/google/protobuf/io/zero_copy_stream.h index d3bd6daed..2041cbf64 100644 --- a/windows/include/google/protobuf/io/zero_copy_stream.h +++ b/windows/include/google/protobuf/io/zero_copy_stream.h @@ -108,12 +108,12 @@ #define GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__ -#include - #include -#include +// Must be included last. +#include + namespace google { namespace protobuf { namespace io { @@ -154,6 +154,13 @@ class PROTOBUF_EXPORT ZeroCopyInputStream { // buffer that goes beyond what you wanted to read, you can use BackUp() // to return to the point where you intended to finish. // + // This method can be called with `count = 0` to finalize (flush) any + // previously returned buffer. For example, a file output stream can + // flush buffers returned from a previous call to Next() upon such + // BackUp(0) invocations. ZeroCopyOutputStream callers should always + // invoke BackUp() after a final Next() call, even if there is no + // excess buffer data to be backed up to indicate a flush point. + // // Preconditions: // * The last method called must have been Next(). // * count must be less than or equal to the size of the last buffer diff --git a/windows/include/google/protobuf/io/zero_copy_stream_impl.h b/windows/include/google/protobuf/io/zero_copy_stream_impl.h index e6ba902e8..a385992f2 100644 --- a/windows/include/google/protobuf/io/zero_copy_stream_impl.h +++ b/windows/include/google/protobuf/io/zero_copy_stream_impl.h @@ -48,6 +48,7 @@ #include #include +// Must be included last. #include namespace google { @@ -62,7 +63,8 @@ namespace io { // The latter will introduce an extra layer of buffering, harming performance. // Also, it's conceivable that FileInputStream could someday be enhanced // to use zero-copy file descriptors on OSs which support them. -class PROTOBUF_EXPORT FileInputStream : public ZeroCopyInputStream { +class PROTOBUF_EXPORT FileInputStream PROTOBUF_FUTURE_FINAL + : public ZeroCopyInputStream { public: // Creates a stream that reads from the given Unix file descriptor. // If a block_size is given, it specifies the number of bytes that @@ -95,7 +97,8 @@ class PROTOBUF_EXPORT FileInputStream : public ZeroCopyInputStream { int64_t ByteCount() const override; private: - class PROTOBUF_EXPORT CopyingFileInputStream : public CopyingInputStream { + class PROTOBUF_EXPORT CopyingFileInputStream PROTOBUF_FUTURE_FINAL + : public CopyingInputStream { public: CopyingFileInputStream(int file_descriptor); ~CopyingFileInputStream() override; @@ -139,7 +142,8 @@ class PROTOBUF_EXPORT FileInputStream : public ZeroCopyInputStream { // harming performance. Also, it's conceivable that FileOutputStream could // someday be enhanced to use zero-copy file descriptors on OSs which // support them. -class PROTOBUF_EXPORT FileOutputStream : public CopyingOutputStreamAdaptor { +class PROTOBUF_EXPORT FileOutputStream PROTOBUF_FUTURE_FINAL + : public CopyingOutputStreamAdaptor { public: // Creates a stream that writes to the given Unix file descriptor. // If a block_size is given, it specifies the size of the buffers @@ -168,7 +172,8 @@ class PROTOBUF_EXPORT FileOutputStream : public CopyingOutputStreamAdaptor { int GetErrno() const { return copying_output_.GetErrno(); } private: - class PROTOBUF_EXPORT CopyingFileOutputStream : public CopyingOutputStream { + class PROTOBUF_EXPORT CopyingFileOutputStream PROTOBUF_FUTURE_FINAL + : public CopyingOutputStream { public: CopyingFileOutputStream(int file_descriptor); ~CopyingFileOutputStream() override; @@ -203,7 +208,8 @@ class PROTOBUF_EXPORT FileOutputStream : public CopyingOutputStreamAdaptor { // // Note that for reading files (or anything represented by a file descriptor), // FileInputStream is more efficient. -class PROTOBUF_EXPORT IstreamInputStream : public ZeroCopyInputStream { +class PROTOBUF_EXPORT IstreamInputStream PROTOBUF_FUTURE_FINAL + : public ZeroCopyInputStream { public: // Creates a stream that reads from the given C++ istream. // If a block_size is given, it specifies the number of bytes that @@ -218,7 +224,8 @@ class PROTOBUF_EXPORT IstreamInputStream : public ZeroCopyInputStream { int64_t ByteCount() const override; private: - class PROTOBUF_EXPORT CopyingIstreamInputStream : public CopyingInputStream { + class PROTOBUF_EXPORT CopyingIstreamInputStream PROTOBUF_FUTURE_FINAL + : public CopyingInputStream { public: CopyingIstreamInputStream(std::istream* input); ~CopyingIstreamInputStream() override; @@ -246,7 +253,8 @@ class PROTOBUF_EXPORT IstreamInputStream : public ZeroCopyInputStream { // // Note that for writing files (or anything represented by a file descriptor), // FileOutputStream is more efficient. -class PROTOBUF_EXPORT OstreamOutputStream : public ZeroCopyOutputStream { +class PROTOBUF_EXPORT OstreamOutputStream PROTOBUF_FUTURE_FINAL + : public ZeroCopyOutputStream { public: // Creates a stream that writes to the given C++ ostream. // If a block_size is given, it specifies the size of the buffers @@ -261,7 +269,7 @@ class PROTOBUF_EXPORT OstreamOutputStream : public ZeroCopyOutputStream { int64_t ByteCount() const override; private: - class PROTOBUF_EXPORT CopyingOstreamOutputStream + class PROTOBUF_EXPORT CopyingOstreamOutputStream PROTOBUF_FUTURE_FINAL : public CopyingOutputStream { public: CopyingOstreamOutputStream(std::ostream* output); @@ -292,7 +300,8 @@ class PROTOBUF_EXPORT OstreamOutputStream : public ZeroCopyOutputStream { // ConcatenatingInputStream may do odd things. It is suggested that you do // not use ConcatenatingInputStream on streams that might produce read errors // other than end-of-stream. -class PROTOBUF_EXPORT ConcatenatingInputStream : public ZeroCopyInputStream { +class PROTOBUF_EXPORT ConcatenatingInputStream PROTOBUF_FUTURE_FINAL + : public ZeroCopyInputStream { public: // All streams passed in as well as the array itself must remain valid // until the ConcatenatingInputStream is destroyed. diff --git a/windows/include/google/protobuf/io/zero_copy_stream_impl_lite.h b/windows/include/google/protobuf/io/zero_copy_stream_impl_lite.h index 9ee369191..cbda32871 100644 --- a/windows/include/google/protobuf/io/zero_copy_stream_impl_lite.h +++ b/windows/include/google/protobuf/io/zero_copy_stream_impl_lite.h @@ -55,6 +55,7 @@ #include +// Must be included last. #include namespace google { @@ -64,7 +65,8 @@ namespace io { // =================================================================== // A ZeroCopyInputStream backed by an in-memory array of bytes. -class PROTOBUF_EXPORT ArrayInputStream : public ZeroCopyInputStream { +class PROTOBUF_EXPORT ArrayInputStream PROTOBUF_FUTURE_FINAL + : public ZeroCopyInputStream { public: // Create an InputStream that returns the bytes pointed to by "data". // "data" remains the property of the caller but must remain valid until @@ -98,7 +100,8 @@ class PROTOBUF_EXPORT ArrayInputStream : public ZeroCopyInputStream { // =================================================================== // A ZeroCopyOutputStream backed by an in-memory array of bytes. -class PROTOBUF_EXPORT ArrayOutputStream : public ZeroCopyOutputStream { +class PROTOBUF_EXPORT ArrayOutputStream PROTOBUF_FUTURE_FINAL + : public ZeroCopyOutputStream { public: // Create an OutputStream that writes to the bytes pointed to by "data". // "data" remains the property of the caller but must remain valid until @@ -130,7 +133,8 @@ class PROTOBUF_EXPORT ArrayOutputStream : public ZeroCopyOutputStream { // =================================================================== // A ZeroCopyOutputStream which appends bytes to a string. -class PROTOBUF_EXPORT StringOutputStream : public ZeroCopyOutputStream { +class PROTOBUF_EXPORT StringOutputStream PROTOBUF_FUTURE_FINAL + : public ZeroCopyOutputStream { public: // Create a StringOutputStream which appends bytes to the given string. // The string remains property of the caller, but it is mutated in arbitrary @@ -346,7 +350,8 @@ class PROTOBUF_EXPORT CopyingOutputStreamAdaptor : public ZeroCopyOutputStream { // A ZeroCopyInputStream which wraps some other stream and limits it to // a particular byte count. -class PROTOBUF_EXPORT LimitingInputStream : public ZeroCopyInputStream { +class PROTOBUF_EXPORT LimitingInputStream PROTOBUF_FUTURE_FINAL + : public ZeroCopyInputStream { public: LimitingInputStream(ZeroCopyInputStream* input, int64_t limit); ~LimitingInputStream() override; diff --git a/windows/include/google/protobuf/map.h b/windows/include/google/protobuf/map.h index 0708366c6..008c19225 100644 --- a/windows/include/google/protobuf/map.h +++ b/windows/include/google/protobuf/map.h @@ -37,6 +37,7 @@ #ifndef GOOGLE_PROTOBUF_MAP_H__ #define GOOGLE_PROTOBUF_MAP_H__ + #include #include #include @@ -58,12 +59,14 @@ #include #include #include +#include #include #ifdef SWIG #error "You cannot SWIG proto headers" #endif +// Must be included last. #include namespace google { @@ -115,6 +118,11 @@ class MapAllocator { MapAllocator(const MapAllocator& allocator) // NOLINT(runtime/explicit) : arena_(allocator.arena()) {} + // MapAllocator does not support alignments beyond 8. Technically we should + // support up to std::max_align_t, but this fails with ubsan and tcmalloc + // debug allocation logic which assume 8 as default alignment. + static_assert(alignof(value_type) <= 8, ""); + pointer allocate(size_type n, const void* /* hint */ = nullptr) { // If arena is not given, malloc needs to be called which doesn't // construct element object. @@ -128,12 +136,7 @@ class MapAllocator { void deallocate(pointer p, size_type n) { if (arena_ == nullptr) { -#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation) - ::operator delete(p, n * sizeof(value_type)); -#else - (void)n; - ::operator delete(p); -#endif + internal::SizedDelete(p, n * sizeof(value_type)); } } @@ -334,7 +337,7 @@ inline size_t SpaceUsedInValues(const void*) { return 0; } // std::pair as value_type, we use this class which provides us more control of // its process of construction and destruction. template -struct MapPair { +struct PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG MapPair { using first_type = const Key; using second_type = T; @@ -689,40 +692,30 @@ class Map { return FindHelper(k).first; } - // Insert the key into the map, if not present. In that case, the value will - // be value initialized. + // Inserts a new element into the container if there is no element with the + // key in the container. + // The new element is: + // (1) Constructed in-place with the given args, if mapped_type is not + // arena constructible. + // (2) Constructed in-place with the arena and then assigned with a + // mapped_type temporary constructed with the given args, otherwise. + template + std::pair try_emplace(K&& k, Args&&... args) { + return ArenaAwareTryEmplace(Arena::is_arena_constructable(), + std::forward(k), + std::forward(args)...); + } + + // Inserts the key into the map, if not present. In that case, the value + // will be value initialized. template std::pair insert(K&& k) { - std::pair p = FindHelper(k); - // Case 1: key was already present. - if (p.first.node_ != nullptr) - return std::make_pair(iterator(p.first), false); - // Case 2: insert. - if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { - p = FindHelper(k); - } - const size_type b = p.second; // bucket number - // If K is not key_type, make the conversion to key_type explicit. - using TypeToInit = typename std::conditional< - std::is_same::type, key_type>::value, K&&, - key_type>::type; - Node* node = Alloc(1); - // Even when arena is nullptr, CreateInArenaStorage is still used to - // ensure the arena of submessage will be consistent. Otherwise, - // submessage may have its own arena when message-owned arena is enabled. - Arena::CreateInArenaStorage(const_cast(&node->kv.first), - alloc_.arena(), - static_cast(std::forward(k))); - Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena()); - - iterator result = InsertUnique(b, node); - ++num_elements_; - return std::make_pair(result, true); + return try_emplace(std::forward(k)); } template value_type& operator[](K&& k) { - return *insert(std::forward(k)).first; + return *try_emplace(std::forward(k)).first; } void erase(iterator it) { @@ -764,6 +757,79 @@ class Map { } private: + template + std::pair TryEmplaceInternal(K&& k, Args&&... args) { + std::pair p = FindHelper(k); + // Case 1: key was already present. + if (p.first.node_ != nullptr) + return std::make_pair(iterator(p.first), false); + // Case 2: insert. + if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { + p = FindHelper(k); + } + const size_type b = p.second; // bucket number + // If K is not key_type, make the conversion to key_type explicit. + using TypeToInit = typename std::conditional< + std::is_same::type, key_type>::value, K&&, + key_type>::type; + Node* node = Alloc(1); + // Even when arena is nullptr, CreateInArenaStorage is still used to + // ensure the arena of submessage will be consistent. Otherwise, + // submessage may have its own arena when message-owned arena is enabled. + // Note: This only works if `Key` is not arena constructible. + Arena::CreateInArenaStorage(const_cast(&node->kv.first), + alloc_.arena(), + static_cast(std::forward(k))); + // Note: if `T` is arena constructible, `Args` needs to be empty. + Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), + std::forward(args)...); + + iterator result = InsertUnique(b, node); + ++num_elements_; + return std::make_pair(result, true); + } + + // A helper function to perform an assignment of `mapped_type`. + // If the first argument is true, then it is a regular assignment. + // Otherwise, we first create a temporary and then perform an assignment. + template + static void AssignMapped(std::true_type, mapped_type& mapped, V&& v) { + mapped = std::forward(v); + } + template + static void AssignMapped(std::false_type, mapped_type& mapped, + Args&&... args) { + mapped = mapped_type(std::forward(args)...); + } + + // Case 1: `mapped_type` is arena constructible. A temporary object is + // created and then (if `Args` are not empty) assigned to a mapped value + // that was created with the arena. + template + std::pair ArenaAwareTryEmplace(std::true_type, K&& k) { + // case 1.1: "default" constructed (e.g. from arena only). + return TryEmplaceInternal(std::forward(k)); + } + template + std::pair ArenaAwareTryEmplace(std::true_type, K&& k, + Args&&... args) { + // case 1.2: "default" constructed + copy/move assignment + auto p = TryEmplaceInternal(std::forward(k)); + if (p.second) { + AssignMapped(std::is_same::type...), + void(mapped_type)>(), + p.first->second, std::forward(args)...); + } + return p; + } + // Case 2: `mapped_type` is not arena constructible. Using in-place + // construction. + template + std::pair ArenaAwareTryEmplace(std::false_type, + Args&&... args) { + return TryEmplaceInternal(std::forward(args)...); + } + const_iterator find(const Key& k, TreeIterator* it) const { return FindHelper(k, it).first; } @@ -1279,21 +1345,26 @@ class Map { } // insert - std::pair insert(const value_type& value) { - std::pair p = - elements_.insert(value.first); - if (p.second) { - p.first->second = value.second; - } + template + std::pair try_emplace(K&& k, Args&&... args) { + auto p = + elements_.try_emplace(std::forward(k), std::forward(args)...); return std::pair(iterator(p.first), p.second); } + std::pair insert(const value_type& value) { + return try_emplace(value.first, value.second); + } + std::pair insert(value_type&& value) { + return try_emplace(value.first, std::move(value.second)); + } + template + std::pair emplace(Args&&... args) { + return insert(value_type(std::forward(args)...)); + } template void insert(InputIt first, InputIt last) { - for (InputIt it = first; it != last; ++it) { - iterator exist_it = find(it->first); - if (exist_it == end()) { - operator[](it->first) = it->second; - } + for (; first != last; ++first) { + try_emplace(first->first, first->second); } } void insert(std::initializer_list values) { diff --git a/windows/include/google/protobuf/map_entry.h b/windows/include/google/protobuf/map_entry.h index 2aec2d4b0..536dec9d0 100644 --- a/windows/include/google/protobuf/map_entry.h +++ b/windows/include/google/protobuf/map_entry.h @@ -31,14 +31,15 @@ #ifndef GOOGLE_PROTOBUF_MAP_ENTRY_H__ #define GOOGLE_PROTOBUF_MAP_ENTRY_H__ +#include #include #include #include -#include #include #include #include +// Must be included last. #include #ifdef SWIG @@ -93,14 +94,12 @@ template { public: - constexpr MapEntry() : _internal_metadata_() {} + constexpr MapEntry() {} explicit MapEntry(Arena* arena) : MapEntryImpl(arena), - _internal_metadata_(arena) {} - ~MapEntry() { + kValueFieldType>(arena) {} + ~MapEntry() override { Message::_internal_metadata_.template Delete(); - _internal_metadata_.Delete(); } typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -117,8 +116,6 @@ class MapEntry : public MapEntryImpl -struct MapEntryHelper< - MapEntry > - : MapEntryHelper< - MapEntryLite > { - explicit MapEntryHelper(const MapPair& map_pair) - : MapEntryHelper< - MapEntryLite >( - map_pair) {} -}; - -template -struct DeconstructMapEntry > { - typedef K Key; - typedef V Value; - static constexpr WireFormatLite::FieldType kKeyFieldType = key; - static constexpr WireFormatLite::FieldType kValueFieldType = value; -}; - } // namespace internal } // namespace protobuf } // namespace google diff --git a/windows/include/google/protobuf/map_entry_lite.h b/windows/include/google/protobuf/map_entry_lite.h index 34b185bfc..6b08cd92b 100644 --- a/windows/include/google/protobuf/map_entry_lite.h +++ b/windows/include/google/protobuf/map_entry_lite.h @@ -32,19 +32,23 @@ #define GOOGLE_PROTOBUF_MAP_ENTRY_LITE_H__ #include + +#include #include +#include #include -#include #include #include +#include #include #include #include #include -#include +#include #include +// Must be included last. #include #ifdef SWIG #error "You cannot SWIG proto headers" @@ -97,44 +101,6 @@ struct MoveHelper { // strings and similar } }; -// Functions for operating on a map entry. Does not contain any representation -// (this class is not intended to be instantiated). -template -struct MapEntryFuncs { - typedef MapTypeHandler KeyTypeHandler; - typedef MapTypeHandler ValueTypeHandler; - static const int kKeyFieldNumber = 1; - static const int kValueFieldNumber = 2; - - static uint8_t* InternalSerialize(int field_number, const Key& key, - const Value& value, uint8_t* ptr, - io::EpsCopyOutputStream* stream) { - ptr = stream->EnsureSpace(ptr); - ptr = WireFormatLite::WriteTagToArray( - field_number, WireFormatLite::WIRETYPE_LENGTH_DELIMITED, ptr); - ptr = io::CodedOutputStream::WriteVarint32ToArray(GetCachedSize(key, value), - ptr); - - ptr = KeyTypeHandler::Write(kKeyFieldNumber, key, ptr, stream); - return ValueTypeHandler::Write(kValueFieldNumber, value, ptr, stream); - } - - static size_t ByteSizeLong(const Key& key, const Value& value) { - // Tags for key and value will both be one byte (field numbers 1 and 2). - size_t inner_length = - 2 + KeyTypeHandler::ByteSize(key) + ValueTypeHandler::ByteSize(value); - return inner_length + io::CodedOutputStream::VarintSize32( - static_cast(inner_length)); - } - - static int GetCachedSize(const Key& key, const Value& value) { - // Tags for key and value will both be one byte (field numbers 1 and 2). - return 2 + KeyTypeHandler::GetCachedSize(key) + - ValueTypeHandler::GetCachedSize(value); - } -}; - // MapEntryImpl is used to implement parsing and serialization of map entries. // It uses Curious Recursive Template Pattern (CRTP) to provide the type of // the eventual code to the template code. @@ -193,7 +159,7 @@ class MapEntryImpl : public Base { value_(ValueTypeHandler::Constinit()), _has_bits_{} {} - ~MapEntryImpl() { + ~MapEntryImpl() override { if (Base::GetArenaForAllocation() != nullptr) return; KeyTypeHandler::DeleteNoArena(key_); ValueTypeHandler::DeleteNoArena(value_); @@ -329,51 +295,6 @@ class MapEntryImpl : public Base { delete entry_; } - // This does what the typical MergePartialFromCodedStream() is expected to - // do, with the additional side-effect that if successful (i.e., if true is - // going to be its return value) it inserts the key-value pair into map_. - bool MergePartialFromCodedStream(io::CodedInputStream* input) { - // Look for the expected thing: a key and then a value. If it fails, - // invoke the enclosing class's MergePartialFromCodedStream, or return - // false if that would be pointless. - if (input->ExpectTag(kKeyTag)) { - if (!KeyTypeHandler::Read(input, &key_)) { - return false; - } - // Peek at the next byte to see if it is kValueTag. If not, bail out. - const void* data; - int size; - input->GetDirectBufferPointerInline(&data, &size); - // We could use memcmp here, but we don't bother. The tag is one byte. - static_assert(kTagSize == 1, "tag size must be 1"); - if (size > 0 && *reinterpret_cast(data) == kValueTag) { - typename Map::size_type map_size = map_->size(); - value_ptr_ = &(*map_)[key_]; - if (PROTOBUF_PREDICT_TRUE(map_size != map_->size())) { - // We created a new key-value pair. Fill in the value. - typedef - typename MapIf::type T; - input->Skip(kTagSize); // Skip kValueTag. - if (!ValueTypeHandler::Read(input, - reinterpret_cast(value_ptr_))) { - map_->erase(key_); // Failure! Undo insertion. - return false; - } - if (input->ExpectAtEnd()) return true; - return ReadBeyondKeyValuePair(input); - } - } - } else { - key_ = Key(); - } - - NewEntry(); - *entry_->mutable_key() = key_; - const bool result = entry_->MergePartialFromCodedStream(input); - if (result) UseKeyAndValueFromEntry(); - return result; - } - const char* _InternalParse(const char* ptr, ParseContext* ctx) { if (PROTOBUF_PREDICT_TRUE(!ctx->Done(&ptr) && *ptr == kKeyTag)) { ptr = KeyTypeHandler::Read(ptr + 1, ctx, &key_); @@ -493,7 +414,7 @@ class MapEntryImpl : public Base { public: inline Arena* GetArena() const { return Base::GetArena(); } - public: // Needed for constructing tables + protected: // Needed for constructing tables KeyOnMemory key_; ValueOnMemory value_; uint32_t _has_bits_[1]; @@ -523,7 +444,7 @@ class MapEntryLite : public MapEntryImpl(); } void MergeFrom(const MapEntryLite& other) { MergeFromInternal(other); } @@ -531,118 +452,106 @@ class MapEntryLite : public MapEntryImpl -struct DeconstructMapEntry; - -template -struct DeconstructMapEntry > { - typedef K Key; - typedef V Value; - static const WireFormatLite::FieldType kKeyFieldType = key; - static const WireFormatLite::FieldType kValueFieldType = value; -}; // Helpers for deterministic serialization ============================= -// This struct can be used with any generic sorting algorithm. If the Key -// type is relatively small and easy to copy then copying Keys into an -// array of SortItems can be beneficial. Then all the data the sorting -// algorithm needs to touch is in that one array. -template -struct SortItem { - SortItem() {} - explicit SortItem(PtrToKeyValuePair p) : first(p->first), second(p) {} - - Key first; - PtrToKeyValuePair second; +// Iterator base for MapSorterFlat and MapSorterPtr. +template +struct MapSorterIt { + storage_type* ptr; + MapSorterIt(storage_type* ptr) : ptr(ptr) {} + bool operator==(const MapSorterIt& other) const { return ptr == other.ptr; } + bool operator!=(const MapSorterIt& other) const { return !(*this == other); } + MapSorterIt& operator++() { ++ptr; return *this; } + MapSorterIt operator++(int) { auto other = *this; ++ptr; return other; } + MapSorterIt operator+(int v) { return MapSorterIt{ptr + v}; } }; -template -struct CompareByFirstField { - bool operator()(const T& a, const T& b) const { return a.first < b.first; } -}; +// MapSorterFlat stores keys inline with pointers to map entries, so that +// keys can be compared without indirection. This type is used for maps with +// keys that are not strings. +template +class MapSorterFlat { + public: + using value_type = typename MapT::value_type; + using storage_type = std::pair; -template -struct CompareByDerefFirst { - bool operator()(const T& a, const T& b) const { return a->first < b->first; } -}; + // This const_iterator dereferenes to the map entry stored in the sorting + // array pairs. This is the same interface as the Map::const_iterator type, + // and allows generated code to use the same loop body with either form: + // for (const auto& entry : map) { ... } + // for (const auto& entry : MapSorterFlat(map)) { ... } + struct const_iterator : public MapSorterIt { + using pointer = const typename MapT::value_type*; + using reference = const typename MapT::value_type&; + using MapSorterIt::MapSorterIt; -// Helper for table driven serialization + pointer operator->() const { return this->ptr->second; } + reference operator*() const { return *this->operator->(); } + }; -template -struct FromHelper { - template - static const T& From(const T& x) { - return x; + explicit MapSorterFlat(const MapT& m) + : size_(m.size()), items_(size_ ? new storage_type[size_] : nullptr) { + if (!size_) return; + storage_type* it = &items_[0]; + for (const auto& entry : m) { + *it++ = {entry.first, &entry}; + } + std::sort(&items_[0], &items_[size_], + [](const storage_type& a, const storage_type& b) { + return a.first < b.first; + }); } + size_t size() const { return size_; } + const_iterator begin() const { return {items_.get()}; } + const_iterator end() const { return {items_.get() + size_}; } + + private: + size_t size_; + std::unique_ptr items_; }; -template <> -struct FromHelper { - static ArenaStringPtr From(const std::string& x) { - ArenaStringPtr res; - TaggedPtr ptr; - ptr.Set(const_cast(&x)); - res.UnsafeSetTaggedPointer(ptr); - return res; +// MapSorterPtr stores and sorts pointers to map entries. This type is used for +// maps with keys that are strings. +template +class MapSorterPtr { + public: + using value_type = typename MapT::value_type; + using storage_type = const typename MapT::value_type*; + + // This const_iterator dereferenes the map entry pointer stored in the sorting + // array. This is the same interface as the Map::const_iterator type, and + // allows generated code to use the same loop body with either form: + // for (const auto& entry : map) { ... } + // for (const auto& entry : MapSorterPtr(map)) { ... } + struct const_iterator : public MapSorterIt { + using pointer = const typename MapT::value_type*; + using reference = const typename MapT::value_type&; + using MapSorterIt::MapSorterIt; + + pointer operator->() const { return *this->ptr; } + reference operator*() const { return *this->operator->(); } + }; + + explicit MapSorterPtr(const MapT& m) + : size_(m.size()), items_(size_ ? new storage_type[size_] : nullptr) { + if (!size_) return; + storage_type* it = &items_[0]; + for (const auto& entry : m) { + *it++ = &entry; + } + std::sort(&items_[0], &items_[size_], + [](const storage_type& a, const storage_type& b) { + return a->first < b->first; + }); } -}; -template <> -struct FromHelper { - static ArenaStringPtr From(const std::string& x) { - ArenaStringPtr res; - TaggedPtr ptr; - ptr.Set(const_cast(&x)); - res.UnsafeSetTaggedPointer(ptr); - return res; - } -}; -template <> -struct FromHelper { - template - static T* From(const T& x) { - return const_cast(&x); - } -}; + size_t size() const { return size_; } + const_iterator begin() const { return {items_.get()}; } + const_iterator end() const { return {items_.get() + size_}; } -template -struct MapEntryHelper; - -template -struct MapEntryHelper< - MapEntryLite > { - // Provide utilities to parse/serialize key/value. Provide utilities to - // manipulate internal stored type. - typedef MapTypeHandler KeyTypeHandler; - typedef MapTypeHandler ValueTypeHandler; - - // Define internal memory layout. Strings and messages are stored as - // pointers, while other types are stored as values. - typedef typename KeyTypeHandler::TypeOnMemory KeyOnMemory; - typedef typename ValueTypeHandler::TypeOnMemory ValueOnMemory; - - explicit MapEntryHelper(const MapPair& map_pair) - : _has_bits_(3), - _cached_size_(2 + KeyTypeHandler::GetCachedSize(map_pair.first) + - ValueTypeHandler::GetCachedSize(map_pair.second)), - key_(FromHelper::From(map_pair.first)), - value_(FromHelper::From(map_pair.second)) {} - - // Purposely not following the style guide naming. These are the names - // the proto compiler would generate given the map entry descriptor. - // The proto compiler generates the offsets in this struct as if this was - // a regular message. This way the table driven code barely notices it's - // dealing with a map field. - uint32_t _has_bits_; // NOLINT - uint32_t _cached_size_; // NOLINT - KeyOnMemory key_; // NOLINT - ValueOnMemory value_; // NOLINT + private: + size_t size_; + std::unique_ptr items_; }; } // namespace internal diff --git a/windows/include/google/protobuf/map_field.h b/windows/include/google/protobuf/map_field.h index c87d44e5e..287d58f31 100644 --- a/windows/include/google/protobuf/map_field.h +++ b/windows/include/google/protobuf/map_field.h @@ -35,6 +35,8 @@ #include #include +#include +#include #include #include #include @@ -42,12 +44,11 @@ #include #include #include -#include -#include #include #include +// Must be included last. #include #ifdef SWIG @@ -59,6 +60,13 @@ namespace protobuf { class DynamicMessage; class MapIterator; +// Microsoft compiler complains about non-virtual destructor, +// even when the destructor is private. +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4265) +#endif // _MSC_VER + #define TYPE_CHECK(EXPECTEDTYPE, METHOD) \ if (type() != EXPECTEDTYPE) { \ GOOGLE_LOG(FATAL) << "Protocol Buffer map usage error:\n" \ @@ -330,15 +338,22 @@ class PROTOBUF_EXPORT MapFieldBase { // It uses a linker initialized mutex, so it is not compatible with regular // runtime instances. // Except in MSVC, where we can't have a constinit mutex. - explicit constexpr MapFieldBase(ConstantInitialized) + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr MapFieldBase(ConstantInitialized) : arena_(nullptr), repeated_field_(nullptr), mutex_(GOOGLE_PROTOBUF_LINKER_INITIALIZED), state_(STATE_MODIFIED_MAP) {} explicit MapFieldBase(Arena* arena) : arena_(arena), repeated_field_(nullptr), state_(STATE_MODIFIED_MAP) {} - virtual ~MapFieldBase(); + protected: + ~MapFieldBase() { // "protected" stops users from deleting a `MapFieldBase *` + GOOGLE_DCHECK(repeated_field_ == nullptr); + } + void Destruct(); + + public: // Returns reference to internal repeated field. Data written using // Map's api prior to calling this function is guarantted to be // included in repeated field. @@ -483,10 +498,18 @@ class TypeDefinedMapFieldBase : public MapFieldBase { // This constructor is for constant initialized global instances. // It uses a linker initialized mutex, so it is not compatible with regular // runtime instances. - explicit constexpr TypeDefinedMapFieldBase(ConstantInitialized tag) + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr TypeDefinedMapFieldBase(ConstantInitialized tag) : MapFieldBase(tag) {} explicit TypeDefinedMapFieldBase(Arena* arena) : MapFieldBase(arena) {} - ~TypeDefinedMapFieldBase() override {} + TypeDefinedMapFieldBase(ArenaInitialized, Arena* arena) + : TypeDefinedMapFieldBase(arena) {} + + protected: + ~TypeDefinedMapFieldBase() {} + using MapFieldBase::Destruct; + + public: void MapBegin(MapIterator* map_iter) const override; void MapEnd(MapIterator* map_iter) const override; bool EqualIterator(const MapIterator& a, const MapIterator& b) const override; @@ -536,18 +559,24 @@ class MapField : public TypeDefinedMapFieldBase { typedef typename MapIf::type CastValueType; public: - typedef typename Derived::SuperType EntryTypeTrait; typedef Map MapType; - MapField() {} + MapField() : impl_() {} + virtual ~MapField() {} // Destruct() must already have been called! + void Destruct() { + impl_.Destruct(); + TypeDefinedMapFieldBase::Destruct(); + } // This constructor is for constant initialized global instances. // It uses a linker initialized mutex, so it is not compatible with regular // runtime instances. - explicit constexpr MapField(ConstantInitialized tag) + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr MapField(ConstantInitialized tag) : TypeDefinedMapFieldBase(tag), impl_() {} explicit MapField(Arena* arena) : TypeDefinedMapFieldBase(arena), impl_(arena) {} + MapField(ArenaInitialized, Arena* arena) : MapField(arena) {} // Implement MapFieldBase bool ContainsMapKey(const MapKey& map_key) const override; @@ -579,16 +608,6 @@ class MapField : public TypeDefinedMapFieldBase { // Used in the implementation of parsing. Caller should take the ownership iff // arena_ is nullptr. EntryType* NewEntry() const { return impl_.NewEntry(); } - // Used in the implementation of serializing enum value type. Caller should - // take the ownership iff arena_ is nullptr. - EntryType* NewEnumEntryWrapper(const Key& key, const T t) const { - return impl_.NewEnumEntryWrapper(key, t); - } - // Used in the implementation of serializing other value types. Caller should - // take the ownership iff arena_ is nullptr. - EntryType* NewEntryWrapper(const Key& key, const T& t) const { - return impl_.NewEntryWrapper(key, t); - } const char* _InternalParse(const char* ptr, ParseContext* ctx) { return impl_._InternalParse(ptr, ctx); @@ -645,7 +664,7 @@ class PROTOBUF_EXPORT DynamicMapField public: explicit DynamicMapField(const Message* default_entry); DynamicMapField(const Message* default_entry, Arena* arena); - ~DynamicMapField() override; + virtual ~DynamicMapField(); // Implement MapFieldBase bool ContainsMapKey(const MapKey& map_key) const override; @@ -855,8 +874,8 @@ class PROTOBUF_EXPORT MapIterator { MapIterator(Message* message, const FieldDescriptor* field) { const Reflection* reflection = message->GetReflection(); map_ = reflection->MutableMapData(message, field); - key_.SetType(field->message_type()->FindFieldByName("key")->cpp_type()); - value_.SetType(field->message_type()->FindFieldByName("value")->cpp_type()); + key_.SetType(field->message_type()->map_key()->cpp_type()); + value_.SetType(field->message_type()->map_value()->cpp_type()); map_->InitializeIterator(this); } MapIterator(const MapIterator& other) { @@ -918,6 +937,10 @@ class PROTOBUF_EXPORT MapIterator { } // namespace protobuf } // namespace google +#ifdef _MSC_VER +#pragma warning(pop) // restore warning C4265 +#endif // _MSC_VER + #include #endif // GOOGLE_PROTOBUF_MAP_FIELD_H__ diff --git a/windows/include/google/protobuf/map_field_lite.h b/windows/include/google/protobuf/map_field_lite.h index 255a0bc15..53bf7a081 100644 --- a/windows/include/google/protobuf/map_field_lite.h +++ b/windows/include/google/protobuf/map_field_lite.h @@ -32,13 +32,15 @@ #define GOOGLE_PROTOBUF_MAP_FIELD_LITE_H__ #include -#include + #include +#include #include #include -#include +#include #include +// Must be included last. #include #ifdef SWIG @@ -49,6 +51,10 @@ namespace google { namespace protobuf { namespace internal { +#ifndef NDEBUG +void MapFieldLiteNotDestructed(void* map_field_lite); +#endif + // This class provides access to map field using generated api. It is used for // internal generated message implementation only. Users should never use this // directly. @@ -61,12 +67,30 @@ class MapFieldLite { public: typedef Map MapType; - typedef EntryType EntryTypeTrait; - - constexpr MapFieldLite() {} + constexpr MapFieldLite() : map_() {} explicit MapFieldLite(Arena* arena) : map_(arena) {} + MapFieldLite(ArenaInitialized, Arena* arena) : MapFieldLite(arena) {} +#ifdef NDEBUG + void Destruct() { map_.~Map(); } + ~MapFieldLite() {} +#else + void Destruct() { + // We want to destruct the map in such a way that we can verify + // that we've done that, but also be sure that we've deallocated + // everything (as opposed to leaving an allocation behind with no + // data in it, as would happen if a vector was resize'd to zero. + // Map::Swap with an empty map accomplishes that. + decltype(map_) swapped_map(map_.arena()); + map_.InternalSwap(swapped_map); + } + ~MapFieldLite() { + if (map_.arena() == nullptr && !map_.empty()) { + MapFieldLiteNotDestructed(this); + } + } +#endif // Accessors const Map& GetMap() const { return map_; } Map* MutableMap() { return &map_; } @@ -88,16 +112,6 @@ class MapFieldLite { EntryType* NewEntry() const { return Arena::CreateMessage(map_.arena()); } - // Used in the implementation of serializing enum value type. Caller should - // take the ownership iff arena_ is nullptr. - EntryType* NewEnumEntryWrapper(const Key& key, const T t) const { - return EntryType::EnumWrap(key, t, map_.arena_); - } - // Used in the implementation of serializing other value types. Caller should - // take the ownership iff arena_ is nullptr. - EntryType* NewEntryWrapper(const Key& key, const T& t) const { - return EntryType::Wrap(key, t, map_.arena_); - } const char* _InternalParse(const char* ptr, ParseContext* ctx) { typename Derived::template Parser> parser(this); @@ -116,7 +130,11 @@ class MapFieldLite { private: typedef void DestructorSkippable_; - Map map_; + // map_ is inside an anonymous union so we can explicitly control its + // destruction + union { + Map map_; + }; friend class ::PROTOBUF_NAMESPACE_ID::Arena; }; @@ -175,6 +193,13 @@ struct MapEntryToMapField< MapFieldType; }; +#ifndef NDEBUG +inline PROTOBUF_NOINLINE void MapFieldLiteNotDestructed(void* map_field_lite) { + bool proper_destruct = false; + GOOGLE_CHECK(proper_destruct) << map_field_lite; +} +#endif + } // namespace internal } // namespace protobuf } // namespace google diff --git a/windows/include/google/protobuf/map_type_handler.h b/windows/include/google/protobuf/map_type_handler.h index 285734251..c210c63db 100644 --- a/windows/include/google/protobuf/map_type_handler.h +++ b/windows/include/google/protobuf/map_type_handler.h @@ -31,9 +31,10 @@ #ifndef GOOGLE_PROTOBUF_MAP_TYPE_HANDLER_H__ #define GOOGLE_PROTOBUF_MAP_TYPE_HANDLER_H__ -#include #include #include +#include +#include #include #ifdef SWIG @@ -322,7 +323,8 @@ inline uint8_t* MapTypeHandler::Write( int field, const MapEntryAccessorType& value, uint8_t* ptr, io::EpsCopyOutputStream* stream) { ptr = stream->EnsureSpace(ptr); - return WireFormatLite::InternalWriteMessage(field, value, ptr, stream); + return WireFormatLite::InternalWriteMessage( + field, value, value.GetCachedSize(), ptr, stream); } #define WRITE_METHOD(FieldType, DeclaredType) \ @@ -578,25 +580,26 @@ inline bool MapTypeHandler::IsInitialized( template \ inline void MapTypeHandler::Merge( \ const MapEntryAccessorType& from, TypeOnMemory* to, Arena* arena) { \ - to->Set(&internal::GetEmptyStringAlreadyInited(), from, arena); \ + to->Set(from, arena); \ } \ template \ void MapTypeHandler::DeleteNoArena( \ TypeOnMemory& value) { \ - value.DestroyNoArena(&internal::GetEmptyStringAlreadyInited()); \ + value.Destroy(); \ } \ template \ constexpr auto \ MapTypeHandler::Constinit() \ ->TypeOnMemory { \ - return TypeOnMemory(&internal::fixed_address_empty_string); \ + return TypeOnMemory(&internal::fixed_address_empty_string, \ + ConstantInitialized{}); \ } \ template \ inline typename MapTypeHandler::MapEntryAccessorType* \ MapTypeHandler::EnsureMutable( \ TypeOnMemory* value, Arena* arena) { \ - return value->Mutable(ArenaStringPtr::EmptyDefault{}, arena); \ + return value->Mutable(arena); \ } \ template \ inline const typename MapTypeHandler +struct MapEntryFuncs { + typedef MapTypeHandler KeyTypeHandler; + typedef MapTypeHandler ValueTypeHandler; + enum : int { + kKeyFieldNumber = 1, + kValueFieldNumber = 2 + }; + + static uint8_t* InternalSerialize(int field_number, const Key& key, + const Value& value, uint8_t* ptr, + io::EpsCopyOutputStream* stream) { + ptr = stream->EnsureSpace(ptr); + ptr = WireFormatLite::WriteTagToArray( + field_number, WireFormatLite::WIRETYPE_LENGTH_DELIMITED, ptr); + ptr = io::CodedOutputStream::WriteVarint32ToArray(GetCachedSize(key, value), + ptr); + + ptr = KeyTypeHandler::Write(kKeyFieldNumber, key, ptr, stream); + return ValueTypeHandler::Write(kValueFieldNumber, value, ptr, stream); + } + + static size_t ByteSizeLong(const Key& key, const Value& value) { + // Tags for key and value will both be one byte (field numbers 1 and 2). + size_t inner_length = + 2 + KeyTypeHandler::ByteSize(key) + ValueTypeHandler::ByteSize(value); + return inner_length + io::CodedOutputStream::VarintSize32( + static_cast(inner_length)); + } + + static int GetCachedSize(const Key& key, const Value& value) { + // Tags for key and value will both be one byte (field numbers 1 and 2). + return 2 + KeyTypeHandler::GetCachedSize(key) + + ValueTypeHandler::GetCachedSize(value); + } +}; + } // namespace internal } // namespace protobuf } // namespace google diff --git a/windows/include/google/protobuf/message.h b/windows/include/google/protobuf/message.h index a08694584..39ec154c3 100644 --- a/windows/include/google/protobuf/message.h +++ b/windows/include/google/protobuf/message.h @@ -110,6 +110,7 @@ #ifndef GOOGLE_PROTOBUF_MESSAGE_H__ #define GOOGLE_PROTOBUF_MESSAGE_H__ + #include #include #include @@ -118,16 +119,15 @@ #include #include #include +#include #include #include #include +#include // TODO(b/211442718): cleanup #include -#include -#define GOOGLE_PROTOBUF_HAS_ONEOF -#define GOOGLE_PROTOBUF_HAS_ARENAS - +// Must be included last. #include #ifdef SWIG @@ -145,7 +145,6 @@ class MessageFactory; // Defined in other files. class AssignDescriptorsHelper; class DynamicMessageFactory; -class DynamicMessageReflectionHelper; class GeneratedMessageReflectionTestHelper; class MapKey; class MapValueConstRef; @@ -220,6 +219,9 @@ const To& GetConstRefAtOffset(const Message& message, uint32_t offset) { } bool CreateUnknownEnumValues(const FieldDescriptor* field); + +// Returns true if "message" is a descendant of "root". +PROTOBUF_EXPORT bool IsDescendant(Message& root, const Message& message); } // namespace internal // Abstract interface for protocol messages. @@ -253,7 +255,7 @@ class PROTOBUF_EXPORT Message : public MessageLite { // Make this message into a copy of the given message. The given message // must have the same descriptor, but need not necessarily be the same class. // By default this is just implemented as "Clear(); MergeFrom(from);". - virtual void CopyFrom(const Message& from); + void CopyFrom(const Message& from); // Merge the fields from the given message into this message. Singular // fields will be overwritten, if specified in from, except for embedded @@ -303,8 +305,11 @@ class PROTOBUF_EXPORT Message : public MessageLite { // Debugging & Testing---------------------------------------------- - // Generates a human readable form of this message, useful for debugging - // and other purposes. + // Generates a human-readable form of this message for debugging purposes. + // Note that the format and content of a debug string is not guaranteed, may + // change without notice, and should not be depended on. Code that does + // anything except display a string to assist in debugging should use + // TextFormat instead. std::string DebugString() const; // Like DebugString(), but with less whitespace. std::string ShortDebugString() const; @@ -366,8 +371,8 @@ class PROTOBUF_EXPORT Message : public MessageLite { // Note: The order of arguments (to, then from) is chosen so that the ABI // of this function is the same as the CopyFrom method. That is, the // hidden "this" parameter comes first. - void (*copy_to_from)(Message* to, const Message& from_msg); - void (*merge_to_from)(Message* to, const Message& from_msg); + void (*copy_to_from)(Message& to, const Message& from_msg); + void (*merge_to_from)(Message& to, const Message& from_msg); }; // GetClassData() returns a pointer to a ClassData struct which // exists in global memory and is unique to each subclass. This uniqueness @@ -376,11 +381,14 @@ class PROTOBUF_EXPORT Message : public MessageLite { // TODO(jorg): change to pure virtual virtual const ClassData* GetClassData() const { return nullptr; } - // CopyWithSizeCheck calls Clear() and then MergeFrom(), and in debug + // CopyWithSourceCheck calls Clear() and then MergeFrom(), and in debug // builds, checks that calling Clear() on the destination message doesn't - // alter the size of the source. It assumes the messages are known to be - // of the same type, and thus uses GetClassData(). - static void CopyWithSizeCheck(Message* to, const Message& from); + // alter the source. It assumes the messages are known to be of the same + // type, and thus uses GetClassData(). + static void CopyWithSourceCheck(Message& to, const Message& from); + + // Fail if "from" is a descendant of "to" as such copy is not allowed. + static void FailIfCopyFromDescendant(Message& to, const Message& from); inline explicit Message(Arena* arena, bool is_message_owned = false) : MessageLite(arena, is_message_owned) {} @@ -1022,6 +1030,7 @@ class PROTOBUF_EXPORT Reflection final { bool IsEagerlyVerifiedLazyField(const FieldDescriptor* field) const; friend class FastReflectionMessageMutator; + friend bool internal::IsDescendant(Message& root, const Message& message); const Descriptor* const descriptor_; const internal::ReflectionSchema schema_; @@ -1040,7 +1049,6 @@ class PROTOBUF_EXPORT Reflection final { friend class ::PROTOBUF_NAMESPACE_ID::MessageLayoutInspector; friend class ::PROTOBUF_NAMESPACE_ID::AssignDescriptorsHelper; friend class DynamicMessageFactory; - friend class DynamicMessageReflectionHelper; friend class GeneratedMessageReflectionTestHelper; friend class python::MapReflectionFriend; friend class python::MessageReflectionFriend; @@ -1144,7 +1152,7 @@ class PROTOBUF_EXPORT Reflection final { const internal::ExtensionSet& GetExtensionSet(const Message& message) const; internal::ExtensionSet* MutableExtensionSet(Message* message) const; - inline const internal::InternalMetadata& GetInternalMetadata( + const internal::InternalMetadata& GetInternalMetadata( const Message& message) const; internal::InternalMetadata* MutableInternalMetadata(Message* message) const; @@ -1163,6 +1171,8 @@ class PROTOBUF_EXPORT Reflection final { inline uint32_t* MutableInlinedStringDonatedArray(Message* message) const; inline bool IsInlinedStringDonated(const Message& message, const FieldDescriptor* field) const; + inline void SwapInlinedStringDonated(Message* lhs, Message* rhs, + const FieldDescriptor* field) const; // Shallow-swap fields listed in fields vector of two messages. It is the // caller's responsibility to make sure shallow swap is safe. @@ -1375,11 +1385,11 @@ T* DynamicCastToGenerated(Message* from) { // Call this function to ensure that this message's reflection is linked into // the binary: // -// google::protobuf::LinkMessageReflection(); +// google::protobuf::LinkMessageReflection(); // // This will ensure that the following lookup will succeed: // -// DescriptorPool::generated_pool()->FindMessageTypeByName("FooMessage"); +// DescriptorPool::generated_pool()->FindMessageTypeByName("pkg.FooMessage"); // // As a side-effect, it will also guarantee that anything else from the same // .proto file will also be available for lookup in the generated pool. diff --git a/windows/include/google/protobuf/message_lite.h b/windows/include/google/protobuf/message_lite.h index 5e6fbdb5d..950ae1a12 100644 --- a/windows/include/google/protobuf/message_lite.h +++ b/windows/include/google/protobuf/message_lite.h @@ -39,6 +39,7 @@ #ifndef GOOGLE_PROTOBUF_MESSAGE_LITE_H__ #define GOOGLE_PROTOBUF_MESSAGE_LITE_H__ + #include #include @@ -46,12 +47,12 @@ #include #include #include -#include -#include #include #include #include - +#include +#include +#include // TODO(b/211442718): cleanup // clang-format off #include @@ -83,12 +84,6 @@ namespace internal { class SwapFieldHelper; -// Tag type used to invoke the constinit constructor overload of some classes. -// Such constructors are internal implementation details of the library. -struct ConstantInitialized { - explicit ConstantInitialized() = default; -}; - // See parse_context.h for explanation class ParseContext; @@ -130,8 +125,9 @@ inline int ToIntSize(size_t size) { } // Default empty string object. Don't use this directly. Instead, call -// GetEmptyString() to get the reference. -PROTOBUF_EXPORT extern ExplicitlyConstructed +// GetEmptyString() to get the reference. This empty string is aligned with a +// minimum alignment of 8 bytes to match the requirement of ArenaStringPtr. +PROTOBUF_EXPORT extern ExplicitlyConstructedArenaString fixed_address_empty_string; @@ -187,14 +183,13 @@ class PROTOBUF_EXPORT MessageLite { // if arena is a nullptr. virtual MessageLite* New(Arena* arena) const = 0; - // Same as GetOwningArena. - Arena* GetArena() const { return GetOwningArena(); } + // Returns user-owned arena; nullptr if it's message owned. + Arena* GetArena() const { return _internal_metadata_.user_arena(); } // Clear all fields of the message and set them to their default values. - // Clear() avoids freeing memory, assuming that any memory allocated - // to hold parts of the message will be needed again to hold the next - // message. If you actually want to free the memory used by a Message, - // you must delete it. + // Clear() assumes that any memory allocated to hold parts of the message + // will likely be needed again, so the memory used may not be freed. + // To ensure that all memory used by a Message is freed, you must delete it. virtual void Clear() = 0; // Quickly check if all required fields have values set. @@ -422,6 +417,8 @@ class PROTOBUF_EXPORT MessageLite { return nullptr; } + virtual void OnDemandRegisterArenaDtor(Arena* /*arena*/) {} + protected: template static T* CreateMaybeMessage(Arena* arena) { @@ -442,6 +439,10 @@ class PROTOBUF_EXPORT MessageLite { // messages, etc), or owning incoming objects (e.g., set allocated). Arena* GetArenaForAllocation() const { return _internal_metadata_.arena(); } + // Returns true if this message is enabled for message-owned arena (MOA) + // trials. No lite messages are eligible for MOA. + static bool InMoaTrial() { return false; } + internal::InternalMetadata _internal_metadata_; public: @@ -472,9 +473,6 @@ class PROTOBUF_EXPORT MessageLite { } private: - // TODO(gerbens) make this a pure abstract function - virtual const void* InternalGetTable() const { return nullptr; } - friend class FastReflectionMessageMutator; friend class FastReflectionStringSetter; friend class Message; diff --git a/windows/include/google/protobuf/metadata_lite.h b/windows/include/google/protobuf/metadata_lite.h index e6ecfb7e2..0c31517f0 100644 --- a/windows/include/google/protobuf/metadata_lite.h +++ b/windows/include/google/protobuf/metadata_lite.h @@ -36,6 +36,7 @@ #include #include +// Must be included last. #include #ifdef SWIG @@ -59,20 +60,32 @@ namespace internal { // It uses bit 0 == 0 to indicate an arena pointer and bit 0 == 1 to indicate a // UFS+Arena-container pointer. Besides it uses bit 1 == 0 to indicate arena // allocation and bit 1 == 1 to indicate heap allocation. -class InternalMetadata { +class PROTOBUF_EXPORT InternalMetadata { public: constexpr InternalMetadata() : ptr_(0) {} - explicit InternalMetadata(Arena* arena, bool is_message_owned = false) - : ptr_(is_message_owned - ? reinterpret_cast(arena) | kMessageOwnedArenaTagMask - : reinterpret_cast(arena)) { + explicit InternalMetadata(Arena* arena, bool is_message_owned = false) { + SetArena(arena, is_message_owned); + } + + void SetArena(Arena* arena, bool is_message_owned) { + ptr_ = is_message_owned + ? reinterpret_cast(arena) | kMessageOwnedArenaTagMask + : reinterpret_cast(arena); GOOGLE_DCHECK(!is_message_owned || arena != nullptr); } + // To keep the ABI identical between debug and non-debug builds, + // the destructor is always defined here even though it may delegate + // to a non-inline private method. + // (see https://github.com/protocolbuffers/protobuf/issues/9947) ~InternalMetadata() { +#if defined(NDEBUG) || defined(_MSC_VER) if (HasMessageOwnedArenaTag()) { - delete arena(); + delete reinterpret_cast(ptr_ - kMessageOwnedArenaTagMask); } +#else + CheckedDestruct(); +#endif } template @@ -83,10 +96,31 @@ class InternalMetadata { } } + // DeleteReturnArena will delete the unknown fields only if they weren't + // allocated on an arena. Then it updates the flags so that if you call + // have_unknown_fields(), it will return false. Finally, it returns the + // current value of arena(). It is designed to be used as part of a + // Message class's destructor call, so that when control eventually gets + // to ~InternalMetadata(), we don't need to check for have_unknown_fields() + // again. + template + Arena* DeleteReturnArena() { + if (have_unknown_fields()) { + return DeleteOutOfLineHelper(); + } else { + return PtrValue(); + } + } + PROTOBUF_NDEBUG_INLINE Arena* owning_arena() const { return HasMessageOwnedArenaTag() ? nullptr : arena(); } + PROTOBUF_NDEBUG_INLINE Arena* user_arena() const { + Arena* a = arena(); + return a && !a->IsMessageOwned() ? a : nullptr; + } + PROTOBUF_NDEBUG_INLINE Arena* arena() const { if (PROTOBUF_PREDICT_FALSE(have_unknown_fields())) { return PtrValue()->arena; @@ -187,9 +221,18 @@ class InternalMetadata { }; template - PROTOBUF_NOINLINE void DeleteOutOfLineHelper() { - if (arena() == nullptr) { + PROTOBUF_NOINLINE Arena* DeleteOutOfLineHelper() { + if (auto* a = arena()) { + // Subtle: we want to preserve the message-owned arena flag, while at the + // same time replacing the pointer to Container with a pointer to the + // arena. + intptr_t message_owned_arena_tag = ptr_ & kMessageOwnedArenaTagMask; + ptr_ = reinterpret_cast(a) | message_owned_arena_tag; + return a; + } else { delete PtrValue>(); + ptr_ = 0; + return nullptr; } } @@ -222,6 +265,9 @@ class InternalMetadata { PROTOBUF_NOINLINE void DoSwap(T* other) { mutable_unknown_fields()->Swap(other); } + + // Private helper with debug checks for ~InternalMetadata() + void CheckedDestruct(); }; // String Template specializations. diff --git a/windows/include/google/protobuf/parse_context.h b/windows/include/google/protobuf/parse_context.h index 62e25dc76..7aea50cdc 100644 --- a/windows/include/google/protobuf/parse_context.h +++ b/windows/include/google/protobuf/parse_context.h @@ -34,19 +34,22 @@ #include #include #include +#include #include #include #include +#include +#include #include +#include #include #include #include -#include #include #include -#include +// Must be included last. #include @@ -197,6 +200,7 @@ class PROTOBUF_EXPORT EpsCopyInputStream { return ptr > limit_end_ && (next_chunk_ == nullptr || ptr - buffer_end_ > limit_); } + bool AliasingEnabled() const { return aliasing_ != kNoAliasing; } int BytesUntilLimit(const char* ptr) const { return limit_ + static_cast(buffer_end_ - ptr); } @@ -370,6 +374,10 @@ class PROTOBUF_EXPORT EpsCopyInputStream { friend class ImplicitWeakMessage; }; +using LazyEagerVerifyFnType = const char* (*)(const char* ptr, + ParseContext* ctx); +using LazyEagerVerifyFnRef = std::remove_pointer::type&; + // ParseContext holds all data that is global to the entire parse. Most // importantly it contains the input stream, but also recursion depth and also // stores the end group tag, in case a parser ended on a endgroup, to verify @@ -399,6 +407,18 @@ class PROTOBUF_EXPORT ParseContext : public EpsCopyInputStream { const char* ParseMessage(MessageLite* msg, const char* ptr); + // Spawns a child parsing context that inherits key properties. New context + // inherits the following: + // --depth_, data_, check_required_fields_, lazy_parse_mode_ + // The spawned context always disables aliasing (different input). + template + ParseContext Spawn(const char** start, T&&... args) { + ParseContext spawned(depth_, false, start, std::forward(args)...); + // Transfer key context states. + spawned.data_ = data_; + return spawned; + } + // This overload supports those few cases where ParseMessage is called // on a class that is not actually a proto message. // TODO(jorg): Eliminate this use case. @@ -467,10 +487,7 @@ struct EndianHelper<2> { static uint16_t Load(const void* p) { uint16_t tmp; std::memcpy(&tmp, p, 2); -#ifndef PROTOBUF_LITTLE_ENDIAN - tmp = bswap_16(tmp); -#endif - return tmp; + return little_endian::ToHost(tmp); } }; @@ -479,10 +496,7 @@ struct EndianHelper<4> { static uint32_t Load(const void* p) { uint32_t tmp; std::memcpy(&tmp, p, 4); -#ifndef PROTOBUF_LITTLE_ENDIAN - tmp = bswap_32(tmp); -#endif - return tmp; + return little_endian::ToHost(tmp); } }; @@ -491,10 +505,7 @@ struct EndianHelper<8> { static uint64_t Load(const void* p) { uint64_t tmp; std::memcpy(&tmp, p, 8); -#ifndef PROTOBUF_LITTLE_ENDIAN - tmp = bswap_64(tmp); -#endif - return tmp; + return little_endian::ToHost(tmp); } }; @@ -565,20 +576,96 @@ inline const char* ReadTag(const char* p, uint32_t* out, return tmp.first; } +// As above, but optimized to consume very few registers while still being fast, +// ReadTagInlined is useful for callers that don't mind the extra code but would +// like to avoid an extern function call causing spills into the stack. +// +// Two support routines for ReadTagInlined come first... +template +PROTOBUF_NODISCARD PROTOBUF_ALWAYS_INLINE constexpr T RotateLeft( + T x, int s) noexcept { + return static_cast(x << (s & (std::numeric_limits::digits - 1))) | + static_cast(x >> ((-s) & (std::numeric_limits::digits - 1))); +} + +PROTOBUF_NODISCARD inline PROTOBUF_ALWAYS_INLINE uint64_t +RotRight7AndReplaceLowByte(uint64_t res, const char& byte) { +#if defined(__x86_64__) && defined(__GNUC__) + // This will only use one register for `res`. + // `byte` comes as a reference to allow the compiler to generate code like: + // + // rorq $7, %rcx + // movb 1(%rax), %cl + // + // which avoids loading the incoming bytes into a separate register first. + asm("ror $7,%0\n\t" + "movb %1,%b0" + : "+r"(res) + : "m"(byte)); +#else + res = RotateLeft(res, -7); + res = res & ~0xFF; + res |= 0xFF & byte; +#endif + return res; +}; + +inline PROTOBUF_ALWAYS_INLINE +const char* ReadTagInlined(const char* ptr, uint32_t* out) { + uint64_t res = 0xFF & ptr[0]; + if (PROTOBUF_PREDICT_FALSE(res >= 128)) { + res = RotRight7AndReplaceLowByte(res, ptr[1]); + if (PROTOBUF_PREDICT_FALSE(res & 0x80)) { + res = RotRight7AndReplaceLowByte(res, ptr[2]); + if (PROTOBUF_PREDICT_FALSE(res & 0x80)) { + res = RotRight7AndReplaceLowByte(res, ptr[3]); + if (PROTOBUF_PREDICT_FALSE(res & 0x80)) { + // Note: this wouldn't work if res were 32-bit, + // because then replacing the low byte would overwrite + // the bottom 4 bits of the result. + res = RotRight7AndReplaceLowByte(res, ptr[4]); + if (PROTOBUF_PREDICT_FALSE(res & 0x80)) { + // The proto format does not permit longer than 5-byte encodings for + // tags. + *out = 0; + return nullptr; + } + *out = static_cast(RotateLeft(res, 28)); +#if defined(__GNUC__) + // Note: this asm statement prevents the compiler from + // trying to share the "return ptr + constant" among all + // branches. + asm("" : "+r"(ptr)); +#endif + return ptr + 5; + } + *out = static_cast(RotateLeft(res, 21)); + return ptr + 4; + } + *out = static_cast(RotateLeft(res, 14)); + return ptr + 3; + } + *out = static_cast(RotateLeft(res, 7)); + return ptr + 2; + } + *out = static_cast(res); + return ptr + 1; +} + // Decode 2 consecutive bytes of a varint and returns the value, shifted left // by 1. It simultaneous updates *ptr to *ptr + 1 or *ptr + 2 depending if the // first byte's continuation bit is set. // If bit 15 of return value is set (equivalent to the continuation bits of both // bytes being set) the varint continues, otherwise the parse is done. On x86 // movsx eax, dil -// add edi, eax +// and edi, eax +// add eax, edi // adc [rsi], 1 -// add eax, eax -// and eax, edi inline uint32_t DecodeTwoBytes(const char** ptr) { uint32_t value = UnalignedLoad(*ptr); // Sign extend the low byte continuation bit uint32_t x = static_cast(value); + value &= x; // Mask out the high byte iff no continuation // This add is an amazing operation, it cancels the low byte continuation bit // from y transferring it to the carry. Simultaneously it also shifts the 7 // LSB left by one tightly against high byte varint bits. Hence value now @@ -586,7 +673,7 @@ inline uint32_t DecodeTwoBytes(const char** ptr) { value += x; // Use the carry to update the ptr appropriately. *ptr += value < x ? 2 : 1; - return value & (x + x); // Mask out the high byte iff no continuation + return value; } // More efficient varint parsing for big varints @@ -787,7 +874,7 @@ inline bool VerifyUTF8(const std::string* s, const char* field_name) { } // All the string parsers with or without UTF checking and for all CTypes. -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* InlineGreedyStringParser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* InlineGreedyStringParser( std::string* s, const char* ptr, ParseContext* ctx); @@ -859,19 +946,19 @@ PROTOBUF_NODISCARD const char* WireFormatParser(T& field_parser, // corresponding field // These are packed varints -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedInt32Parser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedInt32Parser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedUInt32Parser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedUInt32Parser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedInt64Parser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedInt64Parser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedUInt64Parser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedUInt64Parser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedSInt32Parser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedSInt32Parser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedSInt64Parser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedSInt64Parser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedEnumParser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedEnumParser( void* object, const char* ptr, ParseContext* ctx); template @@ -905,28 +992,28 @@ PROTOBUF_NODISCARD const char* PackedEnumParserArg( }); } -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedBoolParser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedBoolParser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedFixed32Parser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedFixed32Parser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedSFixed32Parser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedSFixed32Parser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedFixed64Parser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedFixed64Parser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedSFixed64Parser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedSFixed64Parser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedFloatParser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedFloatParser( void* object, const char* ptr, ParseContext* ctx); -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* PackedDoubleParser( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* PackedDoubleParser( void* object, const char* ptr, ParseContext* ctx); // This is the only recursive parser. -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* UnknownGroupLiteParse( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* UnknownGroupLiteParse( std::string* unknown, const char* ptr, ParseContext* ctx); // This is a helper to for the UnknownGroupLiteParse but is actually also // useful in the generated code. It uses overload on std::string* vs // UnknownFieldSet* to make the generated code isomorphic between full and lite. -PROTOBUF_EXPORT PROTOBUF_NODISCARD const char* UnknownFieldParse( +PROTOBUF_NODISCARD PROTOBUF_EXPORT const char* UnknownFieldParse( uint32_t tag, std::string* unknown, const char* ptr, ParseContext* ctx); } // namespace internal diff --git a/windows/include/google/protobuf/port.h b/windows/include/google/protobuf/port.h index 4c09eb1db..a5c060b6f 100644 --- a/windows/include/google/protobuf/port.h +++ b/windows/include/google/protobuf/port.h @@ -36,5 +36,45 @@ #ifndef GOOGLE_PROTOBUF_PORT_H__ #define GOOGLE_PROTOBUF_PORT_H__ +#include +#include + + +namespace google { +namespace protobuf { +namespace internal { +inline void SizedDelete(void* p, size_t size) { +#if defined(__cpp_sized_deallocation) + ::operator delete(p, size); +#else + ::operator delete(p); +#endif +} +inline void SizedArrayDelete(void* p, size_t size) { +#if defined(__cpp_sized_deallocation) + ::operator delete[](p, size); +#else + ::operator delete[](p); +#endif +} + +// Tag type used to invoke the constinit constructor overload of classes +// such as ArenaStringPtr and MapFieldBase. Such constructors are internal +// implementation details of the library. +struct ConstantInitialized { + explicit ConstantInitialized() = default; +}; + +// Tag type used to invoke the arena constructor overload of classes such +// as ExtensionSet and MapFieldLite in aggregate initialization. These +// classes typically don't have move/copy constructors, which rules out +// explicit initialization in pre-C++17. +struct ArenaInitialized { + explicit ArenaInitialized() = default; +}; + +} // namespace internal +} // namespace protobuf +} // namespace google #endif // GOOGLE_PROTOBUF_PORT_H__ diff --git a/windows/include/google/protobuf/port_def.inc b/windows/include/google/protobuf/port_def.inc index 71325c387..6c6aa1834 100644 --- a/windows/include/google/protobuf/port_def.inc +++ b/windows/include/google/protobuf/port_def.inc @@ -118,6 +118,27 @@ #define PROTOBUF_has_builtin_DEFINED_ #endif +// Portable PROTOBUF_BUILTIN_BSWAPxx definitions +// Code must check for availability, e.g.: `defined(PROTOBUF_BUILTIN_BSWAP32)` +#ifdef PROTOBUF_BUILTIN_BSWAP16 +#error PROTOBUF_BUILTIN_BSWAP16 was previously defined +#endif +#ifdef PROTOBUF_BUILTIN_BSWAP32 +#error PROTOBUF_BUILTIN_BSWAP32 was previously defined +#endif +#ifdef PROTOBUF_BUILTIN_BSWAP64 +#error PROTOBUF_BUILTIN_BSWAP64 was previously defined +#endif +#if defined(__GNUC__) || __has_builtin(__builtin_bswap16) +#define PROTOBUF_BUILTIN_BSWAP16(x) __builtin_bswap16(x) +#endif +#if defined(__GNUC__) || __has_builtin(__builtin_bswap32) +#define PROTOBUF_BUILTIN_BSWAP32(x) __builtin_bswap32(x) +#endif +#if defined(__GNUC__) || __has_builtin(__builtin_bswap64) +#define PROTOBUF_BUILTIN_BSWAP64(x) __builtin_bswap64(x) +#endif + // Portable check for GCC minimum version: // https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html #if defined(__GNUC__) && defined(__GNUC_MINOR__) \ @@ -148,22 +169,26 @@ // Future versions of protobuf will include breaking changes to some APIs. // This macro can be set to enable these API changes ahead of time, so that // user code can be updated before upgrading versions of protobuf. +// PROTOBUF_FUTURE_FINAL is used on classes that are historically not marked as +// final, but that may be marked final in future (breaking) releases. // #define PROTOBUF_FUTURE_BREAKING_CHANGES 1 +// #define PROTOBUF_FUTURE_FINAL final +#define PROTOBUF_FUTURE_FINAL #ifdef PROTOBUF_VERSION #error PROTOBUF_VERSION was previously defined #endif -#define PROTOBUF_VERSION 3019001 +#define PROTOBUF_VERSION 3021012 #ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC #error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined #endif -#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3019000 +#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3021000 #ifdef PROTOBUF_MIN_PROTOC_VERSION #error PROTOBUF_MIN_PROTOC_VERSION was previously defined #endif -#define PROTOBUF_MIN_PROTOC_VERSION 3019000 +#define PROTOBUF_MIN_PROTOC_VERSION 3021000 #ifdef PROTOBUF_VERSION_SUFFIX #error PROTOBUF_VERSION_SUFFIX was previously defined @@ -229,11 +254,15 @@ #ifdef PROTOBUF_TAILCALL #error PROTOBUF_TAILCALL was previously defined #endif -#if __has_cpp_attribute(clang::musttail) && \ - !defined(__arm__) && !defined(_ARCH_PPC) && !defined(__wasm__) +#if __has_cpp_attribute(clang::musttail) && !defined(__arm__) && \ + !defined(_ARCH_PPC) && !defined(__wasm__) && \ + !(defined(_MSC_VER) && defined(_M_IX86)) && \ + !(defined(__NDK_MAJOR__) && __NDK_MAJOR <= 24) # ifndef PROTO2_OPENSOURCE // Compilation fails on ARM32: b/195943306 // Compilation fails on powerpc64le: b/187985113 +// Compilation fails on X86 Windows: +// https://github.com/llvm/llvm-project/issues/53271 # endif #define PROTOBUF_MUSTTAIL [[clang::musttail]] #define PROTOBUF_TAILCALL true @@ -356,17 +385,25 @@ // The minimum library version which works with the current version of the // headers. -#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3019000 +#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3021000 #ifdef PROTOBUF_RTTI #error PROTOBUF_RTTI was previously defined #endif #if defined(GOOGLE_PROTOBUF_NO_RTTI) && GOOGLE_PROTOBUF_NO_RTTI +// A user-provided definition GOOGLE_PROTOBUF_NO_RTTI=1 disables RTTI. #define PROTOBUF_RTTI 0 -#elif __has_feature(cxx_rtti) +#elif defined(__cpp_rtti) +// https://en.cppreference.com/w/cpp/feature_test #define PROTOBUF_RTTI 1 -#elif defined(__cxx_rtti) -// https://en.cppreference.com/w/User:D41D8CD98F/feature_testing_macros#C.2B.2B98 +#elif __has_feature(cxx_rtti) +// https://clang.llvm.org/docs/LanguageExtensions.html#c-rtti +#define PROTOBUF_RTTI 1 +#elif defined(__GXX_RTTI) +// https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html +#define PROTOBUF_RTTI 1 +#elif defined(_CPPRTTI) +// https://docs.microsoft.com/en-us/cpp/build/reference/gr-enable-run-time-type-information #define PROTOBUF_RTTI 1 #else #define PROTOBUF_RTTI 0 @@ -439,7 +476,7 @@ # else # define PROTOC_EXPORT __declspec(dllimport) # endif // defined(LIBPROTOC_EXPORTS) -#elif defined(PROTOBUF_USE_DLLS) && defined(LIBPROTOBUF_EXPORTS) +#elif defined(PROTOBUF_USE_DLLS) && defined(LIBPROTOC_EXPORTS) # define PROTOC_EXPORT __attribute__((visibility("default"))) #else # define PROTOC_EXPORT @@ -459,7 +496,7 @@ #ifdef PROTOBUF_NODISCARD #error PROTOBUF_NODISCARD was previously defined #endif -#if __has_cpp_attribute(nodiscard) +#if __has_cpp_attribute(nodiscard) && PROTOBUF_CPLUSPLUS_MIN(201703L) #define PROTOBUF_NODISCARD [[nodiscard]] #elif __has_attribute(warn_unused_result) || PROTOBUF_GNUC_MIN(4, 8) #define PROTOBUF_NODISCARD __attribute__((warn_unused_result)) @@ -467,6 +504,13 @@ #define PROTOBUF_NODISCARD #endif +// Enable all stable experiments if this flag is set. This allows us to group +// all of these experiments under a single build flag, which can be enabled in +// the protobuf.stable-experiments TAP project. +#ifdef PROTOBUF_ENABLE_STABLE_EXPERIMENTS +#define PROTOBUF_FORCE_MESSAGE_OWNED_ARENA +#endif // !PROTOBUF_ENABLE_STABLE_EXPERIMENTS + #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE #error PROTOBUF_FORCE_COPY_IN_RELEASE was previously defined #endif @@ -479,6 +523,10 @@ #error PROTOBUF_FORCE_COPY_IN_MOVE was previously defined #endif +#ifdef PROTOBUF_FORCE_RESET_IN_CLEAR +#error PROTOBUF_FORCE_RESET_IN_CLEAR was previously defined +#endif + // Force copy the default string to a string field so that non-optimized builds // have harder-to-rely-on address stability. #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING @@ -560,6 +608,22 @@ #define PROTOBUF_THREAD_LOCAL __thread #endif +// TODO(b/228173843): cleanup PROTOBUF_LITTLE_ENDIAN in various 3p forks. +#if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ + __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) +#define PROTOBUF_LITTLE_ENDIAN 1 +#ifdef PROTOBUF_BIG_ENDIAN +#error Conflicting PROTOBUF_BIG_ENDIAN was previously defined +#endif +#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \ + __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define PROTOBUF_BIG_ENDIAN 1 +#elif defined(_WIN32) || defined(__x86_64__) || defined(__aarch64__) +#define PROTOBUF_LITTLE_ENDIAN 1 +#else +#error "endian detection failed for current compiler" +#endif + // For enabling message owned arena, one major blocker is semantic change from // moving to copying when there is ownership transfer (e.g., move ctor, swap, // set allocated, release). This change not only causes performance regression @@ -574,16 +638,29 @@ #ifdef PROTOBUF_CONSTINIT #error PROTOBUF_CONSTINIT was previously defined #endif -#if defined(__cpp_constinit) && !PROTOBUF_GNUC_MIN(3, 0) && !defined(_MSC_VER) -// Our use of constinit does not yet work with GCC: -// https://github.com/protocolbuffers/protobuf/issues/8310 -// Does not work yet with Visual Studio 2019 Update 16.10 +#if defined(__cpp_constinit) && !defined(_MSC_VER) #define PROTOBUF_CONSTINIT constinit -#elif !defined(_MSC_VER) && \ - __has_cpp_attribute(clang::require_constant_initialization) +#define PROTOBUF_CONSTEXPR constexpr +// Some older Clang versions incorrectly raise an error about +// constant-initializing weak default instance pointers. Versions 12.0 and +// higher seem to work, except that XCode 12.5.1 shows the error even though it +// uses Clang 12.0.5. +// Clang-cl on Windows raises error also. +#elif !defined(_MSC_VER) && __has_cpp_attribute(clang::require_constant_initialization) && \ + ((defined(__APPLE__) && __clang_major__ >= 13) || \ + (!defined(__APPLE__) && __clang_major__ >= 12)) #define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]] +#define PROTOBUF_CONSTEXPR constexpr +#elif PROTOBUF_GNUC_MIN(12, 2) +#define PROTOBUF_CONSTINIT __constinit +#define PROTOBUF_CONSTEXPR constexpr +// MSVC 17 currently seems to raise an error about constant-initialized pointers. +#elif defined(_MSC_VER) && _MSC_VER >= 1930 +#define PROTOBUF_CONSTINIT +#define PROTOBUF_CONSTEXPR constexpr #else #define PROTOBUF_CONSTINIT +#define PROTOBUF_CONSTEXPR #endif // Some globals with an empty non-trivial destructor are annotated with @@ -598,26 +675,49 @@ #define PROTOBUF_ATTRIBUTE_NO_DESTROY #endif +// Force clang to always emit complete debug info for a type. +// Clang uses constructor homing to determine when to emit debug info for a +// type. If the constructor of a type is never used, which can happen in some +// cases where member variables are constructed in place for optimization +// purposes (see b/208803175 for an example), the type will have incomplete +// debug info unless this attribute is used. +#ifdef PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG +#error PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG was previously defined +#endif +#if __has_cpp_attribute(clang::standalone_debug) +#define PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG [[clang::standalone_debug]] +#else +#define PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG +#endif + // Protobuf extensions and reflection require registration of the protos linked // in the binary. Not until everything is registered does the runtime have a // complete view on all protos. When code is using reflection or extensions // in between registration calls this can lead to surprising behavior. By // having the registration run first we mitigate this scenario. -// Highest priority is 101. We use 102 to allow code that really wants to -// higher priority to still beat us. -#ifdef PROTOBUF_ATTRIBUTE_INIT_PRIORITY -#error PROTOBUF_ATTRIBUTE_INIT_PRIORITY was previously defined +// Highest priority is 101. We use 102 for registration, to allow code that +// really wants to higher priority to still beat us. Some initialization happens +// at higher priority, though, since it is needed before registration. +#ifdef PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +#error PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 was previously defined #endif -#if PROTOBUF_GNUC_MIN(3, 0) && (!defined(__APPLE__) || defined(__clang__)) && !((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))) -#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY __attribute__((init_priority((102)))) +#ifdef PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 +#error PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 was previously defined +#endif +#if PROTOBUF_GNUC_MIN(3, 0) && (!defined(__APPLE__) || defined(__clang__)) && \ + !((defined(sun) || defined(__sun)) && \ + (defined(__SVR4) || defined(__svr4__))) +#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 __attribute__((init_priority((101)))) +#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 __attribute__((init_priority((102)))) #else -#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY +#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 #endif #ifdef PROTOBUF_PRAGMA_INIT_SEG #error PROTOBUF_PRAGMA_INIT_SEG was previously defined #endif -#if _MSC_VER +#ifdef _MSC_VER #define PROTOBUF_PRAGMA_INIT_SEG __pragma(init_seg(lib)) #else #define PROTOBUF_PRAGMA_INIT_SEG @@ -679,19 +779,6 @@ #endif #if defined(PROTOBUF_EXPERIMENTAL_USE_TAIL_CALL_TABLE_PARSER) #define PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED 1 -// Selectively use static member functions instead of templates: -#ifndef PROTOBUF_TC_STATIC_PARSE_SINGULAR1 -# define PROTOBUF_TC_STATIC_PARSE_SINGULAR1 1 -#endif -#ifndef PROTOBUF_TC_STATIC_PARSE_SINGULAR2 -# define PROTOBUF_TC_STATIC_PARSE_SINGULAR2 0 -#endif -#ifndef PROTOBUF_TC_STATIC_PARSE_REPEATED1 -# define PROTOBUF_TC_STATIC_PARSE_REPEATED1 0 -#endif -#ifndef PROTOBUF_TC_STATIC_PARSE_REPEATED2 -# define PROTOBUF_TC_STATIC_PARSE_REPEATED2 0 -#endif #endif #define PROTOBUF_TC_PARAM_DECL \ @@ -712,6 +799,8 @@ #define PROTOBUF_UNUSED #endif +// ThreadSafeArenaz is turned off completely in opensource builds. + // Windows declares several inconvenient macro names. We #undef them and then // restore them in port_undef.inc. #ifdef _MSC_VER @@ -729,8 +818,12 @@ #undef ERROR_INSTALL_FAILED #pragma push_macro("ERROR_NOT_FOUND") #undef ERROR_NOT_FOUND +#pragma push_macro("GetClassName") +#undef GetClassName #pragma push_macro("GetMessage") #undef GetMessage +#pragma push_macro("GetObject") +#undef GetObject #pragma push_macro("IGNORE") #undef IGNORE #pragma push_macro("IN") @@ -757,12 +850,28 @@ #undef SERVICE_DISABLED #pragma push_macro("SEVERITY_ERROR") #undef SEVERITY_ERROR +#pragma push_macro("STATUS_PENDING") +#undef STATUS_PENDING #pragma push_macro("STRICT") #undef STRICT #pragma push_macro("timezone") #undef timezone #endif // _MSC_VER +#ifdef __APPLE__ +// Inconvenient macro names from usr/include/math.h in some macOS SDKs. +#pragma push_macro("DOMAIN") +#undef DOMAIN +// Inconvenient macro names from /usr/include/mach/boolean.h in some macOS SDKs. +#pragma push_macro("TRUE") +#undef TRUE +#pragma push_macro("FALSE") +#undef FALSE +// Inconvenient macro names from usr/include/sys/syslimits.h in some macOS SDKs. +#pragma push_macro("UID_MAX") +#undef UID_MAX +#endif // __APPLE__ + #if defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) // Don't let Objective-C Macros interfere with proto identifiers with the same // name. @@ -770,12 +879,7 @@ #undef DEBUG #endif // defined(__clang__) || PROTOBUF_GNUC_MIN(3, 0) || defined(_MSC_VER) -#if defined(__clang__) -#pragma clang diagnostic push -// TODO(gerbens) ideally we cleanup the code. But a cursory try shows many -// violations. So let's ignore for now. -#pragma clang diagnostic ignored "-Wshorten-64-to-32" -#elif PROTOBUF_GNUC_MIN(3, 0) +#if PROTOBUF_GNUC_MIN(3, 0) // GCC does not allow disabling diagnostics within an expression: // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60875, so we disable this one // globally even though it's only used for PROTOBUF_FIELD_OFFSET. @@ -784,7 +888,7 @@ #endif // Silence some MSVC warnings in all our code. -#if _MSC_VER +#ifdef _MSC_VER #pragma warning(push) // For non-trivial unions #pragma warning(disable : 4582) diff --git a/windows/include/google/protobuf/port_undef.inc b/windows/include/google/protobuf/port_undef.inc index 579eb419d..e880fa5c5 100644 --- a/windows/include/google/protobuf/port_undef.inc +++ b/windows/include/google/protobuf/port_undef.inc @@ -34,6 +34,10 @@ #ifndef PROTOBUF_NAMESPACE #error "port_undef.inc must be included after port_def.inc" #endif + +#undef PROTOBUF_BUILTIN_BSWAP16 +#undef PROTOBUF_BUILTIN_BSWAP32 +#undef PROTOBUF_BUILTIN_BSWAP64 #undef PROTOBUF_GNUC_MIN #undef PROTOBUF_MSC_VER_MIN #undef PROTOBUF_CPLUSPLUS_MIN @@ -67,6 +71,7 @@ #undef PROTOBUF_FORCE_COPY_IN_RELEASE #undef PROTOBUF_FORCE_COPY_IN_SWAP #undef PROTOBUF_FORCE_COPY_IN_MOVE +#undef PROTOBUF_FORCE_RESET_IN_CLEAR #undef PROTOBUF_FORCE_COPY_DEFAULT_STRING #undef PROTOBUF_NAMESPACE_OPEN #undef PROTOBUF_NAMESPACE_CLOSE @@ -76,22 +81,24 @@ #undef PROTOBUF_EXPORT_TEMPLATE_DEFINE #undef PROTOBUF_ALIGNAS #undef PROTOBUF_FINAL +#undef PROTOBUF_FUTURE_FINAL #undef PROTOBUF_THREAD_LOCAL +#undef PROTOBUF_LITTLE_ENDIAN +#undef PROTOBUF_BIG_ENDIAN #undef PROTOBUF_MESSAGE_OWNED_ARENA_EXPERIMENT #undef PROTOBUF_CONSTINIT +#undef PROTOBUF_CONSTEXPR #undef PROTOBUF_ATTRIBUTE_WEAK #undef PROTOBUF_HAVE_ATTRIBUTE_WEAK #undef PROTOBUF_ATTRIBUTE_NO_DESTROY -#undef PROTOBUF_ATTRIBUTE_INIT_PRIORITY +#undef PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG +#undef PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +#undef PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 #undef PROTOBUF_PRAGMA_INIT_SEG #undef PROTOBUF_ASAN #undef PROTOBUF_MSAN #undef PROTOBUF_TSAN #undef PROTOBUF_TAIL_CALL_TABLE_PARSER_ENABLED -#undef PROTOBUF_TC_STATIC_PARSE_SINGULAR1 -#undef PROTOBUF_TC_STATIC_PARSE_SINGULAR2 -#undef PROTOBUF_TC_STATIC_PARSE_REPEATED1 -#undef PROTOBUF_TC_STATIC_PARSE_REPEATED2 #undef PROTOBUF_TC_PARAM_DECL #undef PROTOBUF_EXCLUSIVE_LOCKS_REQUIRED #undef PROTOBUF_LOCKS_EXCLUDED @@ -111,7 +118,9 @@ #pragma pop_macro("ERROR_BUSY") #pragma pop_macro("ERROR_INSTALL_FAILED") #pragma pop_macro("ERROR_NOT_FOUND") +#pragma pop_macro("GetClassName") #pragma pop_macro("GetMessage") +#pragma pop_macro("GetObject") #pragma pop_macro("IGNORE") #pragma pop_macro("IN") #pragma pop_macro("INPUT_KEYBOARD") @@ -126,20 +135,26 @@ #pragma pop_macro("SERVICE_DISABLED") #pragma pop_macro("SEVERITY_ERROR") #pragma pop_macro("STRICT") +#pragma pop_macro("STATUS_PENDING") #pragma pop_macro("timezone") #endif +#ifdef __APPLE__ +#pragma pop_macro("DOMAIN") +#pragma pop_macro("TRUE") +#pragma pop_macro("FALSE") +#pragma pop_macro("UID_MAX") +#endif // __APPLE__ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) #pragma pop_macro("DEBUG") #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) -#if defined(__clang__) -#pragma clang diagnostic pop -#elif defined(__GNUC__) +#if defined(__GNUC__) #pragma GCC diagnostic pop #endif // Pop the warning(push) from port_def.inc -#if _MSC_VER +#ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/windows/include/google/protobuf/reflection.h b/windows/include/google/protobuf/reflection.h index 498ab712b..7b75a43f2 100644 --- a/windows/include/google/protobuf/reflection.h +++ b/windows/include/google/protobuf/reflection.h @@ -33,6 +33,7 @@ #ifndef GOOGLE_PROTOBUF_REFLECTION_H__ #define GOOGLE_PROTOBUF_REFLECTION_H__ + #include #include @@ -42,6 +43,7 @@ #error "You cannot SWIG proto headers" #endif +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/reflection_ops.h b/windows/include/google/protobuf/reflection_ops.h index fb98714de..0a45702f9 100644 --- a/windows/include/google/protobuf/reflection_ops.h +++ b/windows/include/google/protobuf/reflection_ops.h @@ -45,6 +45,7 @@ #error "You cannot SWIG proto headers" #endif +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/repeated_field.h b/windows/include/google/protobuf/repeated_field.h index 3f362f9f0..3fb734e5c 100644 --- a/windows/include/google/protobuf/repeated_field.h +++ b/windows/include/google/protobuf/repeated_field.h @@ -39,32 +39,25 @@ // particularly different from STL vector as it manages ownership of the // pointers that it contains. // -// Typically, clients should not need to access RepeatedField objects directly, -// but should instead use the accessor functions generated automatically by the -// protocol compiler. -// // This header covers RepeatedField. #ifndef GOOGLE_PROTOBUF_REPEATED_FIELD_H__ #define GOOGLE_PROTOBUF_REPEATED_FIELD_H__ -#include -#ifdef _MSC_VER -// This is required for min/max on VS2013 only. -#include -#endif +#include #include #include #include #include +#include #include #include -#include #include -#include #include +#include +#include // Must be included last. @@ -81,9 +74,18 @@ class Message; namespace internal { -// kRepeatedFieldLowerClampLimit is the smallest size that will be allocated -// when growing a repeated field. -constexpr int kRepeatedFieldLowerClampLimit = 4; +template +constexpr int RepeatedFieldLowerClampLimit() { + // The header is padded to be at least `sizeof(T)` when it would be smaller + // otherwise. + static_assert(sizeof(T) <= kRepHeaderSize, ""); + // We want to pad the minimum size to be a power of two bytes, including the + // header. + // The first allocation is kRepHeaderSize bytes worth of elements for a total + // of 2*kRepHeaderSize bytes. + // For an 8-byte header, we allocate 8 bool, 2 ints, or 1 int64. + return kRepHeaderSize / sizeof(T); +} // kRepeatedFieldUpperClampLimit is the lowest signed integer value that // overflows when multiplied by 2 (which is undefined behavior). Sizes above @@ -120,7 +122,6 @@ inline void SwapBlock(char* p, char* q) { // Swaps two blocks of memory of size kSize: // template void memswap(char* p, char* q); - template inline typename std::enable_if<(kSize == 0), void>::type memswap(char*, char*) { } @@ -148,6 +149,9 @@ PROTO_MEMSWAP_DEF_SIZE(uint64_t, (1u << 31)) #undef PROTO_MEMSWAP_DEF_SIZE +template +class RepeatedIterator; + } // namespace internal // RepeatedField is used to represent repeated fields of a primitive type (in @@ -192,20 +196,20 @@ class RepeatedField final { void Set(int index, const Element& value); void Add(const Element& value); - // Appends a new element and return a pointer to it. + // Appends a new element and returns a pointer to it. // The new element is uninitialized if |Element| is a POD type. Element* Add(); - // Append elements in the range [begin, end) after reserving + // Appends elements in the range [begin, end) after reserving // the appropriate number of elements. template void Add(Iter begin, Iter end); - // Remove the last element in the array. + // Removes the last element in the array. void RemoveLast(); - // Extract elements with indices in "[start .. start+num-1]". - // Copy them into "elements[0 .. num-1]" if "elements" is not nullptr. - // Caution: implementation also moves elements with indices [start+num ..]. + // Extracts elements with indices in "[start .. start+num-1]". + // Copies them into "elements[0 .. num-1]" if "elements" is not nullptr. + // Caution: also moves elements with indices [start+num ..]. // Calling this routine inside a loop can cause quadratic behavior. void ExtractSubrange(int start, int num, Element* elements); @@ -217,11 +221,11 @@ class RepeatedField final { template PROTOBUF_ATTRIBUTE_REINITIALIZES void Assign(Iter begin, Iter end); - // Reserve space to expand the field to at least the given size. If the + // Reserves space to expand the field to at least the given size. If the // array is grown, it will always be at least doubled in size. void Reserve(int new_size); - // Resize the RepeatedField to a new, smaller size. This is O(1). + // Resizes the RepeatedField to a new, smaller size. This is O(1). void Truncate(int new_size); void AddAlreadyReserved(const Element& value); @@ -242,22 +246,22 @@ class RepeatedField final { Element* mutable_data(); const Element* data() const; - // Swap entire contents with "other". If they are separate arenas then, copies - // data between each other. + // Swaps entire contents with "other". If they are separate arenas then, + // copies data between each other. void Swap(RepeatedField* other); - // Swap entire contents with "other". Should be called only if the caller can + // Swaps entire contents with "other". Should be called only if the caller can // guarantee that both repeated fields are on the same arena or are on the // heap. Swapping between different arenas is disallowed and caught by a // GOOGLE_DCHECK (see API docs for details). void UnsafeArenaSwap(RepeatedField* other); - // Swap two elements. + // Swaps two elements. void SwapElements(int index1, int index2); // STL-like iterator support - typedef Element* iterator; - typedef const Element* const_iterator; + typedef internal::RepeatedIterator iterator; + typedef internal::RepeatedIterator const_iterator; typedef Element value_type; typedef value_type& reference; typedef const value_type& const_reference; @@ -308,10 +312,9 @@ class RepeatedField final { // Invalidates all iterators at or after the removed range, including end(). iterator erase(const_iterator first, const_iterator last); - // Get the Arena on which this RepeatedField stores its elements. + // Gets the Arena on which this RepeatedField stores its elements. inline Arena* GetArena() const { - return (total_size_ == 0) ? static_cast(arena_or_elements_) - : rep()->arena; + return GetOwningArena(); } // For internal use only. @@ -320,6 +323,14 @@ class RepeatedField final { inline void InternalSwap(RepeatedField* other); private: + template friend class Arena::InternalHelper; + + // Gets the Arena on which this RepeatedField stores its elements. + inline Arena* GetOwningArena() const { + return (total_size_ == 0) ? static_cast(arena_or_elements_) + : rep()->arena; + } + static constexpr int kInitialSize = 0; // A note on the representation here (see also comment below for // RepeatedPtrFieldBase's struct Rep): @@ -333,21 +344,24 @@ class RepeatedField final { // RepeatedField class to avoid costly cache misses due to the indirection. int current_size_; int total_size_; + // Pad the Rep after arena allow for power-of-two byte sizes when + // sizeof(Element) > sizeof(Arena*). eg for 16-byte objects. + static PROTOBUF_CONSTEXPR const size_t kRepHeaderSize = + sizeof(Arena*) < sizeof(Element) ? sizeof(Element) : sizeof(Arena*); struct Rep { Arena* arena; - // Here we declare a huge array as a way of approximating C's "flexible - // array member" feature without relying on undefined behavior. - Element elements[(std::numeric_limits::max() - 2 * sizeof(Arena*)) / - sizeof(Element)]; + Element* elements() { + return reinterpret_cast(reinterpret_cast(this) + + kRepHeaderSize); + } }; - static constexpr size_t kRepHeaderSize = offsetof(Rep, elements); // If total_size_ == 0 this points to an Arena otherwise it points to the // elements member of a Rep struct. Using this invariant allows the storage of // the arena pointer without an extra allocation in the constructor. void* arena_or_elements_; - // Return pointer to elements array. + // Returns a pointer to elements array. // pre-condition: the array must have been allocated. Element* elements() const { GOOGLE_DCHECK_GT(total_size_, 0); @@ -355,48 +369,48 @@ class RepeatedField final { return unsafe_elements(); } - // Return pointer to elements array if it exists otherwise either null or - // a invalid pointer is returned. This only happens for empty repeated fields, - // where you can't dereference this pointer anyway (it's empty). + // Returns a pointer to elements array if it exists; otherwise either null or + // an invalid pointer is returned. This only happens for empty repeated + // fields, where you can't dereference this pointer anyway (it's empty). Element* unsafe_elements() const { return static_cast(arena_or_elements_); } - // Return pointer to the Rep struct. + // Returns a pointer to the Rep struct. // pre-condition: the Rep must have been allocated, ie elements() is safe. Rep* rep() const { - char* addr = reinterpret_cast(elements()) - offsetof(Rep, elements); - return reinterpret_cast(addr); + return reinterpret_cast(reinterpret_cast(elements()) - + kRepHeaderSize); } friend class Arena; typedef void InternalArenaConstructable_; - // Move the contents of |from| into |to|, possibly clobbering |from| in the + // Moves the contents of |from| into |to|, possibly clobbering |from| in the // process. For primitive types this is just a memcpy(), but it could be // specialized for non-primitive types to, say, swap each element instead. void MoveArray(Element* to, Element* from, int size); - // Copy the elements of |from| into |to|. + // Copies the elements of |from| into |to|. void CopyArray(Element* to, const Element* from, int size); // Internal helper to delete all elements and deallocate the storage. - void InternalDeallocate(Rep* rep, int size) { + void InternalDeallocate(Rep* rep, int size, bool in_destructor) { if (rep != nullptr) { - Element* e = &rep->elements[0]; + Element* e = &rep->elements()[0]; if (!std::is_trivial::value) { - Element* limit = &rep->elements[size]; + Element* limit = &rep->elements()[size]; for (; e < limit; e++) { e->~Element(); } } + const size_t bytes = size * sizeof(*e) + kRepHeaderSize; if (rep->arena == nullptr) { -#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation) - const size_t bytes = size * sizeof(*e) + kRepHeaderSize; - ::operator delete(static_cast(rep), bytes); -#else - ::operator delete(static_cast(rep)); -#endif + internal::SizedDelete(rep, bytes); + } else if (!in_destructor) { + // If we are in the destructor, we might be being destroyed as part of + // the arena teardown. We can't try and return blocks to the arena then. + rep->arena->ReturnArrayMemory(rep, bytes); } } } @@ -419,7 +433,7 @@ class RepeatedField final { // largely the presence of the fallback path disturbs the compilers mem-to-reg // analysis. // - // This class takes ownership of a repeated field for the duration of it's + // This class takes ownership of a repeated field for the duration of its // lifetime. The repeated field should not be accessed during this time, ie. // only access through this class is allowed. This class should always be a // function local stack variable. Intended use @@ -432,13 +446,13 @@ class RepeatedField final { // } // } // - // Typically due to the fact adder is a local stack variable. The compiler - // will be successful in mem-to-reg transformation and the machine code will - // be loop: cmp %size, %capacity jae fallback mov dword ptr [%buffer + %size * - // 4], %val inc %size jmp loop + // Typically, due to the fact that adder is a local stack variable, the + // compiler will be successful in mem-to-reg transformation and the machine + // code will be loop: cmp %size, %capacity jae fallback mov dword ptr [%buffer + // + %size * 4], %val inc %size jmp loop // // The first version executes at 7 cycles per iteration while the second - // version near 1 or 2 cycles. + // version executes at only 1 or 2 cycles. template ::value> class FastAdderImpl { public: @@ -531,13 +545,13 @@ RepeatedField::RepeatedField(Iter begin, Iter end) template RepeatedField::~RepeatedField() { #ifndef NDEBUG - // Try to trigger segfault / asan failure in non-opt builds. If arena_ + // Try to trigger segfault / asan failure in non-opt builds if arena_ // lifetime has ended before the destructor. - auto arena = GetArena(); + auto arena = GetOwningArena(); if (arena) (void)arena->SpaceAllocated(); #endif if (total_size_ > 0) { - InternalDeallocate(rep(), total_size_); + InternalDeallocate(rep(), total_size_, true); } } @@ -557,7 +571,7 @@ inline RepeatedField::RepeatedField(RepeatedField&& other) noexcept // We don't just call Swap(&other) here because it would perform 3 copies if // other is on an arena. This field can't be on an arena because arena // construction always uses the Arena* accepting constructor. - if (other.GetArena()) { + if (other.GetOwningArena()) { CopyFrom(other); } else { InternalSwap(&other); @@ -571,9 +585,9 @@ inline RepeatedField& RepeatedField::operator=( // We don't just call Swap(&other) here because it would perform 3 copies if // the two fields are on different arenas. if (this != &other) { - if (GetArena() != other.GetArena() + if (GetOwningArena() != other.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - || GetArena() == nullptr + || GetOwningArena() == nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { CopyFrom(other); @@ -612,15 +626,15 @@ inline Element* RepeatedField::AddAlreadyReserved() { } template -inline Element* RepeatedField::AddNAlreadyReserved(int n) { - GOOGLE_DCHECK_GE(total_size_ - current_size_, n) +inline Element* RepeatedField::AddNAlreadyReserved(int elements) { + GOOGLE_DCHECK_GE(total_size_ - current_size_, elements) << total_size_ << ", " << current_size_; - // Warning: sometimes people call this when n == 0 and total_size_ == 0. In - // this case the return pointer points to a zero size array (n == 0). Hence - // we can just use unsafe_elements(), because the user cannot dereference the - // pointer anyway. + // Warning: sometimes people call this when elements == 0 and + // total_size_ == 0. In this case the return pointer points to a zero size + // array (n == 0). Hence we can just use unsafe_elements(), because the user + // cannot dereference the pointer anyway. Element* ret = unsafe_elements() + current_size_; - current_size_ += n; + current_size_ += elements; return ret; } @@ -817,13 +831,14 @@ template void RepeatedField::Swap(RepeatedField* other) { if (this == other) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { + if (GetOwningArena() == other->GetOwningArena()) { #endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { - RepeatedField temp(other->GetArena()); + RepeatedField temp(other->GetOwningArena()); temp.MergeFrom(*this); CopyFrom(*other); other->UnsafeArenaSwap(&temp); @@ -833,6 +848,7 @@ void RepeatedField::Swap(RepeatedField* other) { template void RepeatedField::UnsafeArenaSwap(RepeatedField* other) { if (this == other) return; + GOOGLE_DCHECK_EQ(GetOwningArena(), other->GetOwningArena()); InternalSwap(other); } @@ -845,31 +861,31 @@ void RepeatedField::SwapElements(int index1, int index2) { template inline typename RepeatedField::iterator RepeatedField::begin() { - return unsafe_elements(); + return iterator(unsafe_elements()); } template inline typename RepeatedField::const_iterator RepeatedField::begin() const { - return unsafe_elements(); + return const_iterator(unsafe_elements()); } template inline typename RepeatedField::const_iterator RepeatedField::cbegin() const { - return unsafe_elements(); + return const_iterator(unsafe_elements()); } template inline typename RepeatedField::iterator RepeatedField::end() { - return unsafe_elements() + current_size_; + return iterator(unsafe_elements() + current_size_); } template inline typename RepeatedField::const_iterator RepeatedField::end() const { - return unsafe_elements() + current_size_; + return const_iterator(unsafe_elements() + current_size_); } template inline typename RepeatedField::const_iterator RepeatedField::cend() const { - return unsafe_elements() + current_size_; + return const_iterator(unsafe_elements() + current_size_); } template @@ -886,18 +902,23 @@ namespace internal { // new_size > total_size && // (total_size == 0 || // total_size >= kRepeatedFieldLowerClampLimit) +template inline int CalculateReserveSize(int total_size, int new_size) { - if (new_size < kRepeatedFieldLowerClampLimit) { + constexpr int lower_limit = RepeatedFieldLowerClampLimit(); + if (new_size < lower_limit) { // Clamp to smallest allowed size. - return kRepeatedFieldLowerClampLimit; + return lower_limit; } - if (total_size < kRepeatedFieldUpperClampLimit) { - return std::max(total_size * 2, new_size); - } else { - // Clamp to largest allowed size. - GOOGLE_DCHECK_GT(new_size, kRepeatedFieldUpperClampLimit); + constexpr int kMaxSizeBeforeClamp = + (std::numeric_limits::max() - kRepHeaderSize) / 2; + if (PROTOBUF_PREDICT_FALSE(total_size > kMaxSizeBeforeClamp)) { return std::numeric_limits::max(); } + // We want to double the number of bytes, not the number of elements, to try + // to stay within power-of-two allocations. + // The allocation has kRepHeaderSize + sizeof(T) * capacity. + int doubled_size = 2 * total_size + kRepHeaderSize / sizeof(T); + return std::max(doubled_size, new_size); } } // namespace internal @@ -908,8 +929,11 @@ void RepeatedField::Reserve(int new_size) { if (total_size_ >= new_size) return; Rep* old_rep = total_size_ > 0 ? rep() : nullptr; Rep* new_rep; - Arena* arena = GetArena(); - new_size = internal::CalculateReserveSize(total_size_, new_size); + Arena* arena = GetOwningArena(); + + new_size = internal::CalculateReserveSize( + total_size_, new_size); + GOOGLE_DCHECK_LE( static_cast(new_size), (std::numeric_limits::max() - kRepHeaderSize) / sizeof(Element)) @@ -928,7 +952,7 @@ void RepeatedField::Reserve(int new_size) { // total_size_ == 0 || // total_size_ >= internal::kMinRepeatedFieldAllocationSize total_size_ = new_size; - arena_or_elements_ = new_rep->elements; + arena_or_elements_ = new_rep->elements(); // Invoke placement-new on newly allocated elements. We shouldn't have to do // this, since Element is supposed to be POD, but a previous version of this // code allocated storage with "new Element[size]" and some code uses @@ -944,11 +968,11 @@ void RepeatedField::Reserve(int new_size) { new (e) Element; } if (current_size_ > 0) { - MoveArray(&elements()[0], old_rep->elements, current_size_); + MoveArray(&elements()[0], old_rep->elements(), current_size_); } // Likewise, we need to invoke destructors on the old array. - InternalDeallocate(old_rep, old_total_size); + InternalDeallocate(old_rep, old_total_size, false); } @@ -1003,6 +1027,130 @@ struct ElementCopier { // Ported by johannes from util/gtl/proto-array-iterators.h namespace internal { + +// STL-like iterator implementation for RepeatedField. You should not +// refer to this class directly; use RepeatedField::iterator instead. +// +// Note: All of the iterator operators *must* be inlined to avoid performance +// regressions. This is caused by the extern template declarations below (which +// are required because of the RepeatedField extern template declarations). If +// any of these functions aren't explicitly inlined (e.g. defined in the class), +// the compiler isn't allowed to inline them. +template +class RepeatedIterator { + public: + using iterator_category = std::random_access_iterator_tag; + // Note: remove_const is necessary for std::partial_sum, which uses value_type + // to determine the summation variable type. + using value_type = typename std::remove_const::type; + using difference_type = std::ptrdiff_t; + using pointer = Element*; + using reference = Element&; + + constexpr RepeatedIterator() noexcept : it_(nullptr) {} + + // Allows "upcasting" from RepeatedIterator to + // RepeatedIterator. + template ::value>::type* = nullptr> + constexpr RepeatedIterator( + const RepeatedIterator& other) noexcept + : it_(other.it_) {} + + // dereferenceable + constexpr reference operator*() const noexcept { return *it_; } + constexpr pointer operator->() const noexcept { return it_; } + + private: + // Helper alias to hide the internal type. + using iterator = RepeatedIterator; + + public: + // {inc,dec}rementable + iterator& operator++() noexcept { + ++it_; + return *this; + } + iterator operator++(int) noexcept { return iterator(it_++); } + iterator& operator--() noexcept { + --it_; + return *this; + } + iterator operator--(int) noexcept { return iterator(it_--); } + + // equality_comparable + friend constexpr bool operator==(const iterator& x, + const iterator& y) noexcept { + return x.it_ == y.it_; + } + friend constexpr bool operator!=(const iterator& x, + const iterator& y) noexcept { + return x.it_ != y.it_; + } + + // less_than_comparable + friend constexpr bool operator<(const iterator& x, + const iterator& y) noexcept { + return x.it_ < y.it_; + } + friend constexpr bool operator<=(const iterator& x, + const iterator& y) noexcept { + return x.it_ <= y.it_; + } + friend constexpr bool operator>(const iterator& x, + const iterator& y) noexcept { + return x.it_ > y.it_; + } + friend constexpr bool operator>=(const iterator& x, + const iterator& y) noexcept { + return x.it_ >= y.it_; + } + + // addable, subtractable + iterator& operator+=(difference_type d) noexcept { + it_ += d; + return *this; + } + constexpr iterator operator+(difference_type d) const noexcept { + return iterator(it_ + d); + } + friend constexpr iterator operator+(const difference_type d, + iterator it) noexcept { + return it + d; + } + + iterator& operator-=(difference_type d) noexcept { + it_ -= d; + return *this; + } + iterator constexpr operator-(difference_type d) const noexcept { + return iterator(it_ - d); + } + + // indexable + constexpr reference operator[](difference_type d) const noexcept { + return it_[d]; + } + + // random access iterator + friend constexpr difference_type operator-(iterator it1, + iterator it2) noexcept { + return it1.it_ - it2.it_; + } + + private: + template + friend class RepeatedIterator; + + // Allow construction from RepeatedField. + friend class RepeatedField; + explicit RepeatedIterator(Element* it) noexcept : it_(it) {} + + // The internal iterator. + Element* it_; +}; + // A back inserter for RepeatedField objects. template class RepeatedFieldBackInsertIterator { @@ -1049,6 +1197,20 @@ extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField; extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField; extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField; +namespace internal { +extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedIterator; +extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE + RepeatedIterator; +extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE + RepeatedIterator; +extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE + RepeatedIterator; +extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE + RepeatedIterator; +extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedIterator; +extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedIterator; +} // namespace internal + } // namespace protobuf } // namespace google diff --git a/windows/include/google/protobuf/repeated_ptr_field.h b/windows/include/google/protobuf/repeated_ptr_field.h index 7d635e3bb..401230bf5 100644 --- a/windows/include/google/protobuf/repeated_ptr_field.h +++ b/windows/include/google/protobuf/repeated_ptr_field.h @@ -39,16 +39,15 @@ // particularly different from STL vector as it manages ownership of the // pointers that it contains. // -// Typically, clients should not need to access RepeatedField objects directly, -// but should instead use the accessor functions generated automatically by the -// protocol compiler. -// // This header covers RepeatedPtrField. +// IWYU pragma: private, include "net/proto2/public/repeated_field.h" + #ifndef GOOGLE_PROTOBUF_REPEATED_PTR_FIELD_H__ #define GOOGLE_PROTOBUF_REPEATED_PTR_FIELD_H__ #include + #ifdef _MSC_VER // This is required for min/max on VS2013 only. #include @@ -62,8 +61,8 @@ #include #include #include -#include #include +#include // Must be included last. @@ -166,8 +165,14 @@ struct IsMovable // }; class PROTOBUF_EXPORT RepeatedPtrFieldBase { protected: - constexpr RepeatedPtrFieldBase(); - explicit RepeatedPtrFieldBase(Arena* arena); + constexpr RepeatedPtrFieldBase() + : arena_(nullptr), current_size_(0), total_size_(0), rep_(nullptr) {} + explicit RepeatedPtrFieldBase(Arena* arena) + : arena_(arena), current_size_(0), total_size_(0), rep_(nullptr) {} + + RepeatedPtrFieldBase(const RepeatedPtrFieldBase&) = delete; + RepeatedPtrFieldBase& operator=(const RepeatedPtrFieldBase&) = delete; + ~RepeatedPtrFieldBase() { #ifndef NDEBUG // Try to trigger segfault / asan failure in non-opt builds. If arena_ @@ -176,27 +181,84 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase { #endif } - // Must be called from destructor. - template - void Destroy(); - bool NeedsDestroy() const { return rep_ != nullptr && arena_ == nullptr; } - void DestroyProtos(); - - bool empty() const; - int size() const; + bool empty() const { return current_size_ == 0; } + int size() const { return current_size_; } + int Capacity() const { return total_size_; } template - const typename TypeHandler::Type& at(int index) const; - template - typename TypeHandler::Type& at(int index); + const typename TypeHandler::Type& at(int index) const { + GOOGLE_CHECK_GE(index, 0); + GOOGLE_CHECK_LT(index, current_size_); + return *cast(rep_->elements[index]); + } template - typename TypeHandler::Type* Mutable(int index); + typename TypeHandler::Type& at(int index) { + GOOGLE_CHECK_GE(index, 0); + GOOGLE_CHECK_LT(index, current_size_); + return *cast(rep_->elements[index]); + } + template - void Delete(int index); + typename TypeHandler::Type* Mutable(int index) { + GOOGLE_DCHECK_GE(index, 0); + GOOGLE_DCHECK_LT(index, current_size_); + return cast(rep_->elements[index]); + } + template typename TypeHandler::Type* Add( - typename TypeHandler::Type* prototype = nullptr); + const typename TypeHandler::Type* prototype = nullptr) { + if (rep_ != nullptr && current_size_ < rep_->allocated_size) { + return cast(rep_->elements[current_size_++]); + } + typename TypeHandler::Type* result = + TypeHandler::NewFromPrototype(prototype, arena_); + return reinterpret_cast( + AddOutOfLineHelper(result)); + } + + template < + typename TypeHandler, + typename std::enable_if::type* = nullptr> + inline void Add(typename TypeHandler::Type&& value) { + if (rep_ != nullptr && current_size_ < rep_->allocated_size) { + *cast(rep_->elements[current_size_++]) = std::move(value); + return; + } + if (!rep_ || rep_->allocated_size == total_size_) { + Reserve(total_size_ + 1); + } + ++rep_->allocated_size; + typename TypeHandler::Type* result = + TypeHandler::New(arena_, std::move(value)); + rep_->elements[current_size_++] = result; + } + + template + void Delete(int index) { + GOOGLE_DCHECK_GE(index, 0); + GOOGLE_DCHECK_LT(index, current_size_); + TypeHandler::Delete(cast(rep_->elements[index]), arena_); + } + + // Must be called from destructor. + template + void Destroy() { + if (rep_ != nullptr && arena_ == nullptr) { + int n = rep_->allocated_size; + void* const* elements = rep_->elements; + for (int i = 0; i < n; i++) { + TypeHandler::Delete(cast(elements[i]), nullptr); + } + const size_t size = total_size_ * sizeof(elements[0]) + kRepHeaderSize; + internal::SizedDelete(rep_, size); + } + rep_ = nullptr; + } + + bool NeedsDestroy() const { return rep_ != nullptr && arena_ == nullptr; } + void DestroyProtos(); // implemented in the cc file public: // The next few methods are public so that they can be called from generated @@ -204,7 +266,11 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase { // application code. template - const typename TypeHandler::Type& Get(int index) const; + const typename TypeHandler::Type& Get(int index) const { + GOOGLE_DCHECK_GE(index, 0); + GOOGLE_DCHECK_LT(index, current_size_); + return *cast(rep_->elements[index]); + } // Creates and adds an element using the given prototype, without introducing // a link-time dependency on the concrete message type. This method is used to @@ -213,29 +279,61 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase { MessageLite* AddWeak(const MessageLite* prototype); template - void Clear(); + void Clear() { + const int n = current_size_; + GOOGLE_DCHECK_GE(n, 0); + if (n > 0) { + void* const* elements = rep_->elements; + int i = 0; + do { + TypeHandler::Clear(cast(elements[i++])); + } while (i < n); + current_size_ = 0; + } + } template - void MergeFrom(const RepeatedPtrFieldBase& other); + void MergeFrom(const RepeatedPtrFieldBase& other) { + // To avoid unnecessary code duplication and reduce binary size, we use a + // layered approach to implementing MergeFrom(). The toplevel method is + // templated, so we get a small thunk per concrete message type in the + // binary. This calls a shared implementation with most of the logic, + // passing a function pointer to another type-specific piece of code that + // calls the object-allocate and merge handlers. + GOOGLE_DCHECK_NE(&other, this); + if (other.current_size_ == 0) return; + MergeFromInternal(other, + &RepeatedPtrFieldBase::MergeFromInnerLoop); + } - inline void InternalSwap(RepeatedPtrFieldBase*); + inline void InternalSwap(RepeatedPtrFieldBase* rhs) { + GOOGLE_DCHECK(this != rhs); + + // Swap all fields at once. + auto temp = std::make_tuple(rhs->arena_, rhs->current_size_, + rhs->total_size_, rhs->rep_); + std::tie(rhs->arena_, rhs->current_size_, rhs->total_size_, rhs->rep_) = + std::make_tuple(arena_, current_size_, total_size_, rep_); + std::tie(arena_, current_size_, total_size_, rep_) = temp; + } protected: - template < - typename TypeHandler, - typename std::enable_if::type* = nullptr> - void Add(typename TypeHandler::Type&& value); + template + void RemoveLast() { + GOOGLE_DCHECK_GT(current_size_, 0); + TypeHandler::Clear(cast(rep_->elements[--current_size_])); + } template - void RemoveLast(); - template - void CopyFrom(const RepeatedPtrFieldBase& other); + void CopyFrom(const RepeatedPtrFieldBase& other) { + if (&other == this) return; + RepeatedPtrFieldBase::Clear(); + RepeatedPtrFieldBase::MergeFrom(other); + } - void CloseGap(int start, int num); + void CloseGap(int start, int num); // implemented in the cc file - void Reserve(int new_size); - - int Capacity() const; + void Reserve(int new_size); // implemented in the cc file template static inline typename TypeHandler::Type* copy( @@ -246,27 +344,70 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase { } // Used for constructing iterators. - void* const* raw_data() const; - void** raw_mutable_data() const; + void* const* raw_data() const { return rep_ ? rep_->elements : nullptr; } + void** raw_mutable_data() const { + return rep_ ? const_cast(rep_->elements) : nullptr; + } template - typename TypeHandler::Type** mutable_data(); - template - const typename TypeHandler::Type* const* data() const; + typename TypeHandler::Type** mutable_data() { + // TODO(kenton): Breaks C++ aliasing rules. We should probably remove this + // method entirely. + return reinterpret_cast(raw_mutable_data()); + } template - PROTOBUF_NDEBUG_INLINE void Swap(RepeatedPtrFieldBase* other); - - void SwapElements(int index1, int index2); + const typename TypeHandler::Type* const* data() const { + // TODO(kenton): Breaks C++ aliasing rules. We should probably remove this + // method entirely. + return reinterpret_cast( + raw_data()); + } template - size_t SpaceUsedExcludingSelfLong() const; + PROTOBUF_NDEBUG_INLINE void Swap(RepeatedPtrFieldBase* other) { +#ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) +#else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) +#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + { + InternalSwap(other); + } else { + SwapFallback(other); + } + } + + void SwapElements(int index1, int index2) { + using std::swap; // enable ADL with fallback + swap(rep_->elements[index1], rep_->elements[index2]); + } + + template + size_t SpaceUsedExcludingSelfLong() const { + size_t allocated_bytes = static_cast(total_size_) * sizeof(void*); + if (rep_ != nullptr) { + for (int i = 0; i < rep_->allocated_size; ++i) { + allocated_bytes += + TypeHandler::SpaceUsedLong(*cast(rep_->elements[i])); + } + allocated_bytes += kRepHeaderSize; + } + return allocated_bytes; + } // Advanced memory management -------------------------------------- // Like Add(), but if there are no cleared objects to use, returns nullptr. template - typename TypeHandler::Type* AddFromCleared(); + typename TypeHandler::Type* AddFromCleared() { + if (rep_ != nullptr && current_size_ < rep_->allocated_size) { + return cast(rep_->elements[current_size_++]); + } else { + return nullptr; + } + } template void AddAllocated(typename TypeHandler::Type* value) { @@ -275,7 +416,31 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase { } template - void UnsafeArenaAddAllocated(typename TypeHandler::Type* value); + void UnsafeArenaAddAllocated(typename TypeHandler::Type* value) { + // Make room for the new pointer. + if (!rep_ || current_size_ == total_size_) { + // The array is completely full with no cleared objects, so grow it. + Reserve(total_size_ + 1); + ++rep_->allocated_size; + } else if (rep_->allocated_size == total_size_) { + // There is no more space in the pointer array because it contains some + // cleared objects awaiting reuse. We don't want to grow the array in + // this case because otherwise a loop calling AddAllocated() followed by + // Clear() would leak memory. + TypeHandler::Delete(cast(rep_->elements[current_size_]), + arena_); + } else if (current_size_ < rep_->allocated_size) { + // We have some cleared objects. We don't care about their order, so we + // can just move the first one to the end to make space. + rep_->elements[rep_->allocated_size] = rep_->elements[current_size_]; + ++rep_->allocated_size; + } else { + // There are no cleared objects. + ++rep_->allocated_size; + } + + rep_->elements[current_size_++] = value; + } template PROTOBUF_NODISCARD typename TypeHandler::Type* ReleaseLast() { @@ -283,51 +448,189 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase { return ReleaseLastInternal(t); } - // Releases last element and returns it, but does not do out-of-arena copy. - // And just returns the raw pointer to the contained element in the arena. + // Releases and returns the last element, but does not do out-of-arena copy. + // Instead, just returns the raw pointer to the contained element in the + // arena. template - typename TypeHandler::Type* UnsafeArenaReleaseLast(); + typename TypeHandler::Type* UnsafeArenaReleaseLast() { + GOOGLE_DCHECK_GT(current_size_, 0); + typename TypeHandler::Type* result = + cast(rep_->elements[--current_size_]); + --rep_->allocated_size; + if (current_size_ < rep_->allocated_size) { + // There are cleared elements on the end; replace the removed element + // with the last allocated element. + rep_->elements[current_size_] = rep_->elements[rep_->allocated_size]; + } + return result; + } - int ClearedCount() const; - template - void AddCleared(typename TypeHandler::Type* value); - template - PROTOBUF_NODISCARD typename TypeHandler::Type* ReleaseCleared(); + int ClearedCount() const { + return rep_ ? (rep_->allocated_size - current_size_) : 0; + } template - void AddAllocatedInternal(typename TypeHandler::Type* value, std::true_type); - template - void AddAllocatedInternal(typename TypeHandler::Type* value, std::false_type); + void AddCleared(typename TypeHandler::Type* value) { + GOOGLE_DCHECK(GetOwningArena() == nullptr) << "AddCleared() can only be used on a " + "RepeatedPtrField not on an arena."; + GOOGLE_DCHECK(TypeHandler::GetOwningArena(value) == nullptr) + << "AddCleared() can only accept values not on an arena."; + if (!rep_ || rep_->allocated_size == total_size_) { + Reserve(total_size_ + 1); + } + rep_->elements[rep_->allocated_size++] = value; + } + template + PROTOBUF_NODISCARD typename TypeHandler::Type* ReleaseCleared() { + GOOGLE_DCHECK(GetOwningArena() == nullptr) + << "ReleaseCleared() can only be used on a RepeatedPtrField not on " + << "an arena."; + GOOGLE_DCHECK(GetOwningArena() == nullptr); + GOOGLE_DCHECK(rep_ != nullptr); + GOOGLE_DCHECK_GT(rep_->allocated_size, current_size_); + return cast(rep_->elements[--rep_->allocated_size]); + } + + template + void AddAllocatedInternal(typename TypeHandler::Type* value, std::true_type) { + // AddAllocated version that implements arena-safe copying behavior. + Arena* element_arena = + reinterpret_cast(TypeHandler::GetOwningArena(value)); + Arena* arena = GetOwningArena(); + if (arena == element_arena && rep_ && rep_->allocated_size < total_size_) { + // Fast path: underlying arena representation (tagged pointer) is equal to + // our arena pointer, and we can add to array without resizing it (at + // least one slot that is not allocated). + void** elems = rep_->elements; + if (current_size_ < rep_->allocated_size) { + // Make space at [current] by moving first allocated element to end of + // allocated list. + elems[rep_->allocated_size] = elems[current_size_]; + } + elems[current_size_] = value; + current_size_ = current_size_ + 1; + rep_->allocated_size = rep_->allocated_size + 1; + } else { + AddAllocatedSlowWithCopy(value, element_arena, arena); + } + } + + template + void AddAllocatedInternal( + // AddAllocated version that does not implement arena-safe copying + // behavior. + typename TypeHandler::Type* value, std::false_type) { + if (rep_ && rep_->allocated_size < total_size_) { + // Fast path: underlying arena representation (tagged pointer) is equal to + // our arena pointer, and we can add to array without resizing it (at + // least one slot that is not allocated). + void** elems = rep_->elements; + if (current_size_ < rep_->allocated_size) { + // Make space at [current] by moving first allocated element to end of + // allocated list. + elems[rep_->allocated_size] = elems[current_size_]; + } + elems[current_size_] = value; + current_size_ = current_size_ + 1; + ++rep_->allocated_size; + } else { + UnsafeArenaAddAllocated(value); + } + } + + // Slowpath handles all cases, copying if necessary. template PROTOBUF_NOINLINE void AddAllocatedSlowWithCopy( - typename TypeHandler::Type* value, Arena* value_arena, Arena* my_arena); - template - PROTOBUF_NOINLINE void AddAllocatedSlowWithoutCopy( - typename TypeHandler::Type* value); + // Pass value_arena and my_arena to avoid duplicate virtual call (value) + // or load (mine). + typename TypeHandler::Type* value, Arena* value_arena, Arena* my_arena) { + // Ensure that either the value is in the same arena, or if not, we do the + // appropriate thing: Own() it (if it's on heap and we're in an arena) or + // copy it to our arena/heap (otherwise). + if (my_arena != nullptr && value_arena == nullptr) { + my_arena->Own(value); + } else if (my_arena != value_arena) { + typename TypeHandler::Type* new_value = + TypeHandler::NewFromPrototype(value, my_arena); + TypeHandler::Merge(*value, new_value); + TypeHandler::Delete(value, value_arena); + value = new_value; + } + + UnsafeArenaAddAllocated(value); + } template - typename TypeHandler::Type* ReleaseLastInternal(std::true_type); - template - typename TypeHandler::Type* ReleaseLastInternal(std::false_type); + typename TypeHandler::Type* ReleaseLastInternal(std::true_type) { + // ReleaseLast() for types that implement merge/copy behavior. + // First, release an element. + typename TypeHandler::Type* result = UnsafeArenaReleaseLast(); + // Now perform a copy if we're on an arena. + Arena* arena = GetOwningArena(); + + typename TypeHandler::Type* new_result; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + new_result = copy(result); + if (arena == nullptr) delete result; +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + new_result = (arena == nullptr) ? result : copy(result); +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return new_result; + } template - PROTOBUF_NOINLINE void SwapFallback(RepeatedPtrFieldBase* other); + typename TypeHandler::Type* ReleaseLastInternal(std::false_type) { + // ReleaseLast() for types that *do not* implement merge/copy behavior -- + // this is the same as UnsafeArenaReleaseLast(). Note that we GOOGLE_DCHECK-fail if + // we're on an arena, since the user really should implement the copy + // operation in this case. + GOOGLE_DCHECK(GetOwningArena() == nullptr) + << "ReleaseLast() called on a RepeatedPtrField that is on an arena, " + << "with a type that does not implement MergeFrom. This is unsafe; " + << "please implement MergeFrom for your type."; + return UnsafeArenaReleaseLast(); + } + + template + PROTOBUF_NOINLINE void SwapFallback(RepeatedPtrFieldBase* other) { +#ifdef PROTOBUF_FORCE_COPY_IN_SWAP + GOOGLE_DCHECK(GetOwningArena() == nullptr || + other->GetOwningArena() != GetOwningArena()); +#else // PROTOBUF_FORCE_COPY_IN_SWAP + GOOGLE_DCHECK(other->GetOwningArena() != GetOwningArena()); +#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + + // Copy semantics in this case. We try to improve efficiency by placing the + // temporary on |other|'s arena so that messages are copied twice rather + // than three times. + RepeatedPtrFieldBase temp(other->GetOwningArena()); + temp.MergeFrom(*this); + this->Clear(); + this->MergeFrom(*other); + other->InternalSwap(&temp); + temp.Destroy(); // Frees rep_ if `other` had no arena. + } inline Arena* GetArena() const { return arena_; } + protected: + inline Arena* GetOwningArena() const { return arena_; } + private: + template friend class Arena::InternalHelper; + static constexpr int kInitialSize = 0; // A few notes on internal representation: // // We use an indirected approach, with struct Rep, to keep // sizeof(RepeatedPtrFieldBase) equivalent to what it was before arena support - // was added, namely, 3 8-byte machine words on x86-64. An instance of Rep is + // was added; namely, 3 8-byte machine words on x86-64. An instance of Rep is // allocated only when the repeated field is non-empty, and it is a // dynamically-sized struct (the header is directly followed by elements[]). // We place arena_ and current_size_ directly in the object to avoid cache // misses due to the indirection, because these fields are checked frequently. - // Placing all fields directly in the RepeatedPtrFieldBase instance costs + // Placing all fields directly in the RepeatedPtrFieldBase instance would cost // significant performance for memory-sensitive workloads. Arena* arena_; int current_size_; @@ -356,20 +659,55 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase { void MergeFromInternal(const RepeatedPtrFieldBase& other, void (RepeatedPtrFieldBase::*inner_loop)(void**, void**, int, - int)); + int)) { + // Note: wrapper has already guaranteed that other.rep_ != nullptr here. + int other_size = other.current_size_; + void** other_elements = other.rep_->elements; + void** new_elements = InternalExtend(other_size); + int allocated_elems = rep_->allocated_size - current_size_; + (this->*inner_loop)(new_elements, other_elements, other_size, + allocated_elems); + current_size_ += other_size; + if (rep_->allocated_size < current_size_) { + rep_->allocated_size = current_size_; + } + } + // Merges other_elems to our_elems. template PROTOBUF_NOINLINE void MergeFromInnerLoop(void** our_elems, void** other_elems, int length, - int already_allocated); + int already_allocated) { + if (already_allocated < length) { + Arena* arena = GetOwningArena(); + typename TypeHandler::Type* elem_prototype = + reinterpret_cast(other_elems[0]); + for (int i = already_allocated; i < length; i++) { + // Allocate a new empty element that we'll merge into below + typename TypeHandler::Type* new_elem = + TypeHandler::NewFromPrototype(elem_prototype, arena); + our_elems[i] = new_elem; + } + } + // Main loop that does the actual merging + for (int i = 0; i < length; i++) { + // Already allocated: use existing element. + typename TypeHandler::Type* other_elem = + reinterpret_cast(other_elems[i]); + typename TypeHandler::Type* new_elem = + reinterpret_cast(our_elems[i]); + TypeHandler::Merge(*other_elem, new_elem); + } + } - // Internal helper: extend array space if necessary to contain |extend_amount| - // more elements, and return a pointer to the element immediately following - // the old list of elements. This interface factors out common behavior from - // Reserve() and MergeFrom() to reduce code size. |extend_amount| must be > 0. + // Internal helper: extends array space if necessary to contain + // |extend_amount| more elements, and returns a pointer to the element + // immediately following the old list of elements. This interface factors out + // common behavior from Reserve() and MergeFrom() to reduce code size. + // |extend_amount| must be > 0. void** InternalExtend(int extend_amount); - // Internal helper for Add: add "obj" as the next element in the + // Internal helper for Add: adds "obj" as the next element in the // array, including potentially resizing the array with Reserve if // needed void* AddOutOfLineHelper(void* obj); @@ -399,8 +737,7 @@ class PROTOBUF_EXPORT RepeatedPtrFieldBase { friend class AccessorHelper; template friend struct google::protobuf::WeakRepeatedPtrField; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPtrFieldBase); + friend class internal::TcParser; // TODO(jorg): Remove this friend. }; template @@ -415,8 +752,10 @@ class GenericTypeHandler { static inline GenericType* New(Arena* arena, GenericType&& value) { return Arena::Create(arena, std::move(value)); } - static inline GenericType* NewFromPrototype(const GenericType* prototype, - Arena* arena = nullptr); + static inline GenericType* NewFromPrototype(const GenericType* /*prototype*/, + Arena* arena = nullptr) { + return New(arena); + } static inline void Delete(GenericType* value, Arena* arena) { if (arena == nullptr) { delete value; @@ -427,38 +766,37 @@ class GenericTypeHandler { } static inline void Clear(GenericType* value) { value->Clear(); } - PROTOBUF_NOINLINE static void Merge(const GenericType& from, GenericType* to); static inline size_t SpaceUsedLong(const GenericType& value) { return value.SpaceUsedLong(); } }; -template -GenericType* GenericTypeHandler::NewFromPrototype( - const GenericType* /* prototype */, Arena* arena) { - return New(arena); -} -template -void GenericTypeHandler::Merge(const GenericType& from, - GenericType* to) { - to->MergeFrom(from); -} +// NewFromPrototypeHelper() is not defined inline here, as we will need to do a +// virtual function dispatch anyways to go from Message* to call New/Merge. (The +// additional helper is needed as a workaround for MSVC.) +MessageLite* NewFromPrototypeHelper(const MessageLite* prototype, Arena* arena); -// NewFromPrototype() and Merge() are not defined inline here, as we will need -// to do a virtual function dispatch anyways to go from Message* to call -// New/Merge. template <> -MessageLite* GenericTypeHandler::NewFromPrototype( - const MessageLite* prototype, Arena* arena); +inline MessageLite* GenericTypeHandler::NewFromPrototype( + const MessageLite* prototype, Arena* arena) { + return NewFromPrototypeHelper(prototype, arena); +} template <> inline Arena* GenericTypeHandler::GetOwningArena( MessageLite* value) { return value->GetOwningArena(); } + +template +PROTOBUF_NOINLINE inline void GenericTypeHandler::Merge( + const GenericType& from, GenericType* to) { + to->MergeFrom(from); +} template <> void GenericTypeHandler::Merge(const MessageLite& from, MessageLite* to); + template <> inline void GenericTypeHandler::Clear(std::string* value) { value->clear(); @@ -513,6 +851,7 @@ class StringTypeHandler { // Messages. template class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { + public: constexpr RepeatedPtrField(); explicit RepeatedPtrField(Arena* arena); @@ -536,8 +875,28 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { const Element& Get(int index) const; Element* Mutable(int index); + + // Unlike std::vector, adding an element to a RepeatedPtrField doesn't always + // make a new element; it might re-use an element left over from when the + // field was Clear()'d or reize()'d smaller. For this reason, Add() is the + // fastest API for adding a new element. Element* Add(); + + // `Add(std::move(value));` is equivalent to `*Add() = std::move(value);` + // It will either move-construct to the end of this field, or swap value + // with the new-or-recycled element at the end of this field. Note that + // this operation is very slow if this RepeatedPtrField is not on the + // same Arena, if any, as `value`. void Add(Element&& value); + + // Copying to the end of this RepeatedPtrField is slowest of all; it can't + // reliably copy-construct to the last element of this RepeatedPtrField, for + // example (unlike std::vector). + // We currently block this API. The right way to add to the end is to call + // Add() and modify the element it points to. + // If you must add an existing value, call `*Add() = value;` + void Add(const Element& value) = delete; + // Append elements in the range [begin, end) after reserving // the appropriate number of elements. template @@ -549,12 +908,12 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { const Element& at(int index) const; Element& at(int index); - // Remove the last element in the array. + // Removes the last element in the array. // Ownership of the element is retained by the array. void RemoveLast(); - // Delete elements with indices in the range [start .. start+num-1]. - // Caution: implementation moves all elements with indices [start+num .. ]. + // Deletes elements with indices in the range [start .. start+num-1]. + // Caution: moves all elements with indices [start+num .. ]. // Calling this routine inside a loop can cause quadratic behavior. void DeleteSubrange(int start, int num); @@ -566,7 +925,7 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { template PROTOBUF_ATTRIBUTE_REINITIALIZES void Assign(Iter begin, Iter end); - // Reserve space to expand the field to at least the given size. This only + // Reserves space to expand the field to at least the given size. This only // resizes the pointer array; it doesn't allocate any objects. If the // array is grown, it will always be at least doubled in size. void Reserve(int new_size); @@ -575,20 +934,24 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { // Gets the underlying array. This pointer is possibly invalidated by // any add or remove operation. + // + // This API is deprecated. Instead of directly working with element array, + // use APIs in repeated_field_util.h; e.g. sorting, etc. + PROTOBUF_DEPRECATED_MSG("Use APIs in repeated_field_util.h") Element** mutable_data(); const Element* const* data() const; - // Swap entire contents with "other". If they are on separate arenas, then + // Swaps entire contents with "other". If they are on separate arenas, then // copies data. void Swap(RepeatedPtrField* other); - // Swap entire contents with "other". Caller should guarantee that either both - // fields are on the same arena or both are on the heap. Swapping between + // Swaps entire contents with "other". Caller should guarantee that either + // both fields are on the same arena or both are on the heap. Swapping between // different arenas with this function is disallowed and is caught via // GOOGLE_DCHECK. void UnsafeArenaSwap(RepeatedPtrField* other); - // Swap two elements. + // Swaps two elements. void SwapElements(int index1, int index2); // STL-like iterator support @@ -645,7 +1008,7 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { // When hardcore memory management becomes necessary -- as it sometimes // does here at Google -- the following methods may be useful. - // Add an already-allocated object, passing ownership to the + // Adds an already-allocated object, passing ownership to the // RepeatedPtrField. // // Note that some special behavior occurs with respect to arenas: @@ -658,7 +1021,7 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { // this at runtime, so User Beware. void AddAllocated(Element* value); - // Remove the last element and return it, passing ownership to the caller. + // Removes and returns the last element, passing ownership to the caller. // Requires: size() > 0 // // If this RepeatedPtrField is on an arena, an object copy is required to pass @@ -666,7 +1029,7 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { // UnsafeArenaReleaseLast() if this behavior is undesired. PROTOBUF_NODISCARD Element* ReleaseLast(); - // Add an already-allocated object, skipping arena-ownership checks. The user + // Adds an already-allocated object, skipping arena-ownership checks. The user // must guarantee that the given object is in the same arena as this // RepeatedPtrField. // It is also useful in legacy code that uses temporary ownership to avoid @@ -677,16 +1040,16 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { // temp_field.UnsafeArenaExtractSubrange(0, temp_field.size(), nullptr); // If you put temp_field on the arena this fails, because the ownership // transfers to the arena at the "AddAllocated" call and is not released - // anymore causing a double delete. UnsafeArenaAddAllocated prevents this. + // anymore, causing a double delete. UnsafeArenaAddAllocated prevents this. void UnsafeArenaAddAllocated(Element* value); - // Remove the last element and return it. Unlike ReleaseLast, the returned - // pointer is always to the original object. This may be in an arena, and - // therefore have the arena's lifetime. + // Removes and returns the last element. Unlike ReleaseLast, the returned + // pointer is always to the original object. This may be in an arena, in + // which case it would have the arena's lifetime. // Requires: current_size_ > 0 Element* UnsafeArenaReleaseLast(); - // Extract elements with indices in the range "[start .. start+num-1]". + // Extracts elements with indices in the range "[start .. start+num-1]". // The caller assumes ownership of the extracted elements and is responsible // for deleting them when they are no longer needed. // If "elements" is non-nullptr, then pointers to the extracted elements @@ -717,22 +1080,21 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { // Hardcore programs may choose to manipulate these cleared objects // to better optimize memory management using the following routines. - // Get the number of cleared objects that are currently being kept + // Gets the number of cleared objects that are currently being kept // around for reuse. int ClearedCount() const; #ifndef PROTOBUF_FUTURE_BREAKING_CHANGES - // Add an element to the pool of cleared objects, passing ownership to + // Adds an element to the pool of cleared objects, passing ownership to // the RepeatedPtrField. The element must be cleared prior to calling // this method. // - // This method cannot be called when the repeated field is on an arena or when - // |value| is; both cases will trigger a GOOGLE_DCHECK-failure. + // This method cannot be called when either the repeated field or |value| is + // on an arena; both cases will trigger a GOOGLE_DCHECK-failure. void AddCleared(Element* value); - // Remove a single element from the cleared pool and return it, passing + // Removes and returns a single element from the cleared pool, passing // ownership to the caller. The element is guaranteed to be cleared. // Requires: ClearedCount() > 0 // - // // This method cannot be called when the repeated field is on an arena; doing // so will trigger a GOOGLE_DCHECK-failure. PROTOBUF_NODISCARD Element* ReleaseCleared(); @@ -767,6 +1129,9 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { // Note: RepeatedPtrField SHOULD NOT be subclassed by users. class TypeHandler; + // Internal version of GetArena(). + inline Arena* GetOwningArena() const; + // Implementations for ExtractSubrange(). The copying behavior must be // included only if the type supports the necessary operations (e.g., // MergeFrom()), so we must resolve this at compile time. ExtractSubrange() @@ -785,446 +1150,6 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { }; -// implementation ==================================================== - -namespace internal { - -constexpr RepeatedPtrFieldBase::RepeatedPtrFieldBase() - : arena_(nullptr), current_size_(0), total_size_(0), rep_(nullptr) {} - -inline RepeatedPtrFieldBase::RepeatedPtrFieldBase(Arena* arena) - : arena_(arena), current_size_(0), total_size_(0), rep_(nullptr) {} - -template -void RepeatedPtrFieldBase::Destroy() { - if (rep_ != nullptr && arena_ == nullptr) { - int n = rep_->allocated_size; - void* const* elements = rep_->elements; - for (int i = 0; i < n; i++) { - TypeHandler::Delete(cast(elements[i]), nullptr); - } -#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation) - const size_t size = total_size_ * sizeof(elements[0]) + kRepHeaderSize; - ::operator delete(static_cast(rep_), size); -#else - ::operator delete(static_cast(rep_)); -#endif - } - rep_ = nullptr; -} - -template -inline void RepeatedPtrFieldBase::Swap(RepeatedPtrFieldBase* other) { -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - SwapFallback(other); - } -} - -template -void RepeatedPtrFieldBase::SwapFallback(RepeatedPtrFieldBase* other) { -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - GOOGLE_DCHECK(GetArena() == nullptr || other->GetArena() != GetArena()); -#else // PROTOBUF_FORCE_COPY_IN_SWAP - GOOGLE_DCHECK(other->GetArena() != GetArena()); -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP - - // Copy semantics in this case. We try to improve efficiency by placing the - // temporary on |other|'s arena so that messages are copied twice rather than - // three times. - RepeatedPtrFieldBase temp(other->GetArena()); - temp.MergeFrom(*this); - this->Clear(); - this->MergeFrom(*other); - other->InternalSwap(&temp); - temp.Destroy(); // Frees rep_ if `other` had no arena. -} - -inline bool RepeatedPtrFieldBase::empty() const { return current_size_ == 0; } - -inline int RepeatedPtrFieldBase::size() const { return current_size_; } - -template -inline const typename TypeHandler::Type& RepeatedPtrFieldBase::Get( - int index) const { - GOOGLE_DCHECK_GE(index, 0); - GOOGLE_DCHECK_LT(index, current_size_); - return *cast(rep_->elements[index]); -} - -template -inline const typename TypeHandler::Type& RepeatedPtrFieldBase::at( - int index) const { - GOOGLE_CHECK_GE(index, 0); - GOOGLE_CHECK_LT(index, current_size_); - return *cast(rep_->elements[index]); -} - -template -inline typename TypeHandler::Type& RepeatedPtrFieldBase::at(int index) { - GOOGLE_CHECK_GE(index, 0); - GOOGLE_CHECK_LT(index, current_size_); - return *cast(rep_->elements[index]); -} - -template -inline typename TypeHandler::Type* RepeatedPtrFieldBase::Mutable(int index) { - GOOGLE_DCHECK_GE(index, 0); - GOOGLE_DCHECK_LT(index, current_size_); - return cast(rep_->elements[index]); -} - -template -inline void RepeatedPtrFieldBase::Delete(int index) { - GOOGLE_DCHECK_GE(index, 0); - GOOGLE_DCHECK_LT(index, current_size_); - TypeHandler::Delete(cast(rep_->elements[index]), arena_); -} - -template -inline typename TypeHandler::Type* RepeatedPtrFieldBase::Add( - typename TypeHandler::Type* prototype) { - if (rep_ != nullptr && current_size_ < rep_->allocated_size) { - return cast(rep_->elements[current_size_++]); - } - typename TypeHandler::Type* result = - TypeHandler::NewFromPrototype(prototype, arena_); - return reinterpret_cast( - AddOutOfLineHelper(result)); -} - -template ::type*> -inline void RepeatedPtrFieldBase::Add(typename TypeHandler::Type&& value) { - if (rep_ != nullptr && current_size_ < rep_->allocated_size) { - *cast(rep_->elements[current_size_++]) = std::move(value); - return; - } - if (!rep_ || rep_->allocated_size == total_size_) { - Reserve(total_size_ + 1); - } - ++rep_->allocated_size; - typename TypeHandler::Type* result = - TypeHandler::New(arena_, std::move(value)); - rep_->elements[current_size_++] = result; -} - -template -inline void RepeatedPtrFieldBase::RemoveLast() { - GOOGLE_DCHECK_GT(current_size_, 0); - TypeHandler::Clear(cast(rep_->elements[--current_size_])); -} - -template -void RepeatedPtrFieldBase::Clear() { - const int n = current_size_; - GOOGLE_DCHECK_GE(n, 0); - if (n > 0) { - void* const* elements = rep_->elements; - int i = 0; - do { - TypeHandler::Clear(cast(elements[i++])); - } while (i < n); - current_size_ = 0; - } -} - -// To avoid unnecessary code duplication and reduce binary size, we use a -// layered approach to implementing MergeFrom(). The toplevel method is -// templated, so we get a small thunk per concrete message type in the binary. -// This calls a shared implementation with most of the logic, passing a function -// pointer to another type-specific piece of code that calls the object-allocate -// and merge handlers. -template -inline void RepeatedPtrFieldBase::MergeFrom(const RepeatedPtrFieldBase& other) { - GOOGLE_DCHECK_NE(&other, this); - if (other.current_size_ == 0) return; - MergeFromInternal(other, - &RepeatedPtrFieldBase::MergeFromInnerLoop); -} - -inline void RepeatedPtrFieldBase::MergeFromInternal( - const RepeatedPtrFieldBase& other, - void (RepeatedPtrFieldBase::*inner_loop)(void**, void**, int, int)) { - // Note: wrapper has already guaranteed that other.rep_ != nullptr here. - int other_size = other.current_size_; - void** other_elements = other.rep_->elements; - void** new_elements = InternalExtend(other_size); - int allocated_elems = rep_->allocated_size - current_size_; - (this->*inner_loop)(new_elements, other_elements, other_size, - allocated_elems); - current_size_ += other_size; - if (rep_->allocated_size < current_size_) { - rep_->allocated_size = current_size_; - } -} - -// Merges other_elems to our_elems. -template -void RepeatedPtrFieldBase::MergeFromInnerLoop(void** our_elems, - void** other_elems, int length, - int already_allocated) { - if (already_allocated < length) { - Arena* arena = GetArena(); - typename TypeHandler::Type* elem_prototype = - reinterpret_cast(other_elems[0]); - for (int i = already_allocated; i < length; i++) { - // Allocate a new empty element that we'll merge into below - typename TypeHandler::Type* new_elem = - TypeHandler::NewFromPrototype(elem_prototype, arena); - our_elems[i] = new_elem; - } - } - // Main loop that does the actual merging - for (int i = 0; i < length; i++) { - // Already allocated: use existing element. - typename TypeHandler::Type* other_elem = - reinterpret_cast(other_elems[i]); - typename TypeHandler::Type* new_elem = - reinterpret_cast(our_elems[i]); - TypeHandler::Merge(*other_elem, new_elem); - } -} - -template -inline void RepeatedPtrFieldBase::CopyFrom(const RepeatedPtrFieldBase& other) { - if (&other == this) return; - RepeatedPtrFieldBase::Clear(); - RepeatedPtrFieldBase::MergeFrom(other); -} - -inline int RepeatedPtrFieldBase::Capacity() const { return total_size_; } - -inline void* const* RepeatedPtrFieldBase::raw_data() const { - return rep_ ? rep_->elements : nullptr; -} - -inline void** RepeatedPtrFieldBase::raw_mutable_data() const { - return rep_ ? const_cast(rep_->elements) : nullptr; -} - -template -inline typename TypeHandler::Type** RepeatedPtrFieldBase::mutable_data() { - // TODO(kenton): Breaks C++ aliasing rules. We should probably remove this - // method entirely. - return reinterpret_cast(raw_mutable_data()); -} - -template -inline const typename TypeHandler::Type* const* RepeatedPtrFieldBase::data() - const { - // TODO(kenton): Breaks C++ aliasing rules. We should probably remove this - // method entirely. - return reinterpret_cast(raw_data()); -} - -inline void RepeatedPtrFieldBase::SwapElements(int index1, int index2) { - using std::swap; // enable ADL with fallback - swap(rep_->elements[index1], rep_->elements[index2]); -} - -template -inline size_t RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong() const { - size_t allocated_bytes = static_cast(total_size_) * sizeof(void*); - if (rep_ != nullptr) { - for (int i = 0; i < rep_->allocated_size; ++i) { - allocated_bytes += - TypeHandler::SpaceUsedLong(*cast(rep_->elements[i])); - } - allocated_bytes += kRepHeaderSize; - } - return allocated_bytes; -} - -template -inline typename TypeHandler::Type* RepeatedPtrFieldBase::AddFromCleared() { - if (rep_ != nullptr && current_size_ < rep_->allocated_size) { - return cast(rep_->elements[current_size_++]); - } else { - return nullptr; - } -} - -// AddAllocated version that implements arena-safe copying behavior. -template -void RepeatedPtrFieldBase::AddAllocatedInternal( - typename TypeHandler::Type* value, std::true_type) { - Arena* element_arena = - reinterpret_cast(TypeHandler::GetOwningArena(value)); - Arena* arena = GetArena(); - if (arena == element_arena && rep_ && rep_->allocated_size < total_size_) { - // Fast path: underlying arena representation (tagged pointer) is equal to - // our arena pointer, and we can add to array without resizing it (at least - // one slot that is not allocated). - void** elems = rep_->elements; - if (current_size_ < rep_->allocated_size) { - // Make space at [current] by moving first allocated element to end of - // allocated list. - elems[rep_->allocated_size] = elems[current_size_]; - } - elems[current_size_] = value; - current_size_ = current_size_ + 1; - rep_->allocated_size = rep_->allocated_size + 1; - } else { - AddAllocatedSlowWithCopy(value, element_arena, arena); - } -} - -// Slowpath handles all cases, copying if necessary. -template -void RepeatedPtrFieldBase::AddAllocatedSlowWithCopy( - // Pass value_arena and my_arena to avoid duplicate virtual call (value) or - // load (mine). - typename TypeHandler::Type* value, Arena* value_arena, Arena* my_arena) { - // Ensure that either the value is in the same arena, or if not, we do the - // appropriate thing: Own() it (if it's on heap and we're in an arena) or copy - // it to our arena/heap (otherwise). - if (my_arena != nullptr && value_arena == nullptr) { - my_arena->Own(value); - } else if (my_arena != value_arena) { - typename TypeHandler::Type* new_value = - TypeHandler::NewFromPrototype(value, my_arena); - TypeHandler::Merge(*value, new_value); - TypeHandler::Delete(value, value_arena); - value = new_value; - } - - UnsafeArenaAddAllocated(value); -} - -// AddAllocated version that does not implement arena-safe copying behavior. -template -void RepeatedPtrFieldBase::AddAllocatedInternal( - typename TypeHandler::Type* value, std::false_type) { - if (rep_ && rep_->allocated_size < total_size_) { - // Fast path: underlying arena representation (tagged pointer) is equal to - // our arena pointer, and we can add to array without resizing it (at least - // one slot that is not allocated). - void** elems = rep_->elements; - if (current_size_ < rep_->allocated_size) { - // Make space at [current] by moving first allocated element to end of - // allocated list. - elems[rep_->allocated_size] = elems[current_size_]; - } - elems[current_size_] = value; - current_size_ = current_size_ + 1; - ++rep_->allocated_size; - } else { - UnsafeArenaAddAllocated(value); - } -} - -template -void RepeatedPtrFieldBase::UnsafeArenaAddAllocated( - typename TypeHandler::Type* value) { - // Make room for the new pointer. - if (!rep_ || current_size_ == total_size_) { - // The array is completely full with no cleared objects, so grow it. - Reserve(total_size_ + 1); - ++rep_->allocated_size; - } else if (rep_->allocated_size == total_size_) { - // There is no more space in the pointer array because it contains some - // cleared objects awaiting reuse. We don't want to grow the array in this - // case because otherwise a loop calling AddAllocated() followed by Clear() - // would leak memory. - TypeHandler::Delete(cast(rep_->elements[current_size_]), - arena_); - } else if (current_size_ < rep_->allocated_size) { - // We have some cleared objects. We don't care about their order, so we - // can just move the first one to the end to make space. - rep_->elements[rep_->allocated_size] = rep_->elements[current_size_]; - ++rep_->allocated_size; - } else { - // There are no cleared objects. - ++rep_->allocated_size; - } - - rep_->elements[current_size_++] = value; -} - -// ReleaseLast() for types that implement merge/copy behavior. -template -inline typename TypeHandler::Type* RepeatedPtrFieldBase::ReleaseLastInternal( - std::true_type) { - // First, release an element. - typename TypeHandler::Type* result = UnsafeArenaReleaseLast(); - // Now perform a copy if we're on an arena. - Arena* arena = GetArena(); - - typename TypeHandler::Type* new_result; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - new_result = copy(result); - if (arena == nullptr) delete result; -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - new_result = (arena == nullptr) ? result : copy(result); -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return new_result; -} - -// ReleaseLast() for types that *do not* implement merge/copy behavior -- this -// is the same as UnsafeArenaReleaseLast(). Note that we GOOGLE_DCHECK-fail if we're on -// an arena, since the user really should implement the copy operation in this -// case. -template -inline typename TypeHandler::Type* RepeatedPtrFieldBase::ReleaseLastInternal( - std::false_type) { - GOOGLE_DCHECK(GetArena() == nullptr) - << "ReleaseLast() called on a RepeatedPtrField that is on an arena, " - << "with a type that does not implement MergeFrom. This is unsafe; " - << "please implement MergeFrom for your type."; - return UnsafeArenaReleaseLast(); -} - -template -inline typename TypeHandler::Type* -RepeatedPtrFieldBase::UnsafeArenaReleaseLast() { - GOOGLE_DCHECK_GT(current_size_, 0); - typename TypeHandler::Type* result = - cast(rep_->elements[--current_size_]); - --rep_->allocated_size; - if (current_size_ < rep_->allocated_size) { - // There are cleared elements on the end; replace the removed element - // with the last allocated element. - rep_->elements[current_size_] = rep_->elements[rep_->allocated_size]; - } - return result; -} - -inline int RepeatedPtrFieldBase::ClearedCount() const { - return rep_ ? (rep_->allocated_size - current_size_) : 0; -} - -template -inline void RepeatedPtrFieldBase::AddCleared( - typename TypeHandler::Type* value) { - GOOGLE_DCHECK(GetArena() == nullptr) - << "AddCleared() can only be used on a RepeatedPtrField not on an arena."; - GOOGLE_DCHECK(TypeHandler::GetOwningArena(value) == nullptr) - << "AddCleared() can only accept values not on an arena."; - if (!rep_ || rep_->allocated_size == total_size_) { - Reserve(total_size_ + 1); - } - rep_->elements[rep_->allocated_size++] = value; -} - -template -inline typename TypeHandler::Type* RepeatedPtrFieldBase::ReleaseCleared() { - GOOGLE_DCHECK(GetArena() == nullptr) - << "ReleaseCleared() can only be used on a RepeatedPtrField not on " - << "an arena."; - GOOGLE_DCHECK(GetArena() == nullptr); - GOOGLE_DCHECK(rep_ != nullptr); - GOOGLE_DCHECK_GT(rep_->allocated_size, current_size_); - return cast(rep_->elements[--rep_->allocated_size]); -} - -} // namespace internal - // ------------------------------------------------------------------- template @@ -1286,7 +1211,7 @@ inline RepeatedPtrField::RepeatedPtrField( // We don't just call Swap(&other) here because it would perform 3 copies if // other is on an arena. This field can't be on an arena because arena // construction always uses the Arena* accepting constructor. - if (other.GetArena()) { + if (other.GetOwningArena()) { CopyFrom(other); } else { InternalSwap(&other); @@ -1300,9 +1225,9 @@ inline RepeatedPtrField& RepeatedPtrField::operator=( // We don't just call Swap(&other) here because it would perform 3 copies if // the two fields are on different arenas. if (this != &other) { - if (GetArena() != other.GetArena() + if (GetOwningArena() != other.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - || GetArena() == nullptr + || GetOwningArena() == nullptr #endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { CopyFrom(other); @@ -1411,7 +1336,7 @@ inline void RepeatedPtrField::ExtractSubrangeInternal( return; } - Arena* arena = GetArena(); + Arena* arena = GetOwningArena(); #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE // Always copy. for (int i = 0; i < num; ++i) { @@ -1449,7 +1374,7 @@ inline void RepeatedPtrField::ExtractSubrangeInternal( // ExtractSubrange() must return heap-allocated objects by contract, and we // cannot fulfill this contract if we are an on arena, we must GOOGLE_DCHECK() that // we are not on an arena. - GOOGLE_DCHECK(GetArena() == nullptr) + GOOGLE_DCHECK(GetOwningArena() == nullptr) << "ExtractSubrange() when arena is non-nullptr is only supported when " << "the Element type supplies a MergeFrom() operation to make copies."; UnsafeArenaExtractSubrange(start, num, elements); @@ -1531,6 +1456,7 @@ template inline void RepeatedPtrField::UnsafeArenaSwap( RepeatedPtrField* other) { if (this == other) return; + GOOGLE_DCHECK_EQ(GetOwningArena(), other->GetOwningArena()); RepeatedPtrFieldBase::InternalSwap(other); } @@ -1544,6 +1470,11 @@ inline Arena* RepeatedPtrField::GetArena() const { return RepeatedPtrFieldBase::GetArena(); } +template +inline Arena* RepeatedPtrField::GetOwningArena() const { + return RepeatedPtrFieldBase::GetOwningArena(); +} + template inline size_t RepeatedPtrField::SpaceUsedExcludingSelfLong() const { return RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong(); @@ -1624,16 +1555,13 @@ class RepeatedPtrIterator { RepeatedPtrIterator() : it_(nullptr) {} explicit RepeatedPtrIterator(void* const* it) : it_(it) {} - // Allow "upcasting" from RepeatedPtrIterator to + // Allows "upcasting" from RepeatedPtrIterator to // RepeatedPtrIterator. - template + template ::value>::type* = nullptr> RepeatedPtrIterator(const RepeatedPtrIterator& other) - : it_(other.it_) { - // Force a compiler error if the other type is not convertible to ours. - if (false) { - static_cast([](OtherElement* from) -> Element* { return from; }); - } - } + : it_(other.it_) {} // dereferenceable reference operator*() const { return *reinterpret_cast(*it_); } @@ -1652,14 +1580,26 @@ class RepeatedPtrIterator { iterator operator--(int) { return iterator(it_--); } // equality_comparable - bool operator==(const iterator& x) const { return it_ == x.it_; } - bool operator!=(const iterator& x) const { return it_ != x.it_; } + friend bool operator==(const iterator& x, const iterator& y) { + return x.it_ == y.it_; + } + friend bool operator!=(const iterator& x, const iterator& y) { + return x.it_ != y.it_; + } // less_than_comparable - bool operator<(const iterator& x) const { return it_ < x.it_; } - bool operator<=(const iterator& x) const { return it_ <= x.it_; } - bool operator>(const iterator& x) const { return it_ > x.it_; } - bool operator>=(const iterator& x) const { return it_ >= x.it_; } + friend bool operator<(const iterator& x, const iterator& y) { + return x.it_ < y.it_; + } + friend bool operator<=(const iterator& x, const iterator& y) { + return x.it_ <= y.it_; + } + friend bool operator>(const iterator& x, const iterator& y) { + return x.it_ > y.it_; + } + friend bool operator>=(const iterator& x, const iterator& y) { + return x.it_ >= y.it_; + } // addable, subtractable iterator& operator+=(difference_type d) { @@ -1687,7 +1627,9 @@ class RepeatedPtrIterator { reference operator[](difference_type d) const { return *(*this + d); } // random access iterator - difference_type operator-(const iterator& x) const { return it_ - x.it_; } + friend difference_type operator-(iterator it1, iterator it2) { + return it1.it_ - it2.it_; + } private: template @@ -1697,7 +1639,7 @@ class RepeatedPtrIterator { void* const* it_; }; -// Provide an iterator that operates on pointers to the underlying objects +// Provides an iterator that operates on pointers to the underlying objects // rather than the objects themselves as RepeatedPtrIterator does. // Consider using this when working with stl algorithms that change // the array. @@ -1717,6 +1659,17 @@ class RepeatedPtrOverPtrsIterator { RepeatedPtrOverPtrsIterator() : it_(nullptr) {} explicit RepeatedPtrOverPtrsIterator(VoidPtr* it) : it_(it) {} + // Allows "upcasting" from RepeatedPtrOverPtrsIterator to + // RepeatedPtrOverPtrsIterator. + template < + typename OtherElement, typename OtherVoidPtr, + typename std::enable_if< + std::is_convertible::value && + std::is_convertible::value>::type* = nullptr> + RepeatedPtrOverPtrsIterator( + const RepeatedPtrOverPtrsIterator& other) + : it_(other.it_) {} + // dereferenceable reference operator*() const { return *reinterpret_cast(it_); } pointer operator->() const { return &(operator*()); } @@ -1734,14 +1687,26 @@ class RepeatedPtrOverPtrsIterator { iterator operator--(int) { return iterator(it_--); } // equality_comparable - bool operator==(const iterator& x) const { return it_ == x.it_; } - bool operator!=(const iterator& x) const { return it_ != x.it_; } + friend bool operator==(const iterator& x, const iterator& y) { + return x.it_ == y.it_; + } + friend bool operator!=(const iterator& x, const iterator& y) { + return x.it_ != y.it_; + } // less_than_comparable - bool operator<(const iterator& x) const { return it_ < x.it_; } - bool operator<=(const iterator& x) const { return it_ <= x.it_; } - bool operator>(const iterator& x) const { return it_ > x.it_; } - bool operator>=(const iterator& x) const { return it_ >= x.it_; } + friend bool operator<(const iterator& x, const iterator& y) { + return x.it_ < y.it_; + } + friend bool operator<=(const iterator& x, const iterator& y) { + return x.it_ <= y.it_; + } + friend bool operator>(const iterator& x, const iterator& y) { + return x.it_ > y.it_; + } + friend bool operator>=(const iterator& x, const iterator& y) { + return x.it_ >= y.it_; + } // addable, subtractable iterator& operator+=(difference_type d) { @@ -1769,27 +1734,18 @@ class RepeatedPtrOverPtrsIterator { reference operator[](difference_type d) const { return *(*this + d); } // random access iterator - difference_type operator-(const iterator& x) const { return it_ - x.it_; } + friend difference_type operator-(iterator it1, iterator it2) { + return it1.it_ - it2.it_; + } private: - template - friend class RepeatedPtrIterator; + template + friend class RepeatedPtrOverPtrsIterator; // The internal iterator. VoidPtr* it_; }; -void RepeatedPtrFieldBase::InternalSwap(RepeatedPtrFieldBase* rhs) { - GOOGLE_DCHECK(this != rhs); - - // Swap all fields at once. - auto temp = std::make_tuple(rhs->arena_, rhs->current_size_, rhs->total_size_, - rhs->rep_); - std::tie(rhs->arena_, rhs->current_size_, rhs->total_size_, rhs->rep_) = - std::make_tuple(arena_, current_size_, total_size_, rep_); - std::tie(arena_, current_size_, total_size_, rep_) = temp; -} - } // namespace internal template @@ -1992,9 +1948,9 @@ AllocatedRepeatedPtrFieldBackInserter( // temp_field.UnsafeArenaAddAllocated(new T); // ... // Do something with temp_field // temp_field.UnsafeArenaExtractSubrange(0, temp_field.size(), nullptr); -// If you put temp_field on the arena this fails, because the ownership -// transfers to the arena at the "AddAllocated" call and is not released anymore -// causing a double delete. Using UnsafeArenaAddAllocated prevents this. +// Putting temp_field on the arena fails because the ownership transfers to the +// arena at the "AddAllocated" call and is not released anymore causing a +// double delete. This function uses UnsafeArenaAddAllocated to prevent this. template internal::UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator UnsafeArenaAllocatedRepeatedPtrFieldBackInserter( diff --git a/windows/include/google/protobuf/service.h b/windows/include/google/protobuf/service.h index b18a80392..d288eb554 100644 --- a/windows/include/google/protobuf/service.h +++ b/windows/include/google/protobuf/service.h @@ -100,6 +100,7 @@ #ifndef GOOGLE_PROTOBUF_SERVICE_H__ #define GOOGLE_PROTOBUF_SERVICE_H__ + #include #include #include @@ -108,6 +109,7 @@ #error "You cannot SWIG proto headers" #endif +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/source_context.pb.h b/windows/include/google/protobuf/source_context.pb.h index 5f91f3eb8..63e7d113c 100644 --- a/windows/include/google/protobuf/source_context.pb.h +++ b/windows/include/google/protobuf/source_context.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -42,14 +41,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto; @@ -70,7 +61,7 @@ class PROTOBUF_EXPORT SourceContext final : public: inline SourceContext() : SourceContext(nullptr) {} ~SourceContext() override; - explicit constexpr SourceContext(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR SourceContext(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); SourceContext(const SourceContext& from); SourceContext(SourceContext&& from) noexcept @@ -145,9 +136,11 @@ class PROTOBUF_EXPORT SourceContext final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const SourceContext& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const SourceContext& from); + void MergeFrom( const SourceContext& from) { + SourceContext::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -156,10 +149,10 @@ class PROTOBUF_EXPORT SourceContext final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(SourceContext* other); @@ -172,9 +165,6 @@ class PROTOBUF_EXPORT SourceContext final : protected: explicit SourceContext(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -210,8 +200,11 @@ class PROTOBUF_EXPORT SourceContext final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr file_name_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr file_name_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto; }; // =================================================================== @@ -227,7 +220,7 @@ class PROTOBUF_EXPORT SourceContext final : // string file_name = 1; inline void SourceContext::clear_file_name() { - file_name_.ClearToEmpty(); + _impl_.file_name_.ClearToEmpty(); } inline const std::string& SourceContext::file_name() const { // @@protoc_insertion_point(field_get:google.protobuf.SourceContext.file_name) @@ -237,7 +230,7 @@ template inline PROTOBUF_ALWAYS_INLINE void SourceContext::set_file_name(ArgT0&& arg0, ArgT... args) { - file_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.file_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.SourceContext.file_name) } inline std::string* SourceContext::mutable_file_name() { @@ -246,19 +239,19 @@ inline std::string* SourceContext::mutable_file_name() { return _s; } inline const std::string& SourceContext::_internal_file_name() const { - return file_name_.Get(); + return _impl_.file_name_.Get(); } inline void SourceContext::_internal_set_file_name(const std::string& value) { - file_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.file_name_.Set(value, GetArenaForAllocation()); } inline std::string* SourceContext::_internal_mutable_file_name() { - return file_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.file_name_.Mutable(GetArenaForAllocation()); } inline std::string* SourceContext::release_file_name() { // @@protoc_insertion_point(field_release:google.protobuf.SourceContext.file_name) - return file_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.file_name_.Release(); } inline void SourceContext::set_allocated_file_name(std::string* file_name) { if (file_name != nullptr) { @@ -266,11 +259,10 @@ inline void SourceContext::set_allocated_file_name(std::string* file_name) { } else { } - file_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), file_name, - GetArenaForAllocation()); + _impl_.file_name_.SetAllocated(file_name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (file_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - file_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.file_name_.IsDefault()) { + _impl_.file_name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceContext.file_name) diff --git a/windows/include/google/protobuf/struct.pb.h b/windows/include/google/protobuf/struct.pb.h index 6e54bee65..002aa85dc 100644 --- a/windows/include/google/protobuf/struct.pb.h +++ b/windows/include/google/protobuf/struct.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -46,14 +45,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fstruct_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[4] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fstruct_2eproto; @@ -115,7 +106,7 @@ public: ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> SuperType; Struct_FieldsEntry_DoNotUse(); - explicit constexpr Struct_FieldsEntry_DoNotUse( + explicit PROTOBUF_CONSTEXPR Struct_FieldsEntry_DoNotUse( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); explicit Struct_FieldsEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); void MergeFrom(const Struct_FieldsEntry_DoNotUse& other); @@ -126,6 +117,7 @@ public: static bool ValidateValue(void*) { return true; } using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_google_2fprotobuf_2fstruct_2eproto; }; // ------------------------------------------------------------------- @@ -135,7 +127,7 @@ class PROTOBUF_EXPORT Struct final : public: inline Struct() : Struct(nullptr) {} ~Struct() override; - explicit constexpr Struct(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Struct(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Struct(const Struct& from); Struct(Struct&& from) noexcept @@ -210,9 +202,11 @@ class PROTOBUF_EXPORT Struct final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Struct& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Struct& from); + void MergeFrom( const Struct& from) { + Struct::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -221,10 +215,10 @@ class PROTOBUF_EXPORT Struct final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Struct* other); @@ -239,7 +233,6 @@ class PROTOBUF_EXPORT Struct final : bool is_message_owned = false); private: static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -279,12 +272,15 @@ class PROTOBUF_EXPORT Struct final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::MapField< - Struct_FieldsEntry_DoNotUse, - std::string, ::PROTOBUF_NAMESPACE_ID::Value, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> fields_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + Struct_FieldsEntry_DoNotUse, + std::string, ::PROTOBUF_NAMESPACE_ID::Value, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> fields_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fstruct_2eproto; }; // ------------------------------------------------------------------- @@ -294,7 +290,7 @@ class PROTOBUF_EXPORT Value final : public: inline Value() : Value(nullptr) {} ~Value() override; - explicit constexpr Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Value(const Value& from); Value(Value&& from) noexcept @@ -379,9 +375,11 @@ class PROTOBUF_EXPORT Value final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Value& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Value& from); + void MergeFrom( const Value& from) { + Value::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -390,10 +388,10 @@ class PROTOBUF_EXPORT Value final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Value* other); @@ -406,9 +404,6 @@ class PROTOBUF_EXPORT Value final : protected: explicit Value(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -539,19 +534,22 @@ class PROTOBUF_EXPORT Value final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - union KindUnion { - constexpr KindUnion() : _constinit_{} {} - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; - int null_value_; - double number_value_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr string_value_; - bool bool_value_; - ::PROTOBUF_NAMESPACE_ID::Struct* struct_value_; - ::PROTOBUF_NAMESPACE_ID::ListValue* list_value_; - } kind_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - uint32_t _oneof_case_[1]; + struct Impl_ { + union KindUnion { + constexpr KindUnion() : _constinit_{} {} + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; + int null_value_; + double number_value_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr string_value_; + bool bool_value_; + ::PROTOBUF_NAMESPACE_ID::Struct* struct_value_; + ::PROTOBUF_NAMESPACE_ID::ListValue* list_value_; + } kind_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + uint32_t _oneof_case_[1]; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fstruct_2eproto; }; // ------------------------------------------------------------------- @@ -561,7 +559,7 @@ class PROTOBUF_EXPORT ListValue final : public: inline ListValue() : ListValue(nullptr) {} ~ListValue() override; - explicit constexpr ListValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ListValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); ListValue(const ListValue& from); ListValue(ListValue&& from) noexcept @@ -636,9 +634,11 @@ class PROTOBUF_EXPORT ListValue final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const ListValue& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const ListValue& from); + void MergeFrom( const ListValue& from) { + ListValue::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -647,10 +647,10 @@ class PROTOBUF_EXPORT ListValue final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(ListValue* other); @@ -663,9 +663,6 @@ class PROTOBUF_EXPORT ListValue final : protected: explicit ListValue(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -705,8 +702,11 @@ class PROTOBUF_EXPORT ListValue final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Value > values_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Value > values_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fstruct_2eproto; }; // =================================================================== @@ -724,17 +724,17 @@ class PROTOBUF_EXPORT ListValue final : // map fields = 1; inline int Struct::_internal_fields_size() const { - return fields_.size(); + return _impl_.fields_.size(); } inline int Struct::fields_size() const { return _internal_fields_size(); } inline void Struct::clear_fields() { - fields_.Clear(); + _impl_.fields_.Clear(); } inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >& Struct::_internal_fields() const { - return fields_.GetMap(); + return _impl_.fields_.GetMap(); } inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >& Struct::fields() const { @@ -743,7 +743,7 @@ Struct::fields() const { } inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >* Struct::_internal_mutable_fields() { - return fields_.MutableMap(); + return _impl_.fields_.MutableMap(); } inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::PROTOBUF_NAMESPACE_ID::Value >* Struct::mutable_fields() { @@ -763,17 +763,17 @@ inline bool Value::has_null_value() const { return _internal_has_null_value(); } inline void Value::set_has_null_value() { - _oneof_case_[0] = kNullValue; + _impl_._oneof_case_[0] = kNullValue; } inline void Value::clear_null_value() { if (_internal_has_null_value()) { - kind_.null_value_ = 0; + _impl_.kind_.null_value_ = 0; clear_has_kind(); } } inline ::PROTOBUF_NAMESPACE_ID::NullValue Value::_internal_null_value() const { if (_internal_has_null_value()) { - return static_cast< ::PROTOBUF_NAMESPACE_ID::NullValue >(kind_.null_value_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::NullValue >(_impl_.kind_.null_value_); } return static_cast< ::PROTOBUF_NAMESPACE_ID::NullValue >(0); } @@ -786,7 +786,7 @@ inline void Value::_internal_set_null_value(::PROTOBUF_NAMESPACE_ID::NullValue v clear_kind(); set_has_null_value(); } - kind_.null_value_ = value; + _impl_.kind_.null_value_ = value; } inline void Value::set_null_value(::PROTOBUF_NAMESPACE_ID::NullValue value) { _internal_set_null_value(value); @@ -801,17 +801,17 @@ inline bool Value::has_number_value() const { return _internal_has_number_value(); } inline void Value::set_has_number_value() { - _oneof_case_[0] = kNumberValue; + _impl_._oneof_case_[0] = kNumberValue; } inline void Value::clear_number_value() { if (_internal_has_number_value()) { - kind_.number_value_ = 0; + _impl_.kind_.number_value_ = 0; clear_has_kind(); } } inline double Value::_internal_number_value() const { if (_internal_has_number_value()) { - return kind_.number_value_; + return _impl_.kind_.number_value_; } return 0; } @@ -820,7 +820,7 @@ inline void Value::_internal_set_number_value(double value) { clear_kind(); set_has_number_value(); } - kind_.number_value_ = value; + _impl_.kind_.number_value_ = value; } inline double Value::number_value() const { // @@protoc_insertion_point(field_get:google.protobuf.Value.number_value) @@ -839,11 +839,11 @@ inline bool Value::has_string_value() const { return _internal_has_string_value(); } inline void Value::set_has_string_value() { - _oneof_case_[0] = kStringValue; + _impl_._oneof_case_[0] = kStringValue; } inline void Value::clear_string_value() { if (_internal_has_string_value()) { - kind_.string_value_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + _impl_.kind_.string_value_.Destroy(); clear_has_kind(); } } @@ -856,9 +856,9 @@ inline void Value::set_string_value(ArgT0&& arg0, ArgT... args) { if (!_internal_has_string_value()) { clear_kind(); set_has_string_value(); - kind_.string_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _impl_.kind_.string_value_.InitDefault(); } - kind_.string_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.kind_.string_value_.Set( static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value) } inline std::string* Value::mutable_string_value() { @@ -868,7 +868,7 @@ inline std::string* Value::mutable_string_value() { } inline const std::string& Value::_internal_string_value() const { if (_internal_has_string_value()) { - return kind_.string_value_.Get(); + return _impl_.kind_.string_value_.Get(); } return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); } @@ -876,24 +876,23 @@ inline void Value::_internal_set_string_value(const std::string& value) { if (!_internal_has_string_value()) { clear_kind(); set_has_string_value(); - kind_.string_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _impl_.kind_.string_value_.InitDefault(); } - kind_.string_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.kind_.string_value_.Set(value, GetArenaForAllocation()); } inline std::string* Value::_internal_mutable_string_value() { if (!_internal_has_string_value()) { clear_kind(); set_has_string_value(); - kind_.string_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _impl_.kind_.string_value_.InitDefault(); } - return kind_.string_value_.Mutable( - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.kind_.string_value_.Mutable( GetArenaForAllocation()); } inline std::string* Value::release_string_value() { // @@protoc_insertion_point(field_release:google.protobuf.Value.string_value) if (_internal_has_string_value()) { clear_has_kind(); - return kind_.string_value_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.kind_.string_value_.Release(); } else { return nullptr; } @@ -904,11 +903,7 @@ inline void Value::set_allocated_string_value(std::string* string_value) { } if (string_value != nullptr) { set_has_string_value(); - kind_.string_value_.UnsafeSetDefault(string_value); - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaForAllocation(); - if (arena != nullptr) { - arena->Own(string_value); - } + _impl_.kind_.string_value_.InitAllocated(string_value, GetArenaForAllocation()); } // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.string_value) } @@ -921,17 +916,17 @@ inline bool Value::has_bool_value() const { return _internal_has_bool_value(); } inline void Value::set_has_bool_value() { - _oneof_case_[0] = kBoolValue; + _impl_._oneof_case_[0] = kBoolValue; } inline void Value::clear_bool_value() { if (_internal_has_bool_value()) { - kind_.bool_value_ = false; + _impl_.kind_.bool_value_ = false; clear_has_kind(); } } inline bool Value::_internal_bool_value() const { if (_internal_has_bool_value()) { - return kind_.bool_value_; + return _impl_.kind_.bool_value_; } return false; } @@ -940,7 +935,7 @@ inline void Value::_internal_set_bool_value(bool value) { clear_kind(); set_has_bool_value(); } - kind_.bool_value_ = value; + _impl_.kind_.bool_value_ = value; } inline bool Value::bool_value() const { // @@protoc_insertion_point(field_get:google.protobuf.Value.bool_value) @@ -959,12 +954,12 @@ inline bool Value::has_struct_value() const { return _internal_has_struct_value(); } inline void Value::set_has_struct_value() { - _oneof_case_[0] = kStructValue; + _impl_._oneof_case_[0] = kStructValue; } inline void Value::clear_struct_value() { if (_internal_has_struct_value()) { if (GetArenaForAllocation() == nullptr) { - delete kind_.struct_value_; + delete _impl_.kind_.struct_value_; } clear_has_kind(); } @@ -973,11 +968,11 @@ inline ::PROTOBUF_NAMESPACE_ID::Struct* Value::release_struct_value() { // @@protoc_insertion_point(field_release:google.protobuf.Value.struct_value) if (_internal_has_struct_value()) { clear_has_kind(); - ::PROTOBUF_NAMESPACE_ID::Struct* temp = kind_.struct_value_; + ::PROTOBUF_NAMESPACE_ID::Struct* temp = _impl_.kind_.struct_value_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - kind_.struct_value_ = nullptr; + _impl_.kind_.struct_value_ = nullptr; return temp; } else { return nullptr; @@ -985,7 +980,7 @@ inline ::PROTOBUF_NAMESPACE_ID::Struct* Value::release_struct_value() { } inline const ::PROTOBUF_NAMESPACE_ID::Struct& Value::_internal_struct_value() const { return _internal_has_struct_value() - ? *kind_.struct_value_ + ? *_impl_.kind_.struct_value_ : reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::Struct&>(::PROTOBUF_NAMESPACE_ID::_Struct_default_instance_); } inline const ::PROTOBUF_NAMESPACE_ID::Struct& Value::struct_value() const { @@ -996,8 +991,8 @@ inline ::PROTOBUF_NAMESPACE_ID::Struct* Value::unsafe_arena_release_struct_value // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.struct_value) if (_internal_has_struct_value()) { clear_has_kind(); - ::PROTOBUF_NAMESPACE_ID::Struct* temp = kind_.struct_value_; - kind_.struct_value_ = nullptr; + ::PROTOBUF_NAMESPACE_ID::Struct* temp = _impl_.kind_.struct_value_; + _impl_.kind_.struct_value_ = nullptr; return temp; } else { return nullptr; @@ -1007,7 +1002,7 @@ inline void Value::unsafe_arena_set_allocated_struct_value(::PROTOBUF_NAMESPACE_ clear_kind(); if (struct_value) { set_has_struct_value(); - kind_.struct_value_ = struct_value; + _impl_.kind_.struct_value_ = struct_value; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.struct_value) } @@ -1015,9 +1010,9 @@ inline ::PROTOBUF_NAMESPACE_ID::Struct* Value::_internal_mutable_struct_value() if (!_internal_has_struct_value()) { clear_kind(); set_has_struct_value(); - kind_.struct_value_ = CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Struct >(GetArenaForAllocation()); + _impl_.kind_.struct_value_ = CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Struct >(GetArenaForAllocation()); } - return kind_.struct_value_; + return _impl_.kind_.struct_value_; } inline ::PROTOBUF_NAMESPACE_ID::Struct* Value::mutable_struct_value() { ::PROTOBUF_NAMESPACE_ID::Struct* _msg = _internal_mutable_struct_value(); @@ -1033,12 +1028,12 @@ inline bool Value::has_list_value() const { return _internal_has_list_value(); } inline void Value::set_has_list_value() { - _oneof_case_[0] = kListValue; + _impl_._oneof_case_[0] = kListValue; } inline void Value::clear_list_value() { if (_internal_has_list_value()) { if (GetArenaForAllocation() == nullptr) { - delete kind_.list_value_; + delete _impl_.kind_.list_value_; } clear_has_kind(); } @@ -1047,11 +1042,11 @@ inline ::PROTOBUF_NAMESPACE_ID::ListValue* Value::release_list_value() { // @@protoc_insertion_point(field_release:google.protobuf.Value.list_value) if (_internal_has_list_value()) { clear_has_kind(); - ::PROTOBUF_NAMESPACE_ID::ListValue* temp = kind_.list_value_; + ::PROTOBUF_NAMESPACE_ID::ListValue* temp = _impl_.kind_.list_value_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - kind_.list_value_ = nullptr; + _impl_.kind_.list_value_ = nullptr; return temp; } else { return nullptr; @@ -1059,7 +1054,7 @@ inline ::PROTOBUF_NAMESPACE_ID::ListValue* Value::release_list_value() { } inline const ::PROTOBUF_NAMESPACE_ID::ListValue& Value::_internal_list_value() const { return _internal_has_list_value() - ? *kind_.list_value_ + ? *_impl_.kind_.list_value_ : reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::ListValue&>(::PROTOBUF_NAMESPACE_ID::_ListValue_default_instance_); } inline const ::PROTOBUF_NAMESPACE_ID::ListValue& Value::list_value() const { @@ -1070,8 +1065,8 @@ inline ::PROTOBUF_NAMESPACE_ID::ListValue* Value::unsafe_arena_release_list_valu // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.list_value) if (_internal_has_list_value()) { clear_has_kind(); - ::PROTOBUF_NAMESPACE_ID::ListValue* temp = kind_.list_value_; - kind_.list_value_ = nullptr; + ::PROTOBUF_NAMESPACE_ID::ListValue* temp = _impl_.kind_.list_value_; + _impl_.kind_.list_value_ = nullptr; return temp; } else { return nullptr; @@ -1081,7 +1076,7 @@ inline void Value::unsafe_arena_set_allocated_list_value(::PROTOBUF_NAMESPACE_ID clear_kind(); if (list_value) { set_has_list_value(); - kind_.list_value_ = list_value; + _impl_.kind_.list_value_ = list_value; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.list_value) } @@ -1089,9 +1084,9 @@ inline ::PROTOBUF_NAMESPACE_ID::ListValue* Value::_internal_mutable_list_value() if (!_internal_has_list_value()) { clear_kind(); set_has_list_value(); - kind_.list_value_ = CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::ListValue >(GetArenaForAllocation()); + _impl_.kind_.list_value_ = CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::ListValue >(GetArenaForAllocation()); } - return kind_.list_value_; + return _impl_.kind_.list_value_; } inline ::PROTOBUF_NAMESPACE_ID::ListValue* Value::mutable_list_value() { ::PROTOBUF_NAMESPACE_ID::ListValue* _msg = _internal_mutable_list_value(); @@ -1103,10 +1098,10 @@ inline bool Value::has_kind() const { return kind_case() != KIND_NOT_SET; } inline void Value::clear_has_kind() { - _oneof_case_[0] = KIND_NOT_SET; + _impl_._oneof_case_[0] = KIND_NOT_SET; } inline Value::KindCase Value::kind_case() const { - return Value::KindCase(_oneof_case_[0]); + return Value::KindCase(_impl_._oneof_case_[0]); } // ------------------------------------------------------------------- @@ -1114,32 +1109,32 @@ inline Value::KindCase Value::kind_case() const { // repeated .google.protobuf.Value values = 1; inline int ListValue::_internal_values_size() const { - return values_.size(); + return _impl_.values_.size(); } inline int ListValue::values_size() const { return _internal_values_size(); } inline void ListValue::clear_values() { - values_.Clear(); + _impl_.values_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::Value* ListValue::mutable_values(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.ListValue.values) - return values_.Mutable(index); + return _impl_.values_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Value >* ListValue::mutable_values() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.ListValue.values) - return &values_; + return &_impl_.values_; } inline const ::PROTOBUF_NAMESPACE_ID::Value& ListValue::_internal_values(int index) const { - return values_.Get(index); + return _impl_.values_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::Value& ListValue::values(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.ListValue.values) return _internal_values(index); } inline ::PROTOBUF_NAMESPACE_ID::Value* ListValue::_internal_add_values() { - return values_.Add(); + return _impl_.values_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::Value* ListValue::add_values() { ::PROTOBUF_NAMESPACE_ID::Value* _add = _internal_add_values(); @@ -1149,7 +1144,7 @@ inline ::PROTOBUF_NAMESPACE_ID::Value* ListValue::add_values() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Value >& ListValue::values() const { // @@protoc_insertion_point(field_list:google.protobuf.ListValue.values) - return values_; + return _impl_.values_; } #ifdef __GNUC__ diff --git a/windows/include/google/protobuf/stubs/common.h b/windows/include/google/protobuf/stubs/common.h index c32503a6d..0b9fa812d 100644 --- a/windows/include/google/protobuf/stubs/common.h +++ b/windows/include/google/protobuf/stubs/common.h @@ -82,7 +82,7 @@ namespace internal { // The current version, represented as a single integer to make comparison // easier: major * 10^6 + minor * 10^3 + micro -#define GOOGLE_PROTOBUF_VERSION 3019001 +#define GOOGLE_PROTOBUF_VERSION 3021012 // A suffix string for alpha, beta or rc releases. Empty for stable releases. #define GOOGLE_PROTOBUF_VERSION_SUFFIX "" @@ -90,15 +90,15 @@ namespace internal { // The minimum header version which works with the current version of // the library. This constant should only be used by protoc's C++ code // generator. -static const int kMinHeaderVersionForLibrary = 3019000; +static const int kMinHeaderVersionForLibrary = 3021000; // The minimum protoc version which works with the current version of the // headers. -#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3019000 +#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3021000 // The minimum header version which works with the current version of // protoc. This constant should only be used in VerifyVersion(). -static const int kMinHeaderVersionForProtoc = 3019000; +static const int kMinHeaderVersionForProtoc = 3021000; // Verifies that the headers and libraries are compatible. Use the macro // below to call this. @@ -189,10 +189,6 @@ class FatalException : public std::exception { }; #endif -// This is at the end of the file instead of the beginning to work around a bug -// in some versions of MSVC. -using std::string; - } // namespace protobuf } // namespace google diff --git a/windows/include/google/protobuf/stubs/platform_macros.h b/windows/include/google/protobuf/stubs/platform_macros.h index 24799600d..d10faf9aa 100644 --- a/windows/include/google/protobuf/stubs/platform_macros.h +++ b/windows/include/google/protobuf/stubs/platform_macros.h @@ -122,11 +122,11 @@ GOOGLE_PROTOBUF_PLATFORM_ERROR #undef GOOGLE_PROTOBUF_PLATFORM_ERROR -#if defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE) || defined(__OpenBSD__) +#if defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE) // Android ndk does not support the __thread keyword very well yet. Here // we use pthread_key_create()/pthread_getspecific()/... methods for // TLS support on android. -// iOS and OpenBSD also do not support the __thread keyword. +// iOS also does not support the __thread keyword. #define GOOGLE_PROTOBUF_NO_THREADLOCAL #endif diff --git a/windows/include/google/protobuf/stubs/port.h b/windows/include/google/protobuf/stubs/port.h index 045e25d89..b074cb163 100644 --- a/windows/include/google/protobuf/stubs/port.h +++ b/windows/include/google/protobuf/stubs/port.h @@ -163,68 +163,68 @@ void __sanitizer_unaligned_store64(void *p, uint64_t v); } // extern "C" #endif // __cplusplus -inline uint16 GOOGLE_UNALIGNED_LOAD16(const void *p) { +inline uint16_t GOOGLE_UNALIGNED_LOAD16(const void *p) { return __sanitizer_unaligned_load16(p); } -inline uint32 GOOGLE_UNALIGNED_LOAD32(const void *p) { +inline uint32_t GOOGLE_UNALIGNED_LOAD32(const void *p) { return __sanitizer_unaligned_load32(p); } -inline uint64 GOOGLE_UNALIGNED_LOAD64(const void *p) { +inline uint64_t GOOGLE_UNALIGNED_LOAD64(const void *p) { return __sanitizer_unaligned_load64(p); } -inline void GOOGLE_UNALIGNED_STORE16(void *p, uint16 v) { +inline void GOOGLE_UNALIGNED_STORE16(void *p, uint16_t v) { __sanitizer_unaligned_store16(p, v); } -inline void GOOGLE_UNALIGNED_STORE32(void *p, uint32 v) { +inline void GOOGLE_UNALIGNED_STORE32(void *p, uint32_t v) { __sanitizer_unaligned_store32(p, v); } -inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) { +inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64_t v) { __sanitizer_unaligned_store64(p, v); } #elif defined(GOOGLE_PROTOBUF_USE_UNALIGNED) && GOOGLE_PROTOBUF_USE_UNALIGNED -#define GOOGLE_UNALIGNED_LOAD16(_p) (*reinterpret_cast(_p)) -#define GOOGLE_UNALIGNED_LOAD32(_p) (*reinterpret_cast(_p)) -#define GOOGLE_UNALIGNED_LOAD64(_p) (*reinterpret_cast(_p)) +#define GOOGLE_UNALIGNED_LOAD16(_p) (*reinterpret_cast(_p)) +#define GOOGLE_UNALIGNED_LOAD32(_p) (*reinterpret_cast(_p)) +#define GOOGLE_UNALIGNED_LOAD64(_p) (*reinterpret_cast(_p)) -#define GOOGLE_UNALIGNED_STORE16(_p, _val) (*reinterpret_cast(_p) = (_val)) -#define GOOGLE_UNALIGNED_STORE32(_p, _val) (*reinterpret_cast(_p) = (_val)) -#define GOOGLE_UNALIGNED_STORE64(_p, _val) (*reinterpret_cast(_p) = (_val)) +#define GOOGLE_UNALIGNED_STORE16(_p, _val) (*reinterpret_cast(_p) = (_val)) +#define GOOGLE_UNALIGNED_STORE32(_p, _val) (*reinterpret_cast(_p) = (_val)) +#define GOOGLE_UNALIGNED_STORE64(_p, _val) (*reinterpret_cast(_p) = (_val)) #else -inline uint16 GOOGLE_UNALIGNED_LOAD16(const void *p) { - uint16 t; +inline uint16_t GOOGLE_UNALIGNED_LOAD16(const void *p) { + uint16_t t; memcpy(&t, p, sizeof t); return t; } -inline uint32 GOOGLE_UNALIGNED_LOAD32(const void *p) { - uint32 t; +inline uint32_t GOOGLE_UNALIGNED_LOAD32(const void *p) { + uint32_t t; memcpy(&t, p, sizeof t); return t; } -inline uint64 GOOGLE_UNALIGNED_LOAD64(const void *p) { - uint64 t; +inline uint64_t GOOGLE_UNALIGNED_LOAD64(const void *p) { + uint64_t t; memcpy(&t, p, sizeof t); return t; } -inline void GOOGLE_UNALIGNED_STORE16(void *p, uint16 v) { +inline void GOOGLE_UNALIGNED_STORE16(void *p, uint16_t v) { memcpy(p, &v, sizeof v); } -inline void GOOGLE_UNALIGNED_STORE32(void *p, uint32 v) { +inline void GOOGLE_UNALIGNED_STORE32(void *p, uint32_t v) { memcpy(p, &v, sizeof v); } -inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) { +inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64_t v) { memcpy(p, &v, sizeof v); } #endif @@ -251,14 +251,14 @@ inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) { #elif !defined(__linux__) && !defined(__ANDROID__) && !defined(__CYGWIN__) #ifndef bswap_16 -static inline uint16 bswap_16(uint16 x) { - return static_cast(((x & 0xFF) << 8) | ((x & 0xFF00) >> 8)); +static inline uint16_t bswap_16(uint16_t x) { + return static_cast(((x & 0xFF) << 8) | ((x & 0xFF00) >> 8)); } #define bswap_16(x) bswap_16(x) #endif #ifndef bswap_32 -static inline uint32 bswap_32(uint32 x) { +static inline uint32_t bswap_32(uint32_t x) { return (((x & 0xFF) << 24) | ((x & 0xFF00) << 8) | ((x & 0xFF0000) >> 8) | @@ -268,7 +268,7 @@ static inline uint32 bswap_32(uint32 x) { #endif #ifndef bswap_64 -static inline uint64 bswap_64(uint64 x) { +static inline uint64_t bswap_64(uint64_t x) { return (((x & uint64_t{0xFFu}) << 56) | ((x & uint64_t{0xFF00u}) << 40) | ((x & uint64_t{0xFF0000u}) << 24) | ((x & uint64_t{0xFF000000u}) << 8) | @@ -287,9 +287,9 @@ static inline uint64 bswap_64(uint64 x) { class Bits { public: - static uint32 Log2FloorNonZero(uint32 n) { + static uint32_t Log2FloorNonZero(uint32_t n) { #if defined(__GNUC__) - return 31 ^ static_cast(__builtin_clz(n)); + return 31 ^ static_cast(__builtin_clz(n)); #elif defined(_MSC_VER) unsigned long where; _BitScanReverse(&where, n); @@ -299,7 +299,7 @@ class Bits { #endif } - static uint32 Log2FloorNonZero64(uint64 n) { + static uint32_t Log2FloorNonZero64(uint64_t n) { // Older versions of clang run into an instruction-selection failure when // it encounters __builtin_clzll: // https://bugs.chromium.org/p/nativeclient/issues/detail?id=4395 @@ -307,7 +307,7 @@ class Bits { // To work around this, when we build with those we use the portable // implementation instead. #if defined(__GNUC__) && !defined(GOOGLE_PROTOBUF_USE_PORTABLE_LOG2) - return 63 ^ static_cast(__builtin_clzll(n)); + return 63 ^ static_cast(__builtin_clzll(n)); #elif defined(_MSC_VER) && defined(_M_X64) unsigned long where; _BitScanReverse64(&where, n); @@ -317,14 +317,14 @@ class Bits { #endif } private: - static int Log2FloorNonZero_Portable(uint32 n) { + static int Log2FloorNonZero_Portable(uint32_t n) { if (n == 0) return -1; int log = 0; - uint32 value = n; + uint32_t value = n; for (int i = 4; i >= 0; --i) { int shift = (1 << i); - uint32 x = value >> shift; + uint32_t x = value >> shift; if (x != 0) { value = x; log += shift; @@ -334,11 +334,11 @@ class Bits { return log; } - static int Log2FloorNonZero64_Portable(uint64 n) { - const uint32 topbits = static_cast(n >> 32); + static int Log2FloorNonZero64_Portable(uint64_t n) { + const uint32_t topbits = static_cast(n >> 32); if (topbits == 0) { // Top bits are zero, so scan in bottom bits - return static_cast(Log2FloorNonZero(static_cast(n))); + return static_cast(Log2FloorNonZero(static_cast(n))); } else { return 32 + static_cast(Log2FloorNonZero(topbits)); } @@ -347,60 +347,60 @@ class Bits { // =================================================================== // from google3/util/endian/endian.h -PROTOBUF_EXPORT uint32 ghtonl(uint32 x); +PROTOBUF_EXPORT uint32_t ghtonl(uint32_t x); class BigEndian { public: #ifdef PROTOBUF_LITTLE_ENDIAN - static uint16 FromHost16(uint16 x) { return bswap_16(x); } - static uint16 ToHost16(uint16 x) { return bswap_16(x); } + static uint16_t FromHost16(uint16_t x) { return bswap_16(x); } + static uint16_t ToHost16(uint16_t x) { return bswap_16(x); } - static uint32 FromHost32(uint32 x) { return bswap_32(x); } - static uint32 ToHost32(uint32 x) { return bswap_32(x); } + static uint32_t FromHost32(uint32_t x) { return bswap_32(x); } + static uint32_t ToHost32(uint32_t x) { return bswap_32(x); } - static uint64 FromHost64(uint64 x) { return bswap_64(x); } - static uint64 ToHost64(uint64 x) { return bswap_64(x); } + static uint64_t FromHost64(uint64_t x) { return bswap_64(x); } + static uint64_t ToHost64(uint64_t x) { return bswap_64(x); } static bool IsLittleEndian() { return true; } #else - static uint16 FromHost16(uint16 x) { return x; } - static uint16 ToHost16(uint16 x) { return x; } + static uint16_t FromHost16(uint16_t x) { return x; } + static uint16_t ToHost16(uint16_t x) { return x; } - static uint32 FromHost32(uint32 x) { return x; } - static uint32 ToHost32(uint32 x) { return x; } + static uint32_t FromHost32(uint32_t x) { return x; } + static uint32_t ToHost32(uint32_t x) { return x; } - static uint64 FromHost64(uint64 x) { return x; } - static uint64 ToHost64(uint64 x) { return x; } + static uint64_t FromHost64(uint64_t x) { return x; } + static uint64_t ToHost64(uint64_t x) { return x; } static bool IsLittleEndian() { return false; } #endif /* ENDIAN */ // Functions to do unaligned loads and stores in big-endian order. - static uint16 Load16(const void *p) { + static uint16_t Load16(const void *p) { return ToHost16(GOOGLE_UNALIGNED_LOAD16(p)); } - static void Store16(void *p, uint16 v) { + static void Store16(void *p, uint16_t v) { GOOGLE_UNALIGNED_STORE16(p, FromHost16(v)); } - static uint32 Load32(const void *p) { + static uint32_t Load32(const void *p) { return ToHost32(GOOGLE_UNALIGNED_LOAD32(p)); } - static void Store32(void *p, uint32 v) { + static void Store32(void *p, uint32_t v) { GOOGLE_UNALIGNED_STORE32(p, FromHost32(v)); } - static uint64 Load64(const void *p) { + static uint64_t Load64(const void *p) { return ToHost64(GOOGLE_UNALIGNED_LOAD64(p)); } - static void Store64(void *p, uint64 v) { + static void Store64(void *p, uint64_t v) { GOOGLE_UNALIGNED_STORE64(p, FromHost64(v)); } }; diff --git a/windows/include/google/protobuf/stubs/stl_util.h b/windows/include/google/protobuf/stubs/stl_util.h index 3bc1dbf00..e6260d076 100644 --- a/windows/include/google/protobuf/stubs/stl_util.h +++ b/windows/include/google/protobuf/stubs/stl_util.h @@ -37,6 +37,9 @@ #include +// Must be last. +#include // NOLINT + namespace google { namespace protobuf { @@ -57,7 +60,7 @@ inline void STLStringResizeUninitializedAmortized(std::string* s, const size_t cap = s->capacity(); if (new_size > cap) { // Make sure to always grow by at least a factor of 2x. - s->reserve(std::max(new_size, 2 * cap)); + s->reserve(std::max(new_size, 2 * cap)); } STLStringResizeUninitialized(s, new_size); } @@ -82,4 +85,6 @@ inline char* string_as_array(std::string* str) { } // namespace protobuf } // namespace google +#include // NOLINT + #endif // GOOGLE_PROTOBUF_STUBS_STL_UTIL_H__ diff --git a/windows/include/google/protobuf/stubs/strutil.h b/windows/include/google/protobuf/stubs/strutil.h index 84fc2323b..9658abf90 100644 --- a/windows/include/google/protobuf/stubs/strutil.h +++ b/windows/include/google/protobuf/stubs/strutil.h @@ -355,20 +355,20 @@ PROTOBUF_EXPORT std::string CHexEscape(const std::string& src); // platforms, so using these is safer, from the point of view of // overflow behavior, than using the standard libc functions. // ---------------------------------------------------------------------- -PROTOBUF_EXPORT int32 strto32_adaptor(const char* nptr, char** endptr, - int base); -PROTOBUF_EXPORT uint32 strtou32_adaptor(const char* nptr, char** endptr, +PROTOBUF_EXPORT int32_t strto32_adaptor(const char* nptr, char** endptr, int base); +PROTOBUF_EXPORT uint32_t strtou32_adaptor(const char* nptr, char** endptr, + int base); -inline int32 strto32(const char *nptr, char **endptr, int base) { - if (sizeof(int32) == sizeof(long)) +inline int32_t strto32(const char *nptr, char **endptr, int base) { + if (sizeof(int32_t) == sizeof(long)) return strtol(nptr, endptr, base); else return strto32_adaptor(nptr, endptr, base); } -inline uint32 strtou32(const char *nptr, char **endptr, int base) { - if (sizeof(uint32) == sizeof(unsigned long)) +inline uint32_t strtou32(const char *nptr, char **endptr, int base) { + if (sizeof(uint32_t) == sizeof(unsigned long)) return strtoul(nptr, endptr, base); else return strtou32_adaptor(nptr, endptr, base); @@ -376,15 +376,15 @@ inline uint32 strtou32(const char *nptr, char **endptr, int base) { // For now, long long is 64-bit on all the platforms we care about, so these // functions can simply pass the call to strto[u]ll. -inline int64 strto64(const char *nptr, char **endptr, int base) { - static_assert(sizeof(int64) == sizeof(long long), - "sizeof_int64_is_not_sizeof_long_long"); +inline int64_t strto64(const char *nptr, char **endptr, int base) { + static_assert(sizeof(int64_t) == sizeof(long long), + "sizeof int64_t is not sizeof long long"); return strtoll(nptr, endptr, base); } -inline uint64 strtou64(const char *nptr, char **endptr, int base) { - static_assert(sizeof(uint64) == sizeof(unsigned long long), - "sizeof_uint64_is_not_sizeof_long_long"); +inline uint64_t strtou64(const char *nptr, char **endptr, int base) { + static_assert(sizeof(uint64_t) == sizeof(unsigned long long), + "sizeof uint64_t is not sizeof unsigned long long"); return strtoull(nptr, endptr, base); } @@ -399,33 +399,33 @@ inline uint64 strtou64(const char *nptr, char **endptr, int base) { // ---------------------------------------------------------------------- PROTOBUF_EXPORT bool safe_strtob(StringPiece str, bool* value); -PROTOBUF_EXPORT bool safe_strto32(const std::string& str, int32* value); -PROTOBUF_EXPORT bool safe_strtou32(const std::string& str, uint32* value); -inline bool safe_strto32(const char* str, int32* value) { +PROTOBUF_EXPORT bool safe_strto32(const std::string& str, int32_t* value); +PROTOBUF_EXPORT bool safe_strtou32(const std::string& str, uint32_t* value); +inline bool safe_strto32(const char* str, int32_t* value) { return safe_strto32(std::string(str), value); } -inline bool safe_strto32(StringPiece str, int32* value) { +inline bool safe_strto32(StringPiece str, int32_t* value) { return safe_strto32(str.ToString(), value); } -inline bool safe_strtou32(const char* str, uint32* value) { +inline bool safe_strtou32(const char* str, uint32_t* value) { return safe_strtou32(std::string(str), value); } -inline bool safe_strtou32(StringPiece str, uint32* value) { +inline bool safe_strtou32(StringPiece str, uint32_t* value) { return safe_strtou32(str.ToString(), value); } -PROTOBUF_EXPORT bool safe_strto64(const std::string& str, int64* value); -PROTOBUF_EXPORT bool safe_strtou64(const std::string& str, uint64* value); -inline bool safe_strto64(const char* str, int64* value) { +PROTOBUF_EXPORT bool safe_strto64(const std::string& str, int64_t* value); +PROTOBUF_EXPORT bool safe_strtou64(const std::string& str, uint64_t* value); +inline bool safe_strto64(const char* str, int64_t* value) { return safe_strto64(std::string(str), value); } -inline bool safe_strto64(StringPiece str, int64* value) { +inline bool safe_strto64(StringPiece str, int64_t* value) { return safe_strto64(str.ToString(), value); } -inline bool safe_strtou64(const char* str, uint64* value) { +inline bool safe_strtou64(const char* str, uint64_t* value) { return safe_strtou64(std::string(str), value); } -inline bool safe_strtou64(StringPiece str, uint64* value) { +inline bool safe_strtou64(StringPiece str, uint64_t* value) { return safe_strtou64(str.ToString(), value); } @@ -470,13 +470,13 @@ inline bool safe_strtod(StringPiece str, double* value) { // DoubleToBuffer() and FloatToBuffer(). static const int kFastToBufferSize = 32; -PROTOBUF_EXPORT char* FastInt32ToBuffer(int32 i, char* buffer); -PROTOBUF_EXPORT char* FastInt64ToBuffer(int64 i, char* buffer); -char* FastUInt32ToBuffer(uint32 i, char* buffer); // inline below -char* FastUInt64ToBuffer(uint64 i, char* buffer); // inline below +PROTOBUF_EXPORT char* FastInt32ToBuffer(int32_t i, char* buffer); +PROTOBUF_EXPORT char* FastInt64ToBuffer(int64_t i, char* buffer); +char* FastUInt32ToBuffer(uint32_t i, char* buffer); // inline below +char* FastUInt64ToBuffer(uint64_t i, char* buffer); // inline below PROTOBUF_EXPORT char* FastHexToBuffer(int i, char* buffer); -PROTOBUF_EXPORT char* FastHex64ToBuffer(uint64 i, char* buffer); -PROTOBUF_EXPORT char* FastHex32ToBuffer(uint32 i, char* buffer); +PROTOBUF_EXPORT char* FastHex64ToBuffer(uint64_t i, char* buffer); +PROTOBUF_EXPORT char* FastHex32ToBuffer(uint32_t i, char* buffer); // at least 22 bytes long inline char* FastIntToBuffer(int i, char* buffer) { @@ -512,17 +512,17 @@ inline char* FastULongToBuffer(unsigned long i, char* buffer) { // terminating the string). // ---------------------------------------------------------------------- -PROTOBUF_EXPORT char* FastInt32ToBufferLeft(int32 i, char* buffer); -PROTOBUF_EXPORT char* FastUInt32ToBufferLeft(uint32 i, char* buffer); -PROTOBUF_EXPORT char* FastInt64ToBufferLeft(int64 i, char* buffer); -PROTOBUF_EXPORT char* FastUInt64ToBufferLeft(uint64 i, char* buffer); +PROTOBUF_EXPORT char* FastInt32ToBufferLeft(int32_t i, char* buffer); +PROTOBUF_EXPORT char* FastUInt32ToBufferLeft(uint32_t i, char* buffer); +PROTOBUF_EXPORT char* FastInt64ToBufferLeft(int64_t i, char* buffer); +PROTOBUF_EXPORT char* FastUInt64ToBufferLeft(uint64_t i, char* buffer); // Just define these in terms of the above. -inline char* FastUInt32ToBuffer(uint32 i, char* buffer) { +inline char* FastUInt32ToBuffer(uint32_t i, char* buffer) { FastUInt32ToBufferLeft(i, buffer); return buffer; } -inline char* FastUInt64ToBuffer(uint64 i, char* buffer) { +inline char* FastUInt64ToBuffer(uint64_t i, char* buffer) { FastUInt64ToBufferLeft(i, buffer); return buffer; } @@ -595,7 +595,7 @@ enum PadSpec { }; struct Hex { - uint64 value; + uint64_t value; enum PadSpec spec; template explicit Hex(Int v, PadSpec s = NO_PAD) @@ -607,10 +607,10 @@ struct Hex { sizeof(v) == 1 || sizeof(v) == 2 || sizeof(v) == 4 || sizeof(v) == 8, "Unknown integer type"); #endif - value = sizeof(v) == 1 ? static_cast(v) - : sizeof(v) == 2 ? static_cast(v) - : sizeof(v) == 4 ? static_cast(v) - : static_cast(v); + value = sizeof(v) == 1 ? static_cast(v) + : sizeof(v) == 2 ? static_cast(v) + : sizeof(v) == 4 ? static_cast(v) + : static_cast(v); } }; @@ -789,7 +789,7 @@ std::string Join(const Range& components, const char* delim) { // ToHex() // Return a lower-case hex string representation of the given integer. // ---------------------------------------------------------------------- -PROTOBUF_EXPORT std::string ToHex(uint64 num); +PROTOBUF_EXPORT std::string ToHex(uint64_t num); // ---------------------------------------------------------------------- // GlobalReplaceSubstring() @@ -863,7 +863,7 @@ PROTOBUF_EXPORT void Base64Escape(const unsigned char* src, int szsrc, PROTOBUF_EXPORT void WebSafeBase64Escape(const unsigned char* src, int szsrc, std::string* dest, bool do_padding); -inline bool IsValidCodePoint(uint32 code_point) { +inline bool IsValidCodePoint(uint32_t code_point) { return code_point < 0xD800 || (code_point >= 0xE000 && code_point <= 0x10FFFF); } @@ -875,7 +875,7 @@ static const int UTFmax = 4; // in any external dependencies. The output buffer must be as least 4 bytes // large. // ---------------------------------------------------------------------- -PROTOBUF_EXPORT int EncodeAsUTF8Char(uint32 code_point, char* output); +PROTOBUF_EXPORT int EncodeAsUTF8Char(uint32_t code_point, char* output); // ---------------------------------------------------------------------- // UTF8FirstLetterNumBytes() diff --git a/windows/include/google/protobuf/text_format.h b/windows/include/google/protobuf/text_format.h index f2c8dc3ff..e10bef7dd 100644 --- a/windows/include/google/protobuf/text_format.h +++ b/windows/include/google/protobuf/text_format.h @@ -38,17 +38,19 @@ #ifndef GOOGLE_PROTOBUF_TEXT_FORMAT_H__ #define GOOGLE_PROTOBUF_TEXT_FORMAT_H__ + #include #include #include #include #include +#include #include #include #include -#include +// Must be included last. #include #ifdef SWIG @@ -58,6 +60,11 @@ namespace google { namespace protobuf { +namespace internal { +PROTOBUF_EXPORT extern const char kDebugStringSilentMarker[1]; +PROTOBUF_EXPORT extern const char kDebugStringSilentMarkerForDetection[3]; +} // namespace internal + namespace io { class ErrorCollector; // tokenizer.h } @@ -454,16 +461,15 @@ class PROTOBUF_EXPORT TextFormat { }; // Parses a text-format protocol message from the given input stream to - // the given message object. This function parses the human-readable format - // written by Print(). Returns true on success. The message is cleared first, - // even if the function fails -- See Merge() to avoid this behavior. + // the given message object. This function parses the human-readable + // serialization format written by Print(). Returns true on success. The + // message is cleared first, even if the function fails -- See Merge() to + // avoid this behavior. // // Example input: "user {\n id: 123 extra { gender: MALE language: 'en' }\n}" // - // One use for this function is parsing handwritten strings in test code. - // Another use is to parse the output from google::protobuf::Message::DebugString() - // (or ShortDebugString()), because these functions output using - // google::protobuf::TextFormat::Print(). + // One common use for this function is parsing handwritten strings in test + // code. // // If you would like to read a protocol buffer serialized in the // (non-human-readable) binary wire format, see diff --git a/windows/include/google/protobuf/timestamp.pb.h b/windows/include/google/protobuf/timestamp.pb.h index 95036fdea..540194bc8 100644 --- a/windows/include/google/protobuf/timestamp.pb.h +++ b/windows/include/google/protobuf/timestamp.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -42,14 +41,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2ftimestamp_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2ftimestamp_2eproto; @@ -70,7 +61,7 @@ class PROTOBUF_EXPORT Timestamp final : public: inline Timestamp() : Timestamp(nullptr) {} ~Timestamp() override; - explicit constexpr Timestamp(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Timestamp(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Timestamp(const Timestamp& from); Timestamp(Timestamp&& from) noexcept @@ -145,9 +136,11 @@ class PROTOBUF_EXPORT Timestamp final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Timestamp& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Timestamp& from); + void MergeFrom( const Timestamp& from) { + Timestamp::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -156,10 +149,10 @@ class PROTOBUF_EXPORT Timestamp final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Timestamp* other); @@ -172,9 +165,6 @@ class PROTOBUF_EXPORT Timestamp final : protected: explicit Timestamp(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -215,9 +205,12 @@ class PROTOBUF_EXPORT Timestamp final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - int64_t seconds_; - int32_t nanos_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + int64_t seconds_; + int32_t nanos_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2ftimestamp_2eproto; }; // =================================================================== @@ -233,10 +226,10 @@ class PROTOBUF_EXPORT Timestamp final : // int64 seconds = 1; inline void Timestamp::clear_seconds() { - seconds_ = int64_t{0}; + _impl_.seconds_ = int64_t{0}; } inline int64_t Timestamp::_internal_seconds() const { - return seconds_; + return _impl_.seconds_; } inline int64_t Timestamp::seconds() const { // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.seconds) @@ -244,7 +237,7 @@ inline int64_t Timestamp::seconds() const { } inline void Timestamp::_internal_set_seconds(int64_t value) { - seconds_ = value; + _impl_.seconds_ = value; } inline void Timestamp::set_seconds(int64_t value) { _internal_set_seconds(value); @@ -253,10 +246,10 @@ inline void Timestamp::set_seconds(int64_t value) { // int32 nanos = 2; inline void Timestamp::clear_nanos() { - nanos_ = 0; + _impl_.nanos_ = 0; } inline int32_t Timestamp::_internal_nanos() const { - return nanos_; + return _impl_.nanos_; } inline int32_t Timestamp::nanos() const { // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.nanos) @@ -264,7 +257,7 @@ inline int32_t Timestamp::nanos() const { } inline void Timestamp::_internal_set_nanos(int32_t value) { - nanos_ = value; + _impl_.nanos_ = value; } inline void Timestamp::set_nanos(int32_t value) { _internal_set_nanos(value); diff --git a/windows/include/google/protobuf/type.pb.h b/windows/include/google/protobuf/type.pb.h index b91ab7ce5..cb8105a42 100644 --- a/windows/include/google/protobuf/type.pb.h +++ b/windows/include/google/protobuf/type.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -45,14 +44,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2ftype_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[5] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2ftype_2eproto; @@ -183,7 +174,7 @@ class PROTOBUF_EXPORT Type final : public: inline Type() : Type(nullptr) {} ~Type() override; - explicit constexpr Type(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Type(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Type(const Type& from); Type(Type&& from) noexcept @@ -258,9 +249,11 @@ class PROTOBUF_EXPORT Type final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Type& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Type& from); + void MergeFrom( const Type& from) { + Type::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -269,10 +262,10 @@ class PROTOBUF_EXPORT Type final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Type* other); @@ -285,9 +278,6 @@ class PROTOBUF_EXPORT Type final : protected: explicit Type(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -415,13 +405,16 @@ class PROTOBUF_EXPORT Type final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Field > fields_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField oneofs_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context_; - int syntax_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Field > fields_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField oneofs_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context_; + int syntax_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2ftype_2eproto; }; // ------------------------------------------------------------------- @@ -431,7 +424,7 @@ class PROTOBUF_EXPORT Field final : public: inline Field() : Field(nullptr) {} ~Field() override; - explicit constexpr Field(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Field(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Field(const Field& from); Field(Field&& from) noexcept @@ -506,9 +499,11 @@ class PROTOBUF_EXPORT Field final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Field& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Field& from); + void MergeFrom( const Field& from) { + Field::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -517,10 +512,10 @@ class PROTOBUF_EXPORT Field final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Field* other); @@ -533,9 +528,6 @@ class PROTOBUF_EXPORT Field final : protected: explicit Field(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -783,17 +775,20 @@ class PROTOBUF_EXPORT Field final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_url_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr json_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr default_value_; - int kind_; - int cardinality_; - int32_t number_; - int32_t oneof_index_; - bool packed_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_url_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr json_name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr default_value_; + int kind_; + int cardinality_; + int32_t number_; + int32_t oneof_index_; + bool packed_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2ftype_2eproto; }; // ------------------------------------------------------------------- @@ -803,7 +798,7 @@ class PROTOBUF_EXPORT Enum final : public: inline Enum() : Enum(nullptr) {} ~Enum() override; - explicit constexpr Enum(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Enum(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Enum(const Enum& from); Enum(Enum&& from) noexcept @@ -878,9 +873,11 @@ class PROTOBUF_EXPORT Enum final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Enum& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Enum& from); + void MergeFrom( const Enum& from) { + Enum::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -889,10 +886,10 @@ class PROTOBUF_EXPORT Enum final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Enum* other); @@ -905,9 +902,6 @@ class PROTOBUF_EXPORT Enum final : protected: explicit Enum(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1010,12 +1004,15 @@ class PROTOBUF_EXPORT Enum final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValue > enumvalue_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context_; - int syntax_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValue > enumvalue_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context_; + int syntax_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2ftype_2eproto; }; // ------------------------------------------------------------------- @@ -1025,7 +1022,7 @@ class PROTOBUF_EXPORT EnumValue final : public: inline EnumValue() : EnumValue(nullptr) {} ~EnumValue() override; - explicit constexpr EnumValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR EnumValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); EnumValue(const EnumValue& from); EnumValue(EnumValue&& from) noexcept @@ -1100,9 +1097,11 @@ class PROTOBUF_EXPORT EnumValue final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const EnumValue& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const EnumValue& from); + void MergeFrom( const EnumValue& from) { + EnumValue::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1111,10 +1110,10 @@ class PROTOBUF_EXPORT EnumValue final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(EnumValue* other); @@ -1127,9 +1126,6 @@ class PROTOBUF_EXPORT EnumValue final : protected: explicit EnumValue(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1194,10 +1190,13 @@ class PROTOBUF_EXPORT EnumValue final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - int32_t number_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + int32_t number_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2ftype_2eproto; }; // ------------------------------------------------------------------- @@ -1207,7 +1206,7 @@ class PROTOBUF_EXPORT Option final : public: inline Option() : Option(nullptr) {} ~Option() override; - explicit constexpr Option(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Option(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Option(const Option& from); Option(Option&& from) noexcept @@ -1282,9 +1281,11 @@ class PROTOBUF_EXPORT Option final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Option& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Option& from); + void MergeFrom( const Option& from) { + Option::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1293,10 +1294,10 @@ class PROTOBUF_EXPORT Option final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Option* other); @@ -1309,9 +1310,6 @@ class PROTOBUF_EXPORT Option final : protected: explicit Option(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1366,9 +1364,12 @@ class PROTOBUF_EXPORT Option final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::Any* value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::Any* value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2ftype_2eproto; }; // =================================================================== @@ -1384,7 +1385,7 @@ class PROTOBUF_EXPORT Option final : // string name = 1; inline void Type::clear_name() { - name_.ClearToEmpty(); + _impl_.name_.ClearToEmpty(); } inline const std::string& Type::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Type.name) @@ -1394,7 +1395,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Type::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Type.name) } inline std::string* Type::mutable_name() { @@ -1403,19 +1404,19 @@ inline std::string* Type::mutable_name() { return _s; } inline const std::string& Type::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void Type::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* Type::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* Type::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Type.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.name_.Release(); } inline void Type::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -1423,11 +1424,10 @@ inline void Type::set_allocated_name(std::string* name) { } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.name) @@ -1435,32 +1435,32 @@ inline void Type::set_allocated_name(std::string* name) { // repeated .google.protobuf.Field fields = 2; inline int Type::_internal_fields_size() const { - return fields_.size(); + return _impl_.fields_.size(); } inline int Type::fields_size() const { return _internal_fields_size(); } inline void Type::clear_fields() { - fields_.Clear(); + _impl_.fields_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::Field* Type::mutable_fields(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Type.fields) - return fields_.Mutable(index); + return _impl_.fields_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Field >* Type::mutable_fields() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.fields) - return &fields_; + return &_impl_.fields_; } inline const ::PROTOBUF_NAMESPACE_ID::Field& Type::_internal_fields(int index) const { - return fields_.Get(index); + return _impl_.fields_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::Field& Type::fields(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Type.fields) return _internal_fields(index); } inline ::PROTOBUF_NAMESPACE_ID::Field* Type::_internal_add_fields() { - return fields_.Add(); + return _impl_.fields_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::Field* Type::add_fields() { ::PROTOBUF_NAMESPACE_ID::Field* _add = _internal_add_fields(); @@ -1470,18 +1470,18 @@ inline ::PROTOBUF_NAMESPACE_ID::Field* Type::add_fields() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Field >& Type::fields() const { // @@protoc_insertion_point(field_list:google.protobuf.Type.fields) - return fields_; + return _impl_.fields_; } // repeated string oneofs = 3; inline int Type::_internal_oneofs_size() const { - return oneofs_.size(); + return _impl_.oneofs_.size(); } inline int Type::oneofs_size() const { return _internal_oneofs_size(); } inline void Type::clear_oneofs() { - oneofs_.Clear(); + _impl_.oneofs_.Clear(); } inline std::string* Type::add_oneofs() { std::string* _s = _internal_add_oneofs(); @@ -1489,7 +1489,7 @@ inline std::string* Type::add_oneofs() { return _s; } inline const std::string& Type::_internal_oneofs(int index) const { - return oneofs_.Get(index); + return _impl_.oneofs_.Get(index); } inline const std::string& Type::oneofs(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Type.oneofs) @@ -1497,85 +1497,85 @@ inline const std::string& Type::oneofs(int index) const { } inline std::string* Type::mutable_oneofs(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Type.oneofs) - return oneofs_.Mutable(index); + return _impl_.oneofs_.Mutable(index); } inline void Type::set_oneofs(int index, const std::string& value) { - oneofs_.Mutable(index)->assign(value); + _impl_.oneofs_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs) } inline void Type::set_oneofs(int index, std::string&& value) { - oneofs_.Mutable(index)->assign(std::move(value)); + _impl_.oneofs_.Mutable(index)->assign(std::move(value)); // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs) } inline void Type::set_oneofs(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); - oneofs_.Mutable(index)->assign(value); + _impl_.oneofs_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.Type.oneofs) } inline void Type::set_oneofs(int index, const char* value, size_t size) { - oneofs_.Mutable(index)->assign( + _impl_.oneofs_.Mutable(index)->assign( reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Type.oneofs) } inline std::string* Type::_internal_add_oneofs() { - return oneofs_.Add(); + return _impl_.oneofs_.Add(); } inline void Type::add_oneofs(const std::string& value) { - oneofs_.Add()->assign(value); + _impl_.oneofs_.Add()->assign(value); // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs) } inline void Type::add_oneofs(std::string&& value) { - oneofs_.Add(std::move(value)); + _impl_.oneofs_.Add(std::move(value)); // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs) } inline void Type::add_oneofs(const char* value) { GOOGLE_DCHECK(value != nullptr); - oneofs_.Add()->assign(value); + _impl_.oneofs_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.Type.oneofs) } inline void Type::add_oneofs(const char* value, size_t size) { - oneofs_.Add()->assign(reinterpret_cast(value), size); + _impl_.oneofs_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:google.protobuf.Type.oneofs) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& Type::oneofs() const { // @@protoc_insertion_point(field_list:google.protobuf.Type.oneofs) - return oneofs_; + return _impl_.oneofs_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* Type::mutable_oneofs() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.oneofs) - return &oneofs_; + return &_impl_.oneofs_; } // repeated .google.protobuf.Option options = 4; inline int Type::_internal_options_size() const { - return options_.size(); + return _impl_.options_.size(); } inline int Type::options_size() const { return _internal_options_size(); } inline void Type::clear_options() { - options_.Clear(); + _impl_.options_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::Option* Type::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Type.options) - return options_.Mutable(index); + return _impl_.options_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >* Type::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.options) - return &options_; + return &_impl_.options_; } inline const ::PROTOBUF_NAMESPACE_ID::Option& Type::_internal_options(int index) const { - return options_.Get(index); + return _impl_.options_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::Option& Type::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Type.options) return _internal_options(index); } inline ::PROTOBUF_NAMESPACE_ID::Option* Type::_internal_add_options() { - return options_.Add(); + return _impl_.options_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::Option* Type::add_options() { ::PROTOBUF_NAMESPACE_ID::Option* _add = _internal_add_options(); @@ -1585,18 +1585,18 @@ inline ::PROTOBUF_NAMESPACE_ID::Option* Type::add_options() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >& Type::options() const { // @@protoc_insertion_point(field_list:google.protobuf.Type.options) - return options_; + return _impl_.options_; } // .google.protobuf.SourceContext source_context = 5; inline bool Type::_internal_has_source_context() const { - return this != internal_default_instance() && source_context_ != nullptr; + return this != internal_default_instance() && _impl_.source_context_ != nullptr; } inline bool Type::has_source_context() const { return _internal_has_source_context(); } inline const ::PROTOBUF_NAMESPACE_ID::SourceContext& Type::_internal_source_context() const { - const ::PROTOBUF_NAMESPACE_ID::SourceContext* p = source_context_; + const ::PROTOBUF_NAMESPACE_ID::SourceContext* p = _impl_.source_context_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_SourceContext_default_instance_); } @@ -1607,9 +1607,9 @@ inline const ::PROTOBUF_NAMESPACE_ID::SourceContext& Type::source_context() cons inline void Type::unsafe_arena_set_allocated_source_context( ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.source_context_); } - source_context_ = source_context; + _impl_.source_context_ = source_context; if (source_context) { } else { @@ -1619,8 +1619,8 @@ inline void Type::unsafe_arena_set_allocated_source_context( } inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Type::release_source_context() { - ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_; - source_context_ = nullptr; + ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = _impl_.source_context_; + _impl_.source_context_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -1635,17 +1635,17 @@ inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Type::release_source_context() { inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Type::unsafe_arena_release_source_context() { // @@protoc_insertion_point(field_release:google.protobuf.Type.source_context) - ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_; - source_context_ = nullptr; + ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = _impl_.source_context_; + _impl_.source_context_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Type::_internal_mutable_source_context() { - if (source_context_ == nullptr) { + if (_impl_.source_context_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceContext>(GetArenaForAllocation()); - source_context_ = p; + _impl_.source_context_ = p; } - return source_context_; + return _impl_.source_context_; } inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Type::mutable_source_context() { ::PROTOBUF_NAMESPACE_ID::SourceContext* _msg = _internal_mutable_source_context(); @@ -1655,12 +1655,11 @@ inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Type::mutable_source_context() { inline void Type::set_allocated_source_context(::PROTOBUF_NAMESPACE_ID::SourceContext* source_context) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_); + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.source_context_); } if (source_context) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context)); if (message_arena != submessage_arena) { source_context = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -1670,16 +1669,16 @@ inline void Type::set_allocated_source_context(::PROTOBUF_NAMESPACE_ID::SourceCo } else { } - source_context_ = source_context; + _impl_.source_context_ = source_context; // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.source_context) } // .google.protobuf.Syntax syntax = 6; inline void Type::clear_syntax() { - syntax_ = 0; + _impl_.syntax_ = 0; } inline ::PROTOBUF_NAMESPACE_ID::Syntax Type::_internal_syntax() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::Syntax >(syntax_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::Syntax >(_impl_.syntax_); } inline ::PROTOBUF_NAMESPACE_ID::Syntax Type::syntax() const { // @@protoc_insertion_point(field_get:google.protobuf.Type.syntax) @@ -1687,7 +1686,7 @@ inline ::PROTOBUF_NAMESPACE_ID::Syntax Type::syntax() const { } inline void Type::_internal_set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { - syntax_ = value; + _impl_.syntax_ = value; } inline void Type::set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { _internal_set_syntax(value); @@ -1700,10 +1699,10 @@ inline void Type::set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { // .google.protobuf.Field.Kind kind = 1; inline void Field::clear_kind() { - kind_ = 0; + _impl_.kind_ = 0; } inline ::PROTOBUF_NAMESPACE_ID::Field_Kind Field::_internal_kind() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::Field_Kind >(kind_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::Field_Kind >(_impl_.kind_); } inline ::PROTOBUF_NAMESPACE_ID::Field_Kind Field::kind() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.kind) @@ -1711,7 +1710,7 @@ inline ::PROTOBUF_NAMESPACE_ID::Field_Kind Field::kind() const { } inline void Field::_internal_set_kind(::PROTOBUF_NAMESPACE_ID::Field_Kind value) { - kind_ = value; + _impl_.kind_ = value; } inline void Field::set_kind(::PROTOBUF_NAMESPACE_ID::Field_Kind value) { _internal_set_kind(value); @@ -1720,10 +1719,10 @@ inline void Field::set_kind(::PROTOBUF_NAMESPACE_ID::Field_Kind value) { // .google.protobuf.Field.Cardinality cardinality = 2; inline void Field::clear_cardinality() { - cardinality_ = 0; + _impl_.cardinality_ = 0; } inline ::PROTOBUF_NAMESPACE_ID::Field_Cardinality Field::_internal_cardinality() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::Field_Cardinality >(cardinality_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::Field_Cardinality >(_impl_.cardinality_); } inline ::PROTOBUF_NAMESPACE_ID::Field_Cardinality Field::cardinality() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.cardinality) @@ -1731,7 +1730,7 @@ inline ::PROTOBUF_NAMESPACE_ID::Field_Cardinality Field::cardinality() const { } inline void Field::_internal_set_cardinality(::PROTOBUF_NAMESPACE_ID::Field_Cardinality value) { - cardinality_ = value; + _impl_.cardinality_ = value; } inline void Field::set_cardinality(::PROTOBUF_NAMESPACE_ID::Field_Cardinality value) { _internal_set_cardinality(value); @@ -1740,10 +1739,10 @@ inline void Field::set_cardinality(::PROTOBUF_NAMESPACE_ID::Field_Cardinality va // int32 number = 3; inline void Field::clear_number() { - number_ = 0; + _impl_.number_ = 0; } inline int32_t Field::_internal_number() const { - return number_; + return _impl_.number_; } inline int32_t Field::number() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.number) @@ -1751,7 +1750,7 @@ inline int32_t Field::number() const { } inline void Field::_internal_set_number(int32_t value) { - number_ = value; + _impl_.number_ = value; } inline void Field::set_number(int32_t value) { _internal_set_number(value); @@ -1760,7 +1759,7 @@ inline void Field::set_number(int32_t value) { // string name = 4; inline void Field::clear_name() { - name_.ClearToEmpty(); + _impl_.name_.ClearToEmpty(); } inline const std::string& Field::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.name) @@ -1770,7 +1769,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Field::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Field.name) } inline std::string* Field::mutable_name() { @@ -1779,19 +1778,19 @@ inline std::string* Field::mutable_name() { return _s; } inline const std::string& Field::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void Field::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* Field::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* Field::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Field.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.name_.Release(); } inline void Field::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -1799,11 +1798,10 @@ inline void Field::set_allocated_name(std::string* name) { } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.name) @@ -1811,7 +1809,7 @@ inline void Field::set_allocated_name(std::string* name) { // string type_url = 6; inline void Field::clear_type_url() { - type_url_.ClearToEmpty(); + _impl_.type_url_.ClearToEmpty(); } inline const std::string& Field::type_url() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.type_url) @@ -1821,7 +1819,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Field::set_type_url(ArgT0&& arg0, ArgT... args) { - type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.type_url_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Field.type_url) } inline std::string* Field::mutable_type_url() { @@ -1830,19 +1828,19 @@ inline std::string* Field::mutable_type_url() { return _s; } inline const std::string& Field::_internal_type_url() const { - return type_url_.Get(); + return _impl_.type_url_.Get(); } inline void Field::_internal_set_type_url(const std::string& value) { - type_url_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.type_url_.Set(value, GetArenaForAllocation()); } inline std::string* Field::_internal_mutable_type_url() { - return type_url_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.type_url_.Mutable(GetArenaForAllocation()); } inline std::string* Field::release_type_url() { // @@protoc_insertion_point(field_release:google.protobuf.Field.type_url) - return type_url_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.type_url_.Release(); } inline void Field::set_allocated_type_url(std::string* type_url) { if (type_url != nullptr) { @@ -1850,11 +1848,10 @@ inline void Field::set_allocated_type_url(std::string* type_url) { } else { } - type_url_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), type_url, - GetArenaForAllocation()); + _impl_.type_url_.SetAllocated(type_url, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (type_url_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - type_url_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.type_url_.IsDefault()) { + _impl_.type_url_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.type_url) @@ -1862,10 +1859,10 @@ inline void Field::set_allocated_type_url(std::string* type_url) { // int32 oneof_index = 7; inline void Field::clear_oneof_index() { - oneof_index_ = 0; + _impl_.oneof_index_ = 0; } inline int32_t Field::_internal_oneof_index() const { - return oneof_index_; + return _impl_.oneof_index_; } inline int32_t Field::oneof_index() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.oneof_index) @@ -1873,7 +1870,7 @@ inline int32_t Field::oneof_index() const { } inline void Field::_internal_set_oneof_index(int32_t value) { - oneof_index_ = value; + _impl_.oneof_index_ = value; } inline void Field::set_oneof_index(int32_t value) { _internal_set_oneof_index(value); @@ -1882,10 +1879,10 @@ inline void Field::set_oneof_index(int32_t value) { // bool packed = 8; inline void Field::clear_packed() { - packed_ = false; + _impl_.packed_ = false; } inline bool Field::_internal_packed() const { - return packed_; + return _impl_.packed_; } inline bool Field::packed() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.packed) @@ -1893,7 +1890,7 @@ inline bool Field::packed() const { } inline void Field::_internal_set_packed(bool value) { - packed_ = value; + _impl_.packed_ = value; } inline void Field::set_packed(bool value) { _internal_set_packed(value); @@ -1902,32 +1899,32 @@ inline void Field::set_packed(bool value) { // repeated .google.protobuf.Option options = 9; inline int Field::_internal_options_size() const { - return options_.size(); + return _impl_.options_.size(); } inline int Field::options_size() const { return _internal_options_size(); } inline void Field::clear_options() { - options_.Clear(); + _impl_.options_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::Option* Field::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Field.options) - return options_.Mutable(index); + return _impl_.options_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >* Field::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Field.options) - return &options_; + return &_impl_.options_; } inline const ::PROTOBUF_NAMESPACE_ID::Option& Field::_internal_options(int index) const { - return options_.Get(index); + return _impl_.options_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::Option& Field::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Field.options) return _internal_options(index); } inline ::PROTOBUF_NAMESPACE_ID::Option* Field::_internal_add_options() { - return options_.Add(); + return _impl_.options_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::Option* Field::add_options() { ::PROTOBUF_NAMESPACE_ID::Option* _add = _internal_add_options(); @@ -1937,12 +1934,12 @@ inline ::PROTOBUF_NAMESPACE_ID::Option* Field::add_options() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >& Field::options() const { // @@protoc_insertion_point(field_list:google.protobuf.Field.options) - return options_; + return _impl_.options_; } // string json_name = 10; inline void Field::clear_json_name() { - json_name_.ClearToEmpty(); + _impl_.json_name_.ClearToEmpty(); } inline const std::string& Field::json_name() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.json_name) @@ -1952,7 +1949,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Field::set_json_name(ArgT0&& arg0, ArgT... args) { - json_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.json_name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Field.json_name) } inline std::string* Field::mutable_json_name() { @@ -1961,19 +1958,19 @@ inline std::string* Field::mutable_json_name() { return _s; } inline const std::string& Field::_internal_json_name() const { - return json_name_.Get(); + return _impl_.json_name_.Get(); } inline void Field::_internal_set_json_name(const std::string& value) { - json_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.json_name_.Set(value, GetArenaForAllocation()); } inline std::string* Field::_internal_mutable_json_name() { - return json_name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.json_name_.Mutable(GetArenaForAllocation()); } inline std::string* Field::release_json_name() { // @@protoc_insertion_point(field_release:google.protobuf.Field.json_name) - return json_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.json_name_.Release(); } inline void Field::set_allocated_json_name(std::string* json_name) { if (json_name != nullptr) { @@ -1981,11 +1978,10 @@ inline void Field::set_allocated_json_name(std::string* json_name) { } else { } - json_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), json_name, - GetArenaForAllocation()); + _impl_.json_name_.SetAllocated(json_name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (json_name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - json_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.json_name_.IsDefault()) { + _impl_.json_name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.json_name) @@ -1993,7 +1989,7 @@ inline void Field::set_allocated_json_name(std::string* json_name) { // string default_value = 11; inline void Field::clear_default_value() { - default_value_.ClearToEmpty(); + _impl_.default_value_.ClearToEmpty(); } inline const std::string& Field::default_value() const { // @@protoc_insertion_point(field_get:google.protobuf.Field.default_value) @@ -2003,7 +1999,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Field::set_default_value(ArgT0&& arg0, ArgT... args) { - default_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.default_value_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Field.default_value) } inline std::string* Field::mutable_default_value() { @@ -2012,19 +2008,19 @@ inline std::string* Field::mutable_default_value() { return _s; } inline const std::string& Field::_internal_default_value() const { - return default_value_.Get(); + return _impl_.default_value_.Get(); } inline void Field::_internal_set_default_value(const std::string& value) { - default_value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.default_value_.Set(value, GetArenaForAllocation()); } inline std::string* Field::_internal_mutable_default_value() { - return default_value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.default_value_.Mutable(GetArenaForAllocation()); } inline std::string* Field::release_default_value() { // @@protoc_insertion_point(field_release:google.protobuf.Field.default_value) - return default_value_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.default_value_.Release(); } inline void Field::set_allocated_default_value(std::string* default_value) { if (default_value != nullptr) { @@ -2032,11 +2028,10 @@ inline void Field::set_allocated_default_value(std::string* default_value) { } else { } - default_value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), default_value, - GetArenaForAllocation()); + _impl_.default_value_.SetAllocated(default_value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (default_value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - default_value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.default_value_.IsDefault()) { + _impl_.default_value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.default_value) @@ -2048,7 +2043,7 @@ inline void Field::set_allocated_default_value(std::string* default_value) { // string name = 1; inline void Enum::clear_name() { - name_.ClearToEmpty(); + _impl_.name_.ClearToEmpty(); } inline const std::string& Enum::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Enum.name) @@ -2058,7 +2053,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Enum::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Enum.name) } inline std::string* Enum::mutable_name() { @@ -2067,19 +2062,19 @@ inline std::string* Enum::mutable_name() { return _s; } inline const std::string& Enum::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void Enum::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* Enum::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* Enum::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Enum.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.name_.Release(); } inline void Enum::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -2087,11 +2082,10 @@ inline void Enum::set_allocated_name(std::string* name) { } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.name) @@ -2099,32 +2093,32 @@ inline void Enum::set_allocated_name(std::string* name) { // repeated .google.protobuf.EnumValue enumvalue = 2; inline int Enum::_internal_enumvalue_size() const { - return enumvalue_.size(); + return _impl_.enumvalue_.size(); } inline int Enum::enumvalue_size() const { return _internal_enumvalue_size(); } inline void Enum::clear_enumvalue() { - enumvalue_.Clear(); + _impl_.enumvalue_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::EnumValue* Enum::mutable_enumvalue(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.enumvalue) - return enumvalue_.Mutable(index); + return _impl_.enumvalue_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValue >* Enum::mutable_enumvalue() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.enumvalue) - return &enumvalue_; + return &_impl_.enumvalue_; } inline const ::PROTOBUF_NAMESPACE_ID::EnumValue& Enum::_internal_enumvalue(int index) const { - return enumvalue_.Get(index); + return _impl_.enumvalue_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::EnumValue& Enum::enumvalue(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Enum.enumvalue) return _internal_enumvalue(index); } inline ::PROTOBUF_NAMESPACE_ID::EnumValue* Enum::_internal_add_enumvalue() { - return enumvalue_.Add(); + return _impl_.enumvalue_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::EnumValue* Enum::add_enumvalue() { ::PROTOBUF_NAMESPACE_ID::EnumValue* _add = _internal_add_enumvalue(); @@ -2134,37 +2128,37 @@ inline ::PROTOBUF_NAMESPACE_ID::EnumValue* Enum::add_enumvalue() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::EnumValue >& Enum::enumvalue() const { // @@protoc_insertion_point(field_list:google.protobuf.Enum.enumvalue) - return enumvalue_; + return _impl_.enumvalue_; } // repeated .google.protobuf.Option options = 3; inline int Enum::_internal_options_size() const { - return options_.size(); + return _impl_.options_.size(); } inline int Enum::options_size() const { return _internal_options_size(); } inline void Enum::clear_options() { - options_.Clear(); + _impl_.options_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::Option* Enum::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.options) - return options_.Mutable(index); + return _impl_.options_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >* Enum::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.options) - return &options_; + return &_impl_.options_; } inline const ::PROTOBUF_NAMESPACE_ID::Option& Enum::_internal_options(int index) const { - return options_.Get(index); + return _impl_.options_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::Option& Enum::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Enum.options) return _internal_options(index); } inline ::PROTOBUF_NAMESPACE_ID::Option* Enum::_internal_add_options() { - return options_.Add(); + return _impl_.options_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::Option* Enum::add_options() { ::PROTOBUF_NAMESPACE_ID::Option* _add = _internal_add_options(); @@ -2174,18 +2168,18 @@ inline ::PROTOBUF_NAMESPACE_ID::Option* Enum::add_options() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >& Enum::options() const { // @@protoc_insertion_point(field_list:google.protobuf.Enum.options) - return options_; + return _impl_.options_; } // .google.protobuf.SourceContext source_context = 4; inline bool Enum::_internal_has_source_context() const { - return this != internal_default_instance() && source_context_ != nullptr; + return this != internal_default_instance() && _impl_.source_context_ != nullptr; } inline bool Enum::has_source_context() const { return _internal_has_source_context(); } inline const ::PROTOBUF_NAMESPACE_ID::SourceContext& Enum::_internal_source_context() const { - const ::PROTOBUF_NAMESPACE_ID::SourceContext* p = source_context_; + const ::PROTOBUF_NAMESPACE_ID::SourceContext* p = _impl_.source_context_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_SourceContext_default_instance_); } @@ -2196,9 +2190,9 @@ inline const ::PROTOBUF_NAMESPACE_ID::SourceContext& Enum::source_context() cons inline void Enum::unsafe_arena_set_allocated_source_context( ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.source_context_); } - source_context_ = source_context; + _impl_.source_context_ = source_context; if (source_context) { } else { @@ -2208,8 +2202,8 @@ inline void Enum::unsafe_arena_set_allocated_source_context( } inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Enum::release_source_context() { - ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_; - source_context_ = nullptr; + ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = _impl_.source_context_; + _impl_.source_context_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -2224,17 +2218,17 @@ inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Enum::release_source_context() { inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Enum::unsafe_arena_release_source_context() { // @@protoc_insertion_point(field_release:google.protobuf.Enum.source_context) - ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_; - source_context_ = nullptr; + ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = _impl_.source_context_; + _impl_.source_context_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Enum::_internal_mutable_source_context() { - if (source_context_ == nullptr) { + if (_impl_.source_context_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceContext>(GetArenaForAllocation()); - source_context_ = p; + _impl_.source_context_ = p; } - return source_context_; + return _impl_.source_context_; } inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Enum::mutable_source_context() { ::PROTOBUF_NAMESPACE_ID::SourceContext* _msg = _internal_mutable_source_context(); @@ -2244,12 +2238,11 @@ inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Enum::mutable_source_context() { inline void Enum::set_allocated_source_context(::PROTOBUF_NAMESPACE_ID::SourceContext* source_context) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_); + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.source_context_); } if (source_context) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context)); if (message_arena != submessage_arena) { source_context = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -2259,16 +2252,16 @@ inline void Enum::set_allocated_source_context(::PROTOBUF_NAMESPACE_ID::SourceCo } else { } - source_context_ = source_context; + _impl_.source_context_ = source_context; // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.source_context) } // .google.protobuf.Syntax syntax = 5; inline void Enum::clear_syntax() { - syntax_ = 0; + _impl_.syntax_ = 0; } inline ::PROTOBUF_NAMESPACE_ID::Syntax Enum::_internal_syntax() const { - return static_cast< ::PROTOBUF_NAMESPACE_ID::Syntax >(syntax_); + return static_cast< ::PROTOBUF_NAMESPACE_ID::Syntax >(_impl_.syntax_); } inline ::PROTOBUF_NAMESPACE_ID::Syntax Enum::syntax() const { // @@protoc_insertion_point(field_get:google.protobuf.Enum.syntax) @@ -2276,7 +2269,7 @@ inline ::PROTOBUF_NAMESPACE_ID::Syntax Enum::syntax() const { } inline void Enum::_internal_set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { - syntax_ = value; + _impl_.syntax_ = value; } inline void Enum::set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { _internal_set_syntax(value); @@ -2289,7 +2282,7 @@ inline void Enum::set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { // string name = 1; inline void EnumValue::clear_name() { - name_.ClearToEmpty(); + _impl_.name_.ClearToEmpty(); } inline const std::string& EnumValue::name() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.name) @@ -2299,7 +2292,7 @@ template inline PROTOBUF_ALWAYS_INLINE void EnumValue::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.EnumValue.name) } inline std::string* EnumValue::mutable_name() { @@ -2308,19 +2301,19 @@ inline std::string* EnumValue::mutable_name() { return _s; } inline const std::string& EnumValue::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void EnumValue::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* EnumValue::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* EnumValue::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.EnumValue.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.name_.Release(); } inline void EnumValue::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -2328,11 +2321,10 @@ inline void EnumValue::set_allocated_name(std::string* name) { } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValue.name) @@ -2340,10 +2332,10 @@ inline void EnumValue::set_allocated_name(std::string* name) { // int32 number = 2; inline void EnumValue::clear_number() { - number_ = 0; + _impl_.number_ = 0; } inline int32_t EnumValue::_internal_number() const { - return number_; + return _impl_.number_; } inline int32_t EnumValue::number() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.number) @@ -2351,7 +2343,7 @@ inline int32_t EnumValue::number() const { } inline void EnumValue::_internal_set_number(int32_t value) { - number_ = value; + _impl_.number_ = value; } inline void EnumValue::set_number(int32_t value) { _internal_set_number(value); @@ -2360,32 +2352,32 @@ inline void EnumValue::set_number(int32_t value) { // repeated .google.protobuf.Option options = 3; inline int EnumValue::_internal_options_size() const { - return options_.size(); + return _impl_.options_.size(); } inline int EnumValue::options_size() const { return _internal_options_size(); } inline void EnumValue::clear_options() { - options_.Clear(); + _impl_.options_.Clear(); } inline ::PROTOBUF_NAMESPACE_ID::Option* EnumValue::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.options) - return options_.Mutable(index); + return _impl_.options_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >* EnumValue::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValue.options) - return &options_; + return &_impl_.options_; } inline const ::PROTOBUF_NAMESPACE_ID::Option& EnumValue::_internal_options(int index) const { - return options_.Get(index); + return _impl_.options_.Get(index); } inline const ::PROTOBUF_NAMESPACE_ID::Option& EnumValue::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.options) return _internal_options(index); } inline ::PROTOBUF_NAMESPACE_ID::Option* EnumValue::_internal_add_options() { - return options_.Add(); + return _impl_.options_.Add(); } inline ::PROTOBUF_NAMESPACE_ID::Option* EnumValue::add_options() { ::PROTOBUF_NAMESPACE_ID::Option* _add = _internal_add_options(); @@ -2395,7 +2387,7 @@ inline ::PROTOBUF_NAMESPACE_ID::Option* EnumValue::add_options() { inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >& EnumValue::options() const { // @@protoc_insertion_point(field_list:google.protobuf.EnumValue.options) - return options_; + return _impl_.options_; } // ------------------------------------------------------------------- @@ -2404,7 +2396,7 @@ EnumValue::options() const { // string name = 1; inline void Option::clear_name() { - name_.ClearToEmpty(); + _impl_.name_.ClearToEmpty(); } inline const std::string& Option::name() const { // @@protoc_insertion_point(field_get:google.protobuf.Option.name) @@ -2414,7 +2406,7 @@ template inline PROTOBUF_ALWAYS_INLINE void Option::set_name(ArgT0&& arg0, ArgT... args) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.Option.name) } inline std::string* Option::mutable_name() { @@ -2423,19 +2415,19 @@ inline std::string* Option::mutable_name() { return _s; } inline const std::string& Option::_internal_name() const { - return name_.Get(); + return _impl_.name_.Get(); } inline void Option::_internal_set_name(const std::string& value) { - name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.name_.Set(value, GetArenaForAllocation()); } inline std::string* Option::_internal_mutable_name() { - return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.name_.Mutable(GetArenaForAllocation()); } inline std::string* Option::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.Option.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.name_.Release(); } inline void Option::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -2443,11 +2435,10 @@ inline void Option::set_allocated_name(std::string* name) { } else { } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArenaForAllocation()); + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (name_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.name) @@ -2455,13 +2446,13 @@ inline void Option::set_allocated_name(std::string* name) { // .google.protobuf.Any value = 2; inline bool Option::_internal_has_value() const { - return this != internal_default_instance() && value_ != nullptr; + return this != internal_default_instance() && _impl_.value_ != nullptr; } inline bool Option::has_value() const { return _internal_has_value(); } inline const ::PROTOBUF_NAMESPACE_ID::Any& Option::_internal_value() const { - const ::PROTOBUF_NAMESPACE_ID::Any* p = value_; + const ::PROTOBUF_NAMESPACE_ID::Any* p = _impl_.value_; return p != nullptr ? *p : reinterpret_cast( ::PROTOBUF_NAMESPACE_ID::_Any_default_instance_); } @@ -2472,9 +2463,9 @@ inline const ::PROTOBUF_NAMESPACE_ID::Any& Option::value() const { inline void Option::unsafe_arena_set_allocated_value( ::PROTOBUF_NAMESPACE_ID::Any* value) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(value_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.value_); } - value_ = value; + _impl_.value_ = value; if (value) { } else { @@ -2484,8 +2475,8 @@ inline void Option::unsafe_arena_set_allocated_value( } inline ::PROTOBUF_NAMESPACE_ID::Any* Option::release_value() { - ::PROTOBUF_NAMESPACE_ID::Any* temp = value_; - value_ = nullptr; + ::PROTOBUF_NAMESPACE_ID::Any* temp = _impl_.value_; + _impl_.value_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -2500,17 +2491,17 @@ inline ::PROTOBUF_NAMESPACE_ID::Any* Option::release_value() { inline ::PROTOBUF_NAMESPACE_ID::Any* Option::unsafe_arena_release_value() { // @@protoc_insertion_point(field_release:google.protobuf.Option.value) - ::PROTOBUF_NAMESPACE_ID::Any* temp = value_; - value_ = nullptr; + ::PROTOBUF_NAMESPACE_ID::Any* temp = _impl_.value_; + _impl_.value_ = nullptr; return temp; } inline ::PROTOBUF_NAMESPACE_ID::Any* Option::_internal_mutable_value() { - if (value_ == nullptr) { + if (_impl_.value_ == nullptr) { auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Any>(GetArenaForAllocation()); - value_ = p; + _impl_.value_ = p; } - return value_; + return _impl_.value_; } inline ::PROTOBUF_NAMESPACE_ID::Any* Option::mutable_value() { ::PROTOBUF_NAMESPACE_ID::Any* _msg = _internal_mutable_value(); @@ -2520,12 +2511,11 @@ inline ::PROTOBUF_NAMESPACE_ID::Any* Option::mutable_value() { inline void Option::set_allocated_value(::PROTOBUF_NAMESPACE_ID::Any* value) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(value_); + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.value_); } if (value) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper< - ::PROTOBUF_NAMESPACE_ID::MessageLite>::GetOwningArena( + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(value)); if (message_arena != submessage_arena) { value = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( @@ -2535,7 +2525,7 @@ inline void Option::set_allocated_value(::PROTOBUF_NAMESPACE_ID::Any* value) { } else { } - value_ = value; + _impl_.value_ = value; // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.value) } diff --git a/windows/include/google/protobuf/unknown_field_set.h b/windows/include/google/protobuf/unknown_field_set.h index c5ca06b6e..9aa2cbbe4 100644 --- a/windows/include/google/protobuf/unknown_field_set.h +++ b/windows/include/google/protobuf/unknown_field_set.h @@ -38,6 +38,7 @@ #ifndef GOOGLE_PROTOBUF_UNKNOWN_FIELD_SET_H__ #define GOOGLE_PROTOBUF_UNKNOWN_FIELD_SET_H__ + #include #include @@ -45,12 +46,13 @@ #include #include -#include #include #include -#include #include +#include +#include +// Must be included last. #include #ifdef SWIG @@ -172,6 +174,9 @@ class PROTOBUF_EXPORT UnknownFieldSet { template bool MergeFromMessage(const MessageType& message); + // Serialization. + bool SerializeToString(std::string* output) const; + bool SerializeToCodedStream(io::CodedOutputStream* output) const; static const UnknownFieldSet& default_instance(); private: @@ -259,15 +264,6 @@ class PROTOBUF_EXPORT UnknownField { inline std::string* mutable_length_delimited(); inline UnknownFieldSet* mutable_group(); - // Serialization API. - // These methods can take advantage of the underlying implementation and may - // archieve a better performance than using getters to retrieve the data and - // do the serialization yourself. - void SerializeLengthDelimitedNoTag(io::CodedOutputStream* output) const { - output->SetCur(InternalSerializeLengthDelimitedNoTag(output->Cur(), - output->EpsCopy())); - } - inline size_t GetLengthDelimitedSize() const; uint8_t* InternalSerializeLengthDelimitedNoTag( uint8_t* target, io::EpsCopyOutputStream* stream) const; diff --git a/windows/include/google/protobuf/util/delimited_message_util.h b/windows/include/google/protobuf/util/delimited_message_util.h index d3f7dbe8a..78625cf2f 100644 --- a/windows/include/google/protobuf/util/delimited_message_util.h +++ b/windows/include/google/protobuf/util/delimited_message_util.h @@ -41,6 +41,7 @@ #include #include +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/util/field_comparator.h b/windows/include/google/protobuf/util/field_comparator.h index dd1a48699..5706da357 100644 --- a/windows/include/google/protobuf/util/field_comparator.h +++ b/windows/include/google/protobuf/util/field_comparator.h @@ -33,12 +33,15 @@ #ifndef GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__ #define GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__ + #include #include #include #include #include + +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/util/field_mask_util.h b/windows/include/google/protobuf/util/field_mask_util.h index dd8be8d3b..d51a332c8 100644 --- a/windows/include/google/protobuf/util/field_mask_util.h +++ b/windows/include/google/protobuf/util/field_mask_util.h @@ -37,8 +37,8 @@ #include #include -#include #include +#include // Must be included last. #include @@ -96,8 +96,9 @@ class PROTOBUF_EXPORT FieldMaskUtil { template static bool IsValidFieldMask(const FieldMask& mask) { for (int i = 0; i < mask.paths_size(); ++i) { - if (!GetFieldDescriptors(T::descriptor(), mask.paths(i), nullptr)) + if (!GetFieldDescriptors(T::descriptor(), mask.paths(i), nullptr)) { return false; + } } return true; } diff --git a/windows/include/google/protobuf/util/json_util.h b/windows/include/google/protobuf/util/json_util.h index 73f27837b..0f1c4d8b5 100644 --- a/windows/include/google/protobuf/util/json_util.h +++ b/windows/include/google/protobuf/util/json_util.h @@ -33,12 +33,13 @@ #ifndef GOOGLE_PROTOBUF_UTIL_JSON_UTIL_H__ #define GOOGLE_PROTOBUF_UTIL_JSON_UTIL_H__ -#include -#include #include #include #include +#include +#include +// Must be included last. #include namespace google { @@ -61,8 +62,7 @@ struct JsonParseOptions { bool case_insensitive_enum_parsing; JsonParseOptions() - : ignore_unknown_fields(false), - case_insensitive_enum_parsing(false) {} + : ignore_unknown_fields(false), case_insensitive_enum_parsing(false) {} }; struct JsonPrintOptions { @@ -181,8 +181,8 @@ namespace internal { class PROTOBUF_EXPORT ZeroCopyStreamByteSink : public strings::ByteSink { public: explicit ZeroCopyStreamByteSink(io::ZeroCopyOutputStream* stream) - : stream_(stream), buffer_(NULL), buffer_size_(0) {} - ~ZeroCopyStreamByteSink(); + : stream_(stream), buffer_(nullptr), buffer_size_(0) {} + ~ZeroCopyStreamByteSink() override; void Append(const char* bytes, size_t len) override; diff --git a/windows/include/google/protobuf/util/message_differencer.h b/windows/include/google/protobuf/util/message_differencer.h index fbb5d206d..f63cd5418 100644 --- a/windows/include/google/protobuf/util/message_differencer.h +++ b/windows/include/google/protobuf/util/message_differencer.h @@ -43,6 +43,7 @@ #ifndef GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__ #define GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__ + #include #include #include @@ -222,16 +223,16 @@ class PROTOBUF_EXPORT MessageDifferencer { // itself and the second will be the actual field in the embedded message // that was added/deleted/modified. // Fields will be reported in PostTraversalOrder. - // For example, given following proto, if both baz and quux are changed. + // For example, given following proto, if both baz and mooo are changed. // foo { // bar { // baz: 1 - // quux: 2 + // mooo: 2 // } // } // ReportModified will be invoked with following order: - // 1. foo.bar.baz or foo.bar.quux - // 2. foo.bar.quux or foo.bar.baz + // 1. foo.bar.baz or foo.bar.mooo + // 2. foo.bar.mooo or foo.bar.baz // 2. foo.bar // 3. foo class PROTOBUF_EXPORT Reporter { @@ -544,6 +545,9 @@ class PROTOBUF_EXPORT MessageDifferencer { // to compare fields in messages. void set_message_field_comparison(MessageFieldComparison comparison); + // Returns the current message field comparison used in this differencer. + MessageFieldComparison message_field_comparison() const; + // Tells the differencer whether or not to report matches. This method must // be called before Compare. The default for a new differencer is false. void set_report_matches(bool report_matches) { @@ -567,7 +571,7 @@ class PROTOBUF_EXPORT MessageDifferencer { void set_scope(Scope scope); // Returns the current scope used by this differencer. - Scope scope(); + Scope scope() const; // DEPRECATED. Pass a DefaultFieldComparator instance instead. // Sets the type of comparison (as defined in the FloatComparison enumeration @@ -583,7 +587,7 @@ class PROTOBUF_EXPORT MessageDifferencer { void set_repeated_field_comparison(RepeatedFieldComparison comparison); // Returns the current repeated field comparison used by this differencer. - RepeatedFieldComparison repeated_field_comparison(); + RepeatedFieldComparison repeated_field_comparison() const; // Compares the two specified messages, returning true if they are the same, // false otherwise. If this method returns false, any changes between the diff --git a/windows/include/google/protobuf/util/time_util.h b/windows/include/google/protobuf/util/time_util.h index 96b1aac46..709527ea2 100644 --- a/windows/include/google/protobuf/util/time_util.h +++ b/windows/include/google/protobuf/util/time_util.h @@ -40,8 +40,8 @@ #ifdef _MSC_VER #ifdef _XBOX_ONE struct timeval { - int64 tv_sec; /* seconds */ - int64 tv_usec; /* and microseconds */ + int64_t tv_sec; /* seconds */ + int64_t tv_usec; /* and microseconds */ }; #else #include @@ -53,6 +53,7 @@ struct timeval { #include #include +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/util/type_resolver.h b/windows/include/google/protobuf/util/type_resolver.h index 2bda5c883..b2e7b43d7 100644 --- a/windows/include/google/protobuf/util/type_resolver.h +++ b/windows/include/google/protobuf/util/type_resolver.h @@ -40,6 +40,7 @@ #include #include +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/util/type_resolver_util.h b/windows/include/google/protobuf/util/type_resolver_util.h index fa912b604..7f6a4b9b1 100644 --- a/windows/include/google/protobuf/util/type_resolver_util.h +++ b/windows/include/google/protobuf/util/type_resolver_util.h @@ -41,6 +41,7 @@ class DescriptorPool; namespace util { class TypeResolver; +// Must be included last. #include // Creates a TypeResolver that serves type information in the given descriptor diff --git a/windows/include/google/protobuf/wire_format.h b/windows/include/google/protobuf/wire_format.h index 3628be3f7..1acbf9e1f 100644 --- a/windows/include/google/protobuf/wire_format.h +++ b/windows/include/google/protobuf/wire_format.h @@ -39,22 +39,22 @@ #ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_H__ #define GOOGLE_PROTOBUF_WIRE_FORMAT_H__ -#include #include -#include #include +#include #include #include #include #include +#include #include -#include #ifdef SWIG #error "You cannot SWIG proto headers" #endif +// Must be included last. #include namespace google { diff --git a/windows/include/google/protobuf/wire_format_lite.h b/windows/include/google/protobuf/wire_format_lite.h index b04d17b3c..80d396156 100644 --- a/windows/include/google/protobuf/wire_format_lite.h +++ b/windows/include/google/protobuf/wire_format_lite.h @@ -40,16 +40,18 @@ #ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__ #define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__ + +#include #include #include #include #include +#include +#include #include #include -#include #include -#include // Do UTF-8 validation on string type in Debug build only #ifndef NDEBUG @@ -67,6 +69,7 @@ #undef TYPE_BOOL +// Must be included last. #include namespace google { @@ -622,14 +625,13 @@ class PROTOBUF_EXPORT WireFormatLite { // of serialization, the "ToArray" variants may be invoked. But they don't // have a CodedOutputStream available, so they get an additional parameter // telling them whether to serialize deterministically. - template - PROTOBUF_NDEBUG_INLINE static uint8_t* InternalWriteGroup( - int field_number, const MessageType& value, uint8_t* target, - io::EpsCopyOutputStream* stream); - template - PROTOBUF_NDEBUG_INLINE static uint8_t* InternalWriteMessage( - int field_number, const MessageType& value, uint8_t* target, - io::EpsCopyOutputStream* stream); + static uint8_t* InternalWriteGroup(int field_number, const MessageLite& value, + uint8_t* target, + io::EpsCopyOutputStream* stream); + static uint8_t* InternalWriteMessage(int field_number, + const MessageLite& value, + int cached_size, uint8_t* target, + io::EpsCopyOutputStream* stream); // Like above, but de-virtualize the call to SerializeWithCachedSizes(). The // pointer must point at an instance of MessageType, *not* a subclass (or @@ -662,7 +664,8 @@ class PROTOBUF_EXPORT WireFormatLite { static_cast(field_number) << 3) + io::CodedOutputStream::VarintSize32(size)), io::CodedOutputStream::IsDefaultSerializationDeterministic()); - return InternalWriteMessage(field_number, value, target, &stream); + return InternalWriteMessage(field_number, value, value.GetCachedSize(), + target, &stream); } // Compute the byte size of a field. The XxSize() functions do NOT include @@ -1705,25 +1708,6 @@ inline uint8_t* WireFormatLite::WriteBytesToArray(int field_number, } -template -inline uint8_t* WireFormatLite::InternalWriteGroup( - int field_number, const MessageType& value, uint8_t* target, - io::EpsCopyOutputStream* stream) { - target = WriteTagToArray(field_number, WIRETYPE_START_GROUP, target); - target = value._InternalSerialize(target, stream); - target = stream->EnsureSpace(target); - return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target); -} -template -inline uint8_t* WireFormatLite::InternalWriteMessage( - int field_number, const MessageType& value, uint8_t* target, - io::EpsCopyOutputStream* stream) { - target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target); - target = io::CodedOutputStream::WriteVarint32ToArrayOutOfLine( - static_cast(value.GetCachedSize()), target); - return value._InternalSerialize(target, stream); -} - // See comment on ReadGroupNoVirtual to understand the need for this template // parameter name. template @@ -1847,6 +1831,9 @@ bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) { // we can parse it later. std::string message_data; + enum class State { kNoTag, kHasType, kHasPayload, kDone }; + State state = State::kNoTag; + while (true) { const uint32_t tag = input->ReadTagNoLastTag(); if (tag == 0) return false; @@ -1855,26 +1842,34 @@ bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) { case WireFormatLite::kMessageSetTypeIdTag: { uint32_t type_id; if (!input->ReadVarint32(&type_id)) return false; - last_type_id = type_id; - - if (!message_data.empty()) { + if (state == State::kNoTag) { + last_type_id = type_id; + state = State::kHasType; + } else if (state == State::kHasPayload) { // We saw some message data before the type_id. Have to parse it // now. io::CodedInputStream sub_input( reinterpret_cast(message_data.data()), static_cast(message_data.size())); sub_input.SetRecursionLimit(input->RecursionBudget()); - if (!ms.ParseField(last_type_id, &sub_input)) { + if (!ms.ParseField(type_id, &sub_input)) { return false; } message_data.clear(); + state = State::kDone; } break; } case WireFormatLite::kMessageSetMessageTag: { - if (last_type_id == 0) { + if (state == State::kHasType) { + // Already saw type_id, so we can parse this directly. + if (!ms.ParseField(last_type_id, input)) { + return false; + } + state = State::kDone; + } else if (state == State::kNoTag) { // We haven't seen a type_id yet. Append this data to message_data. uint32_t length; if (!input->ReadVarint32(&length)) return false; @@ -1885,11 +1880,9 @@ bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) { auto ptr = reinterpret_cast(&message_data[0]); ptr = io::CodedOutputStream::WriteVarint32ToArray(length, ptr); if (!input->ReadRaw(ptr, length)) return false; + state = State::kHasPayload; } else { - // Already saw type_id, so we can parse this directly. - if (!ms.ParseField(last_type_id, input)) { - return false; - } + if (!ms.SkipField(tag, input)) return false; } break; diff --git a/windows/include/google/protobuf/wrappers.pb.h b/windows/include/google/protobuf/wrappers.pb.h index 42ffda2ee..0f4b8350b 100644 --- a/windows/include/google/protobuf/wrappers.pb.h +++ b/windows/include/google/protobuf/wrappers.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3019000 +#if PROTOBUF_VERSION < 3021000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -42,14 +41,6 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fwrappers_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[9] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const uint32_t offsets[]; }; PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fwrappers_2eproto; @@ -102,7 +93,7 @@ class PROTOBUF_EXPORT DoubleValue final : public: inline DoubleValue() : DoubleValue(nullptr) {} ~DoubleValue() override; - explicit constexpr DoubleValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR DoubleValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); DoubleValue(const DoubleValue& from); DoubleValue(DoubleValue&& from) noexcept @@ -177,9 +168,11 @@ class PROTOBUF_EXPORT DoubleValue final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const DoubleValue& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const DoubleValue& from); + void MergeFrom( const DoubleValue& from) { + DoubleValue::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -188,10 +181,10 @@ class PROTOBUF_EXPORT DoubleValue final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(DoubleValue* other); @@ -204,9 +197,6 @@ class PROTOBUF_EXPORT DoubleValue final : protected: explicit DoubleValue(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -237,8 +227,11 @@ class PROTOBUF_EXPORT DoubleValue final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - double value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + double value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fwrappers_2eproto; }; // ------------------------------------------------------------------- @@ -248,7 +241,7 @@ class PROTOBUF_EXPORT FloatValue final : public: inline FloatValue() : FloatValue(nullptr) {} ~FloatValue() override; - explicit constexpr FloatValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR FloatValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); FloatValue(const FloatValue& from); FloatValue(FloatValue&& from) noexcept @@ -323,9 +316,11 @@ class PROTOBUF_EXPORT FloatValue final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const FloatValue& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const FloatValue& from); + void MergeFrom( const FloatValue& from) { + FloatValue::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -334,10 +329,10 @@ class PROTOBUF_EXPORT FloatValue final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(FloatValue* other); @@ -350,9 +345,6 @@ class PROTOBUF_EXPORT FloatValue final : protected: explicit FloatValue(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -383,8 +375,11 @@ class PROTOBUF_EXPORT FloatValue final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - float value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + float value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fwrappers_2eproto; }; // ------------------------------------------------------------------- @@ -394,7 +389,7 @@ class PROTOBUF_EXPORT Int64Value final : public: inline Int64Value() : Int64Value(nullptr) {} ~Int64Value() override; - explicit constexpr Int64Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Int64Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Int64Value(const Int64Value& from); Int64Value(Int64Value&& from) noexcept @@ -469,9 +464,11 @@ class PROTOBUF_EXPORT Int64Value final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Int64Value& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Int64Value& from); + void MergeFrom( const Int64Value& from) { + Int64Value::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -480,10 +477,10 @@ class PROTOBUF_EXPORT Int64Value final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Int64Value* other); @@ -496,9 +493,6 @@ class PROTOBUF_EXPORT Int64Value final : protected: explicit Int64Value(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -529,8 +523,11 @@ class PROTOBUF_EXPORT Int64Value final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - int64_t value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + int64_t value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fwrappers_2eproto; }; // ------------------------------------------------------------------- @@ -540,7 +537,7 @@ class PROTOBUF_EXPORT UInt64Value final : public: inline UInt64Value() : UInt64Value(nullptr) {} ~UInt64Value() override; - explicit constexpr UInt64Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UInt64Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); UInt64Value(const UInt64Value& from); UInt64Value(UInt64Value&& from) noexcept @@ -615,9 +612,11 @@ class PROTOBUF_EXPORT UInt64Value final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const UInt64Value& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const UInt64Value& from); + void MergeFrom( const UInt64Value& from) { + UInt64Value::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -626,10 +625,10 @@ class PROTOBUF_EXPORT UInt64Value final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(UInt64Value* other); @@ -642,9 +641,6 @@ class PROTOBUF_EXPORT UInt64Value final : protected: explicit UInt64Value(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -675,8 +671,11 @@ class PROTOBUF_EXPORT UInt64Value final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - uint64_t value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + uint64_t value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fwrappers_2eproto; }; // ------------------------------------------------------------------- @@ -686,7 +685,7 @@ class PROTOBUF_EXPORT Int32Value final : public: inline Int32Value() : Int32Value(nullptr) {} ~Int32Value() override; - explicit constexpr Int32Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Int32Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); Int32Value(const Int32Value& from); Int32Value(Int32Value&& from) noexcept @@ -761,9 +760,11 @@ class PROTOBUF_EXPORT Int32Value final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const Int32Value& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const Int32Value& from); + void MergeFrom( const Int32Value& from) { + Int32Value::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -772,10 +773,10 @@ class PROTOBUF_EXPORT Int32Value final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Int32Value* other); @@ -788,9 +789,6 @@ class PROTOBUF_EXPORT Int32Value final : protected: explicit Int32Value(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -821,8 +819,11 @@ class PROTOBUF_EXPORT Int32Value final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - int32_t value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + int32_t value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fwrappers_2eproto; }; // ------------------------------------------------------------------- @@ -832,7 +833,7 @@ class PROTOBUF_EXPORT UInt32Value final : public: inline UInt32Value() : UInt32Value(nullptr) {} ~UInt32Value() override; - explicit constexpr UInt32Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR UInt32Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); UInt32Value(const UInt32Value& from); UInt32Value(UInt32Value&& from) noexcept @@ -907,9 +908,11 @@ class PROTOBUF_EXPORT UInt32Value final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const UInt32Value& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const UInt32Value& from); + void MergeFrom( const UInt32Value& from) { + UInt32Value::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -918,10 +921,10 @@ class PROTOBUF_EXPORT UInt32Value final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(UInt32Value* other); @@ -934,9 +937,6 @@ class PROTOBUF_EXPORT UInt32Value final : protected: explicit UInt32Value(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -967,8 +967,11 @@ class PROTOBUF_EXPORT UInt32Value final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - uint32_t value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + uint32_t value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fwrappers_2eproto; }; // ------------------------------------------------------------------- @@ -978,7 +981,7 @@ class PROTOBUF_EXPORT BoolValue final : public: inline BoolValue() : BoolValue(nullptr) {} ~BoolValue() override; - explicit constexpr BoolValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR BoolValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); BoolValue(const BoolValue& from); BoolValue(BoolValue&& from) noexcept @@ -1053,9 +1056,11 @@ class PROTOBUF_EXPORT BoolValue final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const BoolValue& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const BoolValue& from); + void MergeFrom( const BoolValue& from) { + BoolValue::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1064,10 +1069,10 @@ class PROTOBUF_EXPORT BoolValue final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(BoolValue* other); @@ -1080,9 +1085,6 @@ class PROTOBUF_EXPORT BoolValue final : protected: explicit BoolValue(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1113,8 +1115,11 @@ class PROTOBUF_EXPORT BoolValue final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - bool value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + bool value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fwrappers_2eproto; }; // ------------------------------------------------------------------- @@ -1124,7 +1129,7 @@ class PROTOBUF_EXPORT StringValue final : public: inline StringValue() : StringValue(nullptr) {} ~StringValue() override; - explicit constexpr StringValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR StringValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); StringValue(const StringValue& from); StringValue(StringValue&& from) noexcept @@ -1199,9 +1204,11 @@ class PROTOBUF_EXPORT StringValue final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const StringValue& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const StringValue& from); + void MergeFrom( const StringValue& from) { + StringValue::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1210,10 +1217,10 @@ class PROTOBUF_EXPORT StringValue final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(StringValue* other); @@ -1226,9 +1233,6 @@ class PROTOBUF_EXPORT StringValue final : protected: explicit StringValue(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1264,8 +1268,11 @@ class PROTOBUF_EXPORT StringValue final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fwrappers_2eproto; }; // ------------------------------------------------------------------- @@ -1275,7 +1282,7 @@ class PROTOBUF_EXPORT BytesValue final : public: inline BytesValue() : BytesValue(nullptr) {} ~BytesValue() override; - explicit constexpr BytesValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR BytesValue(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); BytesValue(const BytesValue& from); BytesValue(BytesValue&& from) noexcept @@ -1350,9 +1357,11 @@ class PROTOBUF_EXPORT BytesValue final : using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; void CopyFrom(const BytesValue& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const BytesValue& from); + void MergeFrom( const BytesValue& from) { + BytesValue::MergeImpl(*this, from); + } private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from); + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); public: PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; @@ -1361,10 +1370,10 @@ class PROTOBUF_EXPORT BytesValue final : const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; uint8_t* _InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } private: - void SharedCtor(); + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(BytesValue* other); @@ -1377,9 +1386,6 @@ class PROTOBUF_EXPORT BytesValue final : protected: explicit BytesValue(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: static const ClassData _class_data_; @@ -1415,8 +1421,11 @@ class PROTOBUF_EXPORT BytesValue final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; friend struct ::TableStruct_google_2fprotobuf_2fwrappers_2eproto; }; // =================================================================== @@ -1432,10 +1441,10 @@ class PROTOBUF_EXPORT BytesValue final : // double value = 1; inline void DoubleValue::clear_value() { - value_ = 0; + _impl_.value_ = 0; } inline double DoubleValue::_internal_value() const { - return value_; + return _impl_.value_; } inline double DoubleValue::value() const { // @@protoc_insertion_point(field_get:google.protobuf.DoubleValue.value) @@ -1443,7 +1452,7 @@ inline double DoubleValue::value() const { } inline void DoubleValue::_internal_set_value(double value) { - value_ = value; + _impl_.value_ = value; } inline void DoubleValue::set_value(double value) { _internal_set_value(value); @@ -1456,10 +1465,10 @@ inline void DoubleValue::set_value(double value) { // float value = 1; inline void FloatValue::clear_value() { - value_ = 0; + _impl_.value_ = 0; } inline float FloatValue::_internal_value() const { - return value_; + return _impl_.value_; } inline float FloatValue::value() const { // @@protoc_insertion_point(field_get:google.protobuf.FloatValue.value) @@ -1467,7 +1476,7 @@ inline float FloatValue::value() const { } inline void FloatValue::_internal_set_value(float value) { - value_ = value; + _impl_.value_ = value; } inline void FloatValue::set_value(float value) { _internal_set_value(value); @@ -1480,10 +1489,10 @@ inline void FloatValue::set_value(float value) { // int64 value = 1; inline void Int64Value::clear_value() { - value_ = int64_t{0}; + _impl_.value_ = int64_t{0}; } inline int64_t Int64Value::_internal_value() const { - return value_; + return _impl_.value_; } inline int64_t Int64Value::value() const { // @@protoc_insertion_point(field_get:google.protobuf.Int64Value.value) @@ -1491,7 +1500,7 @@ inline int64_t Int64Value::value() const { } inline void Int64Value::_internal_set_value(int64_t value) { - value_ = value; + _impl_.value_ = value; } inline void Int64Value::set_value(int64_t value) { _internal_set_value(value); @@ -1504,10 +1513,10 @@ inline void Int64Value::set_value(int64_t value) { // uint64 value = 1; inline void UInt64Value::clear_value() { - value_ = uint64_t{0u}; + _impl_.value_ = uint64_t{0u}; } inline uint64_t UInt64Value::_internal_value() const { - return value_; + return _impl_.value_; } inline uint64_t UInt64Value::value() const { // @@protoc_insertion_point(field_get:google.protobuf.UInt64Value.value) @@ -1515,7 +1524,7 @@ inline uint64_t UInt64Value::value() const { } inline void UInt64Value::_internal_set_value(uint64_t value) { - value_ = value; + _impl_.value_ = value; } inline void UInt64Value::set_value(uint64_t value) { _internal_set_value(value); @@ -1528,10 +1537,10 @@ inline void UInt64Value::set_value(uint64_t value) { // int32 value = 1; inline void Int32Value::clear_value() { - value_ = 0; + _impl_.value_ = 0; } inline int32_t Int32Value::_internal_value() const { - return value_; + return _impl_.value_; } inline int32_t Int32Value::value() const { // @@protoc_insertion_point(field_get:google.protobuf.Int32Value.value) @@ -1539,7 +1548,7 @@ inline int32_t Int32Value::value() const { } inline void Int32Value::_internal_set_value(int32_t value) { - value_ = value; + _impl_.value_ = value; } inline void Int32Value::set_value(int32_t value) { _internal_set_value(value); @@ -1552,10 +1561,10 @@ inline void Int32Value::set_value(int32_t value) { // uint32 value = 1; inline void UInt32Value::clear_value() { - value_ = 0u; + _impl_.value_ = 0u; } inline uint32_t UInt32Value::_internal_value() const { - return value_; + return _impl_.value_; } inline uint32_t UInt32Value::value() const { // @@protoc_insertion_point(field_get:google.protobuf.UInt32Value.value) @@ -1563,7 +1572,7 @@ inline uint32_t UInt32Value::value() const { } inline void UInt32Value::_internal_set_value(uint32_t value) { - value_ = value; + _impl_.value_ = value; } inline void UInt32Value::set_value(uint32_t value) { _internal_set_value(value); @@ -1576,10 +1585,10 @@ inline void UInt32Value::set_value(uint32_t value) { // bool value = 1; inline void BoolValue::clear_value() { - value_ = false; + _impl_.value_ = false; } inline bool BoolValue::_internal_value() const { - return value_; + return _impl_.value_; } inline bool BoolValue::value() const { // @@protoc_insertion_point(field_get:google.protobuf.BoolValue.value) @@ -1587,7 +1596,7 @@ inline bool BoolValue::value() const { } inline void BoolValue::_internal_set_value(bool value) { - value_ = value; + _impl_.value_ = value; } inline void BoolValue::set_value(bool value) { _internal_set_value(value); @@ -1600,7 +1609,7 @@ inline void BoolValue::set_value(bool value) { // string value = 1; inline void StringValue::clear_value() { - value_.ClearToEmpty(); + _impl_.value_.ClearToEmpty(); } inline const std::string& StringValue::value() const { // @@protoc_insertion_point(field_get:google.protobuf.StringValue.value) @@ -1610,7 +1619,7 @@ template inline PROTOBUF_ALWAYS_INLINE void StringValue::set_value(ArgT0&& arg0, ArgT... args) { - value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.value_.Set(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.StringValue.value) } inline std::string* StringValue::mutable_value() { @@ -1619,19 +1628,19 @@ inline std::string* StringValue::mutable_value() { return _s; } inline const std::string& StringValue::_internal_value() const { - return value_.Get(); + return _impl_.value_.Get(); } inline void StringValue::_internal_set_value(const std::string& value) { - value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.value_.Set(value, GetArenaForAllocation()); } inline std::string* StringValue::_internal_mutable_value() { - return value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.value_.Mutable(GetArenaForAllocation()); } inline std::string* StringValue::release_value() { // @@protoc_insertion_point(field_release:google.protobuf.StringValue.value) - return value_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.value_.Release(); } inline void StringValue::set_allocated_value(std::string* value) { if (value != nullptr) { @@ -1639,11 +1648,10 @@ inline void StringValue::set_allocated_value(std::string* value) { } else { } - value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, - GetArenaForAllocation()); + _impl_.value_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.value_.IsDefault()) { + _impl_.value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.StringValue.value) @@ -1655,7 +1663,7 @@ inline void StringValue::set_allocated_value(std::string* value) { // bytes value = 1; inline void BytesValue::clear_value() { - value_.ClearToEmpty(); + _impl_.value_.ClearToEmpty(); } inline const std::string& BytesValue::value() const { // @@protoc_insertion_point(field_get:google.protobuf.BytesValue.value) @@ -1665,7 +1673,7 @@ template inline PROTOBUF_ALWAYS_INLINE void BytesValue::set_value(ArgT0&& arg0, ArgT... args) { - value_.SetBytes(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast(arg0), args..., GetArenaForAllocation()); + _impl_.value_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); // @@protoc_insertion_point(field_set:google.protobuf.BytesValue.value) } inline std::string* BytesValue::mutable_value() { @@ -1674,19 +1682,19 @@ inline std::string* BytesValue::mutable_value() { return _s; } inline const std::string& BytesValue::_internal_value() const { - return value_.Get(); + return _impl_.value_.Get(); } inline void BytesValue::_internal_set_value(const std::string& value) { - value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation()); + _impl_.value_.Set(value, GetArenaForAllocation()); } inline std::string* BytesValue::_internal_mutable_value() { - return value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation()); + return _impl_.value_.Mutable(GetArenaForAllocation()); } inline std::string* BytesValue::release_value() { // @@protoc_insertion_point(field_release:google.protobuf.BytesValue.value) - return value_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation()); + return _impl_.value_.Release(); } inline void BytesValue::set_allocated_value(std::string* value) { if (value != nullptr) { @@ -1694,11 +1702,10 @@ inline void BytesValue::set_allocated_value(std::string* value) { } else { } - value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, - GetArenaForAllocation()); + _impl_.value_.SetAllocated(value, GetArenaForAllocation()); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (value_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited())) { - value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation()); + if (_impl_.value_.IsDefault()) { + _impl_.value_.Set("", GetArenaForAllocation()); } #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING // @@protoc_insertion_point(field_set_allocated:google.protobuf.BytesValue.value) diff --git a/windows/lib/debug/libprotobuf.lib b/windows/lib/debug/libprotobuf.lib index 05745838c..136d23c8f 100755 Binary files a/windows/lib/debug/libprotobuf.lib and b/windows/lib/debug/libprotobuf.lib differ diff --git a/windows/lib/debug/libprotobufd.pdb b/windows/lib/debug/libprotobuf.pdb old mode 100755 new mode 100644 similarity index 56% rename from windows/lib/debug/libprotobufd.pdb rename to windows/lib/debug/libprotobuf.pdb index 521bf558d..864081472 Binary files a/windows/lib/debug/libprotobufd.pdb and b/windows/lib/debug/libprotobuf.pdb differ diff --git a/windows/lib/debug/libprotoc.lib b/windows/lib/debug/libprotoc.lib index 111e7c8bd..3ec320d73 100755 Binary files a/windows/lib/debug/libprotoc.lib and b/windows/lib/debug/libprotoc.lib differ diff --git a/windows/lib/debug/libprotoc.pdb b/windows/lib/debug/libprotoc.pdb index da65e5de8..9b08073d9 100755 Binary files a/windows/lib/debug/libprotoc.pdb and b/windows/lib/debug/libprotoc.pdb differ diff --git a/windows/lib/release/libprotobuf.lib b/windows/lib/release/libprotobuf.lib index 5139886cf..f365b0b67 100755 Binary files a/windows/lib/release/libprotobuf.lib and b/windows/lib/release/libprotobuf.lib differ diff --git a/windows/lib/release/libprotoc.lib b/windows/lib/release/libprotoc.lib index 05513b59c..b73684037 100755 Binary files a/windows/lib/release/libprotoc.lib and b/windows/lib/release/libprotoc.lib differ diff --git a/windows/python/google/protobuf/__init__.py b/windows/python/google/protobuf/__init__.py index 52101b6fe..e7555ee10 100644 --- a/windows/python/google/protobuf/__init__.py +++ b/windows/python/google/protobuf/__init__.py @@ -30,4 +30,4 @@ # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.19.1' +__version__ = '4.21.12' diff --git a/windows/python/google/protobuf/any_pb2.py b/windows/python/google/protobuf/any_pb2.py index 6f1adbc27..9121193d1 100644 --- a/windows/python/google/protobuf/any_pb2.py +++ b/windows/python/google/protobuf/any_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/any.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,16 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19google/protobuf/any.proto\x12\x0fgoogle.protobuf\"&\n\x03\x41ny\x12\x10\n\x08type_url\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\x42v\n\x13\x63om.google.protobufB\x08\x41nyProtoP\x01Z,google.golang.org/protobuf/types/known/anypb\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3') - - -_ANY = DESCRIPTOR.message_types_by_name['Any'] -Any = _reflection.GeneratedProtocolMessageType('Any', (_message.Message,), { - 'DESCRIPTOR' : _ANY, - '__module__' : 'google.protobuf.any_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Any) - }) -_sym_db.RegisterMessage(Any) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.any_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/any_test_pb2.py b/windows/python/google/protobuf/any_test_pb2.py index 49ebd807a..28747d52c 100644 --- a/windows/python/google/protobuf/any_test_pb2.py +++ b/windows/python/google/protobuf/any_test_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/any_test.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,16 +16,8 @@ from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1egoogle/protobuf/any_test.proto\x12\x11protobuf_unittest\x1a\x19google/protobuf/any.proto\"\x87\x01\n\x07TestAny\x12\x13\n\x0bint32_value\x18\x01 \x01(\x05\x12\'\n\tany_value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x30\n\x12repeated_any_value\x18\x03 \x03(\x0b\x32\x14.google.protobuf.Any\x12\x0c\n\x04text\x18\x04 \x01(\tB\x0e\x42\x0cTestAnyProtob\x06proto3') - - -_TESTANY = DESCRIPTOR.message_types_by_name['TestAny'] -TestAny = _reflection.GeneratedProtocolMessageType('TestAny', (_message.Message,), { - 'DESCRIPTOR' : _TESTANY, - '__module__' : 'google.protobuf.any_test_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestAny) - }) -_sym_db.RegisterMessage(TestAny) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.any_test_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/api_pb2.py b/windows/python/google/protobuf/api_pb2.py index 703618161..1721b10a7 100644 --- a/windows/python/google/protobuf/api_pb2.py +++ b/windows/python/google/protobuf/api_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/api.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -18,32 +17,8 @@ from google.protobuf import type_pb2 as google_dot_protobuf_dot_type__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19google/protobuf/api.proto\x12\x0fgoogle.protobuf\x1a$google/protobuf/source_context.proto\x1a\x1agoogle/protobuf/type.proto\"\x81\x02\n\x03\x41pi\x12\x0c\n\x04name\x18\x01 \x01(\t\x12(\n\x07methods\x18\x02 \x03(\x0b\x32\x17.google.protobuf.Method\x12(\n\x07options\x18\x03 \x03(\x0b\x32\x17.google.protobuf.Option\x12\x0f\n\x07version\x18\x04 \x01(\t\x12\x36\n\x0esource_context\x18\x05 \x01(\x0b\x32\x1e.google.protobuf.SourceContext\x12&\n\x06mixins\x18\x06 \x03(\x0b\x32\x16.google.protobuf.Mixin\x12\'\n\x06syntax\x18\x07 \x01(\x0e\x32\x17.google.protobuf.Syntax\"\xd5\x01\n\x06Method\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x10request_type_url\x18\x02 \x01(\t\x12\x19\n\x11request_streaming\x18\x03 \x01(\x08\x12\x19\n\x11response_type_url\x18\x04 \x01(\t\x12\x1a\n\x12response_streaming\x18\x05 \x01(\x08\x12(\n\x07options\x18\x06 \x03(\x0b\x32\x17.google.protobuf.Option\x12\'\n\x06syntax\x18\x07 \x01(\x0e\x32\x17.google.protobuf.Syntax\"#\n\x05Mixin\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04root\x18\x02 \x01(\tBv\n\x13\x63om.google.protobufB\x08\x41piProtoP\x01Z,google.golang.org/protobuf/types/known/apipb\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3') - - -_API = DESCRIPTOR.message_types_by_name['Api'] -_METHOD = DESCRIPTOR.message_types_by_name['Method'] -_MIXIN = DESCRIPTOR.message_types_by_name['Mixin'] -Api = _reflection.GeneratedProtocolMessageType('Api', (_message.Message,), { - 'DESCRIPTOR' : _API, - '__module__' : 'google.protobuf.api_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Api) - }) -_sym_db.RegisterMessage(Api) - -Method = _reflection.GeneratedProtocolMessageType('Method', (_message.Message,), { - 'DESCRIPTOR' : _METHOD, - '__module__' : 'google.protobuf.api_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Method) - }) -_sym_db.RegisterMessage(Method) - -Mixin = _reflection.GeneratedProtocolMessageType('Mixin', (_message.Message,), { - 'DESCRIPTOR' : _MIXIN, - '__module__' : 'google.protobuf.api_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Mixin) - }) -_sym_db.RegisterMessage(Mixin) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.api_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/compiler/plugin_pb2.py b/windows/python/google/protobuf/compiler/plugin_pb2.py index a6daa2c93..715a89137 100644 --- a/windows/python/google/protobuf/compiler/plugin_pb2.py +++ b/windows/python/google/protobuf/compiler/plugin_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/compiler/plugin.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,42 +16,8 @@ from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%google/protobuf/compiler/plugin.proto\x12\x18google.protobuf.compiler\x1a google/protobuf/descriptor.proto\"F\n\x07Version\x12\r\n\x05major\x18\x01 \x01(\x05\x12\r\n\x05minor\x18\x02 \x01(\x05\x12\r\n\x05patch\x18\x03 \x01(\x05\x12\x0e\n\x06suffix\x18\x04 \x01(\t\"\xba\x01\n\x14\x43odeGeneratorRequest\x12\x18\n\x10\x66ile_to_generate\x18\x01 \x03(\t\x12\x11\n\tparameter\x18\x02 \x01(\t\x12\x38\n\nproto_file\x18\x0f \x03(\x0b\x32$.google.protobuf.FileDescriptorProto\x12;\n\x10\x63ompiler_version\x18\x03 \x01(\x0b\x32!.google.protobuf.compiler.Version\"\xc1\x02\n\x15\x43odeGeneratorResponse\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x1a\n\x12supported_features\x18\x02 \x01(\x04\x12\x42\n\x04\x66ile\x18\x0f \x03(\x0b\x32\x34.google.protobuf.compiler.CodeGeneratorResponse.File\x1a\x7f\n\x04\x46ile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\x0finsertion_point\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x0f \x01(\t\x12?\n\x13generated_code_info\x18\x10 \x01(\x0b\x32\".google.protobuf.GeneratedCodeInfo\"8\n\x07\x46\x65\x61ture\x12\x10\n\x0c\x46\x45\x41TURE_NONE\x10\x00\x12\x1b\n\x17\x46\x45\x41TURE_PROTO3_OPTIONAL\x10\x01\x42W\n\x1c\x63om.google.protobuf.compilerB\x0cPluginProtosZ)google.golang.org/protobuf/types/pluginpb') - - -_VERSION = DESCRIPTOR.message_types_by_name['Version'] -_CODEGENERATORREQUEST = DESCRIPTOR.message_types_by_name['CodeGeneratorRequest'] -_CODEGENERATORRESPONSE = DESCRIPTOR.message_types_by_name['CodeGeneratorResponse'] -_CODEGENERATORRESPONSE_FILE = _CODEGENERATORRESPONSE.nested_types_by_name['File'] -_CODEGENERATORRESPONSE_FEATURE = _CODEGENERATORRESPONSE.enum_types_by_name['Feature'] -Version = _reflection.GeneratedProtocolMessageType('Version', (_message.Message,), { - 'DESCRIPTOR' : _VERSION, - '__module__' : 'google.protobuf.compiler.plugin_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.compiler.Version) - }) -_sym_db.RegisterMessage(Version) - -CodeGeneratorRequest = _reflection.GeneratedProtocolMessageType('CodeGeneratorRequest', (_message.Message,), { - 'DESCRIPTOR' : _CODEGENERATORREQUEST, - '__module__' : 'google.protobuf.compiler.plugin_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorRequest) - }) -_sym_db.RegisterMessage(CodeGeneratorRequest) - -CodeGeneratorResponse = _reflection.GeneratedProtocolMessageType('CodeGeneratorResponse', (_message.Message,), { - - 'File' : _reflection.GeneratedProtocolMessageType('File', (_message.Message,), { - 'DESCRIPTOR' : _CODEGENERATORRESPONSE_FILE, - '__module__' : 'google.protobuf.compiler.plugin_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse.File) - }) - , - 'DESCRIPTOR' : _CODEGENERATORRESPONSE, - '__module__' : 'google.protobuf.compiler.plugin_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse) - }) -_sym_db.RegisterMessage(CodeGeneratorResponse) -_sym_db.RegisterMessage(CodeGeneratorResponse.File) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.compiler.plugin_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/descriptor.py b/windows/python/google/protobuf/descriptor.py index 61c242f9d..f5a0caa6b 100644 --- a/windows/python/google/protobuf/descriptor.py +++ b/windows/python/google/protobuf/descriptor.py @@ -40,11 +40,15 @@ import warnings from google.protobuf.internal import api_implementation _USE_C_DESCRIPTORS = False -if api_implementation.Type() == 'cpp': +if api_implementation.Type() != 'python': # Used by MakeDescriptor in cpp mode import binascii import os - from google.protobuf.pyext import _message + # pylint: disable=protected-access + _message = api_implementation._c_module + # TODO(jieluo): Remove this import after fix api_implementation + if _message is None: + from google.protobuf.pyext import _message _USE_C_DESCRIPTORS = True @@ -598,13 +602,13 @@ class FieldDescriptor(DescriptorBase): self.is_extension = is_extension self.extension_scope = extension_scope self.containing_oneof = containing_oneof - if api_implementation.Type() == 'cpp': + if api_implementation.Type() == 'python': + self._cdescriptor = None + else: if is_extension: self._cdescriptor = _message.default_pool.FindExtensionByName(full_name) else: self._cdescriptor = _message.default_pool.FindFieldByName(full_name) - else: - self._cdescriptor = None @property def camelcase_name(self): @@ -617,6 +621,26 @@ class FieldDescriptor(DescriptorBase): self._camelcase_name = _ToCamelCase(self.name) return self._camelcase_name + @property + def has_presence(self): + """Whether the field distinguishes between unpopulated and default values. + + Raises: + RuntimeError: singular field that is not linked with message nor file. + """ + if self.label == FieldDescriptor.LABEL_REPEATED: + return False + if (self.cpp_type == FieldDescriptor.CPPTYPE_MESSAGE or + self.containing_oneof): + return True + if hasattr(self.file, 'syntax'): + return self.file.syntax == 'proto2' + if hasattr(self.message_type, 'syntax'): + return self.message_type.syntax == 'proto2' + raise RuntimeError( + 'has_presence is not ready to use because field %s is not' + ' linked with message type nor file' % self.full_name) + @staticmethod def ProtoTypeToCppProtoType(proto_type): """Converts from a Python proto type to a C++ Proto Type. @@ -647,7 +671,7 @@ class EnumDescriptor(_NestedDescriptorBase): full_name (str): Full name of the type, including package name and any enclosing type(s). - values (list[EnumValueDescriptors]): List of the values + values (list[EnumValueDescriptor]): List of the values in this enum. values_by_name (dict(str, EnumValueDescriptor)): Same as :attr:`values`, but indexed by the "name" field of each EnumValueDescriptor. @@ -879,6 +903,8 @@ class MethodDescriptor(DescriptorBase): accepts. output_type (Descriptor): The descriptor of the message that this method returns. + client_streaming (bool): Whether this method uses client streaming. + server_streaming (bool): Whether this method uses server streaming. options (descriptor_pb2.MethodOptions or None): Method options message, or None to use default method options. """ @@ -886,14 +912,32 @@ class MethodDescriptor(DescriptorBase): if _USE_C_DESCRIPTORS: _C_DESCRIPTOR_CLASS = _message.MethodDescriptor - def __new__(cls, name, full_name, index, containing_service, - input_type, output_type, options=None, serialized_options=None, + def __new__(cls, + name, + full_name, + index, + containing_service, + input_type, + output_type, + client_streaming=False, + server_streaming=False, + options=None, + serialized_options=None, create_key=None): _message.Message._CheckCalledFromGeneratedFile() # pylint: disable=protected-access return _message.default_pool.FindMethodByName(full_name) - def __init__(self, name, full_name, index, containing_service, - input_type, output_type, options=None, serialized_options=None, + def __init__(self, + name, + full_name, + index, + containing_service, + input_type, + output_type, + client_streaming=False, + server_streaming=False, + options=None, + serialized_options=None, create_key=None): """The arguments are as described in the description of MethodDescriptor attributes above. @@ -911,6 +955,8 @@ class MethodDescriptor(DescriptorBase): self.containing_service = containing_service self.input_type = input_type self.output_type = output_type + self.client_streaming = client_streaming + self.server_streaming = server_streaming def CopyToProto(self, proto): """Copies this to a descriptor_pb2.MethodDescriptorProto. @@ -1093,7 +1139,7 @@ def MakeDescriptor(desc_proto, package='', build_file_if_cpp=True, Returns: A Descriptor for protobuf messages. """ - if api_implementation.Type() == 'cpp' and build_file_if_cpp: + if api_implementation.Type() != 'python' and build_file_if_cpp: # The C++ implementation requires all descriptors to be backed by the same # definition in the C++ descriptor pool. To do this, we build a # FileDescriptorProto with the same definition as this descriptor and build diff --git a/windows/python/google/protobuf/descriptor_pb2.py b/windows/python/google/protobuf/descriptor_pb2.py index 8f95c9f19..f57038643 100644 --- a/windows/python/google/protobuf/descriptor_pb2.py +++ b/windows/python/google/protobuf/descriptor_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/descriptor.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -21,12 +20,10 @@ if _descriptor._USE_C_DESCRIPTORS == False: syntax='proto2', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n google/protobuf/descriptor.proto\x12\x0fgoogle.protobuf\"G\n\x11\x46ileDescriptorSet\x12\x32\n\x04\x66ile\x18\x01 \x03(\x0b\x32$.google.protobuf.FileDescriptorProto\"\xdb\x03\n\x13\x46ileDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07package\x18\x02 \x01(\t\x12\x12\n\ndependency\x18\x03 \x03(\t\x12\x19\n\x11public_dependency\x18\n \x03(\x05\x12\x17\n\x0fweak_dependency\x18\x0b \x03(\x05\x12\x36\n\x0cmessage_type\x18\x04 \x03(\x0b\x32 .google.protobuf.DescriptorProto\x12\x37\n\tenum_type\x18\x05 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProto\x12\x38\n\x07service\x18\x06 \x03(\x0b\x32\'.google.protobuf.ServiceDescriptorProto\x12\x38\n\textension\x18\x07 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12-\n\x07options\x18\x08 \x01(\x0b\x32\x1c.google.protobuf.FileOptions\x12\x39\n\x10source_code_info\x18\t \x01(\x0b\x32\x1f.google.protobuf.SourceCodeInfo\x12\x0e\n\x06syntax\x18\x0c \x01(\t\"\xa9\x05\n\x0f\x44\x65scriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x05\x66ield\x18\x02 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12\x38\n\textension\x18\x06 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12\x35\n\x0bnested_type\x18\x03 \x03(\x0b\x32 .google.protobuf.DescriptorProto\x12\x37\n\tenum_type\x18\x04 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProto\x12H\n\x0f\x65xtension_range\x18\x05 \x03(\x0b\x32/.google.protobuf.DescriptorProto.ExtensionRange\x12\x39\n\noneof_decl\x18\x08 \x03(\x0b\x32%.google.protobuf.OneofDescriptorProto\x12\x30\n\x07options\x18\x07 \x01(\x0b\x32\x1f.google.protobuf.MessageOptions\x12\x46\n\x0ereserved_range\x18\t \x03(\x0b\x32..google.protobuf.DescriptorProto.ReservedRange\x12\x15\n\rreserved_name\x18\n \x03(\t\x1a\x65\n\x0e\x45xtensionRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\x12\x37\n\x07options\x18\x03 \x01(\x0b\x32&.google.protobuf.ExtensionRangeOptions\x1a+\n\rReservedRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\"g\n\x15\x45xtensionRangeOptions\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd5\x05\n\x14\x46ieldDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06number\x18\x03 \x01(\x05\x12:\n\x05label\x18\x04 \x01(\x0e\x32+.google.protobuf.FieldDescriptorProto.Label\x12\x38\n\x04type\x18\x05 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.Type\x12\x11\n\ttype_name\x18\x06 \x01(\t\x12\x10\n\x08\x65xtendee\x18\x02 \x01(\t\x12\x15\n\rdefault_value\x18\x07 \x01(\t\x12\x13\n\x0boneof_index\x18\t \x01(\x05\x12\x11\n\tjson_name\x18\n \x01(\t\x12.\n\x07options\x18\x08 \x01(\x0b\x32\x1d.google.protobuf.FieldOptions\x12\x17\n\x0fproto3_optional\x18\x11 \x01(\x08\"\xb6\x02\n\x04Type\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12\"C\n\x05Label\x12\x12\n\x0eLABEL_OPTIONAL\x10\x01\x12\x12\n\x0eLABEL_REQUIRED\x10\x02\x12\x12\n\x0eLABEL_REPEATED\x10\x03\"T\n\x14OneofDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\x07options\x18\x02 \x01(\x0b\x32\x1d.google.protobuf.OneofOptions\"\xa4\x02\n\x13\x45numDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x03(\x0b\x32).google.protobuf.EnumValueDescriptorProto\x12-\n\x07options\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.EnumOptions\x12N\n\x0ereserved_range\x18\x04 \x03(\x0b\x32\x36.google.protobuf.EnumDescriptorProto.EnumReservedRange\x12\x15\n\rreserved_name\x18\x05 \x03(\t\x1a/\n\x11\x45numReservedRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\"l\n\x18\x45numValueDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06number\x18\x02 \x01(\x05\x12\x32\n\x07options\x18\x03 \x01(\x0b\x32!.google.protobuf.EnumValueOptions\"\x90\x01\n\x16ServiceDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x36\n\x06method\x18\x02 \x03(\x0b\x32&.google.protobuf.MethodDescriptorProto\x12\x30\n\x07options\x18\x03 \x01(\x0b\x32\x1f.google.protobuf.ServiceOptions\"\xc1\x01\n\x15MethodDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ninput_type\x18\x02 \x01(\t\x12\x13\n\x0boutput_type\x18\x03 \x01(\t\x12/\n\x07options\x18\x04 \x01(\x0b\x32\x1e.google.protobuf.MethodOptions\x12\x1f\n\x10\x63lient_streaming\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x1f\n\x10server_streaming\x18\x06 \x01(\x08:\x05\x66\x61lse\"\xa5\x06\n\x0b\x46ileOptions\x12\x14\n\x0cjava_package\x18\x01 \x01(\t\x12\x1c\n\x14java_outer_classname\x18\x08 \x01(\t\x12\"\n\x13java_multiple_files\x18\n \x01(\x08:\x05\x66\x61lse\x12)\n\x1djava_generate_equals_and_hash\x18\x14 \x01(\x08\x42\x02\x18\x01\x12%\n\x16java_string_check_utf8\x18\x1b \x01(\x08:\x05\x66\x61lse\x12\x46\n\x0coptimize_for\x18\t \x01(\x0e\x32).google.protobuf.FileOptions.OptimizeMode:\x05SPEED\x12\x12\n\ngo_package\x18\x0b \x01(\t\x12\"\n\x13\x63\x63_generic_services\x18\x10 \x01(\x08:\x05\x66\x61lse\x12$\n\x15java_generic_services\x18\x11 \x01(\x08:\x05\x66\x61lse\x12\"\n\x13py_generic_services\x18\x12 \x01(\x08:\x05\x66\x61lse\x12#\n\x14php_generic_services\x18* \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x17 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x10\x63\x63_enable_arenas\x18\x1f \x01(\x08:\x04true\x12\x19\n\x11objc_class_prefix\x18$ \x01(\t\x12\x18\n\x10\x63sharp_namespace\x18% \x01(\t\x12\x14\n\x0cswift_prefix\x18\' \x01(\t\x12\x18\n\x10php_class_prefix\x18( \x01(\t\x12\x15\n\rphp_namespace\x18) \x01(\t\x12\x1e\n\x16php_metadata_namespace\x18, \x01(\t\x12\x14\n\x0cruby_package\x18- \x01(\t\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\":\n\x0cOptimizeMode\x12\t\n\x05SPEED\x10\x01\x12\r\n\tCODE_SIZE\x10\x02\x12\x10\n\x0cLITE_RUNTIME\x10\x03*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08&\x10\'\"\x84\x02\n\x0eMessageOptions\x12&\n\x17message_set_wire_format\x18\x01 \x01(\x08:\x05\x66\x61lse\x12.\n\x1fno_standard_descriptor_accessor\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x11\n\tmap_entry\x18\x07 \x01(\x08\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\tJ\x04\x08\t\x10\n\"\x9e\x03\n\x0c\x46ieldOptions\x12:\n\x05\x63type\x18\x01 \x01(\x0e\x32#.google.protobuf.FieldOptions.CType:\x06STRING\x12\x0e\n\x06packed\x18\x02 \x01(\x08\x12?\n\x06jstype\x18\x06 \x01(\x0e\x32$.google.protobuf.FieldOptions.JSType:\tJS_NORMAL\x12\x13\n\x04lazy\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x13\n\x04weak\x18\n \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\"/\n\x05\x43Type\x12\n\n\x06STRING\x10\x00\x12\x08\n\x04\x43ORD\x10\x01\x12\x10\n\x0cSTRING_PIECE\x10\x02\"5\n\x06JSType\x12\r\n\tJS_NORMAL\x10\x00\x12\r\n\tJS_STRING\x10\x01\x12\r\n\tJS_NUMBER\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05\"^\n\x0cOneofOptions\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x93\x01\n\x0b\x45numOptions\x12\x13\n\x0b\x61llow_alias\x18\x02 \x01(\x08\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x05\x10\x06\"}\n\x10\x45numValueOptions\x12\x19\n\ndeprecated\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"{\n\x0eServiceOptions\x12\x19\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xad\x02\n\rMethodOptions\x12\x19\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lse\x12_\n\x11idempotency_level\x18\" \x01(\x0e\x32/.google.protobuf.MethodOptions.IdempotencyLevel:\x13IDEMPOTENCY_UNKNOWN\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\"P\n\x10IdempotencyLevel\x12\x17\n\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n\nIDEMPOTENT\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x9e\x02\n\x13UninterpretedOption\x12;\n\x04name\x18\x02 \x03(\x0b\x32-.google.protobuf.UninterpretedOption.NamePart\x12\x18\n\x10identifier_value\x18\x03 \x01(\t\x12\x1a\n\x12positive_int_value\x18\x04 \x01(\x04\x12\x1a\n\x12negative_int_value\x18\x05 \x01(\x03\x12\x14\n\x0c\x64ouble_value\x18\x06 \x01(\x01\x12\x14\n\x0cstring_value\x18\x07 \x01(\x0c\x12\x17\n\x0f\x61ggregate_value\x18\x08 \x01(\t\x1a\x33\n\x08NamePart\x12\x11\n\tname_part\x18\x01 \x02(\t\x12\x14\n\x0cis_extension\x18\x02 \x02(\x08\"\xd5\x01\n\x0eSourceCodeInfo\x12:\n\x08location\x18\x01 \x03(\x0b\x32(.google.protobuf.SourceCodeInfo.Location\x1a\x86\x01\n\x08Location\x12\x10\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01\x12\x10\n\x04span\x18\x02 \x03(\x05\x42\x02\x10\x01\x12\x18\n\x10leading_comments\x18\x03 \x01(\t\x12\x19\n\x11trailing_comments\x18\x04 \x01(\t\x12!\n\x19leading_detached_comments\x18\x06 \x03(\t\"\xa7\x01\n\x11GeneratedCodeInfo\x12\x41\n\nannotation\x18\x01 \x03(\x0b\x32-.google.protobuf.GeneratedCodeInfo.Annotation\x1aO\n\nAnnotation\x12\x10\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01\x12\x13\n\x0bsource_file\x18\x02 \x01(\t\x12\r\n\x05\x62\x65gin\x18\x03 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x04 \x01(\x05\x42~\n\x13\x63om.google.protobufB\x10\x44\x65scriptorProtosH\x01Z-google.golang.org/protobuf/types/descriptorpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1aGoogle.Protobuf.Reflection' + serialized_pb=b'\n google/protobuf/descriptor.proto\x12\x0fgoogle.protobuf\"G\n\x11\x46ileDescriptorSet\x12\x32\n\x04\x66ile\x18\x01 \x03(\x0b\x32$.google.protobuf.FileDescriptorProto\"\xdb\x03\n\x13\x46ileDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07package\x18\x02 \x01(\t\x12\x12\n\ndependency\x18\x03 \x03(\t\x12\x19\n\x11public_dependency\x18\n \x03(\x05\x12\x17\n\x0fweak_dependency\x18\x0b \x03(\x05\x12\x36\n\x0cmessage_type\x18\x04 \x03(\x0b\x32 .google.protobuf.DescriptorProto\x12\x37\n\tenum_type\x18\x05 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProto\x12\x38\n\x07service\x18\x06 \x03(\x0b\x32\'.google.protobuf.ServiceDescriptorProto\x12\x38\n\textension\x18\x07 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12-\n\x07options\x18\x08 \x01(\x0b\x32\x1c.google.protobuf.FileOptions\x12\x39\n\x10source_code_info\x18\t \x01(\x0b\x32\x1f.google.protobuf.SourceCodeInfo\x12\x0e\n\x06syntax\x18\x0c \x01(\t\"\xa9\x05\n\x0f\x44\x65scriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x05\x66ield\x18\x02 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12\x38\n\textension\x18\x06 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12\x35\n\x0bnested_type\x18\x03 \x03(\x0b\x32 .google.protobuf.DescriptorProto\x12\x37\n\tenum_type\x18\x04 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProto\x12H\n\x0f\x65xtension_range\x18\x05 \x03(\x0b\x32/.google.protobuf.DescriptorProto.ExtensionRange\x12\x39\n\noneof_decl\x18\x08 \x03(\x0b\x32%.google.protobuf.OneofDescriptorProto\x12\x30\n\x07options\x18\x07 \x01(\x0b\x32\x1f.google.protobuf.MessageOptions\x12\x46\n\x0ereserved_range\x18\t \x03(\x0b\x32..google.protobuf.DescriptorProto.ReservedRange\x12\x15\n\rreserved_name\x18\n \x03(\t\x1a\x65\n\x0e\x45xtensionRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\x12\x37\n\x07options\x18\x03 \x01(\x0b\x32&.google.protobuf.ExtensionRangeOptions\x1a+\n\rReservedRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\"g\n\x15\x45xtensionRangeOptions\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd5\x05\n\x14\x46ieldDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06number\x18\x03 \x01(\x05\x12:\n\x05label\x18\x04 \x01(\x0e\x32+.google.protobuf.FieldDescriptorProto.Label\x12\x38\n\x04type\x18\x05 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.Type\x12\x11\n\ttype_name\x18\x06 \x01(\t\x12\x10\n\x08\x65xtendee\x18\x02 \x01(\t\x12\x15\n\rdefault_value\x18\x07 \x01(\t\x12\x13\n\x0boneof_index\x18\t \x01(\x05\x12\x11\n\tjson_name\x18\n \x01(\t\x12.\n\x07options\x18\x08 \x01(\x0b\x32\x1d.google.protobuf.FieldOptions\x12\x17\n\x0fproto3_optional\x18\x11 \x01(\x08\"\xb6\x02\n\x04Type\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12\"C\n\x05Label\x12\x12\n\x0eLABEL_OPTIONAL\x10\x01\x12\x12\n\x0eLABEL_REQUIRED\x10\x02\x12\x12\n\x0eLABEL_REPEATED\x10\x03\"T\n\x14OneofDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\x07options\x18\x02 \x01(\x0b\x32\x1d.google.protobuf.OneofOptions\"\xa4\x02\n\x13\x45numDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x03(\x0b\x32).google.protobuf.EnumValueDescriptorProto\x12-\n\x07options\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.EnumOptions\x12N\n\x0ereserved_range\x18\x04 \x03(\x0b\x32\x36.google.protobuf.EnumDescriptorProto.EnumReservedRange\x12\x15\n\rreserved_name\x18\x05 \x03(\t\x1a/\n\x11\x45numReservedRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\"l\n\x18\x45numValueDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06number\x18\x02 \x01(\x05\x12\x32\n\x07options\x18\x03 \x01(\x0b\x32!.google.protobuf.EnumValueOptions\"\x90\x01\n\x16ServiceDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x36\n\x06method\x18\x02 \x03(\x0b\x32&.google.protobuf.MethodDescriptorProto\x12\x30\n\x07options\x18\x03 \x01(\x0b\x32\x1f.google.protobuf.ServiceOptions\"\xc1\x01\n\x15MethodDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ninput_type\x18\x02 \x01(\t\x12\x13\n\x0boutput_type\x18\x03 \x01(\t\x12/\n\x07options\x18\x04 \x01(\x0b\x32\x1e.google.protobuf.MethodOptions\x12\x1f\n\x10\x63lient_streaming\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x1f\n\x10server_streaming\x18\x06 \x01(\x08:\x05\x66\x61lse\"\xa5\x06\n\x0b\x46ileOptions\x12\x14\n\x0cjava_package\x18\x01 \x01(\t\x12\x1c\n\x14java_outer_classname\x18\x08 \x01(\t\x12\"\n\x13java_multiple_files\x18\n \x01(\x08:\x05\x66\x61lse\x12)\n\x1djava_generate_equals_and_hash\x18\x14 \x01(\x08\x42\x02\x18\x01\x12%\n\x16java_string_check_utf8\x18\x1b \x01(\x08:\x05\x66\x61lse\x12\x46\n\x0coptimize_for\x18\t \x01(\x0e\x32).google.protobuf.FileOptions.OptimizeMode:\x05SPEED\x12\x12\n\ngo_package\x18\x0b \x01(\t\x12\"\n\x13\x63\x63_generic_services\x18\x10 \x01(\x08:\x05\x66\x61lse\x12$\n\x15java_generic_services\x18\x11 \x01(\x08:\x05\x66\x61lse\x12\"\n\x13py_generic_services\x18\x12 \x01(\x08:\x05\x66\x61lse\x12#\n\x14php_generic_services\x18* \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x17 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x10\x63\x63_enable_arenas\x18\x1f \x01(\x08:\x04true\x12\x19\n\x11objc_class_prefix\x18$ \x01(\t\x12\x18\n\x10\x63sharp_namespace\x18% \x01(\t\x12\x14\n\x0cswift_prefix\x18\' \x01(\t\x12\x18\n\x10php_class_prefix\x18( \x01(\t\x12\x15\n\rphp_namespace\x18) \x01(\t\x12\x1e\n\x16php_metadata_namespace\x18, \x01(\t\x12\x14\n\x0cruby_package\x18- \x01(\t\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\":\n\x0cOptimizeMode\x12\t\n\x05SPEED\x10\x01\x12\r\n\tCODE_SIZE\x10\x02\x12\x10\n\x0cLITE_RUNTIME\x10\x03*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08&\x10\'\"\x84\x02\n\x0eMessageOptions\x12&\n\x17message_set_wire_format\x18\x01 \x01(\x08:\x05\x66\x61lse\x12.\n\x1fno_standard_descriptor_accessor\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x11\n\tmap_entry\x18\x07 \x01(\x08\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\tJ\x04\x08\t\x10\n\"\xbe\x03\n\x0c\x46ieldOptions\x12:\n\x05\x63type\x18\x01 \x01(\x0e\x32#.google.protobuf.FieldOptions.CType:\x06STRING\x12\x0e\n\x06packed\x18\x02 \x01(\x08\x12?\n\x06jstype\x18\x06 \x01(\x0e\x32$.google.protobuf.FieldOptions.JSType:\tJS_NORMAL\x12\x13\n\x04lazy\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x0funverified_lazy\x18\x0f \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x13\n\x04weak\x18\n \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\"/\n\x05\x43Type\x12\n\n\x06STRING\x10\x00\x12\x08\n\x04\x43ORD\x10\x01\x12\x10\n\x0cSTRING_PIECE\x10\x02\"5\n\x06JSType\x12\r\n\tJS_NORMAL\x10\x00\x12\r\n\tJS_STRING\x10\x01\x12\r\n\tJS_NUMBER\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05\"^\n\x0cOneofOptions\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x93\x01\n\x0b\x45numOptions\x12\x13\n\x0b\x61llow_alias\x18\x02 \x01(\x08\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x05\x10\x06\"}\n\x10\x45numValueOptions\x12\x19\n\ndeprecated\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"{\n\x0eServiceOptions\x12\x19\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xad\x02\n\rMethodOptions\x12\x19\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lse\x12_\n\x11idempotency_level\x18\" \x01(\x0e\x32/.google.protobuf.MethodOptions.IdempotencyLevel:\x13IDEMPOTENCY_UNKNOWN\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\"P\n\x10IdempotencyLevel\x12\x17\n\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n\nIDEMPOTENT\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x9e\x02\n\x13UninterpretedOption\x12;\n\x04name\x18\x02 \x03(\x0b\x32-.google.protobuf.UninterpretedOption.NamePart\x12\x18\n\x10identifier_value\x18\x03 \x01(\t\x12\x1a\n\x12positive_int_value\x18\x04 \x01(\x04\x12\x1a\n\x12negative_int_value\x18\x05 \x01(\x03\x12\x14\n\x0c\x64ouble_value\x18\x06 \x01(\x01\x12\x14\n\x0cstring_value\x18\x07 \x01(\x0c\x12\x17\n\x0f\x61ggregate_value\x18\x08 \x01(\t\x1a\x33\n\x08NamePart\x12\x11\n\tname_part\x18\x01 \x02(\t\x12\x14\n\x0cis_extension\x18\x02 \x02(\x08\"\xd5\x01\n\x0eSourceCodeInfo\x12:\n\x08location\x18\x01 \x03(\x0b\x32(.google.protobuf.SourceCodeInfo.Location\x1a\x86\x01\n\x08Location\x12\x10\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01\x12\x10\n\x04span\x18\x02 \x03(\x05\x42\x02\x10\x01\x12\x18\n\x10leading_comments\x18\x03 \x01(\t\x12\x19\n\x11trailing_comments\x18\x04 \x01(\t\x12!\n\x19leading_detached_comments\x18\x06 \x03(\t\"\xa7\x01\n\x11GeneratedCodeInfo\x12\x41\n\nannotation\x18\x01 \x03(\x0b\x32-.google.protobuf.GeneratedCodeInfo.Annotation\x1aO\n\nAnnotation\x12\x10\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01\x12\x13\n\x0bsource_file\x18\x02 \x01(\t\x12\r\n\x05\x62\x65gin\x18\x03 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x04 \x01(\x05\x42~\n\x13\x63om.google.protobufB\x10\x44\x65scriptorProtosH\x01Z-google.golang.org/protobuf/types/descriptorpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1aGoogle.Protobuf.Reflection' ) else: - DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n google/protobuf/descriptor.proto\x12\x0fgoogle.protobuf\"G\n\x11\x46ileDescriptorSet\x12\x32\n\x04\x66ile\x18\x01 \x03(\x0b\x32$.google.protobuf.FileDescriptorProto\"\xdb\x03\n\x13\x46ileDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07package\x18\x02 \x01(\t\x12\x12\n\ndependency\x18\x03 \x03(\t\x12\x19\n\x11public_dependency\x18\n \x03(\x05\x12\x17\n\x0fweak_dependency\x18\x0b \x03(\x05\x12\x36\n\x0cmessage_type\x18\x04 \x03(\x0b\x32 .google.protobuf.DescriptorProto\x12\x37\n\tenum_type\x18\x05 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProto\x12\x38\n\x07service\x18\x06 \x03(\x0b\x32\'.google.protobuf.ServiceDescriptorProto\x12\x38\n\textension\x18\x07 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12-\n\x07options\x18\x08 \x01(\x0b\x32\x1c.google.protobuf.FileOptions\x12\x39\n\x10source_code_info\x18\t \x01(\x0b\x32\x1f.google.protobuf.SourceCodeInfo\x12\x0e\n\x06syntax\x18\x0c \x01(\t\"\xa9\x05\n\x0f\x44\x65scriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x05\x66ield\x18\x02 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12\x38\n\textension\x18\x06 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12\x35\n\x0bnested_type\x18\x03 \x03(\x0b\x32 .google.protobuf.DescriptorProto\x12\x37\n\tenum_type\x18\x04 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProto\x12H\n\x0f\x65xtension_range\x18\x05 \x03(\x0b\x32/.google.protobuf.DescriptorProto.ExtensionRange\x12\x39\n\noneof_decl\x18\x08 \x03(\x0b\x32%.google.protobuf.OneofDescriptorProto\x12\x30\n\x07options\x18\x07 \x01(\x0b\x32\x1f.google.protobuf.MessageOptions\x12\x46\n\x0ereserved_range\x18\t \x03(\x0b\x32..google.protobuf.DescriptorProto.ReservedRange\x12\x15\n\rreserved_name\x18\n \x03(\t\x1a\x65\n\x0e\x45xtensionRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\x12\x37\n\x07options\x18\x03 \x01(\x0b\x32&.google.protobuf.ExtensionRangeOptions\x1a+\n\rReservedRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\"g\n\x15\x45xtensionRangeOptions\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd5\x05\n\x14\x46ieldDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06number\x18\x03 \x01(\x05\x12:\n\x05label\x18\x04 \x01(\x0e\x32+.google.protobuf.FieldDescriptorProto.Label\x12\x38\n\x04type\x18\x05 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.Type\x12\x11\n\ttype_name\x18\x06 \x01(\t\x12\x10\n\x08\x65xtendee\x18\x02 \x01(\t\x12\x15\n\rdefault_value\x18\x07 \x01(\t\x12\x13\n\x0boneof_index\x18\t \x01(\x05\x12\x11\n\tjson_name\x18\n \x01(\t\x12.\n\x07options\x18\x08 \x01(\x0b\x32\x1d.google.protobuf.FieldOptions\x12\x17\n\x0fproto3_optional\x18\x11 \x01(\x08\"\xb6\x02\n\x04Type\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12\"C\n\x05Label\x12\x12\n\x0eLABEL_OPTIONAL\x10\x01\x12\x12\n\x0eLABEL_REQUIRED\x10\x02\x12\x12\n\x0eLABEL_REPEATED\x10\x03\"T\n\x14OneofDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\x07options\x18\x02 \x01(\x0b\x32\x1d.google.protobuf.OneofOptions\"\xa4\x02\n\x13\x45numDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x03(\x0b\x32).google.protobuf.EnumValueDescriptorProto\x12-\n\x07options\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.EnumOptions\x12N\n\x0ereserved_range\x18\x04 \x03(\x0b\x32\x36.google.protobuf.EnumDescriptorProto.EnumReservedRange\x12\x15\n\rreserved_name\x18\x05 \x03(\t\x1a/\n\x11\x45numReservedRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\"l\n\x18\x45numValueDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06number\x18\x02 \x01(\x05\x12\x32\n\x07options\x18\x03 \x01(\x0b\x32!.google.protobuf.EnumValueOptions\"\x90\x01\n\x16ServiceDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x36\n\x06method\x18\x02 \x03(\x0b\x32&.google.protobuf.MethodDescriptorProto\x12\x30\n\x07options\x18\x03 \x01(\x0b\x32\x1f.google.protobuf.ServiceOptions\"\xc1\x01\n\x15MethodDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ninput_type\x18\x02 \x01(\t\x12\x13\n\x0boutput_type\x18\x03 \x01(\t\x12/\n\x07options\x18\x04 \x01(\x0b\x32\x1e.google.protobuf.MethodOptions\x12\x1f\n\x10\x63lient_streaming\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x1f\n\x10server_streaming\x18\x06 \x01(\x08:\x05\x66\x61lse\"\xa5\x06\n\x0b\x46ileOptions\x12\x14\n\x0cjava_package\x18\x01 \x01(\t\x12\x1c\n\x14java_outer_classname\x18\x08 \x01(\t\x12\"\n\x13java_multiple_files\x18\n \x01(\x08:\x05\x66\x61lse\x12)\n\x1djava_generate_equals_and_hash\x18\x14 \x01(\x08\x42\x02\x18\x01\x12%\n\x16java_string_check_utf8\x18\x1b \x01(\x08:\x05\x66\x61lse\x12\x46\n\x0coptimize_for\x18\t \x01(\x0e\x32).google.protobuf.FileOptions.OptimizeMode:\x05SPEED\x12\x12\n\ngo_package\x18\x0b \x01(\t\x12\"\n\x13\x63\x63_generic_services\x18\x10 \x01(\x08:\x05\x66\x61lse\x12$\n\x15java_generic_services\x18\x11 \x01(\x08:\x05\x66\x61lse\x12\"\n\x13py_generic_services\x18\x12 \x01(\x08:\x05\x66\x61lse\x12#\n\x14php_generic_services\x18* \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x17 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x10\x63\x63_enable_arenas\x18\x1f \x01(\x08:\x04true\x12\x19\n\x11objc_class_prefix\x18$ \x01(\t\x12\x18\n\x10\x63sharp_namespace\x18% \x01(\t\x12\x14\n\x0cswift_prefix\x18\' \x01(\t\x12\x18\n\x10php_class_prefix\x18( \x01(\t\x12\x15\n\rphp_namespace\x18) \x01(\t\x12\x1e\n\x16php_metadata_namespace\x18, \x01(\t\x12\x14\n\x0cruby_package\x18- \x01(\t\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\":\n\x0cOptimizeMode\x12\t\n\x05SPEED\x10\x01\x12\r\n\tCODE_SIZE\x10\x02\x12\x10\n\x0cLITE_RUNTIME\x10\x03*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08&\x10\'\"\x84\x02\n\x0eMessageOptions\x12&\n\x17message_set_wire_format\x18\x01 \x01(\x08:\x05\x66\x61lse\x12.\n\x1fno_standard_descriptor_accessor\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x11\n\tmap_entry\x18\x07 \x01(\x08\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\tJ\x04\x08\t\x10\n\"\x9e\x03\n\x0c\x46ieldOptions\x12:\n\x05\x63type\x18\x01 \x01(\x0e\x32#.google.protobuf.FieldOptions.CType:\x06STRING\x12\x0e\n\x06packed\x18\x02 \x01(\x08\x12?\n\x06jstype\x18\x06 \x01(\x0e\x32$.google.protobuf.FieldOptions.JSType:\tJS_NORMAL\x12\x13\n\x04lazy\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x13\n\x04weak\x18\n \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\"/\n\x05\x43Type\x12\n\n\x06STRING\x10\x00\x12\x08\n\x04\x43ORD\x10\x01\x12\x10\n\x0cSTRING_PIECE\x10\x02\"5\n\x06JSType\x12\r\n\tJS_NORMAL\x10\x00\x12\r\n\tJS_STRING\x10\x01\x12\r\n\tJS_NUMBER\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05\"^\n\x0cOneofOptions\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x93\x01\n\x0b\x45numOptions\x12\x13\n\x0b\x61llow_alias\x18\x02 \x01(\x08\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x05\x10\x06\"}\n\x10\x45numValueOptions\x12\x19\n\ndeprecated\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"{\n\x0eServiceOptions\x12\x19\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xad\x02\n\rMethodOptions\x12\x19\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lse\x12_\n\x11idempotency_level\x18\" \x01(\x0e\x32/.google.protobuf.MethodOptions.IdempotencyLevel:\x13IDEMPOTENCY_UNKNOWN\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\"P\n\x10IdempotencyLevel\x12\x17\n\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n\nIDEMPOTENT\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x9e\x02\n\x13UninterpretedOption\x12;\n\x04name\x18\x02 \x03(\x0b\x32-.google.protobuf.UninterpretedOption.NamePart\x12\x18\n\x10identifier_value\x18\x03 \x01(\t\x12\x1a\n\x12positive_int_value\x18\x04 \x01(\x04\x12\x1a\n\x12negative_int_value\x18\x05 \x01(\x03\x12\x14\n\x0c\x64ouble_value\x18\x06 \x01(\x01\x12\x14\n\x0cstring_value\x18\x07 \x01(\x0c\x12\x17\n\x0f\x61ggregate_value\x18\x08 \x01(\t\x1a\x33\n\x08NamePart\x12\x11\n\tname_part\x18\x01 \x02(\t\x12\x14\n\x0cis_extension\x18\x02 \x02(\x08\"\xd5\x01\n\x0eSourceCodeInfo\x12:\n\x08location\x18\x01 \x03(\x0b\x32(.google.protobuf.SourceCodeInfo.Location\x1a\x86\x01\n\x08Location\x12\x10\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01\x12\x10\n\x04span\x18\x02 \x03(\x05\x42\x02\x10\x01\x12\x18\n\x10leading_comments\x18\x03 \x01(\t\x12\x19\n\x11trailing_comments\x18\x04 \x01(\t\x12!\n\x19leading_detached_comments\x18\x06 \x03(\t\"\xa7\x01\n\x11GeneratedCodeInfo\x12\x41\n\nannotation\x18\x01 \x03(\x0b\x32-.google.protobuf.GeneratedCodeInfo.Annotation\x1aO\n\nAnnotation\x12\x10\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01\x12\x13\n\x0bsource_file\x18\x02 \x01(\t\x12\r\n\x05\x62\x65gin\x18\x03 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x04 \x01(\x05\x42~\n\x13\x63om.google.protobufB\x10\x44\x65scriptorProtosH\x01Z-google.golang.org/protobuf/types/descriptorpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1aGoogle.Protobuf.Reflection') - - + DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n google/protobuf/descriptor.proto\x12\x0fgoogle.protobuf\"G\n\x11\x46ileDescriptorSet\x12\x32\n\x04\x66ile\x18\x01 \x03(\x0b\x32$.google.protobuf.FileDescriptorProto\"\xdb\x03\n\x13\x46ileDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07package\x18\x02 \x01(\t\x12\x12\n\ndependency\x18\x03 \x03(\t\x12\x19\n\x11public_dependency\x18\n \x03(\x05\x12\x17\n\x0fweak_dependency\x18\x0b \x03(\x05\x12\x36\n\x0cmessage_type\x18\x04 \x03(\x0b\x32 .google.protobuf.DescriptorProto\x12\x37\n\tenum_type\x18\x05 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProto\x12\x38\n\x07service\x18\x06 \x03(\x0b\x32\'.google.protobuf.ServiceDescriptorProto\x12\x38\n\textension\x18\x07 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12-\n\x07options\x18\x08 \x01(\x0b\x32\x1c.google.protobuf.FileOptions\x12\x39\n\x10source_code_info\x18\t \x01(\x0b\x32\x1f.google.protobuf.SourceCodeInfo\x12\x0e\n\x06syntax\x18\x0c \x01(\t\"\xa9\x05\n\x0f\x44\x65scriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x05\x66ield\x18\x02 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12\x38\n\textension\x18\x06 \x03(\x0b\x32%.google.protobuf.FieldDescriptorProto\x12\x35\n\x0bnested_type\x18\x03 \x03(\x0b\x32 .google.protobuf.DescriptorProto\x12\x37\n\tenum_type\x18\x04 \x03(\x0b\x32$.google.protobuf.EnumDescriptorProto\x12H\n\x0f\x65xtension_range\x18\x05 \x03(\x0b\x32/.google.protobuf.DescriptorProto.ExtensionRange\x12\x39\n\noneof_decl\x18\x08 \x03(\x0b\x32%.google.protobuf.OneofDescriptorProto\x12\x30\n\x07options\x18\x07 \x01(\x0b\x32\x1f.google.protobuf.MessageOptions\x12\x46\n\x0ereserved_range\x18\t \x03(\x0b\x32..google.protobuf.DescriptorProto.ReservedRange\x12\x15\n\rreserved_name\x18\n \x03(\t\x1a\x65\n\x0e\x45xtensionRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\x12\x37\n\x07options\x18\x03 \x01(\x0b\x32&.google.protobuf.ExtensionRangeOptions\x1a+\n\rReservedRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\"g\n\x15\x45xtensionRangeOptions\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd5\x05\n\x14\x46ieldDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06number\x18\x03 \x01(\x05\x12:\n\x05label\x18\x04 \x01(\x0e\x32+.google.protobuf.FieldDescriptorProto.Label\x12\x38\n\x04type\x18\x05 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.Type\x12\x11\n\ttype_name\x18\x06 \x01(\t\x12\x10\n\x08\x65xtendee\x18\x02 \x01(\t\x12\x15\n\rdefault_value\x18\x07 \x01(\t\x12\x13\n\x0boneof_index\x18\t \x01(\x05\x12\x11\n\tjson_name\x18\n \x01(\t\x12.\n\x07options\x18\x08 \x01(\x0b\x32\x1d.google.protobuf.FieldOptions\x12\x17\n\x0fproto3_optional\x18\x11 \x01(\x08\"\xb6\x02\n\x04Type\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12\"C\n\x05Label\x12\x12\n\x0eLABEL_OPTIONAL\x10\x01\x12\x12\n\x0eLABEL_REQUIRED\x10\x02\x12\x12\n\x0eLABEL_REPEATED\x10\x03\"T\n\x14OneofDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\x07options\x18\x02 \x01(\x0b\x32\x1d.google.protobuf.OneofOptions\"\xa4\x02\n\x13\x45numDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x03(\x0b\x32).google.protobuf.EnumValueDescriptorProto\x12-\n\x07options\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.EnumOptions\x12N\n\x0ereserved_range\x18\x04 \x03(\x0b\x32\x36.google.protobuf.EnumDescriptorProto.EnumReservedRange\x12\x15\n\rreserved_name\x18\x05 \x03(\t\x1a/\n\x11\x45numReservedRange\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\"l\n\x18\x45numValueDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06number\x18\x02 \x01(\x05\x12\x32\n\x07options\x18\x03 \x01(\x0b\x32!.google.protobuf.EnumValueOptions\"\x90\x01\n\x16ServiceDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x36\n\x06method\x18\x02 \x03(\x0b\x32&.google.protobuf.MethodDescriptorProto\x12\x30\n\x07options\x18\x03 \x01(\x0b\x32\x1f.google.protobuf.ServiceOptions\"\xc1\x01\n\x15MethodDescriptorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ninput_type\x18\x02 \x01(\t\x12\x13\n\x0boutput_type\x18\x03 \x01(\t\x12/\n\x07options\x18\x04 \x01(\x0b\x32\x1e.google.protobuf.MethodOptions\x12\x1f\n\x10\x63lient_streaming\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x1f\n\x10server_streaming\x18\x06 \x01(\x08:\x05\x66\x61lse\"\xa5\x06\n\x0b\x46ileOptions\x12\x14\n\x0cjava_package\x18\x01 \x01(\t\x12\x1c\n\x14java_outer_classname\x18\x08 \x01(\t\x12\"\n\x13java_multiple_files\x18\n \x01(\x08:\x05\x66\x61lse\x12)\n\x1djava_generate_equals_and_hash\x18\x14 \x01(\x08\x42\x02\x18\x01\x12%\n\x16java_string_check_utf8\x18\x1b \x01(\x08:\x05\x66\x61lse\x12\x46\n\x0coptimize_for\x18\t \x01(\x0e\x32).google.protobuf.FileOptions.OptimizeMode:\x05SPEED\x12\x12\n\ngo_package\x18\x0b \x01(\t\x12\"\n\x13\x63\x63_generic_services\x18\x10 \x01(\x08:\x05\x66\x61lse\x12$\n\x15java_generic_services\x18\x11 \x01(\x08:\x05\x66\x61lse\x12\"\n\x13py_generic_services\x18\x12 \x01(\x08:\x05\x66\x61lse\x12#\n\x14php_generic_services\x18* \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x17 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x10\x63\x63_enable_arenas\x18\x1f \x01(\x08:\x04true\x12\x19\n\x11objc_class_prefix\x18$ \x01(\t\x12\x18\n\x10\x63sharp_namespace\x18% \x01(\t\x12\x14\n\x0cswift_prefix\x18\' \x01(\t\x12\x18\n\x10php_class_prefix\x18( \x01(\t\x12\x15\n\rphp_namespace\x18) \x01(\t\x12\x1e\n\x16php_metadata_namespace\x18, \x01(\t\x12\x14\n\x0cruby_package\x18- \x01(\t\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\":\n\x0cOptimizeMode\x12\t\n\x05SPEED\x10\x01\x12\r\n\tCODE_SIZE\x10\x02\x12\x10\n\x0cLITE_RUNTIME\x10\x03*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08&\x10\'\"\x84\x02\n\x0eMessageOptions\x12&\n\x17message_set_wire_format\x18\x01 \x01(\x08:\x05\x66\x61lse\x12.\n\x1fno_standard_descriptor_accessor\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x11\n\tmap_entry\x18\x07 \x01(\x08\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\tJ\x04\x08\t\x10\n\"\xbe\x03\n\x0c\x46ieldOptions\x12:\n\x05\x63type\x18\x01 \x01(\x0e\x32#.google.protobuf.FieldOptions.CType:\x06STRING\x12\x0e\n\x06packed\x18\x02 \x01(\x08\x12?\n\x06jstype\x18\x06 \x01(\x0e\x32$.google.protobuf.FieldOptions.JSType:\tJS_NORMAL\x12\x13\n\x04lazy\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x0funverified_lazy\x18\x0f \x01(\x08:\x05\x66\x61lse\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x13\n\x04weak\x18\n \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\"/\n\x05\x43Type\x12\n\n\x06STRING\x10\x00\x12\x08\n\x04\x43ORD\x10\x01\x12\x10\n\x0cSTRING_PIECE\x10\x02\"5\n\x06JSType\x12\r\n\tJS_NORMAL\x10\x00\x12\r\n\tJS_STRING\x10\x01\x12\r\n\tJS_NUMBER\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x04\x10\x05\"^\n\x0cOneofOptions\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x93\x01\n\x0b\x45numOptions\x12\x13\n\x0b\x61llow_alias\x18\x02 \x01(\x08\x12\x19\n\ndeprecated\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02J\x04\x08\x05\x10\x06\"}\n\x10\x45numValueOptions\x12\x19\n\ndeprecated\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"{\n\x0eServiceOptions\x12\x19\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lse\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xad\x02\n\rMethodOptions\x12\x19\n\ndeprecated\x18! \x01(\x08:\x05\x66\x61lse\x12_\n\x11idempotency_level\x18\" \x01(\x0e\x32/.google.protobuf.MethodOptions.IdempotencyLevel:\x13IDEMPOTENCY_UNKNOWN\x12\x43\n\x14uninterpreted_option\x18\xe7\x07 \x03(\x0b\x32$.google.protobuf.UninterpretedOption\"P\n\x10IdempotencyLevel\x12\x17\n\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n\nIDEMPOTENT\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x9e\x02\n\x13UninterpretedOption\x12;\n\x04name\x18\x02 \x03(\x0b\x32-.google.protobuf.UninterpretedOption.NamePart\x12\x18\n\x10identifier_value\x18\x03 \x01(\t\x12\x1a\n\x12positive_int_value\x18\x04 \x01(\x04\x12\x1a\n\x12negative_int_value\x18\x05 \x01(\x03\x12\x14\n\x0c\x64ouble_value\x18\x06 \x01(\x01\x12\x14\n\x0cstring_value\x18\x07 \x01(\x0c\x12\x17\n\x0f\x61ggregate_value\x18\x08 \x01(\t\x1a\x33\n\x08NamePart\x12\x11\n\tname_part\x18\x01 \x02(\t\x12\x14\n\x0cis_extension\x18\x02 \x02(\x08\"\xd5\x01\n\x0eSourceCodeInfo\x12:\n\x08location\x18\x01 \x03(\x0b\x32(.google.protobuf.SourceCodeInfo.Location\x1a\x86\x01\n\x08Location\x12\x10\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01\x12\x10\n\x04span\x18\x02 \x03(\x05\x42\x02\x10\x01\x12\x18\n\x10leading_comments\x18\x03 \x01(\t\x12\x19\n\x11trailing_comments\x18\x04 \x01(\t\x12!\n\x19leading_detached_comments\x18\x06 \x03(\t\"\xa7\x01\n\x11GeneratedCodeInfo\x12\x41\n\nannotation\x18\x01 \x03(\x0b\x32-.google.protobuf.GeneratedCodeInfo.Annotation\x1aO\n\nAnnotation\x12\x10\n\x04path\x18\x01 \x03(\x05\x42\x02\x10\x01\x12\x13\n\x0bsource_file\x18\x02 \x01(\t\x12\r\n\x05\x62\x65gin\x18\x03 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x04 \x01(\x05\x42~\n\x13\x63om.google.protobufB\x10\x44\x65scriptorProtosH\x01Z-google.golang.org/protobuf/types/descriptorpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1aGoogle.Protobuf.Reflection') if _descriptor._USE_C_DESCRIPTORS == False: _FIELDDESCRIPTORPROTO_TYPE = _descriptor.EnumDescriptor( @@ -1264,21 +1261,28 @@ if _descriptor._USE_C_DESCRIPTORS == False: is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='deprecated', full_name='google.protobuf.FieldOptions.deprecated', index=4, + name='unverified_lazy', full_name='google.protobuf.FieldOptions.unverified_lazy', index=4, + number=15, type=8, cpp_type=7, label=1, + has_default_value=True, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='deprecated', full_name='google.protobuf.FieldOptions.deprecated', index=5, number=3, type=8, cpp_type=7, label=1, has_default_value=True, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='weak', full_name='google.protobuf.FieldOptions.weak', index=5, + name='weak', full_name='google.protobuf.FieldOptions.weak', index=6, number=10, type=8, cpp_type=7, label=1, has_default_value=True, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='uninterpreted_option', full_name='google.protobuf.FieldOptions.uninterpreted_option', index=6, + name='uninterpreted_option', full_name='google.protobuf.FieldOptions.uninterpreted_option', index=7, number=999, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -1847,234 +1851,8 @@ if _descriptor._USE_C_DESCRIPTORS == False: _sym_db.RegisterFileDescriptor(DESCRIPTOR) else: - _FILEDESCRIPTORSET = DESCRIPTOR.message_types_by_name['FileDescriptorSet'] - _FILEDESCRIPTORPROTO = DESCRIPTOR.message_types_by_name['FileDescriptorProto'] - _DESCRIPTORPROTO = DESCRIPTOR.message_types_by_name['DescriptorProto'] - _DESCRIPTORPROTO_EXTENSIONRANGE = _DESCRIPTORPROTO.nested_types_by_name['ExtensionRange'] - _DESCRIPTORPROTO_RESERVEDRANGE = _DESCRIPTORPROTO.nested_types_by_name['ReservedRange'] - _EXTENSIONRANGEOPTIONS = DESCRIPTOR.message_types_by_name['ExtensionRangeOptions'] - _FIELDDESCRIPTORPROTO = DESCRIPTOR.message_types_by_name['FieldDescriptorProto'] - _ONEOFDESCRIPTORPROTO = DESCRIPTOR.message_types_by_name['OneofDescriptorProto'] - _ENUMDESCRIPTORPROTO = DESCRIPTOR.message_types_by_name['EnumDescriptorProto'] - _ENUMDESCRIPTORPROTO_ENUMRESERVEDRANGE = _ENUMDESCRIPTORPROTO.nested_types_by_name['EnumReservedRange'] - _ENUMVALUEDESCRIPTORPROTO = DESCRIPTOR.message_types_by_name['EnumValueDescriptorProto'] - _SERVICEDESCRIPTORPROTO = DESCRIPTOR.message_types_by_name['ServiceDescriptorProto'] - _METHODDESCRIPTORPROTO = DESCRIPTOR.message_types_by_name['MethodDescriptorProto'] - _FILEOPTIONS = DESCRIPTOR.message_types_by_name['FileOptions'] - _MESSAGEOPTIONS = DESCRIPTOR.message_types_by_name['MessageOptions'] - _FIELDOPTIONS = DESCRIPTOR.message_types_by_name['FieldOptions'] - _ONEOFOPTIONS = DESCRIPTOR.message_types_by_name['OneofOptions'] - _ENUMOPTIONS = DESCRIPTOR.message_types_by_name['EnumOptions'] - _ENUMVALUEOPTIONS = DESCRIPTOR.message_types_by_name['EnumValueOptions'] - _SERVICEOPTIONS = DESCRIPTOR.message_types_by_name['ServiceOptions'] - _METHODOPTIONS = DESCRIPTOR.message_types_by_name['MethodOptions'] - _UNINTERPRETEDOPTION = DESCRIPTOR.message_types_by_name['UninterpretedOption'] - _UNINTERPRETEDOPTION_NAMEPART = _UNINTERPRETEDOPTION.nested_types_by_name['NamePart'] - _SOURCECODEINFO = DESCRIPTOR.message_types_by_name['SourceCodeInfo'] - _SOURCECODEINFO_LOCATION = _SOURCECODEINFO.nested_types_by_name['Location'] - _GENERATEDCODEINFO = DESCRIPTOR.message_types_by_name['GeneratedCodeInfo'] - _GENERATEDCODEINFO_ANNOTATION = _GENERATEDCODEINFO.nested_types_by_name['Annotation'] - _FIELDDESCRIPTORPROTO_TYPE = _FIELDDESCRIPTORPROTO.enum_types_by_name['Type'] - _FIELDDESCRIPTORPROTO_LABEL = _FIELDDESCRIPTORPROTO.enum_types_by_name['Label'] - _FILEOPTIONS_OPTIMIZEMODE = _FILEOPTIONS.enum_types_by_name['OptimizeMode'] - _FIELDOPTIONS_CTYPE = _FIELDOPTIONS.enum_types_by_name['CType'] - _FIELDOPTIONS_JSTYPE = _FIELDOPTIONS.enum_types_by_name['JSType'] - _METHODOPTIONS_IDEMPOTENCYLEVEL = _METHODOPTIONS.enum_types_by_name['IdempotencyLevel'] -FileDescriptorSet = _reflection.GeneratedProtocolMessageType('FileDescriptorSet', (_message.Message,), { - 'DESCRIPTOR' : _FILEDESCRIPTORSET, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorSet) - }) -_sym_db.RegisterMessage(FileDescriptorSet) - -FileDescriptorProto = _reflection.GeneratedProtocolMessageType('FileDescriptorProto', (_message.Message,), { - 'DESCRIPTOR' : _FILEDESCRIPTORPROTO, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorProto) - }) -_sym_db.RegisterMessage(FileDescriptorProto) - -DescriptorProto = _reflection.GeneratedProtocolMessageType('DescriptorProto', (_message.Message,), { - - 'ExtensionRange' : _reflection.GeneratedProtocolMessageType('ExtensionRange', (_message.Message,), { - 'DESCRIPTOR' : _DESCRIPTORPROTO_EXTENSIONRANGE, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ExtensionRange) - }) - , - - 'ReservedRange' : _reflection.GeneratedProtocolMessageType('ReservedRange', (_message.Message,), { - 'DESCRIPTOR' : _DESCRIPTORPROTO_RESERVEDRANGE, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ReservedRange) - }) - , - 'DESCRIPTOR' : _DESCRIPTORPROTO, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto) - }) -_sym_db.RegisterMessage(DescriptorProto) -_sym_db.RegisterMessage(DescriptorProto.ExtensionRange) -_sym_db.RegisterMessage(DescriptorProto.ReservedRange) - -ExtensionRangeOptions = _reflection.GeneratedProtocolMessageType('ExtensionRangeOptions', (_message.Message,), { - 'DESCRIPTOR' : _EXTENSIONRANGEOPTIONS, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.ExtensionRangeOptions) - }) -_sym_db.RegisterMessage(ExtensionRangeOptions) - -FieldDescriptorProto = _reflection.GeneratedProtocolMessageType('FieldDescriptorProto', (_message.Message,), { - 'DESCRIPTOR' : _FIELDDESCRIPTORPROTO, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.FieldDescriptorProto) - }) -_sym_db.RegisterMessage(FieldDescriptorProto) - -OneofDescriptorProto = _reflection.GeneratedProtocolMessageType('OneofDescriptorProto', (_message.Message,), { - 'DESCRIPTOR' : _ONEOFDESCRIPTORPROTO, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.OneofDescriptorProto) - }) -_sym_db.RegisterMessage(OneofDescriptorProto) - -EnumDescriptorProto = _reflection.GeneratedProtocolMessageType('EnumDescriptorProto', (_message.Message,), { - - 'EnumReservedRange' : _reflection.GeneratedProtocolMessageType('EnumReservedRange', (_message.Message,), { - 'DESCRIPTOR' : _ENUMDESCRIPTORPROTO_ENUMRESERVEDRANGE, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto.EnumReservedRange) - }) - , - 'DESCRIPTOR' : _ENUMDESCRIPTORPROTO, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto) - }) -_sym_db.RegisterMessage(EnumDescriptorProto) -_sym_db.RegisterMessage(EnumDescriptorProto.EnumReservedRange) - -EnumValueDescriptorProto = _reflection.GeneratedProtocolMessageType('EnumValueDescriptorProto', (_message.Message,), { - 'DESCRIPTOR' : _ENUMVALUEDESCRIPTORPROTO, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.EnumValueDescriptorProto) - }) -_sym_db.RegisterMessage(EnumValueDescriptorProto) - -ServiceDescriptorProto = _reflection.GeneratedProtocolMessageType('ServiceDescriptorProto', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEDESCRIPTORPROTO, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.ServiceDescriptorProto) - }) -_sym_db.RegisterMessage(ServiceDescriptorProto) - -MethodDescriptorProto = _reflection.GeneratedProtocolMessageType('MethodDescriptorProto', (_message.Message,), { - 'DESCRIPTOR' : _METHODDESCRIPTORPROTO, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.MethodDescriptorProto) - }) -_sym_db.RegisterMessage(MethodDescriptorProto) - -FileOptions = _reflection.GeneratedProtocolMessageType('FileOptions', (_message.Message,), { - 'DESCRIPTOR' : _FILEOPTIONS, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.FileOptions) - }) -_sym_db.RegisterMessage(FileOptions) - -MessageOptions = _reflection.GeneratedProtocolMessageType('MessageOptions', (_message.Message,), { - 'DESCRIPTOR' : _MESSAGEOPTIONS, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.MessageOptions) - }) -_sym_db.RegisterMessage(MessageOptions) - -FieldOptions = _reflection.GeneratedProtocolMessageType('FieldOptions', (_message.Message,), { - 'DESCRIPTOR' : _FIELDOPTIONS, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions) - }) -_sym_db.RegisterMessage(FieldOptions) - -OneofOptions = _reflection.GeneratedProtocolMessageType('OneofOptions', (_message.Message,), { - 'DESCRIPTOR' : _ONEOFOPTIONS, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.OneofOptions) - }) -_sym_db.RegisterMessage(OneofOptions) - -EnumOptions = _reflection.GeneratedProtocolMessageType('EnumOptions', (_message.Message,), { - 'DESCRIPTOR' : _ENUMOPTIONS, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.EnumOptions) - }) -_sym_db.RegisterMessage(EnumOptions) - -EnumValueOptions = _reflection.GeneratedProtocolMessageType('EnumValueOptions', (_message.Message,), { - 'DESCRIPTOR' : _ENUMVALUEOPTIONS, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.EnumValueOptions) - }) -_sym_db.RegisterMessage(EnumValueOptions) - -ServiceOptions = _reflection.GeneratedProtocolMessageType('ServiceOptions', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEOPTIONS, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.ServiceOptions) - }) -_sym_db.RegisterMessage(ServiceOptions) - -MethodOptions = _reflection.GeneratedProtocolMessageType('MethodOptions', (_message.Message,), { - 'DESCRIPTOR' : _METHODOPTIONS, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.MethodOptions) - }) -_sym_db.RegisterMessage(MethodOptions) - -UninterpretedOption = _reflection.GeneratedProtocolMessageType('UninterpretedOption', (_message.Message,), { - - 'NamePart' : _reflection.GeneratedProtocolMessageType('NamePart', (_message.Message,), { - 'DESCRIPTOR' : _UNINTERPRETEDOPTION_NAMEPART, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption.NamePart) - }) - , - 'DESCRIPTOR' : _UNINTERPRETEDOPTION, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption) - }) -_sym_db.RegisterMessage(UninterpretedOption) -_sym_db.RegisterMessage(UninterpretedOption.NamePart) - -SourceCodeInfo = _reflection.GeneratedProtocolMessageType('SourceCodeInfo', (_message.Message,), { - - 'Location' : _reflection.GeneratedProtocolMessageType('Location', (_message.Message,), { - 'DESCRIPTOR' : _SOURCECODEINFO_LOCATION, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo.Location) - }) - , - 'DESCRIPTOR' : _SOURCECODEINFO, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo) - }) -_sym_db.RegisterMessage(SourceCodeInfo) -_sym_db.RegisterMessage(SourceCodeInfo.Location) - -GeneratedCodeInfo = _reflection.GeneratedProtocolMessageType('GeneratedCodeInfo', (_message.Message,), { - - 'Annotation' : _reflection.GeneratedProtocolMessageType('Annotation', (_message.Message,), { - 'DESCRIPTOR' : _GENERATEDCODEINFO_ANNOTATION, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo.Annotation) - }) - , - 'DESCRIPTOR' : _GENERATEDCODEINFO, - '__module__' : 'google.protobuf.descriptor_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo) - }) -_sym_db.RegisterMessage(GeneratedCodeInfo) -_sym_db.RegisterMessage(GeneratedCodeInfo.Annotation) - + _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.descriptor_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None @@ -2115,33 +1893,33 @@ if _descriptor._USE_C_DESCRIPTORS == False: _MESSAGEOPTIONS._serialized_start=3764 _MESSAGEOPTIONS._serialized_end=4024 _FIELDOPTIONS._serialized_start=4027 - _FIELDOPTIONS._serialized_end=4441 - _FIELDOPTIONS_CTYPE._serialized_start=4322 - _FIELDOPTIONS_CTYPE._serialized_end=4369 - _FIELDOPTIONS_JSTYPE._serialized_start=4371 - _FIELDOPTIONS_JSTYPE._serialized_end=4424 - _ONEOFOPTIONS._serialized_start=4443 - _ONEOFOPTIONS._serialized_end=4537 - _ENUMOPTIONS._serialized_start=4540 - _ENUMOPTIONS._serialized_end=4687 - _ENUMVALUEOPTIONS._serialized_start=4689 - _ENUMVALUEOPTIONS._serialized_end=4814 - _SERVICEOPTIONS._serialized_start=4816 - _SERVICEOPTIONS._serialized_end=4939 - _METHODOPTIONS._serialized_start=4942 - _METHODOPTIONS._serialized_end=5243 - _METHODOPTIONS_IDEMPOTENCYLEVEL._serialized_start=5152 - _METHODOPTIONS_IDEMPOTENCYLEVEL._serialized_end=5232 - _UNINTERPRETEDOPTION._serialized_start=5246 - _UNINTERPRETEDOPTION._serialized_end=5532 - _UNINTERPRETEDOPTION_NAMEPART._serialized_start=5481 - _UNINTERPRETEDOPTION_NAMEPART._serialized_end=5532 - _SOURCECODEINFO._serialized_start=5535 - _SOURCECODEINFO._serialized_end=5748 - _SOURCECODEINFO_LOCATION._serialized_start=5614 - _SOURCECODEINFO_LOCATION._serialized_end=5748 - _GENERATEDCODEINFO._serialized_start=5751 - _GENERATEDCODEINFO._serialized_end=5918 - _GENERATEDCODEINFO_ANNOTATION._serialized_start=5839 - _GENERATEDCODEINFO_ANNOTATION._serialized_end=5918 + _FIELDOPTIONS._serialized_end=4473 + _FIELDOPTIONS_CTYPE._serialized_start=4354 + _FIELDOPTIONS_CTYPE._serialized_end=4401 + _FIELDOPTIONS_JSTYPE._serialized_start=4403 + _FIELDOPTIONS_JSTYPE._serialized_end=4456 + _ONEOFOPTIONS._serialized_start=4475 + _ONEOFOPTIONS._serialized_end=4569 + _ENUMOPTIONS._serialized_start=4572 + _ENUMOPTIONS._serialized_end=4719 + _ENUMVALUEOPTIONS._serialized_start=4721 + _ENUMVALUEOPTIONS._serialized_end=4846 + _SERVICEOPTIONS._serialized_start=4848 + _SERVICEOPTIONS._serialized_end=4971 + _METHODOPTIONS._serialized_start=4974 + _METHODOPTIONS._serialized_end=5275 + _METHODOPTIONS_IDEMPOTENCYLEVEL._serialized_start=5184 + _METHODOPTIONS_IDEMPOTENCYLEVEL._serialized_end=5264 + _UNINTERPRETEDOPTION._serialized_start=5278 + _UNINTERPRETEDOPTION._serialized_end=5564 + _UNINTERPRETEDOPTION_NAMEPART._serialized_start=5513 + _UNINTERPRETEDOPTION_NAMEPART._serialized_end=5564 + _SOURCECODEINFO._serialized_start=5567 + _SOURCECODEINFO._serialized_end=5780 + _SOURCECODEINFO_LOCATION._serialized_start=5646 + _SOURCECODEINFO_LOCATION._serialized_end=5780 + _GENERATEDCODEINFO._serialized_start=5783 + _GENERATEDCODEINFO._serialized_end=5950 + _GENERATEDCODEINFO_ANNOTATION._serialized_start=5871 + _GENERATEDCODEINFO_ANNOTATION._serialized_end=5950 # @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/descriptor_pool.py b/windows/python/google/protobuf/descriptor_pool.py index a6955ce81..911372a8b 100644 --- a/windows/python/google/protobuf/descriptor_pool.py +++ b/windows/python/google/protobuf/descriptor_pool.py @@ -1213,6 +1213,8 @@ class DescriptorPool(object): containing_service=None, input_type=input_type, output_type=output_type, + client_streaming=method_proto.client_streaming, + server_streaming=method_proto.server_streaming, options=_OptionsOrNone(method_proto), # pylint: disable=protected-access create_key=descriptor._internal_create_key) @@ -1233,21 +1235,25 @@ class DescriptorPool(object): for enum in desc.enum_types: yield (_PrefixWithDot(enum.full_name), enum) - def _GetDeps(self, dependencies): + def _GetDeps(self, dependencies, visited=None): """Recursively finds dependencies for file protos. Args: dependencies: The names of the files being depended on. + visited: The names of files already found. Yields: Each direct and indirect dependency. """ + visited = visited or set() for dependency in dependencies: - dep_desc = self.FindFileByName(dependency) - yield dep_desc - for parent_dep in dep_desc.dependencies: - yield parent_dep + if dependency not in visited: + visited.add(dependency) + dep_desc = self.FindFileByName(dependency) + yield dep_desc + public_files = [d.name for d in dep_desc.public_dependencies] + yield from self._GetDeps(public_files, visited) def _GetTypeFromScope(self, package, type_name, scope): """Finds a given type name in the current scope. diff --git a/windows/python/google/protobuf/duration_pb2.py b/windows/python/google/protobuf/duration_pb2.py index 60f58678a..a8ecc07bd 100644 --- a/windows/python/google/protobuf/duration_pb2.py +++ b/windows/python/google/protobuf/duration_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/duration.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,16 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1egoogle/protobuf/duration.proto\x12\x0fgoogle.protobuf\"*\n\x08\x44uration\x12\x0f\n\x07seconds\x18\x01 \x01(\x03\x12\r\n\x05nanos\x18\x02 \x01(\x05\x42\x83\x01\n\x13\x63om.google.protobufB\rDurationProtoP\x01Z1google.golang.org/protobuf/types/known/durationpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3') - - -_DURATION = DESCRIPTOR.message_types_by_name['Duration'] -Duration = _reflection.GeneratedProtocolMessageType('Duration', (_message.Message,), { - 'DESCRIPTOR' : _DURATION, - '__module__' : 'google.protobuf.duration_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Duration) - }) -_sym_db.RegisterMessage(Duration) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.duration_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/empty_pb2.py b/windows/python/google/protobuf/empty_pb2.py index aecb7af5d..0b4d554db 100644 --- a/windows/python/google/protobuf/empty_pb2.py +++ b/windows/python/google/protobuf/empty_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/empty.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,16 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bgoogle/protobuf/empty.proto\x12\x0fgoogle.protobuf\"\x07\n\x05\x45mptyB}\n\x13\x63om.google.protobufB\nEmptyProtoP\x01Z.google.golang.org/protobuf/types/known/emptypb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3') - - -_EMPTY = DESCRIPTOR.message_types_by_name['Empty'] -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'google.protobuf.empty_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Empty) - }) -_sym_db.RegisterMessage(Empty) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.empty_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/field_mask_pb2.py b/windows/python/google/protobuf/field_mask_pb2.py index 46e48e8e7..80a4e96e5 100644 --- a/windows/python/google/protobuf/field_mask_pb2.py +++ b/windows/python/google/protobuf/field_mask_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/field_mask.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,16 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n google/protobuf/field_mask.proto\x12\x0fgoogle.protobuf\"\x1a\n\tFieldMask\x12\r\n\x05paths\x18\x01 \x03(\tB\x85\x01\n\x13\x63om.google.protobufB\x0e\x46ieldMaskProtoP\x01Z2google.golang.org/protobuf/types/known/fieldmaskpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3') - - -_FIELDMASK = DESCRIPTOR.message_types_by_name['FieldMask'] -FieldMask = _reflection.GeneratedProtocolMessageType('FieldMask', (_message.Message,), { - 'DESCRIPTOR' : _FIELDMASK, - '__module__' : 'google.protobuf.field_mask_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.FieldMask) - }) -_sym_db.RegisterMessage(FieldMask) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.field_mask_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/internal/_parameterized.py b/windows/python/google/protobuf/internal/_parameterized.py index 2229671ed..afdbb78c3 100644 --- a/windows/python/google/protobuf/internal/_parameterized.py +++ b/windows/python/google/protobuf/internal/_parameterized.py @@ -148,10 +148,7 @@ __author__ = 'tmarek@google.com (Torsten Marek)' import functools import re import types -try: - import unittest2 as unittest -except ImportError: - import unittest +import unittest import uuid try: @@ -357,7 +354,7 @@ class TestGeneratorMetaclass(type): def __new__(mcs, class_name, bases, dct): dct['_id_suffix'] = id_suffix = {} - for name, obj in dct.items(): + for name, obj in dct.copy().items(): if (name.startswith(unittest.TestLoader.testMethodPrefix) and _NonStringIterable(obj)): iterator = iter(obj) @@ -389,9 +386,8 @@ def _UpdateClassDictForParamTestCase(dct, id_suffix, name, iterator): id_suffix[new_name] = getattr(func, '__x_extra_id__', '') -class TestCase(unittest.TestCase): +class TestCase(unittest.TestCase, metaclass=TestGeneratorMetaclass): """Base class for test cases using the parameters decorator.""" - __metaclass__ = TestGeneratorMetaclass def _OriginalName(self): return self._testMethodName.split(_SEPARATOR)[0] diff --git a/windows/python/google/protobuf/internal/any_test_pb2.py b/windows/python/google/protobuf/internal/any_test_pb2.py index 69a2dbf56..a6784f152 100644 --- a/windows/python/google/protobuf/internal/any_test_pb2.py +++ b/windows/python/google/protobuf/internal/any_test_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/any_test.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,33 +16,8 @@ from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'google/protobuf/internal/any_test.proto\x12\x18google.protobuf.internal\x1a\x19google/protobuf/any.proto\"\xc0\x01\n\x07TestAny\x12#\n\x05value\x18\x01 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x11\n\tint_value\x18\x02 \x01(\x05\x12\x42\n\tmap_value\x18\x03 \x03(\x0b\x32/.google.protobuf.internal.TestAny.MapValueEntry\x1a/\n\rMapValueEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01*\x08\x08\n\x10\x80\x80\x80\x80\x02\"\x85\x01\n\x11TestAnyExtension1\x12\t\n\x01i\x18\x0f \x01(\x05\x32\x65\n\nextension1\x12!.google.protobuf.internal.TestAny\x18\xab\xff\xf6. \x01(\x0b\x32+.google.protobuf.internal.TestAnyExtension1') - - -_TESTANY = DESCRIPTOR.message_types_by_name['TestAny'] -_TESTANY_MAPVALUEENTRY = _TESTANY.nested_types_by_name['MapValueEntry'] -_TESTANYEXTENSION1 = DESCRIPTOR.message_types_by_name['TestAnyExtension1'] -TestAny = _reflection.GeneratedProtocolMessageType('TestAny', (_message.Message,), { - - 'MapValueEntry' : _reflection.GeneratedProtocolMessageType('MapValueEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTANY_MAPVALUEENTRY, - '__module__' : 'google.protobuf.internal.any_test_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.TestAny.MapValueEntry) - }) - , - 'DESCRIPTOR' : _TESTANY, - '__module__' : 'google.protobuf.internal.any_test_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.TestAny) - }) -_sym_db.RegisterMessage(TestAny) -_sym_db.RegisterMessage(TestAny.MapValueEntry) - -TestAnyExtension1 = _reflection.GeneratedProtocolMessageType('TestAnyExtension1', (_message.Message,), { - 'DESCRIPTOR' : _TESTANYEXTENSION1, - '__module__' : 'google.protobuf.internal.any_test_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.TestAnyExtension1) - }) -_sym_db.RegisterMessage(TestAnyExtension1) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.any_test_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: TestAny.RegisterExtension(_TESTANYEXTENSION1.extensions_by_name['extension1']) diff --git a/windows/python/google/protobuf/internal/api_implementation.cc b/windows/python/google/protobuf/internal/api_implementation.cc index 6532a8140..33f5b04f4 100644 --- a/windows/python/google/protobuf/internal/api_implementation.cc +++ b/windows/python/google/protobuf/internal/api_implementation.cc @@ -28,6 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#define PY_SSIZE_T_CLEAN #include namespace google { @@ -81,24 +82,24 @@ static struct PyModuleDef _module = {PyModuleDef_HEAD_INIT, kModuleName, kModuleDocstring, -1, - NULL, - NULL, - NULL, - NULL, - NULL}; + nullptr, + nullptr, + nullptr, + nullptr, + nullptr}; extern "C" { PyMODINIT_FUNC PyInit__api_implementation() { PyObject* module = PyModule_Create(&_module); - if (module == NULL) { - return NULL; + if (module == nullptr) { + return nullptr; } // Adds the module variable "api_version". if (PyModule_AddIntConstant(module, const_cast(kImplVersionName), kImplVersion)) { Py_DECREF(module); - return NULL; + return nullptr; } return module; diff --git a/windows/python/google/protobuf/internal/api_implementation.py b/windows/python/google/protobuf/internal/api_implementation.py index 7fef23767..74586487a 100644 --- a/windows/python/google/protobuf/internal/api_implementation.py +++ b/windows/python/google/protobuf/internal/api_implementation.py @@ -31,41 +31,96 @@ """Determine which implementation of the protobuf API is used in this process. """ +import importlib import os import sys import warnings + +def _ApiVersionToImplementationType(api_version): + if api_version == 2: + return 'cpp' + if api_version == 1: + raise ValueError('api_version=1 is no longer supported.') + if api_version == 0: + return 'python' + return None + + +_implementation_type = None try: # pylint: disable=g-import-not-at-top from google.protobuf.internal import _api_implementation # The compile-time constants in the _api_implementation module can be used to # switch to a certain implementation of the Python API at build time. - _api_version = _api_implementation.api_version + _implementation_type = _ApiVersionToImplementationType( + _api_implementation.api_version) except ImportError: - _api_version = -1 # Unspecified by compiler flags. - -if _api_version == 1: - raise ValueError('api_version=1 is no longer supported.') + pass # Unspecified by compiler flags. -_default_implementation_type = ('cpp' if _api_version > 0 else 'python') +def _CanImport(mod_name): + try: + mod = importlib.import_module(mod_name) + # Work around a known issue in the classic bootstrap .par import hook. + if not mod: + raise ImportError(mod_name + ' import succeeded but was None') + return True + except ImportError: + return False + + +if _implementation_type is None: + if _CanImport('google._upb._message'): + _implementation_type = 'upb' + elif _CanImport('google.protobuf.pyext._message'): + _implementation_type = 'cpp' + else: + _implementation_type = 'python' # This environment variable can be used to switch to a certain implementation # of the Python API, overriding the compile-time constants in the -# _api_implementation module. Right now only 'python' and 'cpp' are valid -# values. Any other value will be ignored. +# _api_implementation module. Right now only 'python', 'cpp' and 'upb' are +# valid values. Any other value will raise error. _implementation_type = os.getenv('PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION', - _default_implementation_type) + _implementation_type) -if _implementation_type != 'python': - _implementation_type = 'cpp' +if _implementation_type not in ('python', 'cpp', 'upb'): + raise ValueError('PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION {0} is not ' + 'supported. Please set to \'python\', \'cpp\' or ' + '\'upb\'.'.format(_implementation_type)) if 'PyPy' in sys.version and _implementation_type == 'cpp': warnings.warn('PyPy does not work yet with cpp protocol buffers. ' 'Falling back to the python implementation.') _implementation_type = 'python' +_c_module = None + +if _implementation_type == 'cpp': + try: + # pylint: disable=g-import-not-at-top + from google.protobuf.pyext import _message + _c_module = _message + del _message + except ImportError: + # TODO(jieluo): fail back to python + warnings.warn( + 'Selected implementation cpp is not available.') + pass + +if _implementation_type == 'upb': + try: + # pylint: disable=g-import-not-at-top + from google._upb import _message + _c_module = _message + del _message + except ImportError: + warnings.warn('Selected implementation upb is not available. ' + 'Falling back to the python implementation.') + _implementation_type = 'python' + pass # Detect if serialization should be deterministic by default try: @@ -103,6 +158,7 @@ def _SetType(implementation_type): # See comment on 'Type' above. +# TODO(jieluo): Remove the API, it returns a constant. b/228102101 def Version(): return 2 diff --git a/windows/python/google/protobuf/internal/builder.py b/windows/python/google/protobuf/internal/builder.py new file mode 100644 index 000000000..64353ee4a --- /dev/null +++ b/windows/python/google/protobuf/internal/builder.py @@ -0,0 +1,130 @@ +# Protocol Buffers - Google's data interchange format +# Copyright 2008 Google Inc. All rights reserved. +# https://developers.google.com/protocol-buffers/ +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Builds descriptors, message classes and services for generated _pb2.py. + +This file is only called in python generated _pb2.py files. It builds +descriptors, message classes and services that users can directly use +in generated code. +""" + +__author__ = 'jieluo@google.com (Jie Luo)' + +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +_sym_db = _symbol_database.Default() + + +def BuildMessageAndEnumDescriptors(file_des, module): + """Builds message and enum descriptors. + + Args: + file_des: FileDescriptor of the .proto file + module: Generated _pb2 module + """ + + def BuildNestedDescriptors(msg_des, prefix): + for (name, nested_msg) in msg_des.nested_types_by_name.items(): + module_name = prefix + name.upper() + module[module_name] = nested_msg + BuildNestedDescriptors(nested_msg, module_name + '_') + for enum_des in msg_des.enum_types: + module[prefix + enum_des.name.upper()] = enum_des + + for (name, msg_des) in file_des.message_types_by_name.items(): + module_name = '_' + name.upper() + module[module_name] = msg_des + BuildNestedDescriptors(msg_des, module_name + '_') + + +def BuildTopDescriptorsAndMessages(file_des, module_name, module): + """Builds top level descriptors and message classes. + + Args: + file_des: FileDescriptor of the .proto file + module_name: str, the name of generated _pb2 module + module: Generated _pb2 module + """ + + def BuildMessage(msg_des): + create_dict = {} + for (name, nested_msg) in msg_des.nested_types_by_name.items(): + create_dict[name] = BuildMessage(nested_msg) + create_dict['DESCRIPTOR'] = msg_des + create_dict['__module__'] = module_name + message_class = _reflection.GeneratedProtocolMessageType( + msg_des.name, (_message.Message,), create_dict) + _sym_db.RegisterMessage(message_class) + return message_class + + # top level enums + for (name, enum_des) in file_des.enum_types_by_name.items(): + module['_' + name.upper()] = enum_des + module[name] = enum_type_wrapper.EnumTypeWrapper(enum_des) + for enum_value in enum_des.values: + module[enum_value.name] = enum_value.number + + # top level extensions + for (name, extension_des) in file_des.extensions_by_name.items(): + module[name.upper() + '_FIELD_NUMBER'] = extension_des.number + module[name] = extension_des + + # services + for (name, service) in file_des.services_by_name.items(): + module['_' + name.upper()] = service + + # Build messages. + for (name, msg_des) in file_des.message_types_by_name.items(): + module[name] = BuildMessage(msg_des) + + +def BuildServices(file_des, module_name, module): + """Builds services classes and services stub class. + + Args: + file_des: FileDescriptor of the .proto file + module_name: str, the name of generated _pb2 module + module: Generated _pb2 module + """ + # pylint: disable=g-import-not-at-top + from google.protobuf import service as _service + from google.protobuf import service_reflection + # pylint: enable=g-import-not-at-top + for (name, service) in file_des.services_by_name.items(): + module[name] = service_reflection.GeneratedServiceType( + name, (_service.Service,), + dict(DESCRIPTOR=service, __module__=module_name)) + stub_name = name + '_Stub' + module[stub_name] = service_reflection.GeneratedServiceStubType( + stub_name, (module[name],), + dict(DESCRIPTOR=service, __module__=module_name)) diff --git a/windows/python/google/protobuf/internal/containers.py b/windows/python/google/protobuf/internal/containers.py index f0c06df8d..29fbb53d2 100644 --- a/windows/python/google/protobuf/internal/containers.py +++ b/windows/python/google/protobuf/internal/containers.py @@ -40,19 +40,37 @@ are: includes groups and nested messages. """ -__author__ = 'petar@google.com (Petar Petrov)' - import collections.abc +import copy +import pickle +from typing import ( + Any, + Iterable, + Iterator, + List, + MutableMapping, + MutableSequence, + NoReturn, + Optional, + Sequence, + TypeVar, + Union, + overload, +) -class BaseContainer(object): +_T = TypeVar('_T') +_K = TypeVar('_K') +_V = TypeVar('_V') + +class BaseContainer(Sequence[_T]): """Base container class.""" # Minimizes memory usage and disallows assignment to other attributes. __slots__ = ['_message_listener', '_values'] - def __init__(self, message_listener): + def __init__(self, message_listener: Any) -> None: """ Args: message_listener: A MessageListener implementation. @@ -62,26 +80,33 @@ class BaseContainer(object): self._message_listener = message_listener self._values = [] + @overload + def __getitem__(self, key: int) -> _T: + ... + + @overload + def __getitem__(self, key: slice) -> List[_T]: + ... + def __getitem__(self, key): """Retrieves item by the specified key.""" return self._values[key] - def __len__(self): + def __len__(self) -> int: """Returns the number of elements in the container.""" return len(self._values) - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Checks if another instance isn't equal to this one.""" # The concrete classes should define __eq__. return not self == other - def __hash__(self): - raise TypeError('unhashable object') + __hash__ = None - def __repr__(self): + def __repr__(self) -> str: return repr(self._values) - def sort(self, *args, **kwargs): + def sort(self, *args, **kwargs) -> None: # Continue to support the old sort_function keyword argument. # This is expected to be a rare occurrence, so use LBYL to avoid # the overhead of actually catching KeyError. @@ -89,20 +114,26 @@ class BaseContainer(object): kwargs['cmp'] = kwargs.pop('sort_function') self._values.sort(*args, **kwargs) - def reverse(self): + def reverse(self) -> None: self._values.reverse() +# TODO(slebedev): Remove this. BaseContainer does *not* conform to +# MutableSequence, only its subclasses do. collections.abc.MutableSequence.register(BaseContainer) -class RepeatedScalarFieldContainer(BaseContainer): +class RepeatedScalarFieldContainer(BaseContainer[_T], MutableSequence[_T]): """Simple, type-checked, list-like container for holding repeated scalars.""" # Disallows assignment to other attributes. __slots__ = ['_type_checker'] - def __init__(self, message_listener, type_checker): + def __init__( + self, + message_listener: Any, + type_checker: Any, + ) -> None: """Args: message_listener: A MessageListener implementation. The @@ -111,24 +142,23 @@ class RepeatedScalarFieldContainer(BaseContainer): type_checker: A type_checkers.ValueChecker instance to run on elements inserted into this container. """ - super(RepeatedScalarFieldContainer, self).__init__(message_listener) + super().__init__(message_listener) self._type_checker = type_checker - def append(self, value): + def append(self, value: _T) -> None: """Appends an item to the list. Similar to list.append().""" self._values.append(self._type_checker.CheckValue(value)) if not self._message_listener.dirty: self._message_listener.Modified() - def insert(self, key, value): + def insert(self, key: int, value: _T) -> None: """Inserts the item at the specified position. Similar to list.insert().""" self._values.insert(key, self._type_checker.CheckValue(value)) if not self._message_listener.dirty: self._message_listener.Modified() - def extend(self, elem_seq): + def extend(self, elem_seq: Iterable[_T]) -> None: """Extends by appending the given iterable. Similar to list.extend().""" - if elem_seq is None: return try: @@ -145,57 +175,52 @@ class RepeatedScalarFieldContainer(BaseContainer): self._values.extend(new_values) self._message_listener.Modified() - def MergeFrom(self, other): + def MergeFrom( + self, + other: Union['RepeatedScalarFieldContainer[_T]', Iterable[_T]], + ) -> None: """Appends the contents of another repeated field of the same type to this one. We do not check the types of the individual fields. """ - self._values.extend(other._values) + self._values.extend(other) self._message_listener.Modified() - def remove(self, elem): + def remove(self, elem: _T): """Removes an item from the list. Similar to list.remove().""" self._values.remove(elem) self._message_listener.Modified() - def pop(self, key=-1): + def pop(self, key: Optional[int] = -1) -> _T: """Removes and returns an item at a given index. Similar to list.pop().""" value = self._values[key] self.__delitem__(key) return value - def __setitem__(self, key, value): + @overload + def __setitem__(self, key: int, value: _T) -> None: + ... + + @overload + def __setitem__(self, key: slice, value: Iterable[_T]) -> None: + ... + + def __setitem__(self, key, value) -> None: """Sets the item on the specified position.""" - if isinstance(key, slice): # PY3 + if isinstance(key, slice): if key.step is not None: raise ValueError('Extended slices not supported') - self.__setslice__(key.start, key.stop, value) + self._values[key] = map(self._type_checker.CheckValue, value) + self._message_listener.Modified() else: self._values[key] = self._type_checker.CheckValue(value) self._message_listener.Modified() - def __getslice__(self, start, stop): - """Retrieves the subset of items from between the specified indices.""" - return self._values[start:stop] - - def __setslice__(self, start, stop, values): - """Sets the subset of items from between the specified indices.""" - new_values = [] - for value in values: - new_values.append(self._type_checker.CheckValue(value)) - self._values[start:stop] = new_values - self._message_listener.Modified() - - def __delitem__(self, key): + def __delitem__(self, key: Union[int, slice]) -> None: """Deletes the item at the specified position.""" del self._values[key] self._message_listener.Modified() - def __delslice__(self, start, stop): - """Deletes the subset of items from between the specified indices.""" - del self._values[start:stop] - self._message_listener.Modified() - - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compares the current instance with another one.""" if self is other: return True @@ -205,15 +230,28 @@ class RepeatedScalarFieldContainer(BaseContainer): # We are presumably comparing against some other sequence type. return other == self._values + def __deepcopy__( + self, + unused_memo: Any = None, + ) -> 'RepeatedScalarFieldContainer[_T]': + clone = RepeatedScalarFieldContainer( + copy.deepcopy(self._message_listener), self._type_checker) + clone.MergeFrom(self) + return clone -class RepeatedCompositeFieldContainer(BaseContainer): + def __reduce__(self, **kwargs) -> NoReturn: + raise pickle.PickleError( + "Can't pickle repeated scalar fields, convert to list first") + +# TODO(slebedev): Constrain T to be a subtype of Message. +class RepeatedCompositeFieldContainer(BaseContainer[_T], MutableSequence[_T]): """Simple, list-like container for holding repeated composite fields.""" # Disallows assignment to other attributes. __slots__ = ['_message_descriptor'] - def __init__(self, message_listener, message_descriptor): + def __init__(self, message_listener: Any, message_descriptor: Any) -> None: """ Note that we pass in a descriptor instead of the generated directly, since at the time we construct a _RepeatedCompositeFieldContainer we @@ -228,10 +266,10 @@ class RepeatedCompositeFieldContainer(BaseContainer): that should be present in this container. We'll use the _concrete_class field of this descriptor when the client calls add(). """ - super(RepeatedCompositeFieldContainer, self).__init__(message_listener) + super().__init__(message_listener) self._message_descriptor = message_descriptor - def add(self, **kwargs): + def add(self, **kwargs: Any) -> _T: """Adds a new element at the end of the list and returns it. Keyword arguments may be used to initialize the element. """ @@ -242,7 +280,7 @@ class RepeatedCompositeFieldContainer(BaseContainer): self._message_listener.Modified() return new_element - def append(self, value): + def append(self, value: _T) -> None: """Appends one element by copying the message.""" new_element = self._message_descriptor._concrete_class() new_element._SetListener(self._message_listener) @@ -251,7 +289,7 @@ class RepeatedCompositeFieldContainer(BaseContainer): if not self._message_listener.dirty: self._message_listener.Modified() - def insert(self, key, value): + def insert(self, key: int, value: _T) -> None: """Inserts the item at the specified position by copying.""" new_element = self._message_descriptor._concrete_class() new_element._SetListener(self._message_listener) @@ -260,7 +298,7 @@ class RepeatedCompositeFieldContainer(BaseContainer): if not self._message_listener.dirty: self._message_listener.Modified() - def extend(self, elem_seq): + def extend(self, elem_seq: Iterable[_T]) -> None: """Extends by appending the given sequence of elements of the same type as this one, copying each individual message. @@ -275,38 +313,47 @@ class RepeatedCompositeFieldContainer(BaseContainer): values.append(new_element) listener.Modified() - def MergeFrom(self, other): + def MergeFrom( + self, + other: Union['RepeatedCompositeFieldContainer[_T]', Iterable[_T]], + ) -> None: """Appends the contents of another repeated field of the same type to this one, copying each individual message. """ - self.extend(other._values) + self.extend(other) - def remove(self, elem): + def remove(self, elem: _T) -> None: """Removes an item from the list. Similar to list.remove().""" self._values.remove(elem) self._message_listener.Modified() - def pop(self, key=-1): + def pop(self, key: Optional[int] = -1) -> _T: """Removes and returns an item at a given index. Similar to list.pop().""" value = self._values[key] self.__delitem__(key) return value - def __getslice__(self, start, stop): - """Retrieves the subset of items from between the specified indices.""" - return self._values[start:stop] + @overload + def __setitem__(self, key: int, value: _T) -> None: + ... - def __delitem__(self, key): + @overload + def __setitem__(self, key: slice, value: Iterable[_T]) -> None: + ... + + def __setitem__(self, key, value): + # This method is implemented to make RepeatedCompositeFieldContainer + # structurally compatible with typing.MutableSequence. It is + # otherwise unsupported and will always raise an error. + raise TypeError( + f'{self.__class__.__name__} object does not support item assignment') + + def __delitem__(self, key: Union[int, slice]) -> None: """Deletes the item at the specified position.""" del self._values[key] self._message_listener.Modified() - def __delslice__(self, start, stop): - """Deletes the subset of items from between the specified indices.""" - del self._values[start:stop] - self._message_listener.Modified() - - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compares the current instance with another one.""" if self is other: return True @@ -316,16 +363,20 @@ class RepeatedCompositeFieldContainer(BaseContainer): return self._values == other._values -class ScalarMap(collections.abc.MutableMapping): - +class ScalarMap(MutableMapping[_K, _V]): """Simple, type-checked, dict-like container for holding repeated scalars.""" # Disallows assignment to other attributes. __slots__ = ['_key_checker', '_value_checker', '_values', '_message_listener', '_entry_descriptor'] - def __init__(self, message_listener, key_checker, value_checker, - entry_descriptor): + def __init__( + self, + message_listener: Any, + key_checker: Any, + value_checker: Any, + entry_descriptor: Any, + ) -> None: """ Args: message_listener: A MessageListener implementation. @@ -343,7 +394,7 @@ class ScalarMap(collections.abc.MutableMapping): self._entry_descriptor = entry_descriptor self._values = {} - def __getitem__(self, key): + def __getitem__(self, key: _K) -> _V: try: return self._values[key] except KeyError: @@ -352,12 +403,20 @@ class ScalarMap(collections.abc.MutableMapping): self._values[key] = val return val - def __contains__(self, item): + def __contains__(self, item: _K) -> bool: # We check the key's type to match the strong-typing flavor of the API. # Also this makes it easier to match the behavior of the C++ implementation. self._key_checker.CheckValue(item) return item in self._values + @overload + def get(self, key: _K) -> Optional[_V]: + ... + + @overload + def get(self, key: _K, default: _T) -> Union[_V, _T]: + ... + # We need to override this explicitly, because our defaultdict-like behavior # will make the default implementation (from our base class) always insert # the key. @@ -367,30 +426,30 @@ class ScalarMap(collections.abc.MutableMapping): else: return default - def __setitem__(self, key, value): + def __setitem__(self, key: _K, value: _V) -> _T: checked_key = self._key_checker.CheckValue(key) checked_value = self._value_checker.CheckValue(value) self._values[checked_key] = checked_value self._message_listener.Modified() - def __delitem__(self, key): + def __delitem__(self, key: _K) -> None: del self._values[key] self._message_listener.Modified() - def __len__(self): + def __len__(self) -> int: return len(self._values) - def __iter__(self): + def __iter__(self) -> Iterator[_K]: return iter(self._values) - def __repr__(self): + def __repr__(self) -> str: return repr(self._values) - def MergeFrom(self, other): + def MergeFrom(self, other: 'ScalarMap[_K, _V]') -> None: self._values.update(other._values) self._message_listener.Modified() - def InvalidateIterators(self): + def InvalidateIterators(self) -> None: # It appears that the only way to reliably invalidate iterators to # self._values is to ensure that its size changes. original = self._values @@ -398,24 +457,28 @@ class ScalarMap(collections.abc.MutableMapping): original[None] = None # This is defined in the abstract base, but we can do it much more cheaply. - def clear(self): + def clear(self) -> None: self._values.clear() self._message_listener.Modified() - def GetEntryClass(self): + def GetEntryClass(self) -> Any: return self._entry_descriptor._concrete_class -class MessageMap(collections.abc.MutableMapping): - +class MessageMap(MutableMapping[_K, _V]): """Simple, type-checked, dict-like container for with submessage values.""" # Disallows assignment to other attributes. __slots__ = ['_key_checker', '_values', '_message_listener', '_message_descriptor', '_entry_descriptor'] - def __init__(self, message_listener, message_descriptor, key_checker, - entry_descriptor): + def __init__( + self, + message_listener: Any, + message_descriptor: Any, + key_checker: Any, + entry_descriptor: Any, + ) -> None: """ Args: message_listener: A MessageListener implementation. @@ -433,7 +496,7 @@ class MessageMap(collections.abc.MutableMapping): self._entry_descriptor = entry_descriptor self._values = {} - def __getitem__(self, key): + def __getitem__(self, key: _K) -> _V: key = self._key_checker.CheckValue(key) try: return self._values[key] @@ -442,10 +505,9 @@ class MessageMap(collections.abc.MutableMapping): new_element._SetListener(self._message_listener) self._values[key] = new_element self._message_listener.Modified() - return new_element - def get_or_create(self, key): + def get_or_create(self, key: _K) -> _V: """get_or_create() is an alias for getitem (ie. map[key]). Args: @@ -459,6 +521,14 @@ class MessageMap(collections.abc.MutableMapping): """ return self[key] + @overload + def get(self, key: _K) -> Optional[_V]: + ... + + @overload + def get(self, key: _K, default: _T) -> Union[_V, _T]: + ... + # We need to override this explicitly, because our defaultdict-like behavior # will make the default implementation (from our base class) always insert # the key. @@ -468,28 +538,28 @@ class MessageMap(collections.abc.MutableMapping): else: return default - def __contains__(self, item): + def __contains__(self, item: _K) -> bool: item = self._key_checker.CheckValue(item) return item in self._values - def __setitem__(self, key, value): + def __setitem__(self, key: _K, value: _V) -> NoReturn: raise ValueError('May not set values directly, call my_map[key].foo = 5') - def __delitem__(self, key): + def __delitem__(self, key: _K) -> None: key = self._key_checker.CheckValue(key) del self._values[key] self._message_listener.Modified() - def __len__(self): + def __len__(self) -> int: return len(self._values) - def __iter__(self): + def __iter__(self) -> Iterator[_K]: return iter(self._values) - def __repr__(self): + def __repr__(self) -> str: return repr(self._values) - def MergeFrom(self, other): + def MergeFrom(self, other: 'MessageMap[_K, _V]') -> None: # pylint: disable=protected-access for key in other._values: # According to documentation: "When parsing from the wire or when merging, @@ -500,7 +570,7 @@ class MessageMap(collections.abc.MutableMapping): # self._message_listener.Modified() not required here, because # mutations to submessages already propagate. - def InvalidateIterators(self): + def InvalidateIterators(self) -> None: # It appears that the only way to reliably invalidate iterators to # self._values is to ensure that its size changes. original = self._values @@ -508,16 +578,15 @@ class MessageMap(collections.abc.MutableMapping): original[None] = None # This is defined in the abstract base, but we can do it much more cheaply. - def clear(self): + def clear(self) -> None: self._values.clear() self._message_listener.Modified() - def GetEntryClass(self): + def GetEntryClass(self) -> Any: return self._entry_descriptor._concrete_class -class _UnknownField(object): - +class _UnknownField: """A parsed unknown field.""" # Disallows assignment to other attributes. @@ -542,12 +611,11 @@ class _UnknownField(object): self._data == other._data) -class UnknownFieldRef(object): +class UnknownFieldRef: # pylint: disable=missing-class-docstring def __init__(self, parent, index): self._parent = parent self._index = index - return def _check_valid(self): if not self._parent: @@ -576,8 +644,7 @@ class UnknownFieldRef(object): return self._parent._internal_get(self._index)._data -class UnknownFieldSet(object): - +class UnknownFieldSet: """UnknownField container""" # Disallows assignment to other attributes. diff --git a/windows/python/google/protobuf/internal/decoder.py b/windows/python/google/protobuf/internal/decoder.py index bc1b7b785..a91627631 100644 --- a/windows/python/google/protobuf/internal/decoder.py +++ b/windows/python/google/protobuf/internal/decoder.py @@ -831,6 +831,45 @@ def MessageSetItemDecoder(descriptor): return DecodeItem + +def UnknownMessageSetItemDecoder(): + """Returns a decoder for a Unknown MessageSet item.""" + + type_id_tag_bytes = encoder.TagBytes(2, wire_format.WIRETYPE_VARINT) + message_tag_bytes = encoder.TagBytes(3, wire_format.WIRETYPE_LENGTH_DELIMITED) + item_end_tag_bytes = encoder.TagBytes(1, wire_format.WIRETYPE_END_GROUP) + + def DecodeUnknownItem(buffer): + pos = 0 + end = len(buffer) + message_start = -1 + message_end = -1 + while 1: + (tag_bytes, pos) = ReadTag(buffer, pos) + if tag_bytes == type_id_tag_bytes: + (type_id, pos) = _DecodeVarint(buffer, pos) + elif tag_bytes == message_tag_bytes: + (size, message_start) = _DecodeVarint(buffer, pos) + pos = message_end = message_start + size + elif tag_bytes == item_end_tag_bytes: + break + else: + pos = SkipField(buffer, pos, end, tag_bytes) + if pos == -1: + raise _DecodeError('Missing group end tag.') + + if pos > end: + raise _DecodeError('Truncated message.') + + if type_id == -1: + raise _DecodeError('MessageSet item missing type_id.') + if message_start == -1: + raise _DecodeError('MessageSet item missing message.') + + return (type_id, buffer[message_start:message_end].tobytes()) + + return DecodeUnknownItem + # -------------------------------------------------------------------- def MapDecoder(field_descriptor, new_default, is_message_map): diff --git a/windows/python/google/protobuf/internal/descriptor_database_test.py b/windows/python/google/protobuf/internal/descriptor_database_test.py index ad3ca645f..3c086b924 100644 --- a/windows/python/google/protobuf/internal/descriptor_database_test.py +++ b/windows/python/google/protobuf/internal/descriptor_database_test.py @@ -100,7 +100,7 @@ class DescriptorDatabaseTest(unittest.TestCase): self.assertEqual(file_desc_proto2, db.FindFileContainingSymbol( 'protobuf_unittest.TestAllTypes.none_field')) - with self.assertRaisesRegexp(KeyError, r'\'protobuf_unittest\.NoneMessage\''): + with self.assertRaisesRegex(KeyError, r'\'protobuf_unittest\.NoneMessage\''): db.FindFileContainingSymbol('protobuf_unittest.NoneMessage') def testConflictRegister(self): diff --git a/windows/python/google/protobuf/internal/descriptor_pool_test.py b/windows/python/google/protobuf/internal/descriptor_pool_test.py index e59cf9b97..9e451b45b 100644 --- a/windows/python/google/protobuf/internal/descriptor_pool_test.py +++ b/windows/python/google/protobuf/internal/descriptor_pool_test.py @@ -243,10 +243,10 @@ class DescriptorPoolTestBase(object): self.assertRaises(KeyError, self.pool.FindMethodByName, '') # TODO(jieluo): Fix python to raise correct errors. - if api_implementation.Type() == 'cpp': - error_type = TypeError - else: + if api_implementation.Type() == 'python': error_type = AttributeError + else: + error_type = TypeError self.assertRaises(error_type, self.pool.FindMessageTypeByName, 0) self.assertRaises(error_type, self.pool.FindFieldByName, 0) self.assertRaises(error_type, self.pool.FindExtensionByName, 0) @@ -395,7 +395,7 @@ class DescriptorPoolTestBase(object): def testAddSerializedFile(self): if isinstance(self, SecondaryDescriptorFromDescriptorDB): - if api_implementation.Type() == 'cpp': + if api_implementation.Type() != 'python': # Cpp extension cannot call Add on a DescriptorPool # that uses a DescriptorDatabase. # TODO(jieluo): Fix python and cpp extension diff. @@ -434,7 +434,7 @@ class DescriptorPoolTestBase(object): _CheckDefaultValue(file_descriptor) if isinstance(self, SecondaryDescriptorFromDescriptorDB): - if api_implementation.Type() == 'cpp': + if api_implementation.Type() != 'python': # Cpp extension cannot call Add on a DescriptorPool # that uses a DescriptorDatabase. # TODO(jieluo): Fix python and cpp extension diff. @@ -488,7 +488,7 @@ class DescriptorPoolTestBase(object): def testAddFileDescriptor(self): if isinstance(self, SecondaryDescriptorFromDescriptorDB): - if api_implementation.Type() == 'cpp': + if api_implementation.Type() != 'python': # Cpp extension cannot call Add on a DescriptorPool # that uses a DescriptorDatabase. # TODO(jieluo): Fix python and cpp extension diff. @@ -499,7 +499,7 @@ class DescriptorPoolTestBase(object): def testComplexNesting(self): if isinstance(self, SecondaryDescriptorFromDescriptorDB): - if api_implementation.Type() == 'cpp': + if api_implementation.Type() != 'python': # Cpp extension cannot call Add on a DescriptorPool # that uses a DescriptorDatabase. # TODO(jieluo): Fix python and cpp extension diff. @@ -518,7 +518,7 @@ class DescriptorPoolTestBase(object): def testConflictRegister(self): if isinstance(self, SecondaryDescriptorFromDescriptorDB): - if api_implementation.Type() == 'cpp': + if api_implementation.Type() != 'python': # Cpp extension cannot call Add on a DescriptorPool # that uses a DescriptorDatabase. # TODO(jieluo): Fix python and cpp extension diff. @@ -527,7 +527,7 @@ class DescriptorPoolTestBase(object): unittest_pb2.DESCRIPTOR.serialized_pb) conflict_fd = copy.deepcopy(unittest_fd) conflict_fd.name = 'other_file' - if api_implementation.Type() == 'cpp': + if api_implementation.Type() != 'python': pass else: pool = copy.deepcopy(self.pool) @@ -541,7 +541,13 @@ class DescriptorPoolTestBase(object): pool._AddExtensionDescriptor( file_descriptor.extensions_by_name['optional_int32_extension']) pool.Add(unittest_fd) - pool.Add(conflict_fd) + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always') + pool.Add(conflict_fd) + self.assertTrue(len(w)) + self.assertIs(w[0].category, RuntimeWarning) + self.assertIn('Conflict register for file "other_file": ', + str(w[0].message)) pool.FindFileByName(unittest_fd.name) with self.assertRaises(TypeError): pool.FindFileByName(conflict_fd.name) @@ -648,11 +654,11 @@ class SecondaryDescriptorFromDescriptorDB(DescriptorPoolTestBase, enum_value.number = 0 self.db.Add(file_proto) - self.assertRaisesRegexp(KeyError, 'SubMessage', - self.pool.FindMessageTypeByName, - 'collector.ErrorMessage') - self.assertRaisesRegexp(KeyError, 'SubMessage', - self.pool.FindFileByName, 'error_file') + self.assertRaisesRegex(KeyError, 'SubMessage', + self.pool.FindMessageTypeByName, + 'collector.ErrorMessage') + self.assertRaisesRegex(KeyError, 'SubMessage', self.pool.FindFileByName, + 'error_file') with self.assertRaises(KeyError) as exc: self.pool.FindFileByName('none_file') self.assertIn(str(exc.exception), ('\'none_file\'', @@ -664,7 +670,7 @@ class SecondaryDescriptorFromDescriptorDB(DescriptorPoolTestBase, # called the first time, a KeyError will be raised but call the find # method later will return a descriptor which is not build. # TODO(jieluo): fix pure python to revert the load if file can not be build - if api_implementation.Type() == 'cpp': + if api_implementation.Type() != 'python': error_msg = ('Invalid proto descriptor for file "error_file":\\n ' 'collector.ErrorMessage.nested_message_field: "SubMessage" ' 'is not defined.\\n collector.ErrorMessage.MyOneof: Oneof ' @@ -900,8 +906,8 @@ class AddDescriptorTest(unittest.TestCase): pool.FindFileContainingSymbol( prefix + 'protobuf_unittest.TestAllTypes.NestedMessage').name) - @unittest.skipIf(api_implementation.Type() == 'cpp', - 'With the cpp implementation, Add() must be called first') + @unittest.skipIf(api_implementation.Type() != 'python', + 'Only pure python allows _Add*()') def testMessage(self): self._TestMessage('') self._TestMessage('.') @@ -942,14 +948,14 @@ class AddDescriptorTest(unittest.TestCase): pool.FindFileContainingSymbol( prefix + 'protobuf_unittest.TestAllTypes.NestedEnum').name) - @unittest.skipIf(api_implementation.Type() == 'cpp', - 'With the cpp implementation, Add() must be called first') + @unittest.skipIf(api_implementation.Type() != 'python', + 'Only pure python allows _Add*()') def testEnum(self): self._TestEnum('') self._TestEnum('.') - @unittest.skipIf(api_implementation.Type() == 'cpp', - 'With the cpp implementation, Add() must be called first') + @unittest.skipIf(api_implementation.Type() != 'python', + 'Only pure python allows _Add*()') def testService(self): pool = descriptor_pool.DescriptorPool() with self.assertRaises(KeyError): @@ -959,8 +965,8 @@ class AddDescriptorTest(unittest.TestCase): 'protobuf_unittest.TestService', pool.FindServiceByName('protobuf_unittest.TestService').full_name) - @unittest.skipIf(api_implementation.Type() == 'cpp', - 'With the cpp implementation, Add() must be called first') + @unittest.skipIf(api_implementation.Type() != 'python', + 'Only pure python allows _Add*()') def testFile(self): pool = descriptor_pool.DescriptorPool() pool._AddFileDescriptor(unittest_pb2.DESCRIPTOR) @@ -1037,7 +1043,7 @@ class AddDescriptorTest(unittest.TestCase): def testAddTypeError(self): pool = descriptor_pool.DescriptorPool() - if api_implementation.Type() == 'cpp': + if api_implementation.Type() != 'python': with self.assertRaises(TypeError): pool.AddDescriptor(0) with self.assertRaises(TypeError): diff --git a/windows/python/google/protobuf/internal/descriptor_pool_test1_pb2.py b/windows/python/google/protobuf/internal/descriptor_pool_test1_pb2.py index ffb131381..94624cd83 100644 --- a/windows/python/google/protobuf/internal/descriptor_pool_test1_pb2.py +++ b/windows/python/google/protobuf/internal/descriptor_pool_test1_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/descriptor_pool_test1.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,66 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n4google/protobuf/internal/descriptor_pool_test1.proto\x12\x1fgoogle.protobuf.python.internal\"\xfb\x05\n\x13\x44\x65scriptorPoolTest1\x12Z\n\x0bnested_enum\x18\x01 \x01(\x0e\x32?.google.protobuf.python.internal.DescriptorPoolTest1.NestedEnum:\x04\x42\x45TA\x12Z\n\x0enested_message\x18\x02 \x01(\x0b\x32\x42.google.protobuf.python.internal.DescriptorPoolTest1.NestedMessage\x1a\xfd\x03\n\rNestedMessage\x12h\n\x0bnested_enum\x18\x01 \x01(\x0e\x32M.google.protobuf.python.internal.DescriptorPoolTest1.NestedMessage.NestedEnum:\x04ZETA\x12\x1a\n\x0cnested_field\x18\x02 \x01(\t:\x04\x62\x65ta\x12q\n\x13\x64\x65\x65p_nested_message\x18\x03 \x01(\x0b\x32T.google.protobuf.python.internal.DescriptorPoolTest1.NestedMessage.DeepNestedMessage\x1a\xcd\x01\n\x11\x44\x65\x65pNestedMessage\x12y\n\x0bnested_enum\x18\x01 \x01(\x0e\x32_.google.protobuf.python.internal.DescriptorPoolTest1.NestedMessage.DeepNestedMessage.NestedEnum:\x03\x45TA\x12\x1b\n\x0cnested_field\x18\x02 \x01(\t:\x05theta\" \n\nNestedEnum\x12\x07\n\x03\x45TA\x10\x07\x12\t\n\x05THETA\x10\x08\"#\n\nNestedEnum\x12\x0b\n\x07\x45PSILON\x10\x05\x12\x08\n\x04ZETA\x10\x06\"!\n\nNestedEnum\x12\t\n\x05\x41LPHA\x10\x01\x12\x08\n\x04\x42\x45TA\x10\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xf1\x05\n\x13\x44\x65scriptorPoolTest2\x12[\n\x0bnested_enum\x18\x01 \x01(\x0e\x32?.google.protobuf.python.internal.DescriptorPoolTest2.NestedEnum:\x05GAMMA\x12Z\n\x0enested_message\x18\x02 \x01(\x0b\x32\x42.google.protobuf.python.internal.DescriptorPoolTest2.NestedMessage\x1a\xfc\x03\n\rNestedMessage\x12h\n\x0bnested_enum\x18\x01 \x01(\x0e\x32M.google.protobuf.python.internal.DescriptorPoolTest2.NestedMessage.NestedEnum:\x04IOTA\x12\x1b\n\x0cnested_field\x18\x02 \x01(\t:\x05\x64\x65lta\x12q\n\x13\x64\x65\x65p_nested_message\x18\x03 \x01(\x0b\x32T.google.protobuf.python.internal.DescriptorPoolTest2.NestedMessage.DeepNestedMessage\x1a\xcd\x01\n\x11\x44\x65\x65pNestedMessage\x12x\n\x0bnested_enum\x18\x01 \x01(\x0e\x32_.google.protobuf.python.internal.DescriptorPoolTest2.NestedMessage.DeepNestedMessage.NestedEnum:\x02MU\x12\x1c\n\x0cnested_field\x18\x02 \x01(\t:\x06lambda\" \n\nNestedEnum\x12\n\n\x06LAMBDA\x10\x0b\x12\x06\n\x02MU\x10\x0c\"!\n\nNestedEnum\x12\x08\n\x04IOTA\x10\t\x12\t\n\x05KAPPA\x10\n\"\"\n\nNestedEnum\x12\t\n\x05GAMMA\x10\x03\x12\t\n\x05\x44\x45LTA\x10\x04') - - -_DESCRIPTORPOOLTEST1 = DESCRIPTOR.message_types_by_name['DescriptorPoolTest1'] -_DESCRIPTORPOOLTEST1_NESTEDMESSAGE = _DESCRIPTORPOOLTEST1.nested_types_by_name['NestedMessage'] -_DESCRIPTORPOOLTEST1_NESTEDMESSAGE_DEEPNESTEDMESSAGE = _DESCRIPTORPOOLTEST1_NESTEDMESSAGE.nested_types_by_name['DeepNestedMessage'] -_DESCRIPTORPOOLTEST2 = DESCRIPTOR.message_types_by_name['DescriptorPoolTest2'] -_DESCRIPTORPOOLTEST2_NESTEDMESSAGE = _DESCRIPTORPOOLTEST2.nested_types_by_name['NestedMessage'] -_DESCRIPTORPOOLTEST2_NESTEDMESSAGE_DEEPNESTEDMESSAGE = _DESCRIPTORPOOLTEST2_NESTEDMESSAGE.nested_types_by_name['DeepNestedMessage'] -_DESCRIPTORPOOLTEST1_NESTEDMESSAGE_DEEPNESTEDMESSAGE_NESTEDENUM = _DESCRIPTORPOOLTEST1_NESTEDMESSAGE_DEEPNESTEDMESSAGE.enum_types_by_name['NestedEnum'] -_DESCRIPTORPOOLTEST1_NESTEDMESSAGE_NESTEDENUM = _DESCRIPTORPOOLTEST1_NESTEDMESSAGE.enum_types_by_name['NestedEnum'] -_DESCRIPTORPOOLTEST1_NESTEDENUM = _DESCRIPTORPOOLTEST1.enum_types_by_name['NestedEnum'] -_DESCRIPTORPOOLTEST2_NESTEDMESSAGE_DEEPNESTEDMESSAGE_NESTEDENUM = _DESCRIPTORPOOLTEST2_NESTEDMESSAGE_DEEPNESTEDMESSAGE.enum_types_by_name['NestedEnum'] -_DESCRIPTORPOOLTEST2_NESTEDMESSAGE_NESTEDENUM = _DESCRIPTORPOOLTEST2_NESTEDMESSAGE.enum_types_by_name['NestedEnum'] -_DESCRIPTORPOOLTEST2_NESTEDENUM = _DESCRIPTORPOOLTEST2.enum_types_by_name['NestedEnum'] -DescriptorPoolTest1 = _reflection.GeneratedProtocolMessageType('DescriptorPoolTest1', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - - 'DeepNestedMessage' : _reflection.GeneratedProtocolMessageType('DeepNestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _DESCRIPTORPOOLTEST1_NESTEDMESSAGE_DEEPNESTEDMESSAGE, - '__module__' : 'google.protobuf.internal.descriptor_pool_test1_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.DescriptorPoolTest1.NestedMessage.DeepNestedMessage) - }) - , - 'DESCRIPTOR' : _DESCRIPTORPOOLTEST1_NESTEDMESSAGE, - '__module__' : 'google.protobuf.internal.descriptor_pool_test1_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.DescriptorPoolTest1.NestedMessage) - }) - , - 'DESCRIPTOR' : _DESCRIPTORPOOLTEST1, - '__module__' : 'google.protobuf.internal.descriptor_pool_test1_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.DescriptorPoolTest1) - }) -_sym_db.RegisterMessage(DescriptorPoolTest1) -_sym_db.RegisterMessage(DescriptorPoolTest1.NestedMessage) -_sym_db.RegisterMessage(DescriptorPoolTest1.NestedMessage.DeepNestedMessage) - -DescriptorPoolTest2 = _reflection.GeneratedProtocolMessageType('DescriptorPoolTest2', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - - 'DeepNestedMessage' : _reflection.GeneratedProtocolMessageType('DeepNestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _DESCRIPTORPOOLTEST2_NESTEDMESSAGE_DEEPNESTEDMESSAGE, - '__module__' : 'google.protobuf.internal.descriptor_pool_test1_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.DescriptorPoolTest2.NestedMessage.DeepNestedMessage) - }) - , - 'DESCRIPTOR' : _DESCRIPTORPOOLTEST2_NESTEDMESSAGE, - '__module__' : 'google.protobuf.internal.descriptor_pool_test1_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.DescriptorPoolTest2.NestedMessage) - }) - , - 'DESCRIPTOR' : _DESCRIPTORPOOLTEST2, - '__module__' : 'google.protobuf.internal.descriptor_pool_test1_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.DescriptorPoolTest2) - }) -_sym_db.RegisterMessage(DescriptorPoolTest2) -_sym_db.RegisterMessage(DescriptorPoolTest2.NestedMessage) -_sym_db.RegisterMessage(DescriptorPoolTest2.NestedMessage.DeepNestedMessage) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.descriptor_pool_test1_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/internal/descriptor_pool_test2_pb2.py b/windows/python/google/protobuf/internal/descriptor_pool_test2_pb2.py index 781d66a8c..253ab469a 100644 --- a/windows/python/google/protobuf/internal/descriptor_pool_test2_pb2.py +++ b/windows/python/google/protobuf/internal/descriptor_pool_test2_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/descriptor_pool_test2.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -19,37 +18,8 @@ from google.protobuf.internal.more_messages_pb2 import * DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n4google/protobuf/internal/descriptor_pool_test2.proto\x12\x1fgoogle.protobuf.python.internal\x1a\x34google/protobuf/internal/descriptor_pool_test1.proto\x1a,google/protobuf/internal/more_messages.proto\"\xef\x06\n\x13\x44\x65scriptorPoolTest3\x12X\n\x0bnested_enum\x18\x01 \x01(\x0e\x32?.google.protobuf.python.internal.DescriptorPoolTest3.NestedEnum:\x02XI\x12Z\n\x0enested_message\x18\x02 \x01(\x0b\x32\x42.google.protobuf.python.internal.DescriptorPoolTest3.NestedMessage\x1a\xf7\x03\n\rNestedMessage\x12\x66\n\x0bnested_enum\x18\x01 \x01(\x0e\x32M.google.protobuf.python.internal.DescriptorPoolTest3.NestedMessage.NestedEnum:\x02PI\x12\x18\n\x0cnested_field\x18\x02 \x01(\t:\x02nu\x12q\n\x13\x64\x65\x65p_nested_message\x18\x03 \x01(\x0b\x32T.google.protobuf.python.internal.DescriptorPoolTest3.NestedMessage.DeepNestedMessage\x1a\xcd\x01\n\x11\x44\x65\x65pNestedMessage\x12y\n\x0bnested_enum\x18\x01 \x01(\x0e\x32_.google.protobuf.python.internal.DescriptorPoolTest3.NestedMessage.DeepNestedMessage.NestedEnum:\x03RHO\x12\x1b\n\x0cnested_field\x18\x02 \x01(\t:\x05sigma\" \n\nNestedEnum\x12\x07\n\x03RHO\x10\x11\x12\t\n\x05SIGMA\x10\x12\"!\n\nNestedEnum\x12\x0b\n\x07OMICRON\x10\x0f\x12\x06\n\x02PI\x10\x10\"\x1c\n\nNestedEnum\x12\x06\n\x02NU\x10\r\x12\x06\n\x02XI\x10\x0e\x32\x89\x01\n\x14\x64\x65scriptor_pool_test\x12\x34.google.protobuf.python.internal.DescriptorPoolTest1\x18\xe9\x07 \x01(\x0b\x32\x34.google.protobuf.python.internal.DescriptorPoolTest3P\x01') - - -_DESCRIPTORPOOLTEST3 = DESCRIPTOR.message_types_by_name['DescriptorPoolTest3'] -_DESCRIPTORPOOLTEST3_NESTEDMESSAGE = _DESCRIPTORPOOLTEST3.nested_types_by_name['NestedMessage'] -_DESCRIPTORPOOLTEST3_NESTEDMESSAGE_DEEPNESTEDMESSAGE = _DESCRIPTORPOOLTEST3_NESTEDMESSAGE.nested_types_by_name['DeepNestedMessage'] -_DESCRIPTORPOOLTEST3_NESTEDMESSAGE_DEEPNESTEDMESSAGE_NESTEDENUM = _DESCRIPTORPOOLTEST3_NESTEDMESSAGE_DEEPNESTEDMESSAGE.enum_types_by_name['NestedEnum'] -_DESCRIPTORPOOLTEST3_NESTEDMESSAGE_NESTEDENUM = _DESCRIPTORPOOLTEST3_NESTEDMESSAGE.enum_types_by_name['NestedEnum'] -_DESCRIPTORPOOLTEST3_NESTEDENUM = _DESCRIPTORPOOLTEST3.enum_types_by_name['NestedEnum'] -DescriptorPoolTest3 = _reflection.GeneratedProtocolMessageType('DescriptorPoolTest3', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - - 'DeepNestedMessage' : _reflection.GeneratedProtocolMessageType('DeepNestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _DESCRIPTORPOOLTEST3_NESTEDMESSAGE_DEEPNESTEDMESSAGE, - '__module__' : 'google.protobuf.internal.descriptor_pool_test2_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.DescriptorPoolTest3.NestedMessage.DeepNestedMessage) - }) - , - 'DESCRIPTOR' : _DESCRIPTORPOOLTEST3_NESTEDMESSAGE, - '__module__' : 'google.protobuf.internal.descriptor_pool_test2_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.DescriptorPoolTest3.NestedMessage) - }) - , - 'DESCRIPTOR' : _DESCRIPTORPOOLTEST3, - '__module__' : 'google.protobuf.internal.descriptor_pool_test2_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.DescriptorPoolTest3) - }) -_sym_db.RegisterMessage(DescriptorPoolTest3) -_sym_db.RegisterMessage(DescriptorPoolTest3.NestedMessage) -_sym_db.RegisterMessage(DescriptorPoolTest3.NestedMessage.DeepNestedMessage) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.descriptor_pool_test2_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: google_dot_protobuf_dot_internal_dot_descriptor__pool__test1__pb2.DescriptorPoolTest1.RegisterExtension(_DESCRIPTORPOOLTEST3.extensions_by_name['descriptor_pool_test']) diff --git a/windows/python/google/protobuf/internal/descriptor_test.py b/windows/python/google/protobuf/internal/descriptor_test.py index 88d7136bc..6a8532c40 100644 --- a/windows/python/google/protobuf/internal/descriptor_test.py +++ b/windows/python/google/protobuf/internal/descriptor_test.py @@ -51,6 +51,28 @@ TEST_EMPTY_MESSAGE_DESCRIPTOR_ASCII = """ name: 'TestEmptyMessage' """ +TEST_FILE_DESCRIPTOR_DEBUG = """syntax = "proto2"; + +package protobuf_unittest; + +message NestedMessage { + enum ForeignEnum { + FOREIGN_FOO = 4; + FOREIGN_BAR = 5; + FOREIGN_BAZ = 6; + } + optional int32 bb = 1; +} + +message ResponseMessage { +} + +service Service { + rpc CallMethod(.protobuf_unittest.NestedMessage) returns (.protobuf_unittest.ResponseMessage); +} + +""" + warnings.simplefilter('error', DeprecationWarning) @@ -121,6 +143,13 @@ class DescriptorTest(unittest.TestCase): def testContainingServiceFixups(self): self.assertEqual(self.my_service, self.my_method.containing_service) + @unittest.skipIf( + api_implementation.Type() == 'python', + 'GetDebugString is only available with the cpp implementation', + ) + def testGetDebugString(self): + self.assertEqual(self.my_file.GetDebugString(), TEST_FILE_DESCRIPTOR_DEBUG) + def testGetOptions(self): self.assertEqual(self.my_enum.GetOptions(), descriptor_pb2.EnumOptions()) @@ -299,10 +328,10 @@ class DescriptorTest(unittest.TestCase): unittest_custom_options_pb2.complex_opt1].foo) self.assertEqual(324, options.Extensions[ unittest_custom_options_pb2.complex_opt1].Extensions[ - unittest_custom_options_pb2.quux]) + unittest_custom_options_pb2.mooo]) self.assertEqual(876, options.Extensions[ unittest_custom_options_pb2.complex_opt1].Extensions[ - unittest_custom_options_pb2.corge].qux) + unittest_custom_options_pb2.corge].moo) self.assertEqual(987, options.Extensions[ unittest_custom_options_pb2.complex_opt2].baz) self.assertEqual(654, options.Extensions[ @@ -312,28 +341,28 @@ class DescriptorTest(unittest.TestCase): unittest_custom_options_pb2.complex_opt2].bar.foo) self.assertEqual(1999, options.Extensions[ unittest_custom_options_pb2.complex_opt2].bar.Extensions[ - unittest_custom_options_pb2.quux]) + unittest_custom_options_pb2.mooo]) self.assertEqual(2008, options.Extensions[ unittest_custom_options_pb2.complex_opt2].bar.Extensions[ - unittest_custom_options_pb2.corge].qux) + unittest_custom_options_pb2.corge].moo) self.assertEqual(741, options.Extensions[ unittest_custom_options_pb2.complex_opt2].Extensions[ unittest_custom_options_pb2.garply].foo) self.assertEqual(1998, options.Extensions[ unittest_custom_options_pb2.complex_opt2].Extensions[ unittest_custom_options_pb2.garply].Extensions[ - unittest_custom_options_pb2.quux]) + unittest_custom_options_pb2.mooo]) self.assertEqual(2121, options.Extensions[ unittest_custom_options_pb2.complex_opt2].Extensions[ unittest_custom_options_pb2.garply].Extensions[ - unittest_custom_options_pb2.corge].qux) + unittest_custom_options_pb2.corge].moo) self.assertEqual(1971, options.Extensions[ unittest_custom_options_pb2.ComplexOptionType2 .ComplexOptionType4.complex_opt4].waldo) self.assertEqual(321, options.Extensions[ unittest_custom_options_pb2.complex_opt2].fred.waldo) self.assertEqual(9, options.Extensions[ - unittest_custom_options_pb2.complex_opt3].qux) + unittest_custom_options_pb2.complex_opt3].moo) self.assertEqual(22, options.Extensions[ unittest_custom_options_pb2.complex_opt3].complexoptiontype5.plugh) self.assertEqual(24, options.Extensions[ @@ -428,7 +457,7 @@ class DescriptorTest(unittest.TestCase): self.assertEqual(unittest_pb2.DESCRIPTOR.pool, descriptor_pool.Default()) @unittest.skipIf( - api_implementation.Type() != 'cpp' or api_implementation.Version() != 2, + api_implementation.Type() == 'python', 'Immutability of descriptors is only enforced in v2 implementation') def testImmutableCppDescriptor(self): file_descriptor = unittest_pb2.DESCRIPTOR @@ -523,6 +552,7 @@ class GeneratedDescriptorTest(unittest.TestCase): self.assertIn(field_descriptor, {field_descriptor: None}) self.assertEqual(None, field_descriptor.extension_scope) self.assertEqual(None, field_descriptor.enum_type) + self.assertTrue(field_descriptor.has_presence) if api_implementation.Type() == 'cpp': # For test coverage only self.assertEqual(field_descriptor.id, field_descriptor.id) diff --git a/windows/python/google/protobuf/internal/enum_type_wrapper.py b/windows/python/google/protobuf/internal/enum_type_wrapper.py index 9a53999a4..65d2c7a5c 100644 --- a/windows/python/google/protobuf/internal/enum_type_wrapper.py +++ b/windows/python/google/protobuf/internal/enum_type_wrapper.py @@ -43,6 +43,15 @@ class EnumTypeWrapper(object): DESCRIPTOR = None + # This is a type alias, which mypy typing stubs can type as + # a genericized parameter constrained to an int, allowing subclasses + # to be typed with more constraint in .pyi stubs + # Eg. + # def MyGeneratedEnum(Message): + # ValueType = NewType('ValueType', int) + # def Name(self, number: MyGeneratedEnum.ValueType) -> str + ValueType = int + def __init__(self, enum_type): """Inits EnumTypeWrapper with an EnumDescriptor.""" self._enum_type = enum_type diff --git a/windows/python/google/protobuf/internal/factory_test1_pb2.py b/windows/python/google/protobuf/internal/factory_test1_pb2.py index 27ce3f48c..61be572ea 100644 --- a/windows/python/google/protobuf/internal/factory_test1_pb2.py +++ b/windows/python/google/protobuf/internal/factory_test1_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/factory_test1.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,47 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,google/protobuf/internal/factory_test1.proto\x12\x1fgoogle.protobuf.python.internal\"\xd5\x03\n\x0f\x46\x61\x63tory1Message\x12\x45\n\x0e\x66\x61\x63tory_1_enum\x18\x01 \x01(\x0e\x32-.google.protobuf.python.internal.Factory1Enum\x12\x62\n\x15nested_factory_1_enum\x18\x02 \x01(\x0e\x32\x43.google.protobuf.python.internal.Factory1Message.NestedFactory1Enum\x12h\n\x18nested_factory_1_message\x18\x03 \x01(\x0b\x32\x46.google.protobuf.python.internal.Factory1Message.NestedFactory1Message\x12\x14\n\x0cscalar_value\x18\x04 \x01(\x05\x12\x12\n\nlist_value\x18\x05 \x03(\t\x1a&\n\x15NestedFactory1Message\x12\r\n\x05value\x18\x01 \x01(\t\"P\n\x12NestedFactory1Enum\x12\x1c\n\x18NESTED_FACTORY_1_VALUE_0\x10\x00\x12\x1c\n\x18NESTED_FACTORY_1_VALUE_1\x10\x01*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\")\n\x15\x46\x61\x63tory1MethodRequest\x12\x10\n\x08\x61rgument\x18\x01 \x01(\t\"(\n\x16\x46\x61\x63tory1MethodResponse\x12\x0e\n\x06result\x18\x01 \x01(\t*<\n\x0c\x46\x61\x63tory1Enum\x12\x15\n\x11\x46\x41\x43TORY_1_VALUE_0\x10\x00\x12\x15\n\x11\x46\x41\x43TORY_1_VALUE_1\x10\x01\x32\x97\x01\n\x0f\x46\x61\x63tory1Service\x12\x83\x01\n\x0e\x46\x61\x63tory1Method\x12\x36.google.protobuf.python.internal.Factory1MethodRequest\x1a\x37.google.protobuf.python.internal.Factory1MethodResponse\"\x00') -_FACTORY1ENUM = DESCRIPTOR.enum_types_by_name['Factory1Enum'] -Factory1Enum = enum_type_wrapper.EnumTypeWrapper(_FACTORY1ENUM) -FACTORY_1_VALUE_0 = 0 -FACTORY_1_VALUE_1 = 1 - - -_FACTORY1MESSAGE = DESCRIPTOR.message_types_by_name['Factory1Message'] -_FACTORY1MESSAGE_NESTEDFACTORY1MESSAGE = _FACTORY1MESSAGE.nested_types_by_name['NestedFactory1Message'] -_FACTORY1METHODREQUEST = DESCRIPTOR.message_types_by_name['Factory1MethodRequest'] -_FACTORY1METHODRESPONSE = DESCRIPTOR.message_types_by_name['Factory1MethodResponse'] -_FACTORY1MESSAGE_NESTEDFACTORY1ENUM = _FACTORY1MESSAGE.enum_types_by_name['NestedFactory1Enum'] -Factory1Message = _reflection.GeneratedProtocolMessageType('Factory1Message', (_message.Message,), { - - 'NestedFactory1Message' : _reflection.GeneratedProtocolMessageType('NestedFactory1Message', (_message.Message,), { - 'DESCRIPTOR' : _FACTORY1MESSAGE_NESTEDFACTORY1MESSAGE, - '__module__' : 'google.protobuf.internal.factory_test1_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.Factory1Message.NestedFactory1Message) - }) - , - 'DESCRIPTOR' : _FACTORY1MESSAGE, - '__module__' : 'google.protobuf.internal.factory_test1_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.Factory1Message) - }) -_sym_db.RegisterMessage(Factory1Message) -_sym_db.RegisterMessage(Factory1Message.NestedFactory1Message) - -Factory1MethodRequest = _reflection.GeneratedProtocolMessageType('Factory1MethodRequest', (_message.Message,), { - 'DESCRIPTOR' : _FACTORY1METHODREQUEST, - '__module__' : 'google.protobuf.internal.factory_test1_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.Factory1MethodRequest) - }) -_sym_db.RegisterMessage(Factory1MethodRequest) - -Factory1MethodResponse = _reflection.GeneratedProtocolMessageType('Factory1MethodResponse', (_message.Message,), { - 'DESCRIPTOR' : _FACTORY1METHODRESPONSE, - '__module__' : 'google.protobuf.internal.factory_test1_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.Factory1MethodResponse) - }) -_sym_db.RegisterMessage(Factory1MethodResponse) - -_FACTORY1SERVICE = DESCRIPTOR.services_by_name['Factory1Service'] +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.factory_test1_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/internal/factory_test2_pb2.py b/windows/python/google/protobuf/internal/factory_test2_pb2.py index 583dfdf57..d16708486 100644 --- a/windows/python/google/protobuf/internal/factory_test2_pb2.py +++ b/windows/python/google/protobuf/internal/factory_test2_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/factory_test2.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -18,66 +16,8 @@ from google.protobuf.internal import factory_test1_pb2 as google_dot_protobuf_do DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,google/protobuf/internal/factory_test2.proto\x12\x1fgoogle.protobuf.python.internal\x1a,google/protobuf/internal/factory_test1.proto\"\xd8\x0b\n\x0f\x46\x61\x63tory2Message\x12\x11\n\tmandatory\x18\x01 \x02(\x05\x12\x45\n\x0e\x66\x61\x63tory_2_enum\x18\x02 \x01(\x0e\x32-.google.protobuf.python.internal.Factory2Enum\x12\x62\n\x15nested_factory_2_enum\x18\x03 \x01(\x0e\x32\x43.google.protobuf.python.internal.Factory2Message.NestedFactory2Enum\x12h\n\x18nested_factory_2_message\x18\x04 \x01(\x0b\x32\x46.google.protobuf.python.internal.Factory2Message.NestedFactory2Message\x12K\n\x11\x66\x61\x63tory_1_message\x18\x05 \x01(\x0b\x32\x30.google.protobuf.python.internal.Factory1Message\x12\x45\n\x0e\x66\x61\x63tory_1_enum\x18\x06 \x01(\x0e\x32-.google.protobuf.python.internal.Factory1Enum\x12\x62\n\x15nested_factory_1_enum\x18\x07 \x01(\x0e\x32\x43.google.protobuf.python.internal.Factory1Message.NestedFactory1Enum\x12h\n\x18nested_factory_1_message\x18\x08 \x01(\x0b\x32\x46.google.protobuf.python.internal.Factory1Message.NestedFactory1Message\x12J\n\x10\x63ircular_message\x18\t \x01(\x0b\x32\x30.google.protobuf.python.internal.Factory2Message\x12\x14\n\x0cscalar_value\x18\n \x01(\t\x12\x12\n\nlist_value\x18\x0b \x03(\t\x12I\n\x07grouped\x18\x0c \x03(\n28.google.protobuf.python.internal.Factory2Message.Grouped\x12:\n\x04loop\x18\x0f \x01(\x0b\x32,.google.protobuf.python.internal.LoopMessage\x12\x1e\n\x10int_with_default\x18\x10 \x01(\x05:\x04\x31\x37\x37\x36\x12!\n\x13\x64ouble_with_default\x18\x11 \x01(\x01:\x04\x39.99\x12(\n\x13string_with_default\x18\x12 \x01(\t:\x0bhello world\x12 \n\x11\x62ool_with_default\x18\x13 \x01(\x08:\x05\x66\x61lse\x12[\n\x11\x65num_with_default\x18\x14 \x01(\x0e\x32-.google.protobuf.python.internal.Factory2Enum:\x11\x46\x41\x43TORY_2_VALUE_1\x12&\n\x12\x62ytes_with_default\x18\x15 \x01(\x0c:\na\\373\\000c\x12\x13\n\toneof_int\x18\x16 \x01(\x05H\x00\x12\x16\n\x0coneof_string\x18\x17 \x01(\tH\x00\x1a&\n\x15NestedFactory2Message\x12\r\n\x05value\x18\x01 \x01(\t\x1a)\n\x07Grouped\x12\x0e\n\x06part_1\x18\r \x01(\t\x12\x0e\n\x06part_2\x18\x0e \x01(\t\"P\n\x12NestedFactory2Enum\x12\x1c\n\x18NESTED_FACTORY_2_VALUE_0\x10\x00\x12\x1c\n\x18NESTED_FACTORY_2_VALUE_1\x10\x01\x32I\n\x0eone_more_field\x12\x30.google.protobuf.python.internal.Factory1Message\x18\xe9\x07 \x01(\tB\r\n\x0boneof_field\"M\n\x0bLoopMessage\x12>\n\x04loop\x18\x01 \x01(\x0b\x32\x30.google.protobuf.python.internal.Factory2Message\"D\n\x19MessageWithNestedEnumOnly\"\'\n\nNestedEnum\x12\x19\n\x15NESTED_MESSAGE_ENUM_0\x10\x00\"\'\n\x11MessageWithOption\x12\x0e\n\x06\x66ield1\x18\x01 \x01(\x05:\x02\x10\x01*<\n\x0c\x46\x61\x63tory2Enum\x12\x15\n\x11\x46\x41\x43TORY_2_VALUE_0\x10\x00\x12\x15\n\x11\x46\x41\x43TORY_2_VALUE_1\x10\x01:H\n\ranother_field\x12\x30.google.protobuf.python.internal.Factory1Message\x18\xea\x07 \x01(\t') -_FACTORY2ENUM = DESCRIPTOR.enum_types_by_name['Factory2Enum'] -Factory2Enum = enum_type_wrapper.EnumTypeWrapper(_FACTORY2ENUM) -FACTORY_2_VALUE_0 = 0 -FACTORY_2_VALUE_1 = 1 - -ANOTHER_FIELD_FIELD_NUMBER = 1002 -another_field = DESCRIPTOR.extensions_by_name['another_field'] - -_FACTORY2MESSAGE = DESCRIPTOR.message_types_by_name['Factory2Message'] -_FACTORY2MESSAGE_NESTEDFACTORY2MESSAGE = _FACTORY2MESSAGE.nested_types_by_name['NestedFactory2Message'] -_FACTORY2MESSAGE_GROUPED = _FACTORY2MESSAGE.nested_types_by_name['Grouped'] -_LOOPMESSAGE = DESCRIPTOR.message_types_by_name['LoopMessage'] -_MESSAGEWITHNESTEDENUMONLY = DESCRIPTOR.message_types_by_name['MessageWithNestedEnumOnly'] -_MESSAGEWITHOPTION = DESCRIPTOR.message_types_by_name['MessageWithOption'] -_FACTORY2MESSAGE_NESTEDFACTORY2ENUM = _FACTORY2MESSAGE.enum_types_by_name['NestedFactory2Enum'] -_MESSAGEWITHNESTEDENUMONLY_NESTEDENUM = _MESSAGEWITHNESTEDENUMONLY.enum_types_by_name['NestedEnum'] -Factory2Message = _reflection.GeneratedProtocolMessageType('Factory2Message', (_message.Message,), { - - 'NestedFactory2Message' : _reflection.GeneratedProtocolMessageType('NestedFactory2Message', (_message.Message,), { - 'DESCRIPTOR' : _FACTORY2MESSAGE_NESTEDFACTORY2MESSAGE, - '__module__' : 'google.protobuf.internal.factory_test2_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.Factory2Message.NestedFactory2Message) - }) - , - - 'Grouped' : _reflection.GeneratedProtocolMessageType('Grouped', (_message.Message,), { - 'DESCRIPTOR' : _FACTORY2MESSAGE_GROUPED, - '__module__' : 'google.protobuf.internal.factory_test2_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.Factory2Message.Grouped) - }) - , - 'DESCRIPTOR' : _FACTORY2MESSAGE, - '__module__' : 'google.protobuf.internal.factory_test2_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.Factory2Message) - }) -_sym_db.RegisterMessage(Factory2Message) -_sym_db.RegisterMessage(Factory2Message.NestedFactory2Message) -_sym_db.RegisterMessage(Factory2Message.Grouped) - -LoopMessage = _reflection.GeneratedProtocolMessageType('LoopMessage', (_message.Message,), { - 'DESCRIPTOR' : _LOOPMESSAGE, - '__module__' : 'google.protobuf.internal.factory_test2_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.LoopMessage) - }) -_sym_db.RegisterMessage(LoopMessage) - -MessageWithNestedEnumOnly = _reflection.GeneratedProtocolMessageType('MessageWithNestedEnumOnly', (_message.Message,), { - 'DESCRIPTOR' : _MESSAGEWITHNESTEDENUMONLY, - '__module__' : 'google.protobuf.internal.factory_test2_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.MessageWithNestedEnumOnly) - }) -_sym_db.RegisterMessage(MessageWithNestedEnumOnly) - -MessageWithOption = _reflection.GeneratedProtocolMessageType('MessageWithOption', (_message.Message,), { - 'DESCRIPTOR' : _MESSAGEWITHOPTION, - '__module__' : 'google.protobuf.internal.factory_test2_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.MessageWithOption) - }) -_sym_db.RegisterMessage(MessageWithOption) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.factory_test2_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: google_dot_protobuf_dot_internal_dot_factory__test1__pb2.Factory1Message.RegisterExtension(another_field) google_dot_protobuf_dot_internal_dot_factory__test1__pb2.Factory1Message.RegisterExtension(_FACTORY2MESSAGE.extensions_by_name['one_more_field']) diff --git a/windows/python/google/protobuf/internal/file_options_test_pb2.py b/windows/python/google/protobuf/internal/file_options_test_pb2.py index fdb3aa820..a9d75ff6b 100644 --- a/windows/python/google/protobuf/internal/file_options_test_pb2.py +++ b/windows/python/google/protobuf/internal/file_options_test_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/file_options_test.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,18 +16,8 @@ from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0google/protobuf/internal/file_options_test.proto\x12\x1fgoogle.protobuf.python.internal\x1a google/protobuf/descriptor.proto\"\x1e\n\nFooOptions\x12\x10\n\x08\x66oo_name\x18\x01 \x01(\t:a\n\x0b\x66oo_options\x12\x1c.google.protobuf.FileOptions\x18\xac\xec\xb6\x39 \x01(\x0b\x32+.google.protobuf.python.internal.FooOptions') - -FOO_OPTIONS_FIELD_NUMBER = 120436268 -foo_options = DESCRIPTOR.extensions_by_name['foo_options'] - -_FOOOPTIONS = DESCRIPTOR.message_types_by_name['FooOptions'] -FooOptions = _reflection.GeneratedProtocolMessageType('FooOptions', (_message.Message,), { - 'DESCRIPTOR' : _FOOOPTIONS, - '__module__' : 'google.protobuf.internal.file_options_test_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.FooOptions) - }) -_sym_db.RegisterMessage(FooOptions) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.file_options_test_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(foo_options) diff --git a/windows/python/google/protobuf/internal/generator_test.py b/windows/python/google/protobuf/internal/generator_test.py index 0c4299a3d..9883fce31 100644 --- a/windows/python/google/protobuf/internal/generator_test.py +++ b/windows/python/google/protobuf/internal/generator_test.py @@ -39,10 +39,7 @@ further ensures that we can use Python protocol message objects as we expect. __author__ = 'robinson@google.com (Will Robinson)' -try: - import unittest2 as unittest #PY26 -except ImportError: - import unittest +import unittest from google.protobuf.internal import test_bad_identifiers_pb2 from google.protobuf import unittest_custom_options_pb2 diff --git a/windows/python/google/protobuf/internal/import_test.py b/windows/python/google/protobuf/internal/import_test.py new file mode 100644 index 000000000..b5c572cfc --- /dev/null +++ b/windows/python/google/protobuf/internal/import_test.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Protocol Buffers - Google's data interchange format +# Copyright 2008 Google Inc. All rights reserved. +# https://developers.google.com/protocol-buffers/ +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Unittest for nested public imports.""" + +import unittest + +from google.protobuf.internal.import_test_package import outer_pb2 + + +class ImportTest(unittest.TestCase): + + def testPackageInitializationImport(self): + """Test that we can import nested import public messages.""" + + msg = outer_pb2.Outer() + self.assertEqual(58, msg.import_public_nested.value) + + +if __name__ == '__main__': + unittest.main() diff --git a/windows/python/google/protobuf/internal/import_test_package/import_public.proto b/windows/python/google/protobuf/internal/import_test_package/import_public.proto new file mode 100644 index 000000000..8774702d7 --- /dev/null +++ b/windows/python/google/protobuf/internal/import_test_package/import_public.proto @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// A proto file which is imported by inner.proto to test public importing. + +syntax = "proto2"; + +package google.protobuf.python.internal.import_test_package; + +option optimize_for = SPEED; + +// Test nested public import +import public "google/protobuf/internal/import_test_package/import_public_nested.proto"; diff --git a/windows/python/google/protobuf/internal/import_test_package/import_public_nested.proto b/windows/python/google/protobuf/internal/import_test_package/import_public_nested.proto new file mode 100644 index 000000000..fcf4d6827 --- /dev/null +++ b/windows/python/google/protobuf/internal/import_test_package/import_public_nested.proto @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// A proto file which is imported by import_public.proto to test nested public +// importing. + +syntax = "proto2"; + +package google.protobuf.python.internal.import_test_package; + +message ImportPublicNestedMessage { + optional int32 value = 1 [default = 58]; +} diff --git a/windows/python/google/protobuf/internal/import_test_package/import_public_nested_pb2.py b/windows/python/google/protobuf/internal/import_test_package/import_public_nested_pb2.py new file mode 100644 index 000000000..e0d4425e7 --- /dev/null +++ b/windows/python/google/protobuf/internal/import_test_package/import_public_nested_pb2.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/internal/import_test_package/import_public_nested.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nGgoogle/protobuf/internal/import_test_package/import_public_nested.proto\x12\x33google.protobuf.python.internal.import_test_package\".\n\x19ImportPublicNestedMessage\x12\x11\n\x05value\x18\x01 \x01(\x05:\x02\x35\x38') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.import_test_package.import_public_nested_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _IMPORTPUBLICNESTEDMESSAGE._serialized_start=128 + _IMPORTPUBLICNESTEDMESSAGE._serialized_end=174 +# @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/internal/import_test_package/import_public_pb2.py b/windows/python/google/protobuf/internal/import_test_package/import_public_pb2.py new file mode 100644 index 000000000..5d5a1e3f2 --- /dev/null +++ b/windows/python/google/protobuf/internal/import_test_package/import_public_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/internal/import_test_package/import_public.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf.internal.import_test_package import import_public_nested_pb2 as google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__nested__pb2 + +from google.protobuf.internal.import_test_package.import_public_nested_pb2 import * + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n@google/protobuf/internal/import_test_package/import_public.proto\x12\x33google.protobuf.python.internal.import_test_package\x1aGgoogle/protobuf/internal/import_test_package/import_public_nested.protoB\x02H\x01P\x00') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.import_test_package.import_public_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'H\001' +# @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/internal/import_test_package/inner.proto b/windows/python/google/protobuf/internal/import_test_package/inner.proto index 2887c1230..f20c22e18 100644 --- a/windows/python/google/protobuf/internal/import_test_package/inner.proto +++ b/windows/python/google/protobuf/internal/import_test_package/inner.proto @@ -32,6 +32,9 @@ syntax = "proto2"; package google.protobuf.python.internal.import_test_package; +// Test public import +import public "google/protobuf/internal/import_test_package/import_public.proto"; + message Inner { optional int32 value = 1 [default = 57]; } diff --git a/windows/python/google/protobuf/internal/import_test_package/inner_pb2.py b/windows/python/google/protobuf/internal/import_test_package/inner_pb2.py index 362764102..010bf563b 100644 --- a/windows/python/google/protobuf/internal/import_test_package/inner_pb2.py +++ b/windows/python/google/protobuf/internal/import_test_package/inner_pb2.py @@ -2,33 +2,30 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/import_test_package/inner.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() +from google.protobuf.internal.import_test_package import import_public_pb2 as google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__pb2 +try: + google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__nested__pb2 = google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__pb2.google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__nested__pb2 +except AttributeError: + google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__nested__pb2 = google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__pb2.google.protobuf.internal.import_test_package.import_public_nested_pb2 +from google.protobuf.internal.import_test_package.import_public_pb2 import * -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8google/protobuf/internal/import_test_package/inner.proto\x12\x33google.protobuf.python.internal.import_test_package\"\x1a\n\x05Inner\x12\x11\n\x05value\x18\x01 \x01(\x05:\x02\x35\x37') - - - -_INNER = DESCRIPTOR.message_types_by_name['Inner'] -Inner = _reflection.GeneratedProtocolMessageType('Inner', (_message.Message,), { - 'DESCRIPTOR' : _INNER, - '__module__' : 'google.protobuf.internal.import_test_package.inner_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.import_test_package.Inner) - }) -_sym_db.RegisterMessage(Inner) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8google/protobuf/internal/import_test_package/inner.proto\x12\x33google.protobuf.python.internal.import_test_package\x1a@google/protobuf/internal/import_test_package/import_public.proto\"\x1a\n\x05Inner\x12\x11\n\x05value\x18\x01 \x01(\x05:\x02\x35\x37P\x00') +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.import_test_package.inner_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _INNER._serialized_start=113 - _INNER._serialized_end=139 + _INNER._serialized_start=179 + _INNER._serialized_end=205 # @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/internal/import_test_package/outer.proto b/windows/python/google/protobuf/internal/import_test_package/outer.proto index a27fb5c8f..7810aec5e 100644 --- a/windows/python/google/protobuf/internal/import_test_package/outer.proto +++ b/windows/python/google/protobuf/internal/import_test_package/outer.proto @@ -36,4 +36,5 @@ import "google/protobuf/internal/import_test_package/inner.proto"; message Outer { optional Inner inner = 1; + optional ImportPublicNestedMessage import_public_nested = 2; } diff --git a/windows/python/google/protobuf/internal/import_test_package/outer_pb2.py b/windows/python/google/protobuf/internal/import_test_package/outer_pb2.py index 5c78f7681..bc85e65a5 100644 --- a/windows/python/google/protobuf/internal/import_test_package/outer_pb2.py +++ b/windows/python/google/protobuf/internal/import_test_package/outer_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/import_test_package/outer.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -13,23 +12,23 @@ _sym_db = _symbol_database.Default() from google.protobuf.internal.import_test_package import inner_pb2 as google_dot_protobuf_dot_internal_dot_import__test__package_dot_inner__pb2 +try: + google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__pb2 = google_dot_protobuf_dot_internal_dot_import__test__package_dot_inner__pb2.google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__pb2 +except AttributeError: + google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__pb2 = google_dot_protobuf_dot_internal_dot_import__test__package_dot_inner__pb2.google.protobuf.internal.import_test_package.import_public_pb2 +try: + google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__nested__pb2 = google_dot_protobuf_dot_internal_dot_import__test__package_dot_inner__pb2.google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__nested__pb2 +except AttributeError: + google_dot_protobuf_dot_internal_dot_import__test__package_dot_import__public__nested__pb2 = google_dot_protobuf_dot_internal_dot_import__test__package_dot_inner__pb2.google.protobuf.internal.import_test_package.import_public_nested_pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8google/protobuf/internal/import_test_package/outer.proto\x12\x33google.protobuf.python.internal.import_test_package\x1a\x38google/protobuf/internal/import_test_package/inner.proto\"R\n\x05Outer\x12I\n\x05inner\x18\x01 \x01(\x0b\x32:.google.protobuf.python.internal.import_test_package.Inner') - - - -_OUTER = DESCRIPTOR.message_types_by_name['Outer'] -Outer = _reflection.GeneratedProtocolMessageType('Outer', (_message.Message,), { - 'DESCRIPTOR' : _OUTER, - '__module__' : 'google.protobuf.internal.import_test_package.outer_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.import_test_package.Outer) - }) -_sym_db.RegisterMessage(Outer) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8google/protobuf/internal/import_test_package/outer.proto\x12\x33google.protobuf.python.internal.import_test_package\x1a\x38google/protobuf/internal/import_test_package/inner.proto\"\xc0\x01\n\x05Outer\x12I\n\x05inner\x18\x01 \x01(\x0b\x32:.google.protobuf.python.internal.import_test_package.Inner\x12l\n\x14import_public_nested\x18\x02 \x01(\x0b\x32N.google.protobuf.python.internal.import_test_package.ImportPublicNestedMessage') +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.import_test_package.outer_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _OUTER._serialized_start=171 - _OUTER._serialized_end=253 + _OUTER._serialized_start=172 + _OUTER._serialized_end=364 # @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/internal/json_format_test.py b/windows/python/google/protobuf/internal/json_format_test.py index af3713fcb..d018c3f2e 100644 --- a/windows/python/google/protobuf/internal/json_format_test.py +++ b/windows/python/google/protobuf/internal/json_format_test.py @@ -100,10 +100,8 @@ class JsonFormatBase(unittest.TestCase): def CheckError(self, text, error_message): message = json_format_proto3_pb2.TestMessage() - self.assertRaisesRegexp( - json_format.ParseError, - error_message, - json_format.Parse, text, message) + self.assertRaisesRegex(json_format.ParseError, error_message, + json_format.Parse, text, message) class JsonFormatTest(JsonFormatBase): @@ -697,8 +695,7 @@ class JsonFormatTest(JsonFormatBase): json_format.MessageToJson(message, True, descriptor_pool=empty_pool) self.assertEqual( 'Can not find message descriptor by type_url:' - ' type.googleapis.com/protobuf_unittest.OneString.', - str(cm.exception)) + ' type.googleapis.com/protobuf_unittest.OneString', str(cm.exception)) def testWellKnownInAnyMessage(self): message = any_pb2.Any() @@ -813,16 +810,16 @@ class JsonFormatTest(JsonFormatBase): json_format.Parse('{"messageValue": {}}', parsed_message) self.assertTrue(parsed_message.HasField('message_value')) # Null is not allowed to be used as an element in repeated field. - self.assertRaisesRegexp( - json_format.ParseError, - 'Failed to parse repeatedInt32Value field: ' - 'null is not allowed to be used as an element in a repeated field.', - json_format.Parse, - '{"repeatedInt32Value":[1, null]}', - parsed_message) - self.CheckError('{"repeatedMessageValue":[null]}', - 'Failed to parse repeatedMessageValue field: null is not' - ' allowed to be used as an element in a repeated field.') + self.assertRaisesRegex( + json_format.ParseError, r'Failed to parse repeatedInt32Value field: ' + r'null is not allowed to be used as an element in a repeated field ' + r'at TestMessage.repeatedInt32Value\[1\].', json_format.Parse, + '{"repeatedInt32Value":[1, null]}', parsed_message) + self.CheckError( + '{"repeatedMessageValue":[null]}', + r'Failed to parse repeatedMessageValue field: null is not' + r' allowed to be used as an element in a repeated field ' + r'at TestMessage.repeatedMessageValue\[0\].') def testNanFloat(self): message = json_format_proto3_pb2.TestMessage() @@ -840,9 +837,9 @@ class JsonFormatTest(JsonFormatBase): self.assertEqual(message.repeated_double_value[0], 3.4028235e+39) self.assertEqual(message.repeated_double_value[1], 1.4028235e-39) text = ('{"repeatedFloatValue": [3.4028235e+39, 1.4028235e-39]\n}') - self.CheckError(text, - 'Failed to parse repeatedFloatValue field: ' - 'Float value too large.') + self.CheckError( + text, r'Failed to parse repeatedFloatValue field: ' + r'Float value too large at TestMessage.repeatedFloatValue\[0\].') def testFloatPrecision(self): message = json_format_proto3_pb2.TestMessage() @@ -895,17 +892,18 @@ class JsonFormatTest(JsonFormatBase): self.CheckError( '{"enumValue": "baz"}', 'Failed to parse enumValue field: Invalid enum value baz ' - 'for enum type proto3.EnumType.') + 'for enum type proto3.EnumType at TestMessage.enumValue.') # Proto3 accepts numeric unknown enums. text = '{"enumValue": 12345}' json_format.Parse(text, message) # Proto2 does not accept unknown enums. message = unittest_pb2.TestAllTypes() - self.assertRaisesRegexp( + self.assertRaisesRegex( json_format.ParseError, 'Failed to parse optionalNestedEnum field: Invalid enum value 12345 ' - 'for enum type protobuf_unittest.TestAllTypes.NestedEnum.', - json_format.Parse, '{"optionalNestedEnum": 12345}', message) + 'for enum type protobuf_unittest.TestAllTypes.NestedEnum at ' + 'TestAllTypes.optionalNestedEnum.', json_format.Parse, + '{"optionalNestedEnum": 12345}', message) def testBytes(self): message = json_format_proto3_pb2.TestMessage() @@ -928,9 +926,10 @@ class JsonFormatTest(JsonFormatBase): self.CheckError('{int32Value: 1}', (r'Failed to load JSON: Expecting property name' r'( enclosed in double quotes)?: line 1')) - self.CheckError('{"unknownName": 1}', - 'Message type "proto3.TestMessage" has no field named ' - '"unknownName".') + self.CheckError( + '{"unknownName": 1}', + 'Message type "proto3.TestMessage" has no field named ' + '"unknownName" at "TestMessage".') def testIgnoreUnknownField(self): text = '{"unknownName": 1}' @@ -950,33 +949,34 @@ class JsonFormatTest(JsonFormatBase): 'Failed to load JSON: duplicate key int32Value.') def testInvalidBoolValue(self): - self.CheckError('{"boolValue": 1}', - 'Failed to parse boolValue field: ' - 'Expected true or false without quotes.') - self.CheckError('{"boolValue": "true"}', - 'Failed to parse boolValue field: ' - 'Expected true or false without quotes.') + self.CheckError( + '{"boolValue": 1}', 'Failed to parse boolValue field: ' + 'Expected true or false without quotes at TestMessage.boolValue.') + self.CheckError( + '{"boolValue": "true"}', 'Failed to parse boolValue field: ' + 'Expected true or false without quotes at TestMessage.boolValue.') def testInvalidIntegerValue(self): message = json_format_proto3_pb2.TestMessage() text = '{"int32Value": 0x12345}' self.assertRaises(json_format.ParseError, json_format.Parse, text, message) - self.CheckError('{"int32Value": 1.5}', - 'Failed to parse int32Value field: ' - 'Couldn\'t parse integer: 1.5.') + self.CheckError( + '{"int32Value": 1.5}', 'Failed to parse int32Value field: ' + 'Couldn\'t parse integer: 1.5 at TestMessage.int32Value.') self.CheckError('{"int32Value": 012345}', (r'Failed to load JSON: Expecting \'?,\'? delimiter: ' r'line 1.')) - self.CheckError('{"int32Value": " 1 "}', - 'Failed to parse int32Value field: ' - 'Couldn\'t parse integer: " 1 ".') - self.CheckError('{"int32Value": "1 "}', - 'Failed to parse int32Value field: ' - 'Couldn\'t parse integer: "1 ".') - self.CheckError('{"int32Value": false}', - 'Failed to parse int32Value field: Bool value False ' - 'is not acceptable for integer field.') + self.CheckError( + '{"int32Value": " 1 "}', 'Failed to parse int32Value field: ' + 'Couldn\'t parse integer: " 1 " at TestMessage.int32Value.') + self.CheckError( + '{"int32Value": "1 "}', 'Failed to parse int32Value field: ' + 'Couldn\'t parse integer: "1 " at TestMessage.int32Value.') + self.CheckError( + '{"int32Value": false}', + 'Failed to parse int32Value field: Bool value False ' + 'is not acceptable for integer field at TestMessage.int32Value.') self.CheckError('{"int32Value": 12345678901234567890}', 'Failed to parse int32Value field: Value out of range: ' '12345678901234567890.') @@ -985,9 +985,9 @@ class JsonFormatTest(JsonFormatBase): 'Value out of range: -1.') def testInvalidFloatValue(self): - self.CheckError('{"floatValue": "nan"}', - 'Failed to parse floatValue field: Couldn\'t ' - 'parse float "nan", use "NaN" instead.') + self.CheckError( + '{"floatValue": "nan"}', 'Failed to parse floatValue field: Couldn\'t ' + 'parse float "nan", use "NaN" instead at TestMessage.floatValue.') self.CheckError('{"floatValue": NaN}', 'Failed to parse floatValue field: Couldn\'t ' 'parse NaN, use quoted "NaN" instead.') @@ -1008,71 +1008,65 @@ class JsonFormatTest(JsonFormatBase): 'Failed to parse floatValue field: Float value too small.') def testInvalidRepeated(self): - self.CheckError('{"repeatedInt32Value": 12345}', - (r'Failed to parse repeatedInt32Value field: repeated field' - r' repeatedInt32Value must be in \[\] which is 12345.')) + self.CheckError( + '{"repeatedInt32Value": 12345}', + (r'Failed to parse repeatedInt32Value field: repeated field' + r' repeatedInt32Value must be in \[\] which is 12345 at TestMessage.')) def testInvalidMap(self): message = json_format_proto3_pb2.TestMap() text = '{"int32Map": {"null": 2, "2": 3}}' - self.assertRaisesRegexp( - json_format.ParseError, - 'Failed to parse int32Map field: invalid literal', - json_format.Parse, text, message) + self.assertRaisesRegex(json_format.ParseError, + 'Failed to parse int32Map field: invalid literal', + json_format.Parse, text, message) text = '{"int32Map": {1: 2, "2": 3}}' - self.assertRaisesRegexp( - json_format.ParseError, - (r'Failed to load JSON: Expecting property name' - r'( enclosed in double quotes)?: line 1'), - json_format.Parse, text, message) + self.assertRaisesRegex(json_format.ParseError, + (r'Failed to load JSON: Expecting property name' + r'( enclosed in double quotes)?: line 1'), + json_format.Parse, text, message) text = '{"boolMap": {"null": 1}}' - self.assertRaisesRegexp( + self.assertRaisesRegex( json_format.ParseError, - 'Failed to parse boolMap field: Expected "true" or "false", not null.', - json_format.Parse, text, message) + 'Failed to parse boolMap field: Expected "true" or "false", not null at ' + 'TestMap.boolMap.key', json_format.Parse, text, message) text = r'{"stringMap": {"a": 3, "\u0061": 2}}' - self.assertRaisesRegexp( - json_format.ParseError, - 'Failed to load JSON: duplicate key a', - json_format.Parse, text, message) + self.assertRaisesRegex(json_format.ParseError, + 'Failed to load JSON: duplicate key a', + json_format.Parse, text, message) text = r'{"stringMap": 0}' - self.assertRaisesRegexp( + self.assertRaisesRegex( json_format.ParseError, 'Failed to parse stringMap field: Map field string_map must be ' - 'in a dict which is 0.', - json_format.Parse, text, message) + 'in a dict which is 0 at TestMap.stringMap.', json_format.Parse, text, + message) def testInvalidTimestamp(self): message = json_format_proto3_pb2.TestTimestamp() text = '{"value": "10000-01-01T00:00:00.00Z"}' self.assertRaisesRegexp( - json_format.ParseError, - 'Failed to parse value field: ' + json_format.ParseError, 'Failed to parse value field: ' 'time data \'10000-01-01T00:00:00\' does not match' - ' format \'%Y-%m-%dT%H:%M:%S\'.', + ' format \'%Y-%m-%dT%H:%M:%S\' at TestTimestamp.value.', json_format.Parse, text, message) text = '{"value": "1970-01-01T00:00:00.0123456789012Z"}' - self.assertRaisesRegexp( + self.assertRaisesRegex( json_format.ParseError, - 'nanos 0123456789012 more than 9 fractional digits.', - json_format.Parse, text, message) + 'nanos 0123456789012 more than 9 fractional digits.', json_format.Parse, + text, message) text = '{"value": "1972-01-01T01:00:00.01+08"}' - self.assertRaisesRegexp( - json_format.ParseError, - (r'Invalid timezone offset value: \+08.'), - json_format.Parse, text, message) + self.assertRaisesRegex(json_format.ParseError, + (r'Invalid timezone offset value: \+08.'), + json_format.Parse, text, message) # Time smaller than minimum time. text = '{"value": "0000-01-01T00:00:00Z"}' - self.assertRaisesRegexp( + self.assertRaisesRegex( json_format.ParseError, 'Failed to parse value field: year (0 )?is out of range.', json_format.Parse, text, message) # Time bigger than maximum time. message.value.seconds = 253402300800 - self.assertRaisesRegexp( - OverflowError, - 'date value out of range', - json_format.MessageToJson, message) + self.assertRaisesRegex(OverflowError, 'date value out of range', + json_format.MessageToJson, message) # Lower case t does not accept. text = '{"value": "0001-01-01t00:00:00Z"}' with self.assertRaises(json_format.ParseError) as e: @@ -1080,38 +1074,47 @@ class JsonFormatTest(JsonFormatBase): self.assertEqual( 'Failed to parse value field: ' 'time data \'0001-01-01t00:00:00\' does not match format ' - '\'%Y-%m-%dT%H:%M:%S\', lowercase \'t\' is not accepted.', - str(e.exception)) + '\'%Y-%m-%dT%H:%M:%S\', lowercase \'t\' is not accepted ' + 'at TestTimestamp.value.', str(e.exception)) def testInvalidOneof(self): message = json_format_proto3_pb2.TestOneof() text = '{"oneofInt32Value": 1, "oneofStringValue": "2"}' self.assertRaisesRegexp( - json_format.ParseError, - 'Message type "proto3.TestOneof"' - ' should not have multiple "oneof_value" oneof fields.', + json_format.ParseError, 'Message type "proto3.TestOneof"' + ' should not have multiple "oneof_value" oneof fields at "TestOneof".', json_format.Parse, text, message) def testInvalidListValue(self): message = json_format_proto3_pb2.TestListValue() text = '{"value": 1234}' - self.assertRaisesRegexp( + self.assertRaisesRegex( json_format.ParseError, - r'Failed to parse value field: ListValue must be in \[\] which is 1234', - json_format.Parse, text, message) + r'Failed to parse value field: ListValue must be in \[\] which is ' + '1234 at TestListValue.value.', json_format.Parse, text, message) + + class UnknownClass(object): + + def __str__(self): + return 'v' + self.assertRaisesRegex( + json_format.ParseError, + r' at TestListValue.value\[1\].fake.', + json_format.ParseDict, + {'value': ['hello', {'fake': UnknownClass()}]}, message) def testInvalidStruct(self): message = json_format_proto3_pb2.TestStruct() text = '{"value": 1234}' - self.assertRaisesRegexp( + self.assertRaisesRegex( json_format.ParseError, - 'Failed to parse value field: Struct must be in a dict which is 1234', - json_format.Parse, text, message) + 'Failed to parse value field: Struct must be in a dict which is ' + '1234 at TestStruct.value', json_format.Parse, text, message) def testTimestampInvalidStringValue(self): message = json_format_proto3_pb2.TestTimestamp() text = '{"value": {"foo": 123}}' - self.assertRaisesRegexp( + self.assertRaisesRegex( json_format.ParseError, r"Timestamp JSON value not a string: {u?'foo': 123}", json_format.Parse, text, message) @@ -1119,15 +1122,14 @@ class JsonFormatTest(JsonFormatBase): def testDurationInvalidStringValue(self): message = json_format_proto3_pb2.TestDuration() text = '{"value": {"foo": 123}}' - self.assertRaisesRegexp( - json_format.ParseError, - r"Duration JSON value not a string: {u?'foo': 123}", json_format.Parse, - text, message) + self.assertRaisesRegex(json_format.ParseError, + r"Duration JSON value not a string: {u?'foo': 123}", + json_format.Parse, text, message) def testFieldMaskInvalidStringValue(self): message = json_format_proto3_pb2.TestFieldMask() text = '{"value": {"foo": 123}}' - self.assertRaisesRegexp( + self.assertRaisesRegex( json_format.ParseError, r"FieldMask JSON value not a string: {u?'foo': 123}", json_format.Parse, text, message) @@ -1135,21 +1137,16 @@ class JsonFormatTest(JsonFormatBase): def testInvalidAny(self): message = any_pb2.Any() text = '{"@type": "type.googleapis.com/google.protobuf.Int32Value"}' - self.assertRaisesRegexp( - KeyError, - 'value', - json_format.Parse, text, message) + self.assertRaisesRegex(KeyError, 'value', json_format.Parse, text, message) text = '{"value": 1234}' - self.assertRaisesRegexp( - json_format.ParseError, - '@type is missing when parsing any message.', - json_format.Parse, text, message) + self.assertRaisesRegex(json_format.ParseError, + '@type is missing when parsing any message at Any', + json_format.Parse, text, message) text = '{"@type": "type.googleapis.com/MessageNotExist", "value": 1234}' - self.assertRaisesRegexp( - TypeError, - 'Can not find message descriptor by type_url: ' - 'type.googleapis.com/MessageNotExist.', - json_format.Parse, text, message) + self.assertRaisesRegex( + json_format.ParseError, 'Can not find message descriptor by type_url: ' + 'type.googleapis.com/MessageNotExist at Any', json_format.Parse, text, + message) # Only last part is to be used: b/25630112 text = (r'{"@type": "incorrect.googleapis.com/google.protobuf.Int32Value",' r'"value": 1234}') @@ -1225,7 +1222,9 @@ class JsonFormatTest(JsonFormatBase): self.assertEqual( str(cm.exception), 'Failed to parse any_value field: Can not find message descriptor by' - ' type_url: type.googleapis.com/proto3.MessageType..') + ' type_url: type.googleapis.com/proto3.MessageType at ' + 'TestAny.any_value.' + ) def testParseDictUnknownValueType(self): class UnknownClass(object): @@ -1233,12 +1232,10 @@ class JsonFormatTest(JsonFormatBase): def __repr__(self): return 'v' message = json_format_proto3_pb2.TestValue() - self.assertRaisesRegexp( + self.assertRaisesRegex( json_format.ParseError, r"Value v has unexpected type .", - json_format.ParseDict, - {'value': UnknownClass()}, - message) + json_format.ParseDict, {'value': UnknownClass()}, message) def testMessageToDict(self): message = json_format_proto3_pb2.TestMessage() @@ -1271,6 +1268,18 @@ class JsonFormatTest(JsonFormatBase): 'uint32Value': 4, 'stringValue': 'bla'}, indent=2, sort_keys=True)) + def testNestedRecursiveLimit(self): + message = unittest_pb2.NestedTestAllTypes() + self.assertRaisesRegex( + json_format.ParseError, + 'Message too deep. Max recursion depth is 3', + json_format.Parse, + '{"child": {"child": {"child" : {}}}}', + message, + max_recursion_depth=3) + # The following one can pass + json_format.Parse('{"payload": {}, "child": {"child":{}}}', + message, max_recursion_depth=3) if __name__ == '__main__': unittest.main() diff --git a/windows/python/google/protobuf/internal/message_factory_test.py b/windows/python/google/protobuf/internal/message_factory_test.py index 97ef3aab5..efba6194c 100644 --- a/windows/python/google/protobuf/internal/message_factory_test.py +++ b/windows/python/google/protobuf/internal/message_factory_test.py @@ -174,48 +174,42 @@ class MessageFactoryTest(unittest.TestCase): factory = message_factory.MessageFactory(pool=pool) # Add Container message. - f = descriptor_pb2.FileDescriptorProto() - f.name = 'google/protobuf/internal/container.proto' - f.package = 'google.protobuf.python.internal' - msg = f.message_type.add() - msg.name = 'Container' - rng = msg.extension_range.add() - rng.start = 1 - rng.end = 10 + f = descriptor_pb2.FileDescriptorProto( + name='google/protobuf/internal/container.proto', + package='google.protobuf.python.internal') + f.message_type.add(name='Container').extension_range.add(start=1, end=10) pool.Add(f) msgs = factory.GetMessages([f.name]) self.assertIn('google.protobuf.python.internal.Container', msgs) # Extend container. - f = descriptor_pb2.FileDescriptorProto() - f.name = 'google/protobuf/internal/extension.proto' - f.package = 'google.protobuf.python.internal' - f.dependency.append('google/protobuf/internal/container.proto') - msg = f.message_type.add() - msg.name = 'Extension' - ext = msg.extension.add() - ext.name = 'extension_field' - ext.number = 2 - ext.label = descriptor_pb2.FieldDescriptorProto.LABEL_OPTIONAL - ext.type_name = 'Extension' - ext.extendee = 'Container' + f = descriptor_pb2.FileDescriptorProto( + name='google/protobuf/internal/extension.proto', + package='google.protobuf.python.internal', + dependency=['google/protobuf/internal/container.proto']) + msg = f.message_type.add(name='Extension') + msg.extension.add( + name='extension_field', + number=2, + label=descriptor_pb2.FieldDescriptorProto.LABEL_OPTIONAL, + type_name='Extension', + extendee='Container') pool.Add(f) msgs = factory.GetMessages([f.name]) self.assertIn('google.protobuf.python.internal.Extension', msgs) # Add Duplicate extending the same field number. - f = descriptor_pb2.FileDescriptorProto() - f.name = 'google/protobuf/internal/duplicate.proto' - f.package = 'google.protobuf.python.internal' - f.dependency.append('google/protobuf/internal/container.proto') - msg = f.message_type.add() - msg.name = 'Duplicate' - ext = msg.extension.add() - ext.name = 'extension_field' - ext.number = 2 - ext.label = descriptor_pb2.FieldDescriptorProto.LABEL_OPTIONAL - ext.type_name = 'Duplicate' - ext.extendee = 'Container' + f = descriptor_pb2.FileDescriptorProto( + name='google/protobuf/internal/duplicate.proto', + package='google.protobuf.python.internal', + dependency=['google/protobuf/internal/container.proto']) + msg = f.message_type.add(name='Duplicate') + msg.extension.add( + name='extension_field', + number=2, + label=descriptor_pb2.FieldDescriptorProto.LABEL_OPTIONAL, + type_name='Duplicate', + extendee='Container') pool.Add(f) with self.assertRaises(Exception) as cm: @@ -230,6 +224,76 @@ class MessageFactoryTest(unittest.TestCase): ' with field number 2.', 'Double registration of Extensions']) + def testExtensionValueInDifferentFile(self): + # Add Container message. + f1 = descriptor_pb2.FileDescriptorProto( + name='google/protobuf/internal/container.proto', + package='google.protobuf.python.internal') + f1.message_type.add(name='Container').extension_range.add(start=1, end=10) + + # Add ValueType message. + f2 = descriptor_pb2.FileDescriptorProto( + name='google/protobuf/internal/value_type.proto', + package='google.protobuf.python.internal') + f2.message_type.add(name='ValueType').field.add( + name='setting', + number=1, + label=descriptor_pb2.FieldDescriptorProto.LABEL_OPTIONAL, + type=descriptor_pb2.FieldDescriptorProto.TYPE_INT32, + default_value='123') + + # Extend container with field of ValueType. + f3 = descriptor_pb2.FileDescriptorProto( + name='google/protobuf/internal/extension.proto', + package='google.protobuf.python.internal', + dependency=[f1.name, f2.name]) + f3.extension.add( + name='top_level_extension_field', + number=2, + label=descriptor_pb2.FieldDescriptorProto.LABEL_OPTIONAL, + type_name='ValueType', + extendee='Container') + f3.message_type.add(name='Extension').extension.add( + name='nested_extension_field', + number=3, + label=descriptor_pb2.FieldDescriptorProto.LABEL_OPTIONAL, + type_name='ValueType', + extendee='Container') + + class SimpleDescriptorDB: + + def __init__(self, files): + self._files = files + + def FindFileByName(self, name): + return self._files[name] + + db = SimpleDescriptorDB({f1.name: f1, f2.name: f2, f3.name: f3}) + + pool = descriptor_pool.DescriptorPool(db) + factory = message_factory.MessageFactory(pool=pool) + msgs = factory.GetMessages([f1.name, f3.name]) # Deliberately not f2. + msg = msgs['google.protobuf.python.internal.Container'] + desc = msgs['google.protobuf.python.internal.Extension'].DESCRIPTOR + ext1 = desc.file.extensions_by_name['top_level_extension_field'] + ext2 = desc.extensions_by_name['nested_extension_field'] + m = msg() + m.Extensions[ext1].setting = 234 + m.Extensions[ext2].setting = 345 + serialized = m.SerializeToString() + + pool = descriptor_pool.DescriptorPool(db) + factory = message_factory.MessageFactory(pool=pool) + msgs = factory.GetMessages([f1.name, f3.name]) # Deliberately not f2. + msg = msgs['google.protobuf.python.internal.Container'] + desc = msgs['google.protobuf.python.internal.Extension'].DESCRIPTOR + ext1 = desc.file.extensions_by_name['top_level_extension_field'] + ext2 = desc.extensions_by_name['nested_extension_field'] + m = msg.FromString(serialized) + self.assertEqual(2, len(m.ListFields())) + self.assertEqual(234, m.Extensions[ext1].setting) + self.assertEqual(345, m.Extensions[ext2].setting) + if __name__ == '__main__': unittest.main() diff --git a/windows/python/google/protobuf/internal/message_set_extensions_pb2.py b/windows/python/google/protobuf/internal/message_set_extensions_pb2.py index 5becd9b82..63651a3f1 100644 --- a/windows/python/google/protobuf/internal/message_set_extensions_pb2.py +++ b/windows/python/google/protobuf/internal/message_set_extensions_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/message_set_extensions.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,42 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n5google/protobuf/internal/message_set_extensions.proto\x12\x18google.protobuf.internal\"\x1e\n\x0eTestMessageSet*\x08\x08\x04\x10\xff\xff\xff\xff\x07:\x02\x08\x01\"\xa5\x01\n\x18TestMessageSetExtension1\x12\t\n\x01i\x18\x0f \x01(\x05\x32~\n\x15message_set_extension\x12(.google.protobuf.internal.TestMessageSet\x18\xab\xff\xf6. \x01(\x0b\x32\x32.google.protobuf.internal.TestMessageSetExtension1\"\xa7\x01\n\x18TestMessageSetExtension2\x12\x0b\n\x03str\x18\x19 \x01(\t2~\n\x15message_set_extension\x12(.google.protobuf.internal.TestMessageSet\x18\xca\xff\xf6. \x01(\x0b\x32\x32.google.protobuf.internal.TestMessageSetExtension2\"(\n\x18TestMessageSetExtension3\x12\x0c\n\x04text\x18# \x01(\t:\x7f\n\x16message_set_extension3\x12(.google.protobuf.internal.TestMessageSet\x18\xdf\xff\xf6. \x01(\x0b\x32\x32.google.protobuf.internal.TestMessageSetExtension3') - -MESSAGE_SET_EXTENSION3_FIELD_NUMBER = 98418655 -message_set_extension3 = DESCRIPTOR.extensions_by_name['message_set_extension3'] - -_TESTMESSAGESET = DESCRIPTOR.message_types_by_name['TestMessageSet'] -_TESTMESSAGESETEXTENSION1 = DESCRIPTOR.message_types_by_name['TestMessageSetExtension1'] -_TESTMESSAGESETEXTENSION2 = DESCRIPTOR.message_types_by_name['TestMessageSetExtension2'] -_TESTMESSAGESETEXTENSION3 = DESCRIPTOR.message_types_by_name['TestMessageSetExtension3'] -TestMessageSet = _reflection.GeneratedProtocolMessageType('TestMessageSet', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGESET, - '__module__' : 'google.protobuf.internal.message_set_extensions_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.TestMessageSet) - }) -_sym_db.RegisterMessage(TestMessageSet) - -TestMessageSetExtension1 = _reflection.GeneratedProtocolMessageType('TestMessageSetExtension1', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGESETEXTENSION1, - '__module__' : 'google.protobuf.internal.message_set_extensions_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.TestMessageSetExtension1) - }) -_sym_db.RegisterMessage(TestMessageSetExtension1) - -TestMessageSetExtension2 = _reflection.GeneratedProtocolMessageType('TestMessageSetExtension2', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGESETEXTENSION2, - '__module__' : 'google.protobuf.internal.message_set_extensions_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.TestMessageSetExtension2) - }) -_sym_db.RegisterMessage(TestMessageSetExtension2) - -TestMessageSetExtension3 = _reflection.GeneratedProtocolMessageType('TestMessageSetExtension3', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGESETEXTENSION3, - '__module__' : 'google.protobuf.internal.message_set_extensions_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.TestMessageSetExtension3) - }) -_sym_db.RegisterMessage(TestMessageSetExtension3) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.message_set_extensions_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: TestMessageSet.RegisterExtension(message_set_extension3) TestMessageSet.RegisterExtension(_TESTMESSAGESETEXTENSION1.extensions_by_name['message_set_extension']) diff --git a/windows/python/google/protobuf/internal/message_test.py b/windows/python/google/protobuf/internal/message_test.py index 6ed1f20ef..40abfe4a2 100644 --- a/windows/python/google/protobuf/internal/message_test.py +++ b/windows/python/google/protobuf/internal/message_test.py @@ -58,10 +58,7 @@ from google.protobuf import map_proto2_unittest_pb2 from google.protobuf import map_unittest_pb2 from google.protobuf import unittest_pb2 from google.protobuf import unittest_proto3_arena_pb2 -from google.protobuf import descriptor_pb2 -from google.protobuf import descriptor_pool -from google.protobuf import message_factory -from google.protobuf import text_format +from google.protobuf import descriptor from google.protobuf.internal import api_implementation from google.protobuf.internal import encoder from google.protobuf.internal import more_extensions_pb2 @@ -74,21 +71,19 @@ from google.protobuf.internal import _parameterized UCS2_MAXUNICODE = 65535 - warnings.simplefilter('error', DeprecationWarning) -@_parameterized.named_parameters( - ('_proto2', unittest_pb2), - ('_proto3', unittest_proto3_arena_pb2)) +@_parameterized.named_parameters(('_proto2', unittest_pb2), + ('_proto3', unittest_proto3_arena_pb2)) @testing_refleaks.TestCase class MessageTest(unittest.TestCase): def testBadUtf8String(self, message_module): if api_implementation.Type() != 'python': - self.skipTest("Skipping testBadUtf8String, currently only the python " - "api implementation raises UnicodeDecodeError when a " - "string field contains bad utf-8.") + self.skipTest('Skipping testBadUtf8String, currently only the python ' + 'api implementation raises UnicodeDecodeError when a ' + 'string field contains bad utf-8.') bad_utf8_data = test_util.GoldenFileData('bad_utf8_string') with self.assertRaises(UnicodeDecodeError) as context: message_module.TestAllTypes.FromString(bad_utf8_data) @@ -99,8 +94,7 @@ class MessageTest(unittest.TestCase): # and doesn't preserve unknown fields, so for proto3 we use a golden # message that doesn't have these fields set. if message_module is unittest_pb2: - golden_data = test_util.GoldenFileData( - 'golden_message_oneof_implemented') + golden_data = test_util.GoldenFileData('golden_message_oneof_implemented') else: golden_data = test_util.GoldenFileData('golden_message_proto3') @@ -131,10 +125,13 @@ class MessageTest(unittest.TestCase): # TODO(jieluo): Fix cpp extension to raise error instead of warning. # b/27494216 end_tag = encoder.TagBytes(1, 4) - if api_implementation.Type() == 'python': + if (api_implementation.Type() == 'python' or + api_implementation.Type() == 'upb'): with self.assertRaises(message.DecodeError) as context: msg.FromString(end_tag) - self.assertEqual('Unexpected end-group tag.', str(context.exception)) + if api_implementation.Type() == 'python': + # Only pure-Python has an error message this specific. + self.assertEqual('Unexpected end-group tag.', str(context.exception)) # Field number 0 is illegal. self.assertRaises(message.DecodeError, msg.FromString, b'\3\4') @@ -439,8 +436,7 @@ class MessageTest(unittest.TestCase): except TypeError: pass self.assertEqual(2, len(msg.repeated_nested_message)) - self.assertEqual([1, 2], - [m.bb for m in msg.repeated_nested_message]) + self.assertEqual([1, 2], [m.bb for m in msg.repeated_nested_message]) def testInsertRepeatedCompositeField(self, message_module): msg = message_module.TestAllTypes() @@ -462,22 +458,22 @@ class MessageTest(unittest.TestCase): self.assertEqual(5, len(msg.repeated_nested_message)) self.assertEqual([-1000, 2, -1, 1, 3], [m.bb for m in msg.repeated_nested_message]) - self.assertEqual(str(msg), - 'repeated_nested_message {\n' - ' bb: -1000\n' - '}\n' - 'repeated_nested_message {\n' - ' bb: 2\n' - '}\n' - 'repeated_nested_message {\n' - ' bb: -1\n' - '}\n' - 'repeated_nested_message {\n' - ' bb: 1\n' - '}\n' - 'repeated_nested_message {\n' - ' bb: 3\n' - '}\n') + self.assertEqual( + str(msg), 'repeated_nested_message {\n' + ' bb: -1000\n' + '}\n' + 'repeated_nested_message {\n' + ' bb: 2\n' + '}\n' + 'repeated_nested_message {\n' + ' bb: -1\n' + '}\n' + 'repeated_nested_message {\n' + ' bb: 1\n' + '}\n' + 'repeated_nested_message {\n' + ' bb: 3\n' + '}\n') self.assertEqual(sub_msg.bb, 1) def testMergeFromRepeatedField(self, message_module): @@ -496,8 +492,7 @@ class MessageTest(unittest.TestCase): self.assertEqual(4, len(msg.repeated_int32)) msg.repeated_nested_message.MergeFrom(other_msg.repeated_nested_message) - self.assertEqual([1, 2, 3, 4], - [m.bb for m in msg.repeated_nested_message]) + self.assertEqual([1, 2, 3, 4], [m.bb for m in msg.repeated_nested_message]) def testAddWrongRepeatedNestedField(self, message_module): msg = message_module.TestAllTypes() @@ -542,8 +537,7 @@ class MessageTest(unittest.TestCase): msg.repeated_nested_message.add(bb=3) msg.repeated_nested_message.add(bb=4) - self.assertEqual([1, 2, 3, 4], - [m.bb for m in msg.repeated_nested_message]) + self.assertEqual([1, 2, 3, 4], [m.bb for m in msg.repeated_nested_message]) self.assertEqual([4, 3, 2, 1], [m.bb for m in reversed(msg.repeated_nested_message)]) self.assertEqual([4, 3, 2, 1], @@ -626,8 +620,9 @@ class MessageTest(unittest.TestCase): self.assertEqual(message.repeated_nested_message[3].bb, 4) self.assertEqual(message.repeated_nested_message[4].bb, 5) self.assertEqual(message.repeated_nested_message[5].bb, 6) - self.assertEqual(str(message.repeated_nested_message), - '[bb: 1\n, bb: 2\n, bb: 3\n, bb: 4\n, bb: 5\n, bb: 6\n]') + self.assertEqual( + str(message.repeated_nested_message), + '[bb: 1\n, bb: 2\n, bb: 3\n, bb: 4\n, bb: 5\n, bb: 6\n]') def testSortingRepeatedCompositeFieldsStable(self, message_module): """Check passing a custom comparator to sort a repeated composite field.""" @@ -641,18 +636,16 @@ class MessageTest(unittest.TestCase): message.repeated_nested_message.add().bb = 24 message.repeated_nested_message.add().bb = 10 message.repeated_nested_message.sort(key=lambda z: z.bb // 10) - self.assertEqual( - [13, 11, 10, 21, 20, 24, 33], - [n.bb for n in message.repeated_nested_message]) + self.assertEqual([13, 11, 10, 21, 20, 24, 33], + [n.bb for n in message.repeated_nested_message]) # Make sure that for the C++ implementation, the underlying fields # are actually reordered. pb = message.SerializeToString() message.Clear() message.MergeFromString(pb) - self.assertEqual( - [13, 11, 10, 21, 20, 24, 33], - [n.bb for n in message.repeated_nested_message]) + self.assertEqual([13, 11, 10, 21, 20, 24, 33], + [n.bb for n in message.repeated_nested_message]) def testRepeatedCompositeFieldSortArguments(self, message_module): """Check sorting a repeated composite field using list.sort() arguments.""" @@ -825,7 +818,7 @@ class MessageTest(unittest.TestCase): self.assertTrue(m.HasField('oneof_uint32')) self.assertFalse(m.HasField('oneof_string')) - m.oneof_string = "" + m.oneof_string = '' self.assertEqual('oneof_string', m.WhichOneof('oneof_field')) self.assertTrue(m.HasField('oneof_string')) self.assertFalse(m.HasField('oneof_uint32')) @@ -972,7 +965,9 @@ class MessageTest(unittest.TestCase): def testAssignByteStringToUnicodeField(self, message_module): """Assigning a byte string to a string field should result - in the value being converted to a Unicode string.""" + + in the value being converted to a Unicode string. + """ m = message_module.TestAllTypes() m.optional_string = str('') self.assertIsInstance(m.optional_string, str) @@ -1000,8 +995,7 @@ class MessageTest(unittest.TestCase): with self.assertRaises(NameError) as _: m.repeated_int32.extend(a for i in range(10)) # pylint: disable=undefined-variable with self.assertRaises(NameError) as _: - m.repeated_nested_enum.extend( - a for i in range(10)) # pylint: disable=undefined-variable + m.repeated_nested_enum.extend(a for i in range(10)) # pylint: disable=undefined-variable FALSY_VALUES = [None, False, 0, 0.0, b'', u'', bytearray(), [], {}, set()] @@ -1147,29 +1141,43 @@ class MessageTest(unittest.TestCase): m.repeated_string.extend(MessageTest.TestIterable(['3', '4'])) self.assertSequenceEqual(['', '1', '2', '3', '4'], m.repeated_string) + class TestIndex(object): + """This index object mimics the behavior of numpy.int64 and other types.""" + + def __init__(self, value=None): + self.value = value + + def __index__(self): + return self.value + + def testRepeatedIndexingWithIntIndex(self, message_module): + msg = message_module.TestAllTypes() + msg.repeated_int32.extend([1, 2, 3]) + self.assertEqual(1, msg.repeated_int32[MessageTest.TestIndex(0)]) + + def testRepeatedIndexingWithNegative1IntIndex(self, message_module): + msg = message_module.TestAllTypes() + msg.repeated_int32.extend([1, 2, 3]) + self.assertEqual(3, msg.repeated_int32[MessageTest.TestIndex(-1)]) + + def testRepeatedIndexingWithNegative1Int(self, message_module): + msg = message_module.TestAllTypes() + msg.repeated_int32.extend([1, 2, 3]) + self.assertEqual(3, msg.repeated_int32[-1]) + def testPickleRepeatedScalarContainer(self, message_module): - # TODO(tibell): The pure-Python implementation support pickling of - # scalar containers in *some* cases. For now the cpp2 version - # throws an exception to avoid a segfault. Investigate if we - # want to support pickling of these fields. - # - # For more information see: https://b2.corp.google.com/u/0/issues/18677897 - if (api_implementation.Type() != 'cpp' or - api_implementation.Version() == 2): - return + # Pickle repeated scalar container is not supported. m = message_module.TestAllTypes() with self.assertRaises(pickle.PickleError) as _: pickle.dumps(m.repeated_int32, pickle.HIGHEST_PROTOCOL) def testSortEmptyRepeatedCompositeContainer(self, message_module): - """Exercise a scenario that has led to segfaults in the past. - """ + """Exercise a scenario that has led to segfaults in the past.""" m = message_module.TestAllTypes() m.repeated_nested_message.sort() def testHasFieldOnRepeatedField(self, message_module): - """Using HasField on a repeated field should raise an exception. - """ + """Using HasField on a repeated field should raise an exception.""" m = message_module.TestAllTypes() with self.assertRaises(ValueError) as _: m.HasField('repeated_int32') @@ -1209,6 +1217,7 @@ class MessageTest(unittest.TestCase): def testReleasedNestedMessages(self, message_module): """A case that lead to a segfault when a message detached from its parent + container has itself a child container. """ m = message_module.NestedTestAllTypes() @@ -1254,17 +1263,17 @@ class Proto2Test(unittest.TestCase): def testFieldPresence(self): message = unittest_pb2.TestAllTypes() - self.assertFalse(message.HasField("optional_int32")) - self.assertFalse(message.HasField("optional_bool")) - self.assertFalse(message.HasField("optional_nested_message")) + self.assertFalse(message.HasField('optional_int32')) + self.assertFalse(message.HasField('optional_bool')) + self.assertFalse(message.HasField('optional_nested_message')) with self.assertRaises(ValueError): - message.HasField("field_doesnt_exist") + message.HasField('field_doesnt_exist') with self.assertRaises(ValueError): - message.HasField("repeated_int32") + message.HasField('repeated_int32') with self.assertRaises(ValueError): - message.HasField("repeated_nested_message") + message.HasField('repeated_nested_message') self.assertEqual(0, message.optional_int32) self.assertEqual(False, message.optional_bool) @@ -1274,27 +1283,27 @@ class Proto2Test(unittest.TestCase): message.optional_int32 = 0 message.optional_bool = False message.optional_nested_message.bb = 0 - self.assertTrue(message.HasField("optional_int32")) - self.assertTrue(message.HasField("optional_bool")) - self.assertTrue(message.HasField("optional_nested_message")) + self.assertTrue(message.HasField('optional_int32')) + self.assertTrue(message.HasField('optional_bool')) + self.assertTrue(message.HasField('optional_nested_message')) # Set the fields to non-default values. message.optional_int32 = 5 message.optional_bool = True message.optional_nested_message.bb = 15 - self.assertTrue(message.HasField(u"optional_int32")) - self.assertTrue(message.HasField("optional_bool")) - self.assertTrue(message.HasField("optional_nested_message")) + self.assertTrue(message.HasField(u'optional_int32')) + self.assertTrue(message.HasField('optional_bool')) + self.assertTrue(message.HasField('optional_nested_message')) # Clearing the fields unsets them and resets their value to default. - message.ClearField("optional_int32") - message.ClearField(u"optional_bool") - message.ClearField("optional_nested_message") + message.ClearField('optional_int32') + message.ClearField(u'optional_bool') + message.ClearField('optional_nested_message') - self.assertFalse(message.HasField("optional_int32")) - self.assertFalse(message.HasField("optional_bool")) - self.assertFalse(message.HasField("optional_nested_message")) + self.assertFalse(message.HasField('optional_int32')) + self.assertFalse(message.HasField('optional_bool')) + self.assertFalse(message.HasField('optional_nested_message')) self.assertEqual(0, message.optional_int32) self.assertEqual(False, message.optional_bool) self.assertEqual(0, message.optional_nested_message.bb) @@ -1344,16 +1353,17 @@ class Proto2Test(unittest.TestCase): msg1 = more_extensions_pb2.TopLevelMessage() msg2 = more_extensions_pb2.TopLevelMessage() # Cpp extension will lazily create a sub message which is immutable. - self.assertEqual(0, msg1.submessage.Extensions[ - more_extensions_pb2.optional_int_extension]) + self.assertEqual( + 0, + msg1.submessage.Extensions[more_extensions_pb2.optional_int_extension]) self.assertFalse(msg1.HasField('submessage')) - msg2.submessage.Extensions[ - more_extensions_pb2.optional_int_extension] = 123 + msg2.submessage.Extensions[more_extensions_pb2.optional_int_extension] = 123 # Make sure cmessage and extensions pointing to a mutable message # after merge instead of the lazily created message. msg1.MergeFrom(msg2) - self.assertEqual(123, msg1.submessage.Extensions[ - more_extensions_pb2.optional_int_extension]) + self.assertEqual( + 123, + msg1.submessage.Extensions[more_extensions_pb2.optional_int_extension]) def testGoldenExtensions(self): golden_data = test_util.GoldenFileData('golden_message') @@ -1387,17 +1397,19 @@ class Proto2Test(unittest.TestCase): # This is still an incomplete proto - so serializing should fail self.assertRaises(message.EncodeError, unpickled_message.SerializeToString) - # TODO(haberman): this isn't really a proto2-specific test except that this # message has a required field in it. Should probably be factored out so # that we can test the other parts with proto3. def testParsingMerge(self): """Check the merge behavior when a required or optional field appears - multiple times in the input.""" + + multiple times in the input. + """ messages = [ unittest_pb2.TestAllTypes(), unittest_pb2.TestAllTypes(), - unittest_pb2.TestAllTypes() ] + unittest_pb2.TestAllTypes() + ] messages[0].optional_int32 = 1 messages[1].optional_int64 = 2 messages[2].optional_int32 = 3 @@ -1430,15 +1442,16 @@ class Proto2Test(unittest.TestCase): self.assertEqual(parsing_merge.optional_all_types, merged_message) self.assertEqual(parsing_merge.optionalgroup.optional_group_all_types, merged_message) - self.assertEqual(parsing_merge.Extensions[ - unittest_pb2.TestParsingMerge.optional_ext], - merged_message) + self.assertEqual( + parsing_merge.Extensions[unittest_pb2.TestParsingMerge.optional_ext], + merged_message) # Repeated fields should not be merged. self.assertEqual(len(parsing_merge.repeated_all_types), 3) self.assertEqual(len(parsing_merge.repeatedgroup), 3) - self.assertEqual(len(parsing_merge.Extensions[ - unittest_pb2.TestParsingMerge.repeated_ext]), 3) + self.assertEqual( + len(parsing_merge.Extensions[ + unittest_pb2.TestParsingMerge.repeated_ext]), 3) def testPythonicInit(self): message = unittest_pb2.TestAllTypes( @@ -1450,8 +1463,11 @@ class Proto2Test(unittest.TestCase): optional_nested_message={'bb': 500}, optional_foreign_message={}, optional_nested_enum='BAZ', - repeatedgroup=[{'a': 600}, - {'a': 700}], + repeatedgroup=[{ + 'a': 600 + }, { + 'a': 700 + }], repeated_nested_enum=['FOO', unittest_pb2.TestAllTypes.BAR], default_int32=800, oneof_string='y') @@ -1658,6 +1674,26 @@ class Proto3Test(unittest.TestCase): self.assertEqual(msg.WhichOneof('_optional_int32'), None) + # Test has presence: + for field in test_proto3_optional_pb2.TestProto3Optional.DESCRIPTOR.fields: + self.assertTrue(field.has_presence) + for field in unittest_pb2.TestAllTypes.DESCRIPTOR.fields: + if field.label == descriptor.FieldDescriptor.LABEL_REPEATED: + self.assertFalse(field.has_presence) + else: + self.assertTrue(field.has_presence) + proto3_descriptor = unittest_proto3_arena_pb2.TestAllTypes.DESCRIPTOR + repeated_field = proto3_descriptor.fields_by_name['repeated_int32'] + self.assertFalse(repeated_field.has_presence) + singular_field = proto3_descriptor.fields_by_name['optional_int32'] + self.assertFalse(singular_field.has_presence) + optional_field = proto3_descriptor.fields_by_name['proto3_optional_int32'] + self.assertTrue(optional_field.has_presence) + message_field = proto3_descriptor.fields_by_name['optional_nested_message'] + self.assertTrue(message_field.has_presence) + oneof_field = proto3_descriptor.fields_by_name['oneof_uint32'] + self.assertTrue(oneof_field.has_presence) + def testAssignUnknownEnum(self): """Assigning an unknown enum value is allowed and preserves the value.""" m = unittest_proto3_arena_pb2.TestAllTypes() @@ -1811,8 +1847,7 @@ class Proto3Test(unittest.TestCase): self.assertEqual(True, msg2.map_bool_bool[True]) self.assertEqual(2, msg2.map_int32_enum[888]) self.assertEqual(456, msg2.map_int32_enum[123]) - self.assertEqual('{-123: -456}', - str(msg2.map_int32_int32)) + self.assertEqual('{-123: -456}', str(msg2.map_int32_int32)) def testMapEntryAlwaysSerialized(self): msg = map_unittest_pb2.TestMap() @@ -1875,8 +1910,9 @@ class Proto3Test(unittest.TestCase): self.assertEqual(2, len(msg2.map_int32_foreign_message)) msg2.map_int32_foreign_message[123].c = 1 # TODO(jieluo): Fix text format for message map. - self.assertIn(str(msg2.map_int32_foreign_message), - ('{-456: , 123: c: 1\n}', '{123: c: 1\n, -456: }')) + self.assertIn( + str(msg2.map_int32_foreign_message), + ('{-456: , 123: c: 1\n}', '{123: c: 1\n, -456: }')) def testNestedMessageMapItemDelete(self): msg = map_unittest_pb2.TestMap() @@ -2004,8 +2040,7 @@ class Proto3Test(unittest.TestCase): # Test when cpp extension cache a map. m1 = map_unittest_pb2.TestMap() m2 = map_unittest_pb2.TestMap() - self.assertEqual(m1.map_int32_foreign_message, - m1.map_int32_foreign_message) + self.assertEqual(m1.map_int32_foreign_message, m1.map_int32_foreign_message) m2.map_int32_foreign_message[123].c = 10 m1.MergeFrom(m2) self.assertEqual(10, m2.map_int32_foreign_message[123].c) @@ -2033,7 +2068,7 @@ class Proto3Test(unittest.TestCase): def testMergeFromBadType(self): msg = map_unittest_pb2.TestMap() - with self.assertRaisesRegexp( + with self.assertRaisesRegex( TypeError, r'Parameter to MergeFrom\(\) must be instance of same class: expected ' r'.+TestMap got int\.'): @@ -2041,7 +2076,7 @@ class Proto3Test(unittest.TestCase): def testCopyFromBadType(self): msg = map_unittest_pb2.TestMap() - with self.assertRaisesRegexp( + with self.assertRaisesRegex( TypeError, r'Parameter to [A-Za-z]*From\(\) must be instance of same class: ' r'expected .+TestMap got int\.'): @@ -2130,6 +2165,34 @@ class Proto3Test(unittest.TestCase): for key in int32_foreign_iter: pass + def testModifyMapEntryWhileIterating(self): + msg = map_unittest_pb2.TestMap() + + msg.map_string_string['abc'] = '123' + msg.map_string_string['def'] = '456' + msg.map_string_string['ghi'] = '789' + + msg.map_int32_foreign_message[5].c = 5 + msg.map_int32_foreign_message[6].c = 6 + msg.map_int32_foreign_message[7].c = 7 + + string_string_keys = list(msg.map_string_string.keys()) + int32_foreign_keys = list(msg.map_int32_foreign_message.keys()) + + keys = [] + for key in msg.map_string_string: + keys.append(key) + msg.map_string_string[key] = '000' + self.assertEqual(keys, string_string_keys) + self.assertEqual(keys, list(msg.map_string_string.keys())) + + keys = [] + for key in msg.map_int32_foreign_message: + keys.append(key) + msg.map_int32_foreign_message[key].c = 0 + self.assertEqual(keys, int32_foreign_keys) + self.assertEqual(keys, list(msg.map_int32_foreign_message.keys())) + def testSubmessageMap(self): msg = map_unittest_pb2.TestMap() @@ -2166,7 +2229,7 @@ class Proto3Test(unittest.TestCase): def testMapItems(self): # Map items used to have strange behaviors when use c extension. Because - # [] may reorder the map and invalidate any exsting iterators. + # [] may reorder the map and invalidate any existing iterators. # TODO(jieluo): Check if [] reordering the map is a bug or intended # behavior. msg = map_unittest_pb2.TestMap() @@ -2241,7 +2304,7 @@ class Proto3Test(unittest.TestCase): msg1 = map_unittest_pb2.TestMap() msg1.map_string_foreign_message['test'].c = 42 msg2 = map_unittest_pb2.TestMap( - map_string_foreign_message=msg1.map_string_foreign_message) + map_string_foreign_message=msg1.map_string_foreign_message) self.assertEqual(42, msg2.map_string_foreign_message['test'].c) def testMapFieldRaisesCorrectError(self): @@ -2376,24 +2439,21 @@ class Proto3Test(unittest.TestCase): msg2.MergeFromString(serialized) self.assertEqual(msg2.optional_string, u'😍') - msg = unittest_proto3_arena_pb2.TestAllTypes( - optional_string=u'\ud001') + msg = unittest_proto3_arena_pb2.TestAllTypes(optional_string=u'\ud001') self.assertEqual(msg.optional_string, u'\ud001') def testSurrogatesInPython3(self): # Surrogates are rejected at setters in Python3. with self.assertRaises(ValueError): - unittest_proto3_arena_pb2.TestAllTypes( - optional_string=u'\ud801\udc01') + unittest_proto3_arena_pb2.TestAllTypes(optional_string=u'\ud801\udc01') with self.assertRaises(ValueError): - unittest_proto3_arena_pb2.TestAllTypes( - optional_string=b'\xed\xa0\x81') + unittest_proto3_arena_pb2.TestAllTypes(optional_string=b'\xed\xa0\x81') with self.assertRaises(ValueError): - unittest_proto3_arena_pb2.TestAllTypes( - optional_string=u'\ud801') + unittest_proto3_arena_pb2.TestAllTypes(optional_string=u'\ud801') with self.assertRaises(ValueError): - unittest_proto3_arena_pb2.TestAllTypes( - optional_string=u'\ud801\ud801') + unittest_proto3_arena_pb2.TestAllTypes(optional_string=u'\ud801\ud801') + + @testing_refleaks.TestCase @@ -2404,8 +2464,9 @@ class ValidTypeNamesTest(unittest.TestCase): tp_name = str(type(msg)).split("'")[1] valid_names = ('Repeated%sContainer' % base_name, 'Repeated%sFieldContainer' % base_name) - self.assertTrue(any(tp_name.endswith(v) for v in valid_names), - '%r does end with any of %r' % (tp_name, valid_names)) + self.assertTrue( + any(tp_name.endswith(v) for v in valid_names), + '%r does end with any of %r' % (tp_name, valid_names)) parts = tp_name.split('.') class_name = parts[-1] @@ -2418,6 +2479,7 @@ class ValidTypeNamesTest(unittest.TestCase): self.assertImportFromName(pb.repeated_int32, 'Scalar') self.assertImportFromName(pb.repeated_nested_message, 'Composite') + @testing_refleaks.TestCase class PackedFieldTest(unittest.TestCase): @@ -2476,66 +2538,35 @@ class PackedFieldTest(unittest.TestCase): self.assertEqual(golden_data, message.SerializeToString()) -@unittest.skipIf(api_implementation.Type() != 'cpp', +@unittest.skipIf(api_implementation.Type() == 'python', 'explicit tests of the C++ implementation') @testing_refleaks.TestCase class OversizeProtosTest(unittest.TestCase): - @classmethod - def setUpClass(cls): - # At the moment, reference cycles between DescriptorPool and Message classes - # are not detected and these objects are never freed. - # To avoid errors with ReferenceLeakChecker, we create the class only once. - file_desc = """ - name: "f/f.msg2" - package: "f" - message_type { - name: "msg1" - field { - name: "payload" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_STRING - } - } - message_type { - name: "msg2" - field { - name: "field" - number: 1 - label: LABEL_OPTIONAL - type: TYPE_MESSAGE - type_name: "msg1" - } - } - """ - pool = descriptor_pool.DescriptorPool() - desc = descriptor_pb2.FileDescriptorProto() - text_format.Parse(file_desc, desc) - pool.Add(desc) - cls.proto_cls = message_factory.MessageFactory(pool).GetPrototype( - pool.FindMessageTypeByName('f.msg2')) + def GenerateNestedProto(self, n): + msg = unittest_pb2.TestRecursiveMessage() + sub = msg + for _ in range(n): + sub = sub.a + sub.i = 0 + return msg.SerializeToString() - def setUp(self): - self.p = self.proto_cls() - self.p.field.payload = 'c' * (1024 * 1024 * 64 + 1) - self.p_serialized = self.p.SerializeToString() + def testSucceedOkSizedProto(self): + msg = unittest_pb2.TestRecursiveMessage() + msg.ParseFromString(self.GenerateNestedProto(100)) def testAssertOversizeProto(self): - from google.protobuf.pyext._message import SetAllowOversizeProtos - SetAllowOversizeProtos(False) - q = self.proto_cls() - try: - q.ParseFromString(self.p_serialized) - except message.DecodeError as e: - self.assertEqual(str(e), 'Error parsing message') + api_implementation._c_module.SetAllowOversizeProtos(False) + msg = unittest_pb2.TestRecursiveMessage() + with self.assertRaises(message.DecodeError) as context: + msg.ParseFromString(self.GenerateNestedProto(101)) + self.assertIn('Error parsing message', str(context.exception)) def testSucceedOversizeProto(self): - from google.protobuf.pyext._message import SetAllowOversizeProtos - SetAllowOversizeProtos(True) - q = self.proto_cls() - q.ParseFromString(self.p_serialized) - self.assertEqual(self.p.field.payload, q.field.payload) + api_implementation._c_module.SetAllowOversizeProtos(True) + msg = unittest_pb2.TestRecursiveMessage() + msg.ParseFromString(self.GenerateNestedProto(101)) + if __name__ == '__main__': unittest.main() diff --git a/windows/python/google/protobuf/internal/missing_enum_values.proto b/windows/python/google/protobuf/internal/missing_enum_values.proto index 5c0f499db..37baca7e5 100644 --- a/windows/python/google/protobuf/internal/missing_enum_values.proto +++ b/windows/python/google/protobuf/internal/missing_enum_values.proto @@ -44,9 +44,7 @@ message TestEnumValues { } message TestMissingEnumValues { - enum NestedEnum { - TWO = 2; - } + enum NestedEnum { TWO = 2; } optional NestedEnum optional_nested_enum = 1; repeated NestedEnum repeated_nested_enum = 2; repeated NestedEnum packed_nested_enum = 3 [packed = true]; @@ -55,3 +53,4 @@ message TestMissingEnumValues { message JustString { required string dummy = 1; } + diff --git a/windows/python/google/protobuf/internal/missing_enum_values_pb2.py b/windows/python/google/protobuf/internal/missing_enum_values_pb2.py index fd6cabc08..549708319 100644 --- a/windows/python/google/protobuf/internal/missing_enum_values_pb2.py +++ b/windows/python/google/protobuf/internal/missing_enum_values_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/missing_enum_values.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,34 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2google/protobuf/internal/missing_enum_values.proto\x12\x1fgoogle.protobuf.python.internal\"\xc1\x02\n\x0eTestEnumValues\x12X\n\x14optional_nested_enum\x18\x01 \x01(\x0e\x32:.google.protobuf.python.internal.TestEnumValues.NestedEnum\x12X\n\x14repeated_nested_enum\x18\x02 \x03(\x0e\x32:.google.protobuf.python.internal.TestEnumValues.NestedEnum\x12Z\n\x12packed_nested_enum\x18\x03 \x03(\x0e\x32:.google.protobuf.python.internal.TestEnumValues.NestedEnumB\x02\x10\x01\"\x1f\n\nNestedEnum\x12\x08\n\x04ZERO\x10\x00\x12\x07\n\x03ONE\x10\x01\"\xd3\x02\n\x15TestMissingEnumValues\x12_\n\x14optional_nested_enum\x18\x01 \x01(\x0e\x32\x41.google.protobuf.python.internal.TestMissingEnumValues.NestedEnum\x12_\n\x14repeated_nested_enum\x18\x02 \x03(\x0e\x32\x41.google.protobuf.python.internal.TestMissingEnumValues.NestedEnum\x12\x61\n\x12packed_nested_enum\x18\x03 \x03(\x0e\x32\x41.google.protobuf.python.internal.TestMissingEnumValues.NestedEnumB\x02\x10\x01\"\x15\n\nNestedEnum\x12\x07\n\x03TWO\x10\x02\"\x1b\n\nJustString\x12\r\n\x05\x64ummy\x18\x01 \x02(\t') - - -_TESTENUMVALUES = DESCRIPTOR.message_types_by_name['TestEnumValues'] -_TESTMISSINGENUMVALUES = DESCRIPTOR.message_types_by_name['TestMissingEnumValues'] -_JUSTSTRING = DESCRIPTOR.message_types_by_name['JustString'] -_TESTENUMVALUES_NESTEDENUM = _TESTENUMVALUES.enum_types_by_name['NestedEnum'] -_TESTMISSINGENUMVALUES_NESTEDENUM = _TESTMISSINGENUMVALUES.enum_types_by_name['NestedEnum'] -TestEnumValues = _reflection.GeneratedProtocolMessageType('TestEnumValues', (_message.Message,), { - 'DESCRIPTOR' : _TESTENUMVALUES, - '__module__' : 'google.protobuf.internal.missing_enum_values_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.TestEnumValues) - }) -_sym_db.RegisterMessage(TestEnumValues) - -TestMissingEnumValues = _reflection.GeneratedProtocolMessageType('TestMissingEnumValues', (_message.Message,), { - 'DESCRIPTOR' : _TESTMISSINGENUMVALUES, - '__module__' : 'google.protobuf.internal.missing_enum_values_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.TestMissingEnumValues) - }) -_sym_db.RegisterMessage(TestMissingEnumValues) - -JustString = _reflection.GeneratedProtocolMessageType('JustString', (_message.Message,), { - 'DESCRIPTOR' : _JUSTSTRING, - '__module__' : 'google.protobuf.internal.missing_enum_values_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.JustString) - }) -_sym_db.RegisterMessage(JustString) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.missing_enum_values_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/internal/more_extensions_dynamic_pb2.py b/windows/python/google/protobuf/internal/more_extensions_dynamic_pb2.py index 41a9d5be4..0953706ba 100644 --- a/windows/python/google/protobuf/internal/more_extensions_dynamic_pb2.py +++ b/windows/python/google/protobuf/internal/more_extensions_dynamic_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/more_extensions_dynamic.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,22 +16,8 @@ from google.protobuf.internal import more_extensions_pb2 as google_dot_protobuf_ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n6google/protobuf/internal/more_extensions_dynamic.proto\x12\x18google.protobuf.internal\x1a.google/protobuf/internal/more_extensions.proto\"\x1f\n\x12\x44ynamicMessageType\x12\t\n\x01\x61\x18\x01 \x01(\x05:J\n\x17\x64ynamic_int32_extension\x12).google.protobuf.internal.ExtendedMessage\x18\x64 \x01(\x05:z\n\x19\x64ynamic_message_extension\x12).google.protobuf.internal.ExtendedMessage\x18\x65 \x01(\x0b\x32,.google.protobuf.internal.DynamicMessageType:\x83\x01\n\"repeated_dynamic_message_extension\x12).google.protobuf.internal.ExtendedMessage\x18\x66 \x03(\x0b\x32,.google.protobuf.internal.DynamicMessageType') - -DYNAMIC_INT32_EXTENSION_FIELD_NUMBER = 100 -dynamic_int32_extension = DESCRIPTOR.extensions_by_name['dynamic_int32_extension'] -DYNAMIC_MESSAGE_EXTENSION_FIELD_NUMBER = 101 -dynamic_message_extension = DESCRIPTOR.extensions_by_name['dynamic_message_extension'] -REPEATED_DYNAMIC_MESSAGE_EXTENSION_FIELD_NUMBER = 102 -repeated_dynamic_message_extension = DESCRIPTOR.extensions_by_name['repeated_dynamic_message_extension'] - -_DYNAMICMESSAGETYPE = DESCRIPTOR.message_types_by_name['DynamicMessageType'] -DynamicMessageType = _reflection.GeneratedProtocolMessageType('DynamicMessageType', (_message.Message,), { - 'DESCRIPTOR' : _DYNAMICMESSAGETYPE, - '__module__' : 'google.protobuf.internal.more_extensions_dynamic_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.DynamicMessageType) - }) -_sym_db.RegisterMessage(DynamicMessageType) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.more_extensions_dynamic_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: google_dot_protobuf_dot_internal_dot_more__extensions__pb2.ExtendedMessage.RegisterExtension(dynamic_int32_extension) google_dot_protobuf_dot_internal_dot_more__extensions__pb2.ExtendedMessage.RegisterExtension(dynamic_message_extension) diff --git a/windows/python/google/protobuf/internal/more_extensions_pb2.py b/windows/python/google/protobuf/internal/more_extensions_pb2.py index 855bd9896..1cfa1b7c8 100644 --- a/windows/python/google/protobuf/internal/more_extensions_pb2.py +++ b/windows/python/google/protobuf/internal/more_extensions_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/more_extensions.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,48 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.google/protobuf/internal/more_extensions.proto\x12\x18google.protobuf.internal\"\x99\x01\n\x0fTopLevelMessage\x12\x41\n\nsubmessage\x18\x01 \x01(\x0b\x32).google.protobuf.internal.ExtendedMessageB\x02(\x01\x12\x43\n\x0enested_message\x18\x02 \x01(\x0b\x32\'.google.protobuf.internal.NestedMessageB\x02(\x01\"R\n\rNestedMessage\x12\x41\n\nsubmessage\x18\x01 \x01(\x0b\x32).google.protobuf.internal.ExtendedMessageB\x02(\x01\"K\n\x0f\x45xtendedMessage\x12\x17\n\x0eoptional_int32\x18\xe9\x07 \x01(\x05\x12\x18\n\x0frepeated_string\x18\xea\x07 \x03(\t*\x05\x08\x01\x10\xe8\x07\"-\n\x0e\x46oreignMessage\x12\x1b\n\x13\x66oreign_message_int\x18\x01 \x01(\x05:I\n\x16optional_int_extension\x12).google.protobuf.internal.ExtendedMessage\x18\x01 \x01(\x05:w\n\x1aoptional_message_extension\x12).google.protobuf.internal.ExtendedMessage\x18\x02 \x01(\x0b\x32(.google.protobuf.internal.ForeignMessage:I\n\x16repeated_int_extension\x12).google.protobuf.internal.ExtendedMessage\x18\x03 \x03(\x05:w\n\x1arepeated_message_extension\x12).google.protobuf.internal.ExtendedMessage\x18\x04 \x03(\x0b\x32(.google.protobuf.internal.ForeignMessage') - -OPTIONAL_INT_EXTENSION_FIELD_NUMBER = 1 -optional_int_extension = DESCRIPTOR.extensions_by_name['optional_int_extension'] -OPTIONAL_MESSAGE_EXTENSION_FIELD_NUMBER = 2 -optional_message_extension = DESCRIPTOR.extensions_by_name['optional_message_extension'] -REPEATED_INT_EXTENSION_FIELD_NUMBER = 3 -repeated_int_extension = DESCRIPTOR.extensions_by_name['repeated_int_extension'] -REPEATED_MESSAGE_EXTENSION_FIELD_NUMBER = 4 -repeated_message_extension = DESCRIPTOR.extensions_by_name['repeated_message_extension'] - -_TOPLEVELMESSAGE = DESCRIPTOR.message_types_by_name['TopLevelMessage'] -_NESTEDMESSAGE = DESCRIPTOR.message_types_by_name['NestedMessage'] -_EXTENDEDMESSAGE = DESCRIPTOR.message_types_by_name['ExtendedMessage'] -_FOREIGNMESSAGE = DESCRIPTOR.message_types_by_name['ForeignMessage'] -TopLevelMessage = _reflection.GeneratedProtocolMessageType('TopLevelMessage', (_message.Message,), { - 'DESCRIPTOR' : _TOPLEVELMESSAGE, - '__module__' : 'google.protobuf.internal.more_extensions_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.TopLevelMessage) - }) -_sym_db.RegisterMessage(TopLevelMessage) - -NestedMessage = _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _NESTEDMESSAGE, - '__module__' : 'google.protobuf.internal.more_extensions_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.NestedMessage) - }) -_sym_db.RegisterMessage(NestedMessage) - -ExtendedMessage = _reflection.GeneratedProtocolMessageType('ExtendedMessage', (_message.Message,), { - 'DESCRIPTOR' : _EXTENDEDMESSAGE, - '__module__' : 'google.protobuf.internal.more_extensions_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.ExtendedMessage) - }) -_sym_db.RegisterMessage(ExtendedMessage) - -ForeignMessage = _reflection.GeneratedProtocolMessageType('ForeignMessage', (_message.Message,), { - 'DESCRIPTOR' : _FOREIGNMESSAGE, - '__module__' : 'google.protobuf.internal.more_extensions_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.ForeignMessage) - }) -_sym_db.RegisterMessage(ForeignMessage) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.more_extensions_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: ExtendedMessage.RegisterExtension(optional_int_extension) ExtendedMessage.RegisterExtension(optional_message_extension) diff --git a/windows/python/google/protobuf/internal/more_messages_pb2.py b/windows/python/google/protobuf/internal/more_messages_pb2.py index 02b698c2e..d7f711560 100644 --- a/windows/python/google/protobuf/internal/more_messages_pb2.py +++ b/windows/python/google/protobuf/internal/more_messages_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/more_messages.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,2374 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,google/protobuf/internal/more_messages.proto\x12\x18google.protobuf.internal\"h\n\x10OutOfOrderFields\x12\x17\n\x0foptional_sint32\x18\x05 \x01(\x11\x12\x17\n\x0foptional_uint32\x18\x03 \x01(\r\x12\x16\n\x0eoptional_int32\x18\x01 \x01(\x05*\x04\x08\x04\x10\x05*\x04\x08\x02\x10\x03\"\xcd\x02\n\x05\x63lass\x12\x1b\n\tint_field\x18\x01 \x01(\x05R\x08json_int\x12\n\n\x02if\x18\x02 \x01(\x05\x12(\n\x02\x61s\x18\x03 \x01(\x0e\x32\x1c.google.protobuf.internal.is\x12\x30\n\nenum_field\x18\x04 \x01(\x0e\x32\x1c.google.protobuf.internal.is\x12>\n\x11nested_enum_field\x18\x05 \x01(\x0e\x32#.google.protobuf.internal.class.for\x12;\n\x0enested_message\x18\x06 \x01(\x0b\x32#.google.protobuf.internal.class.try\x1a\x1c\n\x03try\x12\r\n\x05\x66ield\x18\x01 \x01(\x05*\x06\x08\xe7\x07\x10\x90N\"\x1c\n\x03\x66or\x12\x0b\n\x07\x64\x65\x66\x61ult\x10\x00\x12\x08\n\x04True\x10\x01*\x06\x08\xe7\x07\x10\x90N\"?\n\x0b\x45xtendClass20\n\x06return\x12\x1f.google.protobuf.internal.class\x18\xea\x07 \x01(\x05\"~\n\x0fTestFullKeyword\x12:\n\x06\x66ield1\x18\x01 \x01(\x0b\x32*.google.protobuf.internal.OutOfOrderFields\x12/\n\x06\x66ield2\x18\x02 \x01(\x0b\x32\x1f.google.protobuf.internal.class\"\xa5\x0f\n\x11LotsNestedMessage\x1a\x04\n\x02\x42\x30\x1a\x04\n\x02\x42\x31\x1a\x04\n\x02\x42\x32\x1a\x04\n\x02\x42\x33\x1a\x04\n\x02\x42\x34\x1a\x04\n\x02\x42\x35\x1a\x04\n\x02\x42\x36\x1a\x04\n\x02\x42\x37\x1a\x04\n\x02\x42\x38\x1a\x04\n\x02\x42\x39\x1a\x05\n\x03\x42\x31\x30\x1a\x05\n\x03\x42\x31\x31\x1a\x05\n\x03\x42\x31\x32\x1a\x05\n\x03\x42\x31\x33\x1a\x05\n\x03\x42\x31\x34\x1a\x05\n\x03\x42\x31\x35\x1a\x05\n\x03\x42\x31\x36\x1a\x05\n\x03\x42\x31\x37\x1a\x05\n\x03\x42\x31\x38\x1a\x05\n\x03\x42\x31\x39\x1a\x05\n\x03\x42\x32\x30\x1a\x05\n\x03\x42\x32\x31\x1a\x05\n\x03\x42\x32\x32\x1a\x05\n\x03\x42\x32\x33\x1a\x05\n\x03\x42\x32\x34\x1a\x05\n\x03\x42\x32\x35\x1a\x05\n\x03\x42\x32\x36\x1a\x05\n\x03\x42\x32\x37\x1a\x05\n\x03\x42\x32\x38\x1a\x05\n\x03\x42\x32\x39\x1a\x05\n\x03\x42\x33\x30\x1a\x05\n\x03\x42\x33\x31\x1a\x05\n\x03\x42\x33\x32\x1a\x05\n\x03\x42\x33\x33\x1a\x05\n\x03\x42\x33\x34\x1a\x05\n\x03\x42\x33\x35\x1a\x05\n\x03\x42\x33\x36\x1a\x05\n\x03\x42\x33\x37\x1a\x05\n\x03\x42\x33\x38\x1a\x05\n\x03\x42\x33\x39\x1a\x05\n\x03\x42\x34\x30\x1a\x05\n\x03\x42\x34\x31\x1a\x05\n\x03\x42\x34\x32\x1a\x05\n\x03\x42\x34\x33\x1a\x05\n\x03\x42\x34\x34\x1a\x05\n\x03\x42\x34\x35\x1a\x05\n\x03\x42\x34\x36\x1a\x05\n\x03\x42\x34\x37\x1a\x05\n\x03\x42\x34\x38\x1a\x05\n\x03\x42\x34\x39\x1a\x05\n\x03\x42\x35\x30\x1a\x05\n\x03\x42\x35\x31\x1a\x05\n\x03\x42\x35\x32\x1a\x05\n\x03\x42\x35\x33\x1a\x05\n\x03\x42\x35\x34\x1a\x05\n\x03\x42\x35\x35\x1a\x05\n\x03\x42\x35\x36\x1a\x05\n\x03\x42\x35\x37\x1a\x05\n\x03\x42\x35\x38\x1a\x05\n\x03\x42\x35\x39\x1a\x05\n\x03\x42\x36\x30\x1a\x05\n\x03\x42\x36\x31\x1a\x05\n\x03\x42\x36\x32\x1a\x05\n\x03\x42\x36\x33\x1a\x05\n\x03\x42\x36\x34\x1a\x05\n\x03\x42\x36\x35\x1a\x05\n\x03\x42\x36\x36\x1a\x05\n\x03\x42\x36\x37\x1a\x05\n\x03\x42\x36\x38\x1a\x05\n\x03\x42\x36\x39\x1a\x05\n\x03\x42\x37\x30\x1a\x05\n\x03\x42\x37\x31\x1a\x05\n\x03\x42\x37\x32\x1a\x05\n\x03\x42\x37\x33\x1a\x05\n\x03\x42\x37\x34\x1a\x05\n\x03\x42\x37\x35\x1a\x05\n\x03\x42\x37\x36\x1a\x05\n\x03\x42\x37\x37\x1a\x05\n\x03\x42\x37\x38\x1a\x05\n\x03\x42\x37\x39\x1a\x05\n\x03\x42\x38\x30\x1a\x05\n\x03\x42\x38\x31\x1a\x05\n\x03\x42\x38\x32\x1a\x05\n\x03\x42\x38\x33\x1a\x05\n\x03\x42\x38\x34\x1a\x05\n\x03\x42\x38\x35\x1a\x05\n\x03\x42\x38\x36\x1a\x05\n\x03\x42\x38\x37\x1a\x05\n\x03\x42\x38\x38\x1a\x05\n\x03\x42\x38\x39\x1a\x05\n\x03\x42\x39\x30\x1a\x05\n\x03\x42\x39\x31\x1a\x05\n\x03\x42\x39\x32\x1a\x05\n\x03\x42\x39\x33\x1a\x05\n\x03\x42\x39\x34\x1a\x05\n\x03\x42\x39\x35\x1a\x05\n\x03\x42\x39\x36\x1a\x05\n\x03\x42\x39\x37\x1a\x05\n\x03\x42\x39\x38\x1a\x05\n\x03\x42\x39\x39\x1a\x06\n\x04\x42\x31\x30\x30\x1a\x06\n\x04\x42\x31\x30\x31\x1a\x06\n\x04\x42\x31\x30\x32\x1a\x06\n\x04\x42\x31\x30\x33\x1a\x06\n\x04\x42\x31\x30\x34\x1a\x06\n\x04\x42\x31\x30\x35\x1a\x06\n\x04\x42\x31\x30\x36\x1a\x06\n\x04\x42\x31\x30\x37\x1a\x06\n\x04\x42\x31\x30\x38\x1a\x06\n\x04\x42\x31\x30\x39\x1a\x06\n\x04\x42\x31\x31\x30\x1a\x06\n\x04\x42\x31\x31\x31\x1a\x06\n\x04\x42\x31\x31\x32\x1a\x06\n\x04\x42\x31\x31\x33\x1a\x06\n\x04\x42\x31\x31\x34\x1a\x06\n\x04\x42\x31\x31\x35\x1a\x06\n\x04\x42\x31\x31\x36\x1a\x06\n\x04\x42\x31\x31\x37\x1a\x06\n\x04\x42\x31\x31\x38\x1a\x06\n\x04\x42\x31\x31\x39\x1a\x06\n\x04\x42\x31\x32\x30\x1a\x06\n\x04\x42\x31\x32\x31\x1a\x06\n\x04\x42\x31\x32\x32\x1a\x06\n\x04\x42\x31\x32\x33\x1a\x06\n\x04\x42\x31\x32\x34\x1a\x06\n\x04\x42\x31\x32\x35\x1a\x06\n\x04\x42\x31\x32\x36\x1a\x06\n\x04\x42\x31\x32\x37\x1a\x06\n\x04\x42\x31\x32\x38\x1a\x06\n\x04\x42\x31\x32\x39\x1a\x06\n\x04\x42\x31\x33\x30\x1a\x06\n\x04\x42\x31\x33\x31\x1a\x06\n\x04\x42\x31\x33\x32\x1a\x06\n\x04\x42\x31\x33\x33\x1a\x06\n\x04\x42\x31\x33\x34\x1a\x06\n\x04\x42\x31\x33\x35\x1a\x06\n\x04\x42\x31\x33\x36\x1a\x06\n\x04\x42\x31\x33\x37\x1a\x06\n\x04\x42\x31\x33\x38\x1a\x06\n\x04\x42\x31\x33\x39\x1a\x06\n\x04\x42\x31\x34\x30\x1a\x06\n\x04\x42\x31\x34\x31\x1a\x06\n\x04\x42\x31\x34\x32\x1a\x06\n\x04\x42\x31\x34\x33\x1a\x06\n\x04\x42\x31\x34\x34\x1a\x06\n\x04\x42\x31\x34\x35\x1a\x06\n\x04\x42\x31\x34\x36\x1a\x06\n\x04\x42\x31\x34\x37\x1a\x06\n\x04\x42\x31\x34\x38\x1a\x06\n\x04\x42\x31\x34\x39\x1a\x06\n\x04\x42\x31\x35\x30\x1a\x06\n\x04\x42\x31\x35\x31\x1a\x06\n\x04\x42\x31\x35\x32\x1a\x06\n\x04\x42\x31\x35\x33\x1a\x06\n\x04\x42\x31\x35\x34\x1a\x06\n\x04\x42\x31\x35\x35\x1a\x06\n\x04\x42\x31\x35\x36\x1a\x06\n\x04\x42\x31\x35\x37\x1a\x06\n\x04\x42\x31\x35\x38\x1a\x06\n\x04\x42\x31\x35\x39\x1a\x06\n\x04\x42\x31\x36\x30\x1a\x06\n\x04\x42\x31\x36\x31\x1a\x06\n\x04\x42\x31\x36\x32\x1a\x06\n\x04\x42\x31\x36\x33\x1a\x06\n\x04\x42\x31\x36\x34\x1a\x06\n\x04\x42\x31\x36\x35\x1a\x06\n\x04\x42\x31\x36\x36\x1a\x06\n\x04\x42\x31\x36\x37\x1a\x06\n\x04\x42\x31\x36\x38\x1a\x06\n\x04\x42\x31\x36\x39\x1a\x06\n\x04\x42\x31\x37\x30\x1a\x06\n\x04\x42\x31\x37\x31\x1a\x06\n\x04\x42\x31\x37\x32\x1a\x06\n\x04\x42\x31\x37\x33\x1a\x06\n\x04\x42\x31\x37\x34\x1a\x06\n\x04\x42\x31\x37\x35\x1a\x06\n\x04\x42\x31\x37\x36\x1a\x06\n\x04\x42\x31\x37\x37\x1a\x06\n\x04\x42\x31\x37\x38\x1a\x06\n\x04\x42\x31\x37\x39\x1a\x06\n\x04\x42\x31\x38\x30\x1a\x06\n\x04\x42\x31\x38\x31\x1a\x06\n\x04\x42\x31\x38\x32\x1a\x06\n\x04\x42\x31\x38\x33\x1a\x06\n\x04\x42\x31\x38\x34\x1a\x06\n\x04\x42\x31\x38\x35\x1a\x06\n\x04\x42\x31\x38\x36\x1a\x06\n\x04\x42\x31\x38\x37\x1a\x06\n\x04\x42\x31\x38\x38\x1a\x06\n\x04\x42\x31\x38\x39\x1a\x06\n\x04\x42\x31\x39\x30\x1a\x06\n\x04\x42\x31\x39\x31\x1a\x06\n\x04\x42\x31\x39\x32\x1a\x06\n\x04\x42\x31\x39\x33\x1a\x06\n\x04\x42\x31\x39\x34\x1a\x06\n\x04\x42\x31\x39\x35\x1a\x06\n\x04\x42\x31\x39\x36\x1a\x06\n\x04\x42\x31\x39\x37\x1a\x06\n\x04\x42\x31\x39\x38\x1a\x06\n\x04\x42\x31\x39\x39\x1a\x06\n\x04\x42\x32\x30\x30\x1a\x06\n\x04\x42\x32\x30\x31\x1a\x06\n\x04\x42\x32\x30\x32\x1a\x06\n\x04\x42\x32\x30\x33\x1a\x06\n\x04\x42\x32\x30\x34\x1a\x06\n\x04\x42\x32\x30\x35\x1a\x06\n\x04\x42\x32\x30\x36\x1a\x06\n\x04\x42\x32\x30\x37\x1a\x06\n\x04\x42\x32\x30\x38\x1a\x06\n\x04\x42\x32\x30\x39\x1a\x06\n\x04\x42\x32\x31\x30\x1a\x06\n\x04\x42\x32\x31\x31\x1a\x06\n\x04\x42\x32\x31\x32\x1a\x06\n\x04\x42\x32\x31\x33\x1a\x06\n\x04\x42\x32\x31\x34\x1a\x06\n\x04\x42\x32\x31\x35\x1a\x06\n\x04\x42\x32\x31\x36\x1a\x06\n\x04\x42\x32\x31\x37\x1a\x06\n\x04\x42\x32\x31\x38\x1a\x06\n\x04\x42\x32\x31\x39\x1a\x06\n\x04\x42\x32\x32\x30\x1a\x06\n\x04\x42\x32\x32\x31\x1a\x06\n\x04\x42\x32\x32\x32\x1a\x06\n\x04\x42\x32\x32\x33\x1a\x06\n\x04\x42\x32\x32\x34\x1a\x06\n\x04\x42\x32\x32\x35\x1a\x06\n\x04\x42\x32\x32\x36\x1a\x06\n\x04\x42\x32\x32\x37\x1a\x06\n\x04\x42\x32\x32\x38\x1a\x06\n\x04\x42\x32\x32\x39\x1a\x06\n\x04\x42\x32\x33\x30\x1a\x06\n\x04\x42\x32\x33\x31\x1a\x06\n\x04\x42\x32\x33\x32\x1a\x06\n\x04\x42\x32\x33\x33\x1a\x06\n\x04\x42\x32\x33\x34\x1a\x06\n\x04\x42\x32\x33\x35\x1a\x06\n\x04\x42\x32\x33\x36\x1a\x06\n\x04\x42\x32\x33\x37\x1a\x06\n\x04\x42\x32\x33\x38\x1a\x06\n\x04\x42\x32\x33\x39\x1a\x06\n\x04\x42\x32\x34\x30\x1a\x06\n\x04\x42\x32\x34\x31\x1a\x06\n\x04\x42\x32\x34\x32\x1a\x06\n\x04\x42\x32\x34\x33\x1a\x06\n\x04\x42\x32\x34\x34\x1a\x06\n\x04\x42\x32\x34\x35\x1a\x06\n\x04\x42\x32\x34\x36\x1a\x06\n\x04\x42\x32\x34\x37\x1a\x06\n\x04\x42\x32\x34\x38\x1a\x06\n\x04\x42\x32\x34\x39\x1a\x06\n\x04\x42\x32\x35\x30\x1a\x06\n\x04\x42\x32\x35\x31\x1a\x06\n\x04\x42\x32\x35\x32\x1a\x06\n\x04\x42\x32\x35\x33\x1a\x06\n\x04\x42\x32\x35\x34\x1a\x06\n\x04\x42\x32\x35\x35*\x1b\n\x02is\x12\x0b\n\x07\x64\x65\x66\x61ult\x10\x00\x12\x08\n\x04\x65lse\x10\x01:C\n\x0foptional_uint64\x12*.google.protobuf.internal.OutOfOrderFields\x18\x04 \x01(\x04:B\n\x0eoptional_int64\x12*.google.protobuf.internal.OutOfOrderFields\x18\x02 \x01(\x03:2\n\x08\x63ontinue\x12\x1f.google.protobuf.internal.class\x18\xe9\x07 \x01(\x05:2\n\x04with\x12#.google.protobuf.internal.class.try\x18\xe9\x07 \x01(\x05') -_IS = DESCRIPTOR.enum_types_by_name['is'] -globals()['is'] = enum_type_wrapper.EnumTypeWrapper(_IS) -default = 0 -globals()['else'] = 1 - -OPTIONAL_UINT64_FIELD_NUMBER = 4 -optional_uint64 = DESCRIPTOR.extensions_by_name['optional_uint64'] -OPTIONAL_INT64_FIELD_NUMBER = 2 -optional_int64 = DESCRIPTOR.extensions_by_name['optional_int64'] -CONTINUE_FIELD_NUMBER = 1001 -globals()['continue'] = DESCRIPTOR.extensions_by_name['continue'] -WITH_FIELD_NUMBER = 1001 -globals()['with'] = DESCRIPTOR.extensions_by_name['with'] - -_OUTOFORDERFIELDS = DESCRIPTOR.message_types_by_name['OutOfOrderFields'] -_CLASS = DESCRIPTOR.message_types_by_name['class'] -_CLASS_TRY = _CLASS.nested_types_by_name['try'] -_EXTENDCLASS = DESCRIPTOR.message_types_by_name['ExtendClass'] -_TESTFULLKEYWORD = DESCRIPTOR.message_types_by_name['TestFullKeyword'] -_LOTSNESTEDMESSAGE = DESCRIPTOR.message_types_by_name['LotsNestedMessage'] -_LOTSNESTEDMESSAGE_B0 = _LOTSNESTEDMESSAGE.nested_types_by_name['B0'] -_LOTSNESTEDMESSAGE_B1 = _LOTSNESTEDMESSAGE.nested_types_by_name['B1'] -_LOTSNESTEDMESSAGE_B2 = _LOTSNESTEDMESSAGE.nested_types_by_name['B2'] -_LOTSNESTEDMESSAGE_B3 = _LOTSNESTEDMESSAGE.nested_types_by_name['B3'] -_LOTSNESTEDMESSAGE_B4 = _LOTSNESTEDMESSAGE.nested_types_by_name['B4'] -_LOTSNESTEDMESSAGE_B5 = _LOTSNESTEDMESSAGE.nested_types_by_name['B5'] -_LOTSNESTEDMESSAGE_B6 = _LOTSNESTEDMESSAGE.nested_types_by_name['B6'] -_LOTSNESTEDMESSAGE_B7 = _LOTSNESTEDMESSAGE.nested_types_by_name['B7'] -_LOTSNESTEDMESSAGE_B8 = _LOTSNESTEDMESSAGE.nested_types_by_name['B8'] -_LOTSNESTEDMESSAGE_B9 = _LOTSNESTEDMESSAGE.nested_types_by_name['B9'] -_LOTSNESTEDMESSAGE_B10 = _LOTSNESTEDMESSAGE.nested_types_by_name['B10'] -_LOTSNESTEDMESSAGE_B11 = _LOTSNESTEDMESSAGE.nested_types_by_name['B11'] -_LOTSNESTEDMESSAGE_B12 = _LOTSNESTEDMESSAGE.nested_types_by_name['B12'] -_LOTSNESTEDMESSAGE_B13 = _LOTSNESTEDMESSAGE.nested_types_by_name['B13'] -_LOTSNESTEDMESSAGE_B14 = _LOTSNESTEDMESSAGE.nested_types_by_name['B14'] -_LOTSNESTEDMESSAGE_B15 = _LOTSNESTEDMESSAGE.nested_types_by_name['B15'] -_LOTSNESTEDMESSAGE_B16 = _LOTSNESTEDMESSAGE.nested_types_by_name['B16'] -_LOTSNESTEDMESSAGE_B17 = _LOTSNESTEDMESSAGE.nested_types_by_name['B17'] -_LOTSNESTEDMESSAGE_B18 = _LOTSNESTEDMESSAGE.nested_types_by_name['B18'] -_LOTSNESTEDMESSAGE_B19 = _LOTSNESTEDMESSAGE.nested_types_by_name['B19'] -_LOTSNESTEDMESSAGE_B20 = _LOTSNESTEDMESSAGE.nested_types_by_name['B20'] -_LOTSNESTEDMESSAGE_B21 = _LOTSNESTEDMESSAGE.nested_types_by_name['B21'] -_LOTSNESTEDMESSAGE_B22 = _LOTSNESTEDMESSAGE.nested_types_by_name['B22'] -_LOTSNESTEDMESSAGE_B23 = _LOTSNESTEDMESSAGE.nested_types_by_name['B23'] -_LOTSNESTEDMESSAGE_B24 = _LOTSNESTEDMESSAGE.nested_types_by_name['B24'] -_LOTSNESTEDMESSAGE_B25 = _LOTSNESTEDMESSAGE.nested_types_by_name['B25'] -_LOTSNESTEDMESSAGE_B26 = _LOTSNESTEDMESSAGE.nested_types_by_name['B26'] -_LOTSNESTEDMESSAGE_B27 = _LOTSNESTEDMESSAGE.nested_types_by_name['B27'] -_LOTSNESTEDMESSAGE_B28 = _LOTSNESTEDMESSAGE.nested_types_by_name['B28'] -_LOTSNESTEDMESSAGE_B29 = _LOTSNESTEDMESSAGE.nested_types_by_name['B29'] -_LOTSNESTEDMESSAGE_B30 = _LOTSNESTEDMESSAGE.nested_types_by_name['B30'] -_LOTSNESTEDMESSAGE_B31 = _LOTSNESTEDMESSAGE.nested_types_by_name['B31'] -_LOTSNESTEDMESSAGE_B32 = _LOTSNESTEDMESSAGE.nested_types_by_name['B32'] -_LOTSNESTEDMESSAGE_B33 = _LOTSNESTEDMESSAGE.nested_types_by_name['B33'] -_LOTSNESTEDMESSAGE_B34 = _LOTSNESTEDMESSAGE.nested_types_by_name['B34'] -_LOTSNESTEDMESSAGE_B35 = _LOTSNESTEDMESSAGE.nested_types_by_name['B35'] -_LOTSNESTEDMESSAGE_B36 = _LOTSNESTEDMESSAGE.nested_types_by_name['B36'] -_LOTSNESTEDMESSAGE_B37 = _LOTSNESTEDMESSAGE.nested_types_by_name['B37'] -_LOTSNESTEDMESSAGE_B38 = _LOTSNESTEDMESSAGE.nested_types_by_name['B38'] -_LOTSNESTEDMESSAGE_B39 = _LOTSNESTEDMESSAGE.nested_types_by_name['B39'] -_LOTSNESTEDMESSAGE_B40 = _LOTSNESTEDMESSAGE.nested_types_by_name['B40'] -_LOTSNESTEDMESSAGE_B41 = _LOTSNESTEDMESSAGE.nested_types_by_name['B41'] -_LOTSNESTEDMESSAGE_B42 = _LOTSNESTEDMESSAGE.nested_types_by_name['B42'] -_LOTSNESTEDMESSAGE_B43 = _LOTSNESTEDMESSAGE.nested_types_by_name['B43'] -_LOTSNESTEDMESSAGE_B44 = _LOTSNESTEDMESSAGE.nested_types_by_name['B44'] -_LOTSNESTEDMESSAGE_B45 = _LOTSNESTEDMESSAGE.nested_types_by_name['B45'] -_LOTSNESTEDMESSAGE_B46 = _LOTSNESTEDMESSAGE.nested_types_by_name['B46'] -_LOTSNESTEDMESSAGE_B47 = _LOTSNESTEDMESSAGE.nested_types_by_name['B47'] -_LOTSNESTEDMESSAGE_B48 = _LOTSNESTEDMESSAGE.nested_types_by_name['B48'] -_LOTSNESTEDMESSAGE_B49 = _LOTSNESTEDMESSAGE.nested_types_by_name['B49'] -_LOTSNESTEDMESSAGE_B50 = _LOTSNESTEDMESSAGE.nested_types_by_name['B50'] -_LOTSNESTEDMESSAGE_B51 = _LOTSNESTEDMESSAGE.nested_types_by_name['B51'] -_LOTSNESTEDMESSAGE_B52 = _LOTSNESTEDMESSAGE.nested_types_by_name['B52'] -_LOTSNESTEDMESSAGE_B53 = _LOTSNESTEDMESSAGE.nested_types_by_name['B53'] -_LOTSNESTEDMESSAGE_B54 = _LOTSNESTEDMESSAGE.nested_types_by_name['B54'] -_LOTSNESTEDMESSAGE_B55 = _LOTSNESTEDMESSAGE.nested_types_by_name['B55'] -_LOTSNESTEDMESSAGE_B56 = _LOTSNESTEDMESSAGE.nested_types_by_name['B56'] -_LOTSNESTEDMESSAGE_B57 = _LOTSNESTEDMESSAGE.nested_types_by_name['B57'] -_LOTSNESTEDMESSAGE_B58 = _LOTSNESTEDMESSAGE.nested_types_by_name['B58'] -_LOTSNESTEDMESSAGE_B59 = _LOTSNESTEDMESSAGE.nested_types_by_name['B59'] -_LOTSNESTEDMESSAGE_B60 = _LOTSNESTEDMESSAGE.nested_types_by_name['B60'] -_LOTSNESTEDMESSAGE_B61 = _LOTSNESTEDMESSAGE.nested_types_by_name['B61'] -_LOTSNESTEDMESSAGE_B62 = _LOTSNESTEDMESSAGE.nested_types_by_name['B62'] -_LOTSNESTEDMESSAGE_B63 = _LOTSNESTEDMESSAGE.nested_types_by_name['B63'] -_LOTSNESTEDMESSAGE_B64 = _LOTSNESTEDMESSAGE.nested_types_by_name['B64'] -_LOTSNESTEDMESSAGE_B65 = _LOTSNESTEDMESSAGE.nested_types_by_name['B65'] -_LOTSNESTEDMESSAGE_B66 = _LOTSNESTEDMESSAGE.nested_types_by_name['B66'] -_LOTSNESTEDMESSAGE_B67 = _LOTSNESTEDMESSAGE.nested_types_by_name['B67'] -_LOTSNESTEDMESSAGE_B68 = _LOTSNESTEDMESSAGE.nested_types_by_name['B68'] -_LOTSNESTEDMESSAGE_B69 = _LOTSNESTEDMESSAGE.nested_types_by_name['B69'] -_LOTSNESTEDMESSAGE_B70 = _LOTSNESTEDMESSAGE.nested_types_by_name['B70'] -_LOTSNESTEDMESSAGE_B71 = _LOTSNESTEDMESSAGE.nested_types_by_name['B71'] -_LOTSNESTEDMESSAGE_B72 = _LOTSNESTEDMESSAGE.nested_types_by_name['B72'] -_LOTSNESTEDMESSAGE_B73 = _LOTSNESTEDMESSAGE.nested_types_by_name['B73'] -_LOTSNESTEDMESSAGE_B74 = _LOTSNESTEDMESSAGE.nested_types_by_name['B74'] -_LOTSNESTEDMESSAGE_B75 = _LOTSNESTEDMESSAGE.nested_types_by_name['B75'] -_LOTSNESTEDMESSAGE_B76 = _LOTSNESTEDMESSAGE.nested_types_by_name['B76'] -_LOTSNESTEDMESSAGE_B77 = _LOTSNESTEDMESSAGE.nested_types_by_name['B77'] -_LOTSNESTEDMESSAGE_B78 = _LOTSNESTEDMESSAGE.nested_types_by_name['B78'] -_LOTSNESTEDMESSAGE_B79 = _LOTSNESTEDMESSAGE.nested_types_by_name['B79'] -_LOTSNESTEDMESSAGE_B80 = _LOTSNESTEDMESSAGE.nested_types_by_name['B80'] -_LOTSNESTEDMESSAGE_B81 = _LOTSNESTEDMESSAGE.nested_types_by_name['B81'] -_LOTSNESTEDMESSAGE_B82 = _LOTSNESTEDMESSAGE.nested_types_by_name['B82'] -_LOTSNESTEDMESSAGE_B83 = _LOTSNESTEDMESSAGE.nested_types_by_name['B83'] -_LOTSNESTEDMESSAGE_B84 = _LOTSNESTEDMESSAGE.nested_types_by_name['B84'] -_LOTSNESTEDMESSAGE_B85 = _LOTSNESTEDMESSAGE.nested_types_by_name['B85'] -_LOTSNESTEDMESSAGE_B86 = _LOTSNESTEDMESSAGE.nested_types_by_name['B86'] -_LOTSNESTEDMESSAGE_B87 = _LOTSNESTEDMESSAGE.nested_types_by_name['B87'] -_LOTSNESTEDMESSAGE_B88 = _LOTSNESTEDMESSAGE.nested_types_by_name['B88'] -_LOTSNESTEDMESSAGE_B89 = _LOTSNESTEDMESSAGE.nested_types_by_name['B89'] -_LOTSNESTEDMESSAGE_B90 = _LOTSNESTEDMESSAGE.nested_types_by_name['B90'] -_LOTSNESTEDMESSAGE_B91 = _LOTSNESTEDMESSAGE.nested_types_by_name['B91'] -_LOTSNESTEDMESSAGE_B92 = _LOTSNESTEDMESSAGE.nested_types_by_name['B92'] -_LOTSNESTEDMESSAGE_B93 = _LOTSNESTEDMESSAGE.nested_types_by_name['B93'] -_LOTSNESTEDMESSAGE_B94 = _LOTSNESTEDMESSAGE.nested_types_by_name['B94'] -_LOTSNESTEDMESSAGE_B95 = _LOTSNESTEDMESSAGE.nested_types_by_name['B95'] -_LOTSNESTEDMESSAGE_B96 = _LOTSNESTEDMESSAGE.nested_types_by_name['B96'] -_LOTSNESTEDMESSAGE_B97 = _LOTSNESTEDMESSAGE.nested_types_by_name['B97'] -_LOTSNESTEDMESSAGE_B98 = _LOTSNESTEDMESSAGE.nested_types_by_name['B98'] -_LOTSNESTEDMESSAGE_B99 = _LOTSNESTEDMESSAGE.nested_types_by_name['B99'] -_LOTSNESTEDMESSAGE_B100 = _LOTSNESTEDMESSAGE.nested_types_by_name['B100'] -_LOTSNESTEDMESSAGE_B101 = _LOTSNESTEDMESSAGE.nested_types_by_name['B101'] -_LOTSNESTEDMESSAGE_B102 = _LOTSNESTEDMESSAGE.nested_types_by_name['B102'] -_LOTSNESTEDMESSAGE_B103 = _LOTSNESTEDMESSAGE.nested_types_by_name['B103'] -_LOTSNESTEDMESSAGE_B104 = _LOTSNESTEDMESSAGE.nested_types_by_name['B104'] -_LOTSNESTEDMESSAGE_B105 = _LOTSNESTEDMESSAGE.nested_types_by_name['B105'] -_LOTSNESTEDMESSAGE_B106 = _LOTSNESTEDMESSAGE.nested_types_by_name['B106'] -_LOTSNESTEDMESSAGE_B107 = _LOTSNESTEDMESSAGE.nested_types_by_name['B107'] -_LOTSNESTEDMESSAGE_B108 = _LOTSNESTEDMESSAGE.nested_types_by_name['B108'] -_LOTSNESTEDMESSAGE_B109 = _LOTSNESTEDMESSAGE.nested_types_by_name['B109'] -_LOTSNESTEDMESSAGE_B110 = _LOTSNESTEDMESSAGE.nested_types_by_name['B110'] -_LOTSNESTEDMESSAGE_B111 = _LOTSNESTEDMESSAGE.nested_types_by_name['B111'] -_LOTSNESTEDMESSAGE_B112 = _LOTSNESTEDMESSAGE.nested_types_by_name['B112'] -_LOTSNESTEDMESSAGE_B113 = _LOTSNESTEDMESSAGE.nested_types_by_name['B113'] -_LOTSNESTEDMESSAGE_B114 = _LOTSNESTEDMESSAGE.nested_types_by_name['B114'] -_LOTSNESTEDMESSAGE_B115 = _LOTSNESTEDMESSAGE.nested_types_by_name['B115'] -_LOTSNESTEDMESSAGE_B116 = _LOTSNESTEDMESSAGE.nested_types_by_name['B116'] -_LOTSNESTEDMESSAGE_B117 = _LOTSNESTEDMESSAGE.nested_types_by_name['B117'] -_LOTSNESTEDMESSAGE_B118 = _LOTSNESTEDMESSAGE.nested_types_by_name['B118'] -_LOTSNESTEDMESSAGE_B119 = _LOTSNESTEDMESSAGE.nested_types_by_name['B119'] -_LOTSNESTEDMESSAGE_B120 = _LOTSNESTEDMESSAGE.nested_types_by_name['B120'] -_LOTSNESTEDMESSAGE_B121 = _LOTSNESTEDMESSAGE.nested_types_by_name['B121'] -_LOTSNESTEDMESSAGE_B122 = _LOTSNESTEDMESSAGE.nested_types_by_name['B122'] -_LOTSNESTEDMESSAGE_B123 = _LOTSNESTEDMESSAGE.nested_types_by_name['B123'] -_LOTSNESTEDMESSAGE_B124 = _LOTSNESTEDMESSAGE.nested_types_by_name['B124'] -_LOTSNESTEDMESSAGE_B125 = _LOTSNESTEDMESSAGE.nested_types_by_name['B125'] -_LOTSNESTEDMESSAGE_B126 = _LOTSNESTEDMESSAGE.nested_types_by_name['B126'] -_LOTSNESTEDMESSAGE_B127 = _LOTSNESTEDMESSAGE.nested_types_by_name['B127'] -_LOTSNESTEDMESSAGE_B128 = _LOTSNESTEDMESSAGE.nested_types_by_name['B128'] -_LOTSNESTEDMESSAGE_B129 = _LOTSNESTEDMESSAGE.nested_types_by_name['B129'] -_LOTSNESTEDMESSAGE_B130 = _LOTSNESTEDMESSAGE.nested_types_by_name['B130'] -_LOTSNESTEDMESSAGE_B131 = _LOTSNESTEDMESSAGE.nested_types_by_name['B131'] -_LOTSNESTEDMESSAGE_B132 = _LOTSNESTEDMESSAGE.nested_types_by_name['B132'] -_LOTSNESTEDMESSAGE_B133 = _LOTSNESTEDMESSAGE.nested_types_by_name['B133'] -_LOTSNESTEDMESSAGE_B134 = _LOTSNESTEDMESSAGE.nested_types_by_name['B134'] -_LOTSNESTEDMESSAGE_B135 = _LOTSNESTEDMESSAGE.nested_types_by_name['B135'] -_LOTSNESTEDMESSAGE_B136 = _LOTSNESTEDMESSAGE.nested_types_by_name['B136'] -_LOTSNESTEDMESSAGE_B137 = _LOTSNESTEDMESSAGE.nested_types_by_name['B137'] -_LOTSNESTEDMESSAGE_B138 = _LOTSNESTEDMESSAGE.nested_types_by_name['B138'] -_LOTSNESTEDMESSAGE_B139 = _LOTSNESTEDMESSAGE.nested_types_by_name['B139'] -_LOTSNESTEDMESSAGE_B140 = _LOTSNESTEDMESSAGE.nested_types_by_name['B140'] -_LOTSNESTEDMESSAGE_B141 = _LOTSNESTEDMESSAGE.nested_types_by_name['B141'] -_LOTSNESTEDMESSAGE_B142 = _LOTSNESTEDMESSAGE.nested_types_by_name['B142'] -_LOTSNESTEDMESSAGE_B143 = _LOTSNESTEDMESSAGE.nested_types_by_name['B143'] -_LOTSNESTEDMESSAGE_B144 = _LOTSNESTEDMESSAGE.nested_types_by_name['B144'] -_LOTSNESTEDMESSAGE_B145 = _LOTSNESTEDMESSAGE.nested_types_by_name['B145'] -_LOTSNESTEDMESSAGE_B146 = _LOTSNESTEDMESSAGE.nested_types_by_name['B146'] -_LOTSNESTEDMESSAGE_B147 = _LOTSNESTEDMESSAGE.nested_types_by_name['B147'] -_LOTSNESTEDMESSAGE_B148 = _LOTSNESTEDMESSAGE.nested_types_by_name['B148'] -_LOTSNESTEDMESSAGE_B149 = _LOTSNESTEDMESSAGE.nested_types_by_name['B149'] -_LOTSNESTEDMESSAGE_B150 = _LOTSNESTEDMESSAGE.nested_types_by_name['B150'] -_LOTSNESTEDMESSAGE_B151 = _LOTSNESTEDMESSAGE.nested_types_by_name['B151'] -_LOTSNESTEDMESSAGE_B152 = _LOTSNESTEDMESSAGE.nested_types_by_name['B152'] -_LOTSNESTEDMESSAGE_B153 = _LOTSNESTEDMESSAGE.nested_types_by_name['B153'] -_LOTSNESTEDMESSAGE_B154 = _LOTSNESTEDMESSAGE.nested_types_by_name['B154'] -_LOTSNESTEDMESSAGE_B155 = _LOTSNESTEDMESSAGE.nested_types_by_name['B155'] -_LOTSNESTEDMESSAGE_B156 = _LOTSNESTEDMESSAGE.nested_types_by_name['B156'] -_LOTSNESTEDMESSAGE_B157 = _LOTSNESTEDMESSAGE.nested_types_by_name['B157'] -_LOTSNESTEDMESSAGE_B158 = _LOTSNESTEDMESSAGE.nested_types_by_name['B158'] -_LOTSNESTEDMESSAGE_B159 = _LOTSNESTEDMESSAGE.nested_types_by_name['B159'] -_LOTSNESTEDMESSAGE_B160 = _LOTSNESTEDMESSAGE.nested_types_by_name['B160'] -_LOTSNESTEDMESSAGE_B161 = _LOTSNESTEDMESSAGE.nested_types_by_name['B161'] -_LOTSNESTEDMESSAGE_B162 = _LOTSNESTEDMESSAGE.nested_types_by_name['B162'] -_LOTSNESTEDMESSAGE_B163 = _LOTSNESTEDMESSAGE.nested_types_by_name['B163'] -_LOTSNESTEDMESSAGE_B164 = _LOTSNESTEDMESSAGE.nested_types_by_name['B164'] -_LOTSNESTEDMESSAGE_B165 = _LOTSNESTEDMESSAGE.nested_types_by_name['B165'] -_LOTSNESTEDMESSAGE_B166 = _LOTSNESTEDMESSAGE.nested_types_by_name['B166'] -_LOTSNESTEDMESSAGE_B167 = _LOTSNESTEDMESSAGE.nested_types_by_name['B167'] -_LOTSNESTEDMESSAGE_B168 = _LOTSNESTEDMESSAGE.nested_types_by_name['B168'] -_LOTSNESTEDMESSAGE_B169 = _LOTSNESTEDMESSAGE.nested_types_by_name['B169'] -_LOTSNESTEDMESSAGE_B170 = _LOTSNESTEDMESSAGE.nested_types_by_name['B170'] -_LOTSNESTEDMESSAGE_B171 = _LOTSNESTEDMESSAGE.nested_types_by_name['B171'] -_LOTSNESTEDMESSAGE_B172 = _LOTSNESTEDMESSAGE.nested_types_by_name['B172'] -_LOTSNESTEDMESSAGE_B173 = _LOTSNESTEDMESSAGE.nested_types_by_name['B173'] -_LOTSNESTEDMESSAGE_B174 = _LOTSNESTEDMESSAGE.nested_types_by_name['B174'] -_LOTSNESTEDMESSAGE_B175 = _LOTSNESTEDMESSAGE.nested_types_by_name['B175'] -_LOTSNESTEDMESSAGE_B176 = _LOTSNESTEDMESSAGE.nested_types_by_name['B176'] -_LOTSNESTEDMESSAGE_B177 = _LOTSNESTEDMESSAGE.nested_types_by_name['B177'] -_LOTSNESTEDMESSAGE_B178 = _LOTSNESTEDMESSAGE.nested_types_by_name['B178'] -_LOTSNESTEDMESSAGE_B179 = _LOTSNESTEDMESSAGE.nested_types_by_name['B179'] -_LOTSNESTEDMESSAGE_B180 = _LOTSNESTEDMESSAGE.nested_types_by_name['B180'] -_LOTSNESTEDMESSAGE_B181 = _LOTSNESTEDMESSAGE.nested_types_by_name['B181'] -_LOTSNESTEDMESSAGE_B182 = _LOTSNESTEDMESSAGE.nested_types_by_name['B182'] -_LOTSNESTEDMESSAGE_B183 = _LOTSNESTEDMESSAGE.nested_types_by_name['B183'] -_LOTSNESTEDMESSAGE_B184 = _LOTSNESTEDMESSAGE.nested_types_by_name['B184'] -_LOTSNESTEDMESSAGE_B185 = _LOTSNESTEDMESSAGE.nested_types_by_name['B185'] -_LOTSNESTEDMESSAGE_B186 = _LOTSNESTEDMESSAGE.nested_types_by_name['B186'] -_LOTSNESTEDMESSAGE_B187 = _LOTSNESTEDMESSAGE.nested_types_by_name['B187'] -_LOTSNESTEDMESSAGE_B188 = _LOTSNESTEDMESSAGE.nested_types_by_name['B188'] -_LOTSNESTEDMESSAGE_B189 = _LOTSNESTEDMESSAGE.nested_types_by_name['B189'] -_LOTSNESTEDMESSAGE_B190 = _LOTSNESTEDMESSAGE.nested_types_by_name['B190'] -_LOTSNESTEDMESSAGE_B191 = _LOTSNESTEDMESSAGE.nested_types_by_name['B191'] -_LOTSNESTEDMESSAGE_B192 = _LOTSNESTEDMESSAGE.nested_types_by_name['B192'] -_LOTSNESTEDMESSAGE_B193 = _LOTSNESTEDMESSAGE.nested_types_by_name['B193'] -_LOTSNESTEDMESSAGE_B194 = _LOTSNESTEDMESSAGE.nested_types_by_name['B194'] -_LOTSNESTEDMESSAGE_B195 = _LOTSNESTEDMESSAGE.nested_types_by_name['B195'] -_LOTSNESTEDMESSAGE_B196 = _LOTSNESTEDMESSAGE.nested_types_by_name['B196'] -_LOTSNESTEDMESSAGE_B197 = _LOTSNESTEDMESSAGE.nested_types_by_name['B197'] -_LOTSNESTEDMESSAGE_B198 = _LOTSNESTEDMESSAGE.nested_types_by_name['B198'] -_LOTSNESTEDMESSAGE_B199 = _LOTSNESTEDMESSAGE.nested_types_by_name['B199'] -_LOTSNESTEDMESSAGE_B200 = _LOTSNESTEDMESSAGE.nested_types_by_name['B200'] -_LOTSNESTEDMESSAGE_B201 = _LOTSNESTEDMESSAGE.nested_types_by_name['B201'] -_LOTSNESTEDMESSAGE_B202 = _LOTSNESTEDMESSAGE.nested_types_by_name['B202'] -_LOTSNESTEDMESSAGE_B203 = _LOTSNESTEDMESSAGE.nested_types_by_name['B203'] -_LOTSNESTEDMESSAGE_B204 = _LOTSNESTEDMESSAGE.nested_types_by_name['B204'] -_LOTSNESTEDMESSAGE_B205 = _LOTSNESTEDMESSAGE.nested_types_by_name['B205'] -_LOTSNESTEDMESSAGE_B206 = _LOTSNESTEDMESSAGE.nested_types_by_name['B206'] -_LOTSNESTEDMESSAGE_B207 = _LOTSNESTEDMESSAGE.nested_types_by_name['B207'] -_LOTSNESTEDMESSAGE_B208 = _LOTSNESTEDMESSAGE.nested_types_by_name['B208'] -_LOTSNESTEDMESSAGE_B209 = _LOTSNESTEDMESSAGE.nested_types_by_name['B209'] -_LOTSNESTEDMESSAGE_B210 = _LOTSNESTEDMESSAGE.nested_types_by_name['B210'] -_LOTSNESTEDMESSAGE_B211 = _LOTSNESTEDMESSAGE.nested_types_by_name['B211'] -_LOTSNESTEDMESSAGE_B212 = _LOTSNESTEDMESSAGE.nested_types_by_name['B212'] -_LOTSNESTEDMESSAGE_B213 = _LOTSNESTEDMESSAGE.nested_types_by_name['B213'] -_LOTSNESTEDMESSAGE_B214 = _LOTSNESTEDMESSAGE.nested_types_by_name['B214'] -_LOTSNESTEDMESSAGE_B215 = _LOTSNESTEDMESSAGE.nested_types_by_name['B215'] -_LOTSNESTEDMESSAGE_B216 = _LOTSNESTEDMESSAGE.nested_types_by_name['B216'] -_LOTSNESTEDMESSAGE_B217 = _LOTSNESTEDMESSAGE.nested_types_by_name['B217'] -_LOTSNESTEDMESSAGE_B218 = _LOTSNESTEDMESSAGE.nested_types_by_name['B218'] -_LOTSNESTEDMESSAGE_B219 = _LOTSNESTEDMESSAGE.nested_types_by_name['B219'] -_LOTSNESTEDMESSAGE_B220 = _LOTSNESTEDMESSAGE.nested_types_by_name['B220'] -_LOTSNESTEDMESSAGE_B221 = _LOTSNESTEDMESSAGE.nested_types_by_name['B221'] -_LOTSNESTEDMESSAGE_B222 = _LOTSNESTEDMESSAGE.nested_types_by_name['B222'] -_LOTSNESTEDMESSAGE_B223 = _LOTSNESTEDMESSAGE.nested_types_by_name['B223'] -_LOTSNESTEDMESSAGE_B224 = _LOTSNESTEDMESSAGE.nested_types_by_name['B224'] -_LOTSNESTEDMESSAGE_B225 = _LOTSNESTEDMESSAGE.nested_types_by_name['B225'] -_LOTSNESTEDMESSAGE_B226 = _LOTSNESTEDMESSAGE.nested_types_by_name['B226'] -_LOTSNESTEDMESSAGE_B227 = _LOTSNESTEDMESSAGE.nested_types_by_name['B227'] -_LOTSNESTEDMESSAGE_B228 = _LOTSNESTEDMESSAGE.nested_types_by_name['B228'] -_LOTSNESTEDMESSAGE_B229 = _LOTSNESTEDMESSAGE.nested_types_by_name['B229'] -_LOTSNESTEDMESSAGE_B230 = _LOTSNESTEDMESSAGE.nested_types_by_name['B230'] -_LOTSNESTEDMESSAGE_B231 = _LOTSNESTEDMESSAGE.nested_types_by_name['B231'] -_LOTSNESTEDMESSAGE_B232 = _LOTSNESTEDMESSAGE.nested_types_by_name['B232'] -_LOTSNESTEDMESSAGE_B233 = _LOTSNESTEDMESSAGE.nested_types_by_name['B233'] -_LOTSNESTEDMESSAGE_B234 = _LOTSNESTEDMESSAGE.nested_types_by_name['B234'] -_LOTSNESTEDMESSAGE_B235 = _LOTSNESTEDMESSAGE.nested_types_by_name['B235'] -_LOTSNESTEDMESSAGE_B236 = _LOTSNESTEDMESSAGE.nested_types_by_name['B236'] -_LOTSNESTEDMESSAGE_B237 = _LOTSNESTEDMESSAGE.nested_types_by_name['B237'] -_LOTSNESTEDMESSAGE_B238 = _LOTSNESTEDMESSAGE.nested_types_by_name['B238'] -_LOTSNESTEDMESSAGE_B239 = _LOTSNESTEDMESSAGE.nested_types_by_name['B239'] -_LOTSNESTEDMESSAGE_B240 = _LOTSNESTEDMESSAGE.nested_types_by_name['B240'] -_LOTSNESTEDMESSAGE_B241 = _LOTSNESTEDMESSAGE.nested_types_by_name['B241'] -_LOTSNESTEDMESSAGE_B242 = _LOTSNESTEDMESSAGE.nested_types_by_name['B242'] -_LOTSNESTEDMESSAGE_B243 = _LOTSNESTEDMESSAGE.nested_types_by_name['B243'] -_LOTSNESTEDMESSAGE_B244 = _LOTSNESTEDMESSAGE.nested_types_by_name['B244'] -_LOTSNESTEDMESSAGE_B245 = _LOTSNESTEDMESSAGE.nested_types_by_name['B245'] -_LOTSNESTEDMESSAGE_B246 = _LOTSNESTEDMESSAGE.nested_types_by_name['B246'] -_LOTSNESTEDMESSAGE_B247 = _LOTSNESTEDMESSAGE.nested_types_by_name['B247'] -_LOTSNESTEDMESSAGE_B248 = _LOTSNESTEDMESSAGE.nested_types_by_name['B248'] -_LOTSNESTEDMESSAGE_B249 = _LOTSNESTEDMESSAGE.nested_types_by_name['B249'] -_LOTSNESTEDMESSAGE_B250 = _LOTSNESTEDMESSAGE.nested_types_by_name['B250'] -_LOTSNESTEDMESSAGE_B251 = _LOTSNESTEDMESSAGE.nested_types_by_name['B251'] -_LOTSNESTEDMESSAGE_B252 = _LOTSNESTEDMESSAGE.nested_types_by_name['B252'] -_LOTSNESTEDMESSAGE_B253 = _LOTSNESTEDMESSAGE.nested_types_by_name['B253'] -_LOTSNESTEDMESSAGE_B254 = _LOTSNESTEDMESSAGE.nested_types_by_name['B254'] -_LOTSNESTEDMESSAGE_B255 = _LOTSNESTEDMESSAGE.nested_types_by_name['B255'] -_CLASS_FOR = _CLASS.enum_types_by_name['for'] -OutOfOrderFields = _reflection.GeneratedProtocolMessageType('OutOfOrderFields', (_message.Message,), { - 'DESCRIPTOR' : _OUTOFORDERFIELDS, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.OutOfOrderFields) - }) -_sym_db.RegisterMessage(OutOfOrderFields) - -globals()['class'] = _reflection.GeneratedProtocolMessageType('class', (_message.Message,), { - - 'try' : _reflection.GeneratedProtocolMessageType('try', (_message.Message,), { - 'DESCRIPTOR' : _CLASS_TRY, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.class.try) - }) - , - 'DESCRIPTOR' : _CLASS, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.class) - }) -_sym_db.RegisterMessage(globals()['class']) -_sym_db.RegisterMessage(getattr(globals()['class'], 'try')) - -ExtendClass = _reflection.GeneratedProtocolMessageType('ExtendClass', (_message.Message,), { - 'DESCRIPTOR' : _EXTENDCLASS, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.ExtendClass) - }) -_sym_db.RegisterMessage(ExtendClass) - -TestFullKeyword = _reflection.GeneratedProtocolMessageType('TestFullKeyword', (_message.Message,), { - 'DESCRIPTOR' : _TESTFULLKEYWORD, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.TestFullKeyword) - }) -_sym_db.RegisterMessage(TestFullKeyword) - -LotsNestedMessage = _reflection.GeneratedProtocolMessageType('LotsNestedMessage', (_message.Message,), { - - 'B0' : _reflection.GeneratedProtocolMessageType('B0', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B0, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B0) - }) - , - - 'B1' : _reflection.GeneratedProtocolMessageType('B1', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B1, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B1) - }) - , - - 'B2' : _reflection.GeneratedProtocolMessageType('B2', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B2, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B2) - }) - , - - 'B3' : _reflection.GeneratedProtocolMessageType('B3', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B3, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B3) - }) - , - - 'B4' : _reflection.GeneratedProtocolMessageType('B4', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B4, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B4) - }) - , - - 'B5' : _reflection.GeneratedProtocolMessageType('B5', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B5, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B5) - }) - , - - 'B6' : _reflection.GeneratedProtocolMessageType('B6', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B6, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B6) - }) - , - - 'B7' : _reflection.GeneratedProtocolMessageType('B7', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B7, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B7) - }) - , - - 'B8' : _reflection.GeneratedProtocolMessageType('B8', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B8, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B8) - }) - , - - 'B9' : _reflection.GeneratedProtocolMessageType('B9', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B9, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B9) - }) - , - - 'B10' : _reflection.GeneratedProtocolMessageType('B10', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B10, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B10) - }) - , - - 'B11' : _reflection.GeneratedProtocolMessageType('B11', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B11, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B11) - }) - , - - 'B12' : _reflection.GeneratedProtocolMessageType('B12', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B12, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B12) - }) - , - - 'B13' : _reflection.GeneratedProtocolMessageType('B13', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B13, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B13) - }) - , - - 'B14' : _reflection.GeneratedProtocolMessageType('B14', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B14, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B14) - }) - , - - 'B15' : _reflection.GeneratedProtocolMessageType('B15', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B15, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B15) - }) - , - - 'B16' : _reflection.GeneratedProtocolMessageType('B16', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B16, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B16) - }) - , - - 'B17' : _reflection.GeneratedProtocolMessageType('B17', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B17, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B17) - }) - , - - 'B18' : _reflection.GeneratedProtocolMessageType('B18', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B18, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B18) - }) - , - - 'B19' : _reflection.GeneratedProtocolMessageType('B19', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B19, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B19) - }) - , - - 'B20' : _reflection.GeneratedProtocolMessageType('B20', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B20, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B20) - }) - , - - 'B21' : _reflection.GeneratedProtocolMessageType('B21', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B21, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B21) - }) - , - - 'B22' : _reflection.GeneratedProtocolMessageType('B22', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B22, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B22) - }) - , - - 'B23' : _reflection.GeneratedProtocolMessageType('B23', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B23, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B23) - }) - , - - 'B24' : _reflection.GeneratedProtocolMessageType('B24', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B24, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B24) - }) - , - - 'B25' : _reflection.GeneratedProtocolMessageType('B25', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B25, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B25) - }) - , - - 'B26' : _reflection.GeneratedProtocolMessageType('B26', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B26, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B26) - }) - , - - 'B27' : _reflection.GeneratedProtocolMessageType('B27', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B27, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B27) - }) - , - - 'B28' : _reflection.GeneratedProtocolMessageType('B28', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B28, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B28) - }) - , - - 'B29' : _reflection.GeneratedProtocolMessageType('B29', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B29, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B29) - }) - , - - 'B30' : _reflection.GeneratedProtocolMessageType('B30', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B30, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B30) - }) - , - - 'B31' : _reflection.GeneratedProtocolMessageType('B31', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B31, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B31) - }) - , - - 'B32' : _reflection.GeneratedProtocolMessageType('B32', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B32, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B32) - }) - , - - 'B33' : _reflection.GeneratedProtocolMessageType('B33', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B33, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B33) - }) - , - - 'B34' : _reflection.GeneratedProtocolMessageType('B34', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B34, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B34) - }) - , - - 'B35' : _reflection.GeneratedProtocolMessageType('B35', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B35, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B35) - }) - , - - 'B36' : _reflection.GeneratedProtocolMessageType('B36', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B36, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B36) - }) - , - - 'B37' : _reflection.GeneratedProtocolMessageType('B37', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B37, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B37) - }) - , - - 'B38' : _reflection.GeneratedProtocolMessageType('B38', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B38, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B38) - }) - , - - 'B39' : _reflection.GeneratedProtocolMessageType('B39', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B39, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B39) - }) - , - - 'B40' : _reflection.GeneratedProtocolMessageType('B40', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B40, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B40) - }) - , - - 'B41' : _reflection.GeneratedProtocolMessageType('B41', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B41, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B41) - }) - , - - 'B42' : _reflection.GeneratedProtocolMessageType('B42', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B42, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B42) - }) - , - - 'B43' : _reflection.GeneratedProtocolMessageType('B43', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B43, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B43) - }) - , - - 'B44' : _reflection.GeneratedProtocolMessageType('B44', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B44, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B44) - }) - , - - 'B45' : _reflection.GeneratedProtocolMessageType('B45', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B45, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B45) - }) - , - - 'B46' : _reflection.GeneratedProtocolMessageType('B46', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B46, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B46) - }) - , - - 'B47' : _reflection.GeneratedProtocolMessageType('B47', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B47, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B47) - }) - , - - 'B48' : _reflection.GeneratedProtocolMessageType('B48', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B48, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B48) - }) - , - - 'B49' : _reflection.GeneratedProtocolMessageType('B49', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B49, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B49) - }) - , - - 'B50' : _reflection.GeneratedProtocolMessageType('B50', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B50, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B50) - }) - , - - 'B51' : _reflection.GeneratedProtocolMessageType('B51', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B51, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B51) - }) - , - - 'B52' : _reflection.GeneratedProtocolMessageType('B52', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B52, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B52) - }) - , - - 'B53' : _reflection.GeneratedProtocolMessageType('B53', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B53, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B53) - }) - , - - 'B54' : _reflection.GeneratedProtocolMessageType('B54', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B54, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B54) - }) - , - - 'B55' : _reflection.GeneratedProtocolMessageType('B55', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B55, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B55) - }) - , - - 'B56' : _reflection.GeneratedProtocolMessageType('B56', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B56, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B56) - }) - , - - 'B57' : _reflection.GeneratedProtocolMessageType('B57', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B57, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B57) - }) - , - - 'B58' : _reflection.GeneratedProtocolMessageType('B58', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B58, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B58) - }) - , - - 'B59' : _reflection.GeneratedProtocolMessageType('B59', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B59, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B59) - }) - , - - 'B60' : _reflection.GeneratedProtocolMessageType('B60', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B60, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B60) - }) - , - - 'B61' : _reflection.GeneratedProtocolMessageType('B61', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B61, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B61) - }) - , - - 'B62' : _reflection.GeneratedProtocolMessageType('B62', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B62, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B62) - }) - , - - 'B63' : _reflection.GeneratedProtocolMessageType('B63', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B63, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B63) - }) - , - - 'B64' : _reflection.GeneratedProtocolMessageType('B64', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B64, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B64) - }) - , - - 'B65' : _reflection.GeneratedProtocolMessageType('B65', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B65, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B65) - }) - , - - 'B66' : _reflection.GeneratedProtocolMessageType('B66', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B66, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B66) - }) - , - - 'B67' : _reflection.GeneratedProtocolMessageType('B67', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B67, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B67) - }) - , - - 'B68' : _reflection.GeneratedProtocolMessageType('B68', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B68, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B68) - }) - , - - 'B69' : _reflection.GeneratedProtocolMessageType('B69', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B69, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B69) - }) - , - - 'B70' : _reflection.GeneratedProtocolMessageType('B70', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B70, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B70) - }) - , - - 'B71' : _reflection.GeneratedProtocolMessageType('B71', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B71, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B71) - }) - , - - 'B72' : _reflection.GeneratedProtocolMessageType('B72', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B72, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B72) - }) - , - - 'B73' : _reflection.GeneratedProtocolMessageType('B73', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B73, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B73) - }) - , - - 'B74' : _reflection.GeneratedProtocolMessageType('B74', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B74, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B74) - }) - , - - 'B75' : _reflection.GeneratedProtocolMessageType('B75', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B75, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B75) - }) - , - - 'B76' : _reflection.GeneratedProtocolMessageType('B76', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B76, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B76) - }) - , - - 'B77' : _reflection.GeneratedProtocolMessageType('B77', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B77, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B77) - }) - , - - 'B78' : _reflection.GeneratedProtocolMessageType('B78', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B78, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B78) - }) - , - - 'B79' : _reflection.GeneratedProtocolMessageType('B79', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B79, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B79) - }) - , - - 'B80' : _reflection.GeneratedProtocolMessageType('B80', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B80, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B80) - }) - , - - 'B81' : _reflection.GeneratedProtocolMessageType('B81', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B81, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B81) - }) - , - - 'B82' : _reflection.GeneratedProtocolMessageType('B82', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B82, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B82) - }) - , - - 'B83' : _reflection.GeneratedProtocolMessageType('B83', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B83, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B83) - }) - , - - 'B84' : _reflection.GeneratedProtocolMessageType('B84', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B84, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B84) - }) - , - - 'B85' : _reflection.GeneratedProtocolMessageType('B85', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B85, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B85) - }) - , - - 'B86' : _reflection.GeneratedProtocolMessageType('B86', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B86, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B86) - }) - , - - 'B87' : _reflection.GeneratedProtocolMessageType('B87', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B87, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B87) - }) - , - - 'B88' : _reflection.GeneratedProtocolMessageType('B88', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B88, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B88) - }) - , - - 'B89' : _reflection.GeneratedProtocolMessageType('B89', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B89, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B89) - }) - , - - 'B90' : _reflection.GeneratedProtocolMessageType('B90', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B90, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B90) - }) - , - - 'B91' : _reflection.GeneratedProtocolMessageType('B91', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B91, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B91) - }) - , - - 'B92' : _reflection.GeneratedProtocolMessageType('B92', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B92, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B92) - }) - , - - 'B93' : _reflection.GeneratedProtocolMessageType('B93', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B93, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B93) - }) - , - - 'B94' : _reflection.GeneratedProtocolMessageType('B94', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B94, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B94) - }) - , - - 'B95' : _reflection.GeneratedProtocolMessageType('B95', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B95, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B95) - }) - , - - 'B96' : _reflection.GeneratedProtocolMessageType('B96', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B96, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B96) - }) - , - - 'B97' : _reflection.GeneratedProtocolMessageType('B97', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B97, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B97) - }) - , - - 'B98' : _reflection.GeneratedProtocolMessageType('B98', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B98, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B98) - }) - , - - 'B99' : _reflection.GeneratedProtocolMessageType('B99', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B99, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B99) - }) - , - - 'B100' : _reflection.GeneratedProtocolMessageType('B100', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B100, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B100) - }) - , - - 'B101' : _reflection.GeneratedProtocolMessageType('B101', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B101, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B101) - }) - , - - 'B102' : _reflection.GeneratedProtocolMessageType('B102', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B102, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B102) - }) - , - - 'B103' : _reflection.GeneratedProtocolMessageType('B103', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B103, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B103) - }) - , - - 'B104' : _reflection.GeneratedProtocolMessageType('B104', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B104, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B104) - }) - , - - 'B105' : _reflection.GeneratedProtocolMessageType('B105', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B105, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B105) - }) - , - - 'B106' : _reflection.GeneratedProtocolMessageType('B106', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B106, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B106) - }) - , - - 'B107' : _reflection.GeneratedProtocolMessageType('B107', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B107, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B107) - }) - , - - 'B108' : _reflection.GeneratedProtocolMessageType('B108', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B108, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B108) - }) - , - - 'B109' : _reflection.GeneratedProtocolMessageType('B109', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B109, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B109) - }) - , - - 'B110' : _reflection.GeneratedProtocolMessageType('B110', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B110, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B110) - }) - , - - 'B111' : _reflection.GeneratedProtocolMessageType('B111', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B111, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B111) - }) - , - - 'B112' : _reflection.GeneratedProtocolMessageType('B112', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B112, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B112) - }) - , - - 'B113' : _reflection.GeneratedProtocolMessageType('B113', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B113, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B113) - }) - , - - 'B114' : _reflection.GeneratedProtocolMessageType('B114', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B114, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B114) - }) - , - - 'B115' : _reflection.GeneratedProtocolMessageType('B115', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B115, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B115) - }) - , - - 'B116' : _reflection.GeneratedProtocolMessageType('B116', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B116, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B116) - }) - , - - 'B117' : _reflection.GeneratedProtocolMessageType('B117', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B117, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B117) - }) - , - - 'B118' : _reflection.GeneratedProtocolMessageType('B118', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B118, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B118) - }) - , - - 'B119' : _reflection.GeneratedProtocolMessageType('B119', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B119, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B119) - }) - , - - 'B120' : _reflection.GeneratedProtocolMessageType('B120', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B120, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B120) - }) - , - - 'B121' : _reflection.GeneratedProtocolMessageType('B121', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B121, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B121) - }) - , - - 'B122' : _reflection.GeneratedProtocolMessageType('B122', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B122, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B122) - }) - , - - 'B123' : _reflection.GeneratedProtocolMessageType('B123', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B123, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B123) - }) - , - - 'B124' : _reflection.GeneratedProtocolMessageType('B124', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B124, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B124) - }) - , - - 'B125' : _reflection.GeneratedProtocolMessageType('B125', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B125, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B125) - }) - , - - 'B126' : _reflection.GeneratedProtocolMessageType('B126', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B126, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B126) - }) - , - - 'B127' : _reflection.GeneratedProtocolMessageType('B127', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B127, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B127) - }) - , - - 'B128' : _reflection.GeneratedProtocolMessageType('B128', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B128, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B128) - }) - , - - 'B129' : _reflection.GeneratedProtocolMessageType('B129', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B129, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B129) - }) - , - - 'B130' : _reflection.GeneratedProtocolMessageType('B130', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B130, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B130) - }) - , - - 'B131' : _reflection.GeneratedProtocolMessageType('B131', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B131, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B131) - }) - , - - 'B132' : _reflection.GeneratedProtocolMessageType('B132', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B132, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B132) - }) - , - - 'B133' : _reflection.GeneratedProtocolMessageType('B133', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B133, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B133) - }) - , - - 'B134' : _reflection.GeneratedProtocolMessageType('B134', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B134, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B134) - }) - , - - 'B135' : _reflection.GeneratedProtocolMessageType('B135', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B135, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B135) - }) - , - - 'B136' : _reflection.GeneratedProtocolMessageType('B136', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B136, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B136) - }) - , - - 'B137' : _reflection.GeneratedProtocolMessageType('B137', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B137, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B137) - }) - , - - 'B138' : _reflection.GeneratedProtocolMessageType('B138', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B138, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B138) - }) - , - - 'B139' : _reflection.GeneratedProtocolMessageType('B139', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B139, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B139) - }) - , - - 'B140' : _reflection.GeneratedProtocolMessageType('B140', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B140, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B140) - }) - , - - 'B141' : _reflection.GeneratedProtocolMessageType('B141', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B141, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B141) - }) - , - - 'B142' : _reflection.GeneratedProtocolMessageType('B142', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B142, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B142) - }) - , - - 'B143' : _reflection.GeneratedProtocolMessageType('B143', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B143, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B143) - }) - , - - 'B144' : _reflection.GeneratedProtocolMessageType('B144', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B144, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B144) - }) - , - - 'B145' : _reflection.GeneratedProtocolMessageType('B145', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B145, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B145) - }) - , - - 'B146' : _reflection.GeneratedProtocolMessageType('B146', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B146, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B146) - }) - , - - 'B147' : _reflection.GeneratedProtocolMessageType('B147', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B147, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B147) - }) - , - - 'B148' : _reflection.GeneratedProtocolMessageType('B148', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B148, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B148) - }) - , - - 'B149' : _reflection.GeneratedProtocolMessageType('B149', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B149, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B149) - }) - , - - 'B150' : _reflection.GeneratedProtocolMessageType('B150', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B150, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B150) - }) - , - - 'B151' : _reflection.GeneratedProtocolMessageType('B151', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B151, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B151) - }) - , - - 'B152' : _reflection.GeneratedProtocolMessageType('B152', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B152, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B152) - }) - , - - 'B153' : _reflection.GeneratedProtocolMessageType('B153', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B153, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B153) - }) - , - - 'B154' : _reflection.GeneratedProtocolMessageType('B154', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B154, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B154) - }) - , - - 'B155' : _reflection.GeneratedProtocolMessageType('B155', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B155, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B155) - }) - , - - 'B156' : _reflection.GeneratedProtocolMessageType('B156', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B156, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B156) - }) - , - - 'B157' : _reflection.GeneratedProtocolMessageType('B157', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B157, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B157) - }) - , - - 'B158' : _reflection.GeneratedProtocolMessageType('B158', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B158, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B158) - }) - , - - 'B159' : _reflection.GeneratedProtocolMessageType('B159', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B159, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B159) - }) - , - - 'B160' : _reflection.GeneratedProtocolMessageType('B160', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B160, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B160) - }) - , - - 'B161' : _reflection.GeneratedProtocolMessageType('B161', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B161, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B161) - }) - , - - 'B162' : _reflection.GeneratedProtocolMessageType('B162', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B162, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B162) - }) - , - - 'B163' : _reflection.GeneratedProtocolMessageType('B163', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B163, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B163) - }) - , - - 'B164' : _reflection.GeneratedProtocolMessageType('B164', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B164, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B164) - }) - , - - 'B165' : _reflection.GeneratedProtocolMessageType('B165', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B165, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B165) - }) - , - - 'B166' : _reflection.GeneratedProtocolMessageType('B166', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B166, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B166) - }) - , - - 'B167' : _reflection.GeneratedProtocolMessageType('B167', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B167, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B167) - }) - , - - 'B168' : _reflection.GeneratedProtocolMessageType('B168', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B168, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B168) - }) - , - - 'B169' : _reflection.GeneratedProtocolMessageType('B169', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B169, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B169) - }) - , - - 'B170' : _reflection.GeneratedProtocolMessageType('B170', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B170, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B170) - }) - , - - 'B171' : _reflection.GeneratedProtocolMessageType('B171', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B171, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B171) - }) - , - - 'B172' : _reflection.GeneratedProtocolMessageType('B172', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B172, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B172) - }) - , - - 'B173' : _reflection.GeneratedProtocolMessageType('B173', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B173, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B173) - }) - , - - 'B174' : _reflection.GeneratedProtocolMessageType('B174', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B174, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B174) - }) - , - - 'B175' : _reflection.GeneratedProtocolMessageType('B175', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B175, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B175) - }) - , - - 'B176' : _reflection.GeneratedProtocolMessageType('B176', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B176, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B176) - }) - , - - 'B177' : _reflection.GeneratedProtocolMessageType('B177', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B177, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B177) - }) - , - - 'B178' : _reflection.GeneratedProtocolMessageType('B178', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B178, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B178) - }) - , - - 'B179' : _reflection.GeneratedProtocolMessageType('B179', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B179, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B179) - }) - , - - 'B180' : _reflection.GeneratedProtocolMessageType('B180', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B180, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B180) - }) - , - - 'B181' : _reflection.GeneratedProtocolMessageType('B181', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B181, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B181) - }) - , - - 'B182' : _reflection.GeneratedProtocolMessageType('B182', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B182, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B182) - }) - , - - 'B183' : _reflection.GeneratedProtocolMessageType('B183', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B183, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B183) - }) - , - - 'B184' : _reflection.GeneratedProtocolMessageType('B184', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B184, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B184) - }) - , - - 'B185' : _reflection.GeneratedProtocolMessageType('B185', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B185, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B185) - }) - , - - 'B186' : _reflection.GeneratedProtocolMessageType('B186', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B186, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B186) - }) - , - - 'B187' : _reflection.GeneratedProtocolMessageType('B187', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B187, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B187) - }) - , - - 'B188' : _reflection.GeneratedProtocolMessageType('B188', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B188, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B188) - }) - , - - 'B189' : _reflection.GeneratedProtocolMessageType('B189', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B189, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B189) - }) - , - - 'B190' : _reflection.GeneratedProtocolMessageType('B190', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B190, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B190) - }) - , - - 'B191' : _reflection.GeneratedProtocolMessageType('B191', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B191, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B191) - }) - , - - 'B192' : _reflection.GeneratedProtocolMessageType('B192', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B192, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B192) - }) - , - - 'B193' : _reflection.GeneratedProtocolMessageType('B193', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B193, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B193) - }) - , - - 'B194' : _reflection.GeneratedProtocolMessageType('B194', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B194, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B194) - }) - , - - 'B195' : _reflection.GeneratedProtocolMessageType('B195', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B195, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B195) - }) - , - - 'B196' : _reflection.GeneratedProtocolMessageType('B196', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B196, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B196) - }) - , - - 'B197' : _reflection.GeneratedProtocolMessageType('B197', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B197, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B197) - }) - , - - 'B198' : _reflection.GeneratedProtocolMessageType('B198', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B198, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B198) - }) - , - - 'B199' : _reflection.GeneratedProtocolMessageType('B199', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B199, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B199) - }) - , - - 'B200' : _reflection.GeneratedProtocolMessageType('B200', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B200, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B200) - }) - , - - 'B201' : _reflection.GeneratedProtocolMessageType('B201', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B201, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B201) - }) - , - - 'B202' : _reflection.GeneratedProtocolMessageType('B202', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B202, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B202) - }) - , - - 'B203' : _reflection.GeneratedProtocolMessageType('B203', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B203, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B203) - }) - , - - 'B204' : _reflection.GeneratedProtocolMessageType('B204', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B204, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B204) - }) - , - - 'B205' : _reflection.GeneratedProtocolMessageType('B205', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B205, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B205) - }) - , - - 'B206' : _reflection.GeneratedProtocolMessageType('B206', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B206, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B206) - }) - , - - 'B207' : _reflection.GeneratedProtocolMessageType('B207', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B207, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B207) - }) - , - - 'B208' : _reflection.GeneratedProtocolMessageType('B208', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B208, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B208) - }) - , - - 'B209' : _reflection.GeneratedProtocolMessageType('B209', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B209, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B209) - }) - , - - 'B210' : _reflection.GeneratedProtocolMessageType('B210', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B210, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B210) - }) - , - - 'B211' : _reflection.GeneratedProtocolMessageType('B211', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B211, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B211) - }) - , - - 'B212' : _reflection.GeneratedProtocolMessageType('B212', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B212, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B212) - }) - , - - 'B213' : _reflection.GeneratedProtocolMessageType('B213', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B213, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B213) - }) - , - - 'B214' : _reflection.GeneratedProtocolMessageType('B214', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B214, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B214) - }) - , - - 'B215' : _reflection.GeneratedProtocolMessageType('B215', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B215, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B215) - }) - , - - 'B216' : _reflection.GeneratedProtocolMessageType('B216', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B216, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B216) - }) - , - - 'B217' : _reflection.GeneratedProtocolMessageType('B217', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B217, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B217) - }) - , - - 'B218' : _reflection.GeneratedProtocolMessageType('B218', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B218, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B218) - }) - , - - 'B219' : _reflection.GeneratedProtocolMessageType('B219', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B219, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B219) - }) - , - - 'B220' : _reflection.GeneratedProtocolMessageType('B220', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B220, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B220) - }) - , - - 'B221' : _reflection.GeneratedProtocolMessageType('B221', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B221, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B221) - }) - , - - 'B222' : _reflection.GeneratedProtocolMessageType('B222', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B222, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B222) - }) - , - - 'B223' : _reflection.GeneratedProtocolMessageType('B223', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B223, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B223) - }) - , - - 'B224' : _reflection.GeneratedProtocolMessageType('B224', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B224, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B224) - }) - , - - 'B225' : _reflection.GeneratedProtocolMessageType('B225', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B225, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B225) - }) - , - - 'B226' : _reflection.GeneratedProtocolMessageType('B226', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B226, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B226) - }) - , - - 'B227' : _reflection.GeneratedProtocolMessageType('B227', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B227, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B227) - }) - , - - 'B228' : _reflection.GeneratedProtocolMessageType('B228', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B228, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B228) - }) - , - - 'B229' : _reflection.GeneratedProtocolMessageType('B229', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B229, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B229) - }) - , - - 'B230' : _reflection.GeneratedProtocolMessageType('B230', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B230, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B230) - }) - , - - 'B231' : _reflection.GeneratedProtocolMessageType('B231', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B231, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B231) - }) - , - - 'B232' : _reflection.GeneratedProtocolMessageType('B232', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B232, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B232) - }) - , - - 'B233' : _reflection.GeneratedProtocolMessageType('B233', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B233, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B233) - }) - , - - 'B234' : _reflection.GeneratedProtocolMessageType('B234', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B234, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B234) - }) - , - - 'B235' : _reflection.GeneratedProtocolMessageType('B235', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B235, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B235) - }) - , - - 'B236' : _reflection.GeneratedProtocolMessageType('B236', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B236, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B236) - }) - , - - 'B237' : _reflection.GeneratedProtocolMessageType('B237', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B237, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B237) - }) - , - - 'B238' : _reflection.GeneratedProtocolMessageType('B238', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B238, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B238) - }) - , - - 'B239' : _reflection.GeneratedProtocolMessageType('B239', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B239, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B239) - }) - , - - 'B240' : _reflection.GeneratedProtocolMessageType('B240', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B240, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B240) - }) - , - - 'B241' : _reflection.GeneratedProtocolMessageType('B241', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B241, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B241) - }) - , - - 'B242' : _reflection.GeneratedProtocolMessageType('B242', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B242, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B242) - }) - , - - 'B243' : _reflection.GeneratedProtocolMessageType('B243', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B243, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B243) - }) - , - - 'B244' : _reflection.GeneratedProtocolMessageType('B244', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B244, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B244) - }) - , - - 'B245' : _reflection.GeneratedProtocolMessageType('B245', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B245, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B245) - }) - , - - 'B246' : _reflection.GeneratedProtocolMessageType('B246', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B246, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B246) - }) - , - - 'B247' : _reflection.GeneratedProtocolMessageType('B247', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B247, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B247) - }) - , - - 'B248' : _reflection.GeneratedProtocolMessageType('B248', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B248, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B248) - }) - , - - 'B249' : _reflection.GeneratedProtocolMessageType('B249', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B249, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B249) - }) - , - - 'B250' : _reflection.GeneratedProtocolMessageType('B250', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B250, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B250) - }) - , - - 'B251' : _reflection.GeneratedProtocolMessageType('B251', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B251, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B251) - }) - , - - 'B252' : _reflection.GeneratedProtocolMessageType('B252', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B252, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B252) - }) - , - - 'B253' : _reflection.GeneratedProtocolMessageType('B253', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B253, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B253) - }) - , - - 'B254' : _reflection.GeneratedProtocolMessageType('B254', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B254, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B254) - }) - , - - 'B255' : _reflection.GeneratedProtocolMessageType('B255', (_message.Message,), { - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE_B255, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage.B255) - }) - , - 'DESCRIPTOR' : _LOTSNESTEDMESSAGE, - '__module__' : 'google.protobuf.internal.more_messages_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.internal.LotsNestedMessage) - }) -_sym_db.RegisterMessage(LotsNestedMessage) -_sym_db.RegisterMessage(LotsNestedMessage.B0) -_sym_db.RegisterMessage(LotsNestedMessage.B1) -_sym_db.RegisterMessage(LotsNestedMessage.B2) -_sym_db.RegisterMessage(LotsNestedMessage.B3) -_sym_db.RegisterMessage(LotsNestedMessage.B4) -_sym_db.RegisterMessage(LotsNestedMessage.B5) -_sym_db.RegisterMessage(LotsNestedMessage.B6) -_sym_db.RegisterMessage(LotsNestedMessage.B7) -_sym_db.RegisterMessage(LotsNestedMessage.B8) -_sym_db.RegisterMessage(LotsNestedMessage.B9) -_sym_db.RegisterMessage(LotsNestedMessage.B10) -_sym_db.RegisterMessage(LotsNestedMessage.B11) -_sym_db.RegisterMessage(LotsNestedMessage.B12) -_sym_db.RegisterMessage(LotsNestedMessage.B13) -_sym_db.RegisterMessage(LotsNestedMessage.B14) -_sym_db.RegisterMessage(LotsNestedMessage.B15) -_sym_db.RegisterMessage(LotsNestedMessage.B16) -_sym_db.RegisterMessage(LotsNestedMessage.B17) -_sym_db.RegisterMessage(LotsNestedMessage.B18) -_sym_db.RegisterMessage(LotsNestedMessage.B19) -_sym_db.RegisterMessage(LotsNestedMessage.B20) -_sym_db.RegisterMessage(LotsNestedMessage.B21) -_sym_db.RegisterMessage(LotsNestedMessage.B22) -_sym_db.RegisterMessage(LotsNestedMessage.B23) -_sym_db.RegisterMessage(LotsNestedMessage.B24) -_sym_db.RegisterMessage(LotsNestedMessage.B25) -_sym_db.RegisterMessage(LotsNestedMessage.B26) -_sym_db.RegisterMessage(LotsNestedMessage.B27) -_sym_db.RegisterMessage(LotsNestedMessage.B28) -_sym_db.RegisterMessage(LotsNestedMessage.B29) -_sym_db.RegisterMessage(LotsNestedMessage.B30) -_sym_db.RegisterMessage(LotsNestedMessage.B31) -_sym_db.RegisterMessage(LotsNestedMessage.B32) -_sym_db.RegisterMessage(LotsNestedMessage.B33) -_sym_db.RegisterMessage(LotsNestedMessage.B34) -_sym_db.RegisterMessage(LotsNestedMessage.B35) -_sym_db.RegisterMessage(LotsNestedMessage.B36) -_sym_db.RegisterMessage(LotsNestedMessage.B37) -_sym_db.RegisterMessage(LotsNestedMessage.B38) -_sym_db.RegisterMessage(LotsNestedMessage.B39) -_sym_db.RegisterMessage(LotsNestedMessage.B40) -_sym_db.RegisterMessage(LotsNestedMessage.B41) -_sym_db.RegisterMessage(LotsNestedMessage.B42) -_sym_db.RegisterMessage(LotsNestedMessage.B43) -_sym_db.RegisterMessage(LotsNestedMessage.B44) -_sym_db.RegisterMessage(LotsNestedMessage.B45) -_sym_db.RegisterMessage(LotsNestedMessage.B46) -_sym_db.RegisterMessage(LotsNestedMessage.B47) -_sym_db.RegisterMessage(LotsNestedMessage.B48) -_sym_db.RegisterMessage(LotsNestedMessage.B49) -_sym_db.RegisterMessage(LotsNestedMessage.B50) -_sym_db.RegisterMessage(LotsNestedMessage.B51) -_sym_db.RegisterMessage(LotsNestedMessage.B52) -_sym_db.RegisterMessage(LotsNestedMessage.B53) -_sym_db.RegisterMessage(LotsNestedMessage.B54) -_sym_db.RegisterMessage(LotsNestedMessage.B55) -_sym_db.RegisterMessage(LotsNestedMessage.B56) -_sym_db.RegisterMessage(LotsNestedMessage.B57) -_sym_db.RegisterMessage(LotsNestedMessage.B58) -_sym_db.RegisterMessage(LotsNestedMessage.B59) -_sym_db.RegisterMessage(LotsNestedMessage.B60) -_sym_db.RegisterMessage(LotsNestedMessage.B61) -_sym_db.RegisterMessage(LotsNestedMessage.B62) -_sym_db.RegisterMessage(LotsNestedMessage.B63) -_sym_db.RegisterMessage(LotsNestedMessage.B64) -_sym_db.RegisterMessage(LotsNestedMessage.B65) -_sym_db.RegisterMessage(LotsNestedMessage.B66) -_sym_db.RegisterMessage(LotsNestedMessage.B67) -_sym_db.RegisterMessage(LotsNestedMessage.B68) -_sym_db.RegisterMessage(LotsNestedMessage.B69) -_sym_db.RegisterMessage(LotsNestedMessage.B70) -_sym_db.RegisterMessage(LotsNestedMessage.B71) -_sym_db.RegisterMessage(LotsNestedMessage.B72) -_sym_db.RegisterMessage(LotsNestedMessage.B73) -_sym_db.RegisterMessage(LotsNestedMessage.B74) -_sym_db.RegisterMessage(LotsNestedMessage.B75) -_sym_db.RegisterMessage(LotsNestedMessage.B76) -_sym_db.RegisterMessage(LotsNestedMessage.B77) -_sym_db.RegisterMessage(LotsNestedMessage.B78) -_sym_db.RegisterMessage(LotsNestedMessage.B79) -_sym_db.RegisterMessage(LotsNestedMessage.B80) -_sym_db.RegisterMessage(LotsNestedMessage.B81) -_sym_db.RegisterMessage(LotsNestedMessage.B82) -_sym_db.RegisterMessage(LotsNestedMessage.B83) -_sym_db.RegisterMessage(LotsNestedMessage.B84) -_sym_db.RegisterMessage(LotsNestedMessage.B85) -_sym_db.RegisterMessage(LotsNestedMessage.B86) -_sym_db.RegisterMessage(LotsNestedMessage.B87) -_sym_db.RegisterMessage(LotsNestedMessage.B88) -_sym_db.RegisterMessage(LotsNestedMessage.B89) -_sym_db.RegisterMessage(LotsNestedMessage.B90) -_sym_db.RegisterMessage(LotsNestedMessage.B91) -_sym_db.RegisterMessage(LotsNestedMessage.B92) -_sym_db.RegisterMessage(LotsNestedMessage.B93) -_sym_db.RegisterMessage(LotsNestedMessage.B94) -_sym_db.RegisterMessage(LotsNestedMessage.B95) -_sym_db.RegisterMessage(LotsNestedMessage.B96) -_sym_db.RegisterMessage(LotsNestedMessage.B97) -_sym_db.RegisterMessage(LotsNestedMessage.B98) -_sym_db.RegisterMessage(LotsNestedMessage.B99) -_sym_db.RegisterMessage(LotsNestedMessage.B100) -_sym_db.RegisterMessage(LotsNestedMessage.B101) -_sym_db.RegisterMessage(LotsNestedMessage.B102) -_sym_db.RegisterMessage(LotsNestedMessage.B103) -_sym_db.RegisterMessage(LotsNestedMessage.B104) -_sym_db.RegisterMessage(LotsNestedMessage.B105) -_sym_db.RegisterMessage(LotsNestedMessage.B106) -_sym_db.RegisterMessage(LotsNestedMessage.B107) -_sym_db.RegisterMessage(LotsNestedMessage.B108) -_sym_db.RegisterMessage(LotsNestedMessage.B109) -_sym_db.RegisterMessage(LotsNestedMessage.B110) -_sym_db.RegisterMessage(LotsNestedMessage.B111) -_sym_db.RegisterMessage(LotsNestedMessage.B112) -_sym_db.RegisterMessage(LotsNestedMessage.B113) -_sym_db.RegisterMessage(LotsNestedMessage.B114) -_sym_db.RegisterMessage(LotsNestedMessage.B115) -_sym_db.RegisterMessage(LotsNestedMessage.B116) -_sym_db.RegisterMessage(LotsNestedMessage.B117) -_sym_db.RegisterMessage(LotsNestedMessage.B118) -_sym_db.RegisterMessage(LotsNestedMessage.B119) -_sym_db.RegisterMessage(LotsNestedMessage.B120) -_sym_db.RegisterMessage(LotsNestedMessage.B121) -_sym_db.RegisterMessage(LotsNestedMessage.B122) -_sym_db.RegisterMessage(LotsNestedMessage.B123) -_sym_db.RegisterMessage(LotsNestedMessage.B124) -_sym_db.RegisterMessage(LotsNestedMessage.B125) -_sym_db.RegisterMessage(LotsNestedMessage.B126) -_sym_db.RegisterMessage(LotsNestedMessage.B127) -_sym_db.RegisterMessage(LotsNestedMessage.B128) -_sym_db.RegisterMessage(LotsNestedMessage.B129) -_sym_db.RegisterMessage(LotsNestedMessage.B130) -_sym_db.RegisterMessage(LotsNestedMessage.B131) -_sym_db.RegisterMessage(LotsNestedMessage.B132) -_sym_db.RegisterMessage(LotsNestedMessage.B133) -_sym_db.RegisterMessage(LotsNestedMessage.B134) -_sym_db.RegisterMessage(LotsNestedMessage.B135) -_sym_db.RegisterMessage(LotsNestedMessage.B136) -_sym_db.RegisterMessage(LotsNestedMessage.B137) -_sym_db.RegisterMessage(LotsNestedMessage.B138) -_sym_db.RegisterMessage(LotsNestedMessage.B139) -_sym_db.RegisterMessage(LotsNestedMessage.B140) -_sym_db.RegisterMessage(LotsNestedMessage.B141) -_sym_db.RegisterMessage(LotsNestedMessage.B142) -_sym_db.RegisterMessage(LotsNestedMessage.B143) -_sym_db.RegisterMessage(LotsNestedMessage.B144) -_sym_db.RegisterMessage(LotsNestedMessage.B145) -_sym_db.RegisterMessage(LotsNestedMessage.B146) -_sym_db.RegisterMessage(LotsNestedMessage.B147) -_sym_db.RegisterMessage(LotsNestedMessage.B148) -_sym_db.RegisterMessage(LotsNestedMessage.B149) -_sym_db.RegisterMessage(LotsNestedMessage.B150) -_sym_db.RegisterMessage(LotsNestedMessage.B151) -_sym_db.RegisterMessage(LotsNestedMessage.B152) -_sym_db.RegisterMessage(LotsNestedMessage.B153) -_sym_db.RegisterMessage(LotsNestedMessage.B154) -_sym_db.RegisterMessage(LotsNestedMessage.B155) -_sym_db.RegisterMessage(LotsNestedMessage.B156) -_sym_db.RegisterMessage(LotsNestedMessage.B157) -_sym_db.RegisterMessage(LotsNestedMessage.B158) -_sym_db.RegisterMessage(LotsNestedMessage.B159) -_sym_db.RegisterMessage(LotsNestedMessage.B160) -_sym_db.RegisterMessage(LotsNestedMessage.B161) -_sym_db.RegisterMessage(LotsNestedMessage.B162) -_sym_db.RegisterMessage(LotsNestedMessage.B163) -_sym_db.RegisterMessage(LotsNestedMessage.B164) -_sym_db.RegisterMessage(LotsNestedMessage.B165) -_sym_db.RegisterMessage(LotsNestedMessage.B166) -_sym_db.RegisterMessage(LotsNestedMessage.B167) -_sym_db.RegisterMessage(LotsNestedMessage.B168) -_sym_db.RegisterMessage(LotsNestedMessage.B169) -_sym_db.RegisterMessage(LotsNestedMessage.B170) -_sym_db.RegisterMessage(LotsNestedMessage.B171) -_sym_db.RegisterMessage(LotsNestedMessage.B172) -_sym_db.RegisterMessage(LotsNestedMessage.B173) -_sym_db.RegisterMessage(LotsNestedMessage.B174) -_sym_db.RegisterMessage(LotsNestedMessage.B175) -_sym_db.RegisterMessage(LotsNestedMessage.B176) -_sym_db.RegisterMessage(LotsNestedMessage.B177) -_sym_db.RegisterMessage(LotsNestedMessage.B178) -_sym_db.RegisterMessage(LotsNestedMessage.B179) -_sym_db.RegisterMessage(LotsNestedMessage.B180) -_sym_db.RegisterMessage(LotsNestedMessage.B181) -_sym_db.RegisterMessage(LotsNestedMessage.B182) -_sym_db.RegisterMessage(LotsNestedMessage.B183) -_sym_db.RegisterMessage(LotsNestedMessage.B184) -_sym_db.RegisterMessage(LotsNestedMessage.B185) -_sym_db.RegisterMessage(LotsNestedMessage.B186) -_sym_db.RegisterMessage(LotsNestedMessage.B187) -_sym_db.RegisterMessage(LotsNestedMessage.B188) -_sym_db.RegisterMessage(LotsNestedMessage.B189) -_sym_db.RegisterMessage(LotsNestedMessage.B190) -_sym_db.RegisterMessage(LotsNestedMessage.B191) -_sym_db.RegisterMessage(LotsNestedMessage.B192) -_sym_db.RegisterMessage(LotsNestedMessage.B193) -_sym_db.RegisterMessage(LotsNestedMessage.B194) -_sym_db.RegisterMessage(LotsNestedMessage.B195) -_sym_db.RegisterMessage(LotsNestedMessage.B196) -_sym_db.RegisterMessage(LotsNestedMessage.B197) -_sym_db.RegisterMessage(LotsNestedMessage.B198) -_sym_db.RegisterMessage(LotsNestedMessage.B199) -_sym_db.RegisterMessage(LotsNestedMessage.B200) -_sym_db.RegisterMessage(LotsNestedMessage.B201) -_sym_db.RegisterMessage(LotsNestedMessage.B202) -_sym_db.RegisterMessage(LotsNestedMessage.B203) -_sym_db.RegisterMessage(LotsNestedMessage.B204) -_sym_db.RegisterMessage(LotsNestedMessage.B205) -_sym_db.RegisterMessage(LotsNestedMessage.B206) -_sym_db.RegisterMessage(LotsNestedMessage.B207) -_sym_db.RegisterMessage(LotsNestedMessage.B208) -_sym_db.RegisterMessage(LotsNestedMessage.B209) -_sym_db.RegisterMessage(LotsNestedMessage.B210) -_sym_db.RegisterMessage(LotsNestedMessage.B211) -_sym_db.RegisterMessage(LotsNestedMessage.B212) -_sym_db.RegisterMessage(LotsNestedMessage.B213) -_sym_db.RegisterMessage(LotsNestedMessage.B214) -_sym_db.RegisterMessage(LotsNestedMessage.B215) -_sym_db.RegisterMessage(LotsNestedMessage.B216) -_sym_db.RegisterMessage(LotsNestedMessage.B217) -_sym_db.RegisterMessage(LotsNestedMessage.B218) -_sym_db.RegisterMessage(LotsNestedMessage.B219) -_sym_db.RegisterMessage(LotsNestedMessage.B220) -_sym_db.RegisterMessage(LotsNestedMessage.B221) -_sym_db.RegisterMessage(LotsNestedMessage.B222) -_sym_db.RegisterMessage(LotsNestedMessage.B223) -_sym_db.RegisterMessage(LotsNestedMessage.B224) -_sym_db.RegisterMessage(LotsNestedMessage.B225) -_sym_db.RegisterMessage(LotsNestedMessage.B226) -_sym_db.RegisterMessage(LotsNestedMessage.B227) -_sym_db.RegisterMessage(LotsNestedMessage.B228) -_sym_db.RegisterMessage(LotsNestedMessage.B229) -_sym_db.RegisterMessage(LotsNestedMessage.B230) -_sym_db.RegisterMessage(LotsNestedMessage.B231) -_sym_db.RegisterMessage(LotsNestedMessage.B232) -_sym_db.RegisterMessage(LotsNestedMessage.B233) -_sym_db.RegisterMessage(LotsNestedMessage.B234) -_sym_db.RegisterMessage(LotsNestedMessage.B235) -_sym_db.RegisterMessage(LotsNestedMessage.B236) -_sym_db.RegisterMessage(LotsNestedMessage.B237) -_sym_db.RegisterMessage(LotsNestedMessage.B238) -_sym_db.RegisterMessage(LotsNestedMessage.B239) -_sym_db.RegisterMessage(LotsNestedMessage.B240) -_sym_db.RegisterMessage(LotsNestedMessage.B241) -_sym_db.RegisterMessage(LotsNestedMessage.B242) -_sym_db.RegisterMessage(LotsNestedMessage.B243) -_sym_db.RegisterMessage(LotsNestedMessage.B244) -_sym_db.RegisterMessage(LotsNestedMessage.B245) -_sym_db.RegisterMessage(LotsNestedMessage.B246) -_sym_db.RegisterMessage(LotsNestedMessage.B247) -_sym_db.RegisterMessage(LotsNestedMessage.B248) -_sym_db.RegisterMessage(LotsNestedMessage.B249) -_sym_db.RegisterMessage(LotsNestedMessage.B250) -_sym_db.RegisterMessage(LotsNestedMessage.B251) -_sym_db.RegisterMessage(LotsNestedMessage.B252) -_sym_db.RegisterMessage(LotsNestedMessage.B253) -_sym_db.RegisterMessage(LotsNestedMessage.B254) -_sym_db.RegisterMessage(LotsNestedMessage.B255) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.more_messages_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: OutOfOrderFields.RegisterExtension(optional_uint64) OutOfOrderFields.RegisterExtension(optional_int64) diff --git a/windows/python/google/protobuf/internal/no_package_pb2.py b/windows/python/google/protobuf/internal/no_package_pb2.py index 69620d3d6..d46dee080 100644 --- a/windows/python/google/protobuf/internal/no_package_pb2.py +++ b/windows/python/google/protobuf/internal/no_package_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/no_package.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,20 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)google/protobuf/internal/no_package.proto\";\n\x10NoPackageMessage\x12\'\n\x0fno_package_enum\x18\x01 \x01(\x0e\x32\x0e.NoPackageEnum*?\n\rNoPackageEnum\x12\x16\n\x12NO_PACKAGE_VALUE_0\x10\x00\x12\x16\n\x12NO_PACKAGE_VALUE_1\x10\x01') -_NOPACKAGEENUM = DESCRIPTOR.enum_types_by_name['NoPackageEnum'] -NoPackageEnum = enum_type_wrapper.EnumTypeWrapper(_NOPACKAGEENUM) -NO_PACKAGE_VALUE_0 = 0 -NO_PACKAGE_VALUE_1 = 1 - - -_NOPACKAGEMESSAGE = DESCRIPTOR.message_types_by_name['NoPackageMessage'] -NoPackageMessage = _reflection.GeneratedProtocolMessageType('NoPackageMessage', (_message.Message,), { - 'DESCRIPTOR' : _NOPACKAGEMESSAGE, - '__module__' : 'google.protobuf.internal.no_package_pb2' - # @@protoc_insertion_point(class_scope:NoPackageMessage) - }) -_sym_db.RegisterMessage(NoPackageMessage) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.no_package_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/internal/packed_field_test_pb2.py b/windows/python/google/protobuf/internal/packed_field_test_pb2.py index b5fdab299..84f687276 100644 --- a/windows/python/google/protobuf/internal/packed_field_test_pb2.py +++ b/windows/python/google/protobuf/internal/packed_field_test_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/packed_field_test.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,25 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0google/protobuf/internal/packed_field_test.proto\x12\x1fgoogle.protobuf.python.internal\"\xdb\x03\n\x0fTestPackedTypes\x12\x16\n\x0erepeated_int32\x18\x01 \x03(\x05\x12\x16\n\x0erepeated_int64\x18\x02 \x03(\x03\x12\x17\n\x0frepeated_uint32\x18\x03 \x03(\r\x12\x17\n\x0frepeated_uint64\x18\x04 \x03(\x04\x12\x17\n\x0frepeated_sint32\x18\x05 \x03(\x11\x12\x17\n\x0frepeated_sint64\x18\x06 \x03(\x12\x12\x18\n\x10repeated_fixed32\x18\x07 \x03(\x07\x12\x18\n\x10repeated_fixed64\x18\x08 \x03(\x06\x12\x19\n\x11repeated_sfixed32\x18\t \x03(\x0f\x12\x19\n\x11repeated_sfixed64\x18\n \x03(\x10\x12\x16\n\x0erepeated_float\x18\x0b \x03(\x02\x12\x17\n\x0frepeated_double\x18\x0c \x03(\x01\x12\x15\n\rrepeated_bool\x18\r \x03(\x08\x12Y\n\x14repeated_nested_enum\x18\x0e \x03(\x0e\x32;.google.protobuf.python.internal.TestPackedTypes.NestedEnum\"\'\n\nNestedEnum\x12\x07\n\x03\x46OO\x10\x00\x12\x07\n\x03\x42\x41R\x10\x01\x12\x07\n\x03\x42\x41Z\x10\x02\"\xec\x03\n\x11TestUnpackedTypes\x12\x1a\n\x0erepeated_int32\x18\x01 \x03(\x05\x42\x02\x10\x00\x12\x1a\n\x0erepeated_int64\x18\x02 \x03(\x03\x42\x02\x10\x00\x12\x1b\n\x0frepeated_uint32\x18\x03 \x03(\rB\x02\x10\x00\x12\x1b\n\x0frepeated_uint64\x18\x04 \x03(\x04\x42\x02\x10\x00\x12\x1b\n\x0frepeated_sint32\x18\x05 \x03(\x11\x42\x02\x10\x00\x12\x1b\n\x0frepeated_sint64\x18\x06 \x03(\x12\x42\x02\x10\x00\x12\x1c\n\x10repeated_fixed32\x18\x07 \x03(\x07\x42\x02\x10\x00\x12\x1c\n\x10repeated_fixed64\x18\x08 \x03(\x06\x42\x02\x10\x00\x12\x1d\n\x11repeated_sfixed32\x18\t \x03(\x0f\x42\x02\x10\x00\x12\x1d\n\x11repeated_sfixed64\x18\n \x03(\x10\x42\x02\x10\x00\x12\x1a\n\x0erepeated_float\x18\x0b \x03(\x02\x42\x02\x10\x00\x12\x1b\n\x0frepeated_double\x18\x0c \x03(\x01\x42\x02\x10\x00\x12\x19\n\rrepeated_bool\x18\r \x03(\x08\x42\x02\x10\x00\x12]\n\x14repeated_nested_enum\x18\x0e \x03(\x0e\x32;.google.protobuf.python.internal.TestPackedTypes.NestedEnumB\x02\x10\x00\x62\x06proto3') - - -_TESTPACKEDTYPES = DESCRIPTOR.message_types_by_name['TestPackedTypes'] -_TESTUNPACKEDTYPES = DESCRIPTOR.message_types_by_name['TestUnpackedTypes'] -_TESTPACKEDTYPES_NESTEDENUM = _TESTPACKEDTYPES.enum_types_by_name['NestedEnum'] -TestPackedTypes = _reflection.GeneratedProtocolMessageType('TestPackedTypes', (_message.Message,), { - 'DESCRIPTOR' : _TESTPACKEDTYPES, - '__module__' : 'google.protobuf.internal.packed_field_test_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.TestPackedTypes) - }) -_sym_db.RegisterMessage(TestPackedTypes) - -TestUnpackedTypes = _reflection.GeneratedProtocolMessageType('TestUnpackedTypes', (_message.Message,), { - 'DESCRIPTOR' : _TESTUNPACKEDTYPES, - '__module__' : 'google.protobuf.internal.packed_field_test_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.TestUnpackedTypes) - }) -_sym_db.RegisterMessage(TestUnpackedTypes) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.packed_field_test_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/internal/proto_builder_test.py b/windows/python/google/protobuf/internal/proto_builder_test.py index 8e2afaf98..48077b0a4 100644 --- a/windows/python/google/protobuf/internal/proto_builder_test.py +++ b/windows/python/google/protobuf/internal/proto_builder_test.py @@ -31,10 +31,7 @@ """Tests for google.protobuf.proto_builder.""" import collections -try: - import unittest2 as unittest -except ImportError: - import unittest +import unittest from google.protobuf import descriptor_pb2 # pylint: disable=g-import-not-at-top from google.protobuf import descriptor diff --git a/windows/python/google/protobuf/internal/python_message.py b/windows/python/google/protobuf/internal/python_message.py index 2921d5cb6..5550b425c 100644 --- a/windows/python/google/protobuf/internal/python_message.py +++ b/windows/python/google/protobuf/internal/python_message.py @@ -1479,7 +1479,7 @@ class _Listener(object): In order to support semantics like: - foo.bar.baz.qux = 23 + foo.bar.baz.moo = 23 assert foo.HasField('bar') ...child objects must have back references to their parents. diff --git a/windows/python/google/protobuf/internal/python_protobuf.cc b/windows/python/google/protobuf/internal/python_protobuf.cc index e823bf228..26e3a8b98 100644 --- a/windows/python/google/protobuf/internal/python_protobuf.cc +++ b/windows/python/google/protobuf/internal/python_protobuf.cc @@ -36,8 +36,12 @@ namespace google { namespace protobuf { namespace python { -static const Message* GetCProtoInsidePyProtoStub(PyObject* msg) { return NULL; } -static Message* MutableCProtoInsidePyProtoStub(PyObject* msg) { return NULL; } +static const Message* GetCProtoInsidePyProtoStub(PyObject* msg) { + return nullptr; +} +static Message* MutableCProtoInsidePyProtoStub(PyObject* msg) { + return nullptr; +} // This is initialized with a default, stub implementation. // If python-google.protobuf.cc is loaded, the function pointer is overridden diff --git a/windows/python/google/protobuf/internal/reflection_test.py b/windows/python/google/protobuf/internal/reflection_test.py index 9343389ed..62957d3fd 100644 --- a/windows/python/google/protobuf/internal/reflection_test.py +++ b/windows/python/google/protobuf/internal/reflection_test.py @@ -37,6 +37,7 @@ import copy import gc import operator import struct +import sys import warnings import unittest @@ -376,7 +377,8 @@ class ReflectionTest(unittest.TestCase): self.assertRaises(TypeError, setattr, proto, 'optional_float', 'foo') self.assertRaises(TypeError, setattr, proto, 'optional_double', 'foo') # TODO(jieluo): Fix type checking difference for python and c extension - if api_implementation.Type() == 'python': + if (api_implementation.Type() == 'python' or + (sys.version_info.major, sys.version_info.minor) >= (3, 10)): self.assertRaises(TypeError, setattr, proto, 'optional_bool', 1.1) else: proto.optional_bool = 1.1 @@ -427,7 +429,7 @@ class ReflectionTest(unittest.TestCase): pb.optional_uint64 = '2' # The exact error should propagate with a poorly written custom integer. - with self.assertRaisesRegexp(RuntimeError, 'my_error'): + with self.assertRaisesRegex(RuntimeError, 'my_error'): pb.optional_uint64 = test_util.NonStandardInteger(5, 'my_error') def assetIntegerBoundsChecking(self, integer_fn, message_module): @@ -1931,17 +1933,17 @@ class Proto2ReflectionTest(unittest.TestCase): def testDisconnectingInOneof(self): m = unittest_pb2.TestOneof2() # This message has two messages in a oneof. - m.foo_message.qux_int = 5 + m.foo_message.moo_int = 5 sub_message = m.foo_message # Accessing another message's field does not clear the first one - self.assertEqual(m.foo_lazy_message.qux_int, 0) - self.assertEqual(m.foo_message.qux_int, 5) + self.assertEqual(m.foo_lazy_message.moo_int, 0) + self.assertEqual(m.foo_message.moo_int, 5) # But mutating another message in the oneof detaches the first one. - m.foo_lazy_message.qux_int = 6 - self.assertEqual(m.foo_message.qux_int, 0) + m.foo_lazy_message.moo_int = 6 + self.assertEqual(m.foo_message.moo_int, 0) # The reference we got above was detached and is still valid. - self.assertEqual(sub_message.qux_int, 5) - sub_message.qux_int = 7 + self.assertEqual(sub_message.moo_int, 5) + sub_message.moo_int = 7 def assertInitialized(self, proto): self.assertTrue(proto.IsInitialized()) @@ -2018,7 +2020,7 @@ class Proto2ReflectionTest(unittest.TestCase): self.assertRaises(TypeError, proto.IsInitialized, 1, 2, 3) @unittest.skipIf( - api_implementation.Type() != 'cpp' or api_implementation.Version() != 2, + api_implementation.Type() == 'python', 'Errors are only available from the most recent C++ implementation.') def testFileDescriptorErrors(self): file_name = 'test_file_descriptor_errors.proto' @@ -3223,7 +3225,7 @@ class OptionsTest(unittest.TestCase): class ClassAPITest(unittest.TestCase): @unittest.skipIf( - api_implementation.Type() == 'cpp' and api_implementation.Version() == 2, + api_implementation.Type() != 'python', 'C++ implementation requires a call to MakeDescriptor()') @testing_refleaks.SkipReferenceLeakChecker('MakeClass is not repeatable') def testMakeClassWithNestedDescriptor(self): diff --git a/windows/python/google/protobuf/internal/test_bad_identifiers_pb2.py b/windows/python/google/protobuf/internal/test_bad_identifiers_pb2.py index 89720d814..ca06bd62a 100644 --- a/windows/python/google/protobuf/internal/test_bad_identifiers_pb2.py +++ b/windows/python/google/protobuf/internal/test_bad_identifiers_pb2.py @@ -2,13 +2,10 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/test_bad_identifiers.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database -from google.protobuf import service as _service -from google.protobuf import service_reflection # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -18,33 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n3google/protobuf/internal/test_bad_identifiers.proto\x12\x11protobuf_unittest\"\x1e\n\x12TestBadIdentifiers*\x08\x08\x64\x10\x80\x80\x80\x80\x02\"\x10\n\x0e\x41notherMessage2\x10\n\x0e\x41notherService:;\n\x07message\x12%.protobuf_unittest.TestBadIdentifiers\x18\x64 \x01(\t:\x03\x66oo:>\n\ndescriptor\x12%.protobuf_unittest.TestBadIdentifiers\x18\x65 \x01(\t:\x03\x62\x61r:>\n\nreflection\x12%.protobuf_unittest.TestBadIdentifiers\x18\x66 \x01(\t:\x03\x62\x61z:;\n\x07service\x12%.protobuf_unittest.TestBadIdentifiers\x18g \x01(\t:\x03quxB\x03\x90\x01\x01') - -MESSAGE_FIELD_NUMBER = 100 -message = DESCRIPTOR.extensions_by_name['message'] -DESCRIPTOR_FIELD_NUMBER = 101 -descriptor = DESCRIPTOR.extensions_by_name['descriptor'] -REFLECTION_FIELD_NUMBER = 102 -reflection = DESCRIPTOR.extensions_by_name['reflection'] -SERVICE_FIELD_NUMBER = 103 -service = DESCRIPTOR.extensions_by_name['service'] - -_TESTBADIDENTIFIERS = DESCRIPTOR.message_types_by_name['TestBadIdentifiers'] -_ANOTHERMESSAGE = DESCRIPTOR.message_types_by_name['AnotherMessage'] -TestBadIdentifiers = _reflection.GeneratedProtocolMessageType('TestBadIdentifiers', (_message.Message,), { - 'DESCRIPTOR' : _TESTBADIDENTIFIERS, - '__module__' : 'google.protobuf.internal.test_bad_identifiers_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestBadIdentifiers) - }) -_sym_db.RegisterMessage(TestBadIdentifiers) - -AnotherMessage = _reflection.GeneratedProtocolMessageType('AnotherMessage', (_message.Message,), { - 'DESCRIPTOR' : _ANOTHERMESSAGE, - '__module__' : 'google.protobuf.internal.test_bad_identifiers_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.AnotherMessage) - }) -_sym_db.RegisterMessage(AnotherMessage) - -_ANOTHERSERVICE = DESCRIPTOR.services_by_name['AnotherService'] +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.test_bad_identifiers_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: TestBadIdentifiers.RegisterExtension(message) TestBadIdentifiers.RegisterExtension(descriptor) @@ -59,15 +31,5 @@ if _descriptor._USE_C_DESCRIPTORS == False: _ANOTHERMESSAGE._serialized_end=122 _ANOTHERSERVICE._serialized_start=124 _ANOTHERSERVICE._serialized_end=140 -AnotherService = service_reflection.GeneratedServiceType('AnotherService', (_service.Service,), dict( - DESCRIPTOR = _ANOTHERSERVICE, - __module__ = 'google.protobuf.internal.test_bad_identifiers_pb2' - )) - -AnotherService_Stub = service_reflection.GeneratedServiceStubType('AnotherService_Stub', (AnotherService,), dict( - DESCRIPTOR = _ANOTHERSERVICE, - __module__ = 'google.protobuf.internal.test_bad_identifiers_pb2' - )) - - +_builder.BuildServices(DESCRIPTOR, 'google.protobuf.internal.test_bad_identifiers_pb2', globals()) # @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/internal/test_proto3_optional_pb2.py b/windows/python/google/protobuf/internal/test_proto3_optional_pb2.py index 2d8ebf9fb..b683d7b0d 100644 --- a/windows/python/google/protobuf/internal/test_proto3_optional_pb2.py +++ b/windows/python/google/protobuf/internal/test_proto3_optional_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/test_proto3_optional.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,26 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n3google/protobuf/internal/test_proto3_optional.proto\x12\x1fgoogle.protobuf.python.internal\"\xf8\x08\n\x12TestProto3Optional\x12\x1b\n\x0eoptional_int32\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x1b\n\x0eoptional_int64\x18\x02 \x01(\x03H\x01\x88\x01\x01\x12\x1c\n\x0foptional_uint32\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x1c\n\x0foptional_uint64\x18\x04 \x01(\x04H\x03\x88\x01\x01\x12\x1c\n\x0foptional_sint32\x18\x05 \x01(\x11H\x04\x88\x01\x01\x12\x1c\n\x0foptional_sint64\x18\x06 \x01(\x12H\x05\x88\x01\x01\x12\x1d\n\x10optional_fixed32\x18\x07 \x01(\x07H\x06\x88\x01\x01\x12\x1d\n\x10optional_fixed64\x18\x08 \x01(\x06H\x07\x88\x01\x01\x12\x1e\n\x11optional_sfixed32\x18\t \x01(\x0fH\x08\x88\x01\x01\x12\x1e\n\x11optional_sfixed64\x18\n \x01(\x10H\t\x88\x01\x01\x12\x1b\n\x0eoptional_float\x18\x0b \x01(\x02H\n\x88\x01\x01\x12\x1c\n\x0foptional_double\x18\x0c \x01(\x01H\x0b\x88\x01\x01\x12\x1a\n\roptional_bool\x18\r \x01(\x08H\x0c\x88\x01\x01\x12\x1c\n\x0foptional_string\x18\x0e \x01(\tH\r\x88\x01\x01\x12\x1b\n\x0eoptional_bytes\x18\x0f \x01(\x0cH\x0e\x88\x01\x01\x12g\n\x17optional_nested_message\x18\x12 \x01(\x0b\x32\x41.google.protobuf.python.internal.TestProto3Optional.NestedMessageH\x0f\x88\x01\x01\x12\x61\n\x14optional_nested_enum\x18\x15 \x01(\x0e\x32>.google.protobuf.python.internal.TestProto3Optional.NestedEnumH\x10\x88\x01\x01\x1a\'\n\rNestedMessage\x12\x0f\n\x02\x62\x62\x18\x01 \x01(\x05H\x00\x88\x01\x01\x42\x05\n\x03_bb\"J\n\nNestedEnum\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x07\n\x03\x46OO\x10\x01\x12\x07\n\x03\x42\x41R\x10\x02\x12\x07\n\x03\x42\x41Z\x10\x03\x12\x10\n\x03NEG\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x42\x11\n\x0f_optional_int32B\x11\n\x0f_optional_int64B\x12\n\x10_optional_uint32B\x12\n\x10_optional_uint64B\x12\n\x10_optional_sint32B\x12\n\x10_optional_sint64B\x13\n\x11_optional_fixed32B\x13\n\x11_optional_fixed64B\x14\n\x12_optional_sfixed32B\x14\n\x12_optional_sfixed64B\x11\n\x0f_optional_floatB\x12\n\x10_optional_doubleB\x10\n\x0e_optional_boolB\x12\n\x10_optional_stringB\x11\n\x0f_optional_bytesB\x1a\n\x18_optional_nested_messageB\x17\n\x15_optional_nested_enumb\x06proto3') - - -_TESTPROTO3OPTIONAL = DESCRIPTOR.message_types_by_name['TestProto3Optional'] -_TESTPROTO3OPTIONAL_NESTEDMESSAGE = _TESTPROTO3OPTIONAL.nested_types_by_name['NestedMessage'] -_TESTPROTO3OPTIONAL_NESTEDENUM = _TESTPROTO3OPTIONAL.enum_types_by_name['NestedEnum'] -TestProto3Optional = _reflection.GeneratedProtocolMessageType('TestProto3Optional', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTPROTO3OPTIONAL_NESTEDMESSAGE, - '__module__' : 'google.protobuf.internal.test_proto3_optional_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.TestProto3Optional.NestedMessage) - }) - , - 'DESCRIPTOR' : _TESTPROTO3OPTIONAL, - '__module__' : 'google.protobuf.internal.test_proto3_optional_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.TestProto3Optional) - }) -_sym_db.RegisterMessage(TestProto3Optional) -_sym_db.RegisterMessage(TestProto3Optional.NestedMessage) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.internal.test_proto3_optional_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/internal/test_util.py b/windows/python/google/protobuf/internal/test_util.py index a6e34ef56..32fb8fd27 100644 --- a/windows/python/google/protobuf/internal/test_util.py +++ b/windows/python/google/protobuf/internal/test_util.py @@ -218,6 +218,7 @@ def SetAllNonLazyFields(message): def SetAllFields(message): SetAllNonLazyFields(message) message.optional_lazy_message.bb = 127 + message.optional_unverified_lazy_message.bb = 128 def SetAllExtensions(message): @@ -257,6 +258,7 @@ def SetAllExtensions(message): extensions[pb2.optional_import_message_extension].d = 120 extensions[pb2.optional_public_import_message_extension].e = 126 extensions[pb2.optional_lazy_message_extension].bb = 127 + extensions[pb2.optional_unverified_lazy_message_extension].bb = 128 extensions[pb2.optional_nested_enum_extension] = pb2.TestAllTypes.BAZ extensions[pb2.optional_nested_enum_extension] = pb2.TestAllTypes.BAZ @@ -465,6 +467,7 @@ def ExpectAllFieldsSet(test_case, message): test_case.assertEqual(120, message.optional_import_message.d) test_case.assertEqual(126, message.optional_public_import_message.e) test_case.assertEqual(127, message.optional_lazy_message.bb) + test_case.assertEqual(128, message.optional_unverified_lazy_message.bb) test_case.assertEqual(unittest_pb2.TestAllTypes.BAZ, message.optional_nested_enum) @@ -634,6 +637,13 @@ def GoldenFile(filename): # Found it. Load the golden file from the testdata directory. return open(full_path, 'rb') + # Search for cross-repo path. + full_path = os.path.join('external/com_google_protobuf/src/google/protobuf/testdata', + filename) + if os.path.exists(full_path): + # Found it. Load the golden file from the testdata directory. + return open(full_path, 'rb') + raise RuntimeError( 'Could not find golden files. This test must be run from within the ' 'protobuf source package so that it can read test data files from the ' diff --git a/windows/python/google/protobuf/internal/testing_refleaks.py b/windows/python/google/protobuf/internal/testing_refleaks.py index abe88ed57..5f19c46fd 100644 --- a/windows/python/google/protobuf/internal/testing_refleaks.py +++ b/windows/python/google/protobuf/internal/testing_refleaks.py @@ -67,6 +67,12 @@ class ReferenceLeakCheckerMixin(object): NB_RUNS = 3 def run(self, result=None): + testMethod = getattr(self, self._testMethodName) + expecting_failure_method = getattr(testMethod, "__unittest_expecting_failure__", False) + expecting_failure_class = getattr(self, "__unittest_expecting_failure__", False) + if expecting_failure_class or expecting_failure_method: + return + # python_message.py registers all Message classes to some pickle global # registry, which makes the classes immortal. # We save a copy of this registry, and reset it before we could references. @@ -78,12 +84,23 @@ class ReferenceLeakCheckerMixin(object): oldrefcount = 0 local_result = LocalTestResult(result) + num_flakes = 0 refcount_deltas = [] - for _ in range(self.NB_RUNS): + while len(refcount_deltas) < self.NB_RUNS: oldrefcount = self._getRefcounts() super(ReferenceLeakCheckerMixin, self).run(result=local_result) newrefcount = self._getRefcounts() + # If the GC was able to collect some objects after the call to run() that + # it could not collect before the call, then the counts won't match. + if newrefcount < oldrefcount and num_flakes < 2: + # This result is (probably) a flake -- garbage collectors aren't very + # predictable, but a lower ending refcount is the opposite of the + # failure we are testing for. If the result is repeatable, then we will + # eventually report it, but not after trying to eliminate it. + num_flakes += 1 + continue + num_flakes = 0 refcount_deltas.append(newrefcount - oldrefcount) print(refcount_deltas, self) diff --git a/windows/python/google/protobuf/internal/text_format_test.py b/windows/python/google/protobuf/internal/text_format_test.py index ec1ad5254..18b784e5b 100644 --- a/windows/python/google/protobuf/internal/text_format_test.py +++ b/windows/python/google/protobuf/internal/text_format_test.py @@ -40,6 +40,7 @@ import textwrap import unittest from google.protobuf import any_pb2 +from google.protobuf import struct_pb2 from google.protobuf import any_test_pb2 from google.protobuf import map_unittest_pb2 from google.protobuf import unittest_custom_options_pb2 @@ -48,6 +49,7 @@ from google.protobuf import unittest_pb2 from google.protobuf import unittest_proto3_arena_pb2 from google.protobuf import descriptor_pb2 from google.protobuf.internal import any_test_pb2 as test_extend_any +from google.protobuf.internal import api_implementation from google.protobuf.internal import message_set_extensions_pb2 from google.protobuf.internal import test_proto3_optional_pb2 from google.protobuf.internal import test_util @@ -582,6 +584,10 @@ class TextFormatMessageToStringTests(TextFormatBase): text_format.Parse(expected_text, parsed_proto) self.assertEqual(message_proto, parsed_proto) + @unittest.skipIf( + api_implementation.Type() == 'upb', + "upb API doesn't support old UnknownField API. The TextFormat library " + "needs to convert to the new API.") def testPrintUnknownFieldsEmbeddedMessageInBytes(self, message_module): inner_msg = message_module.TestAllTypes() inner_msg.optional_int32 = 101 @@ -1470,9 +1476,11 @@ class Proto2Tests(TextFormatBase): text = ('message_set {\n' ' [unknown_extension] {\n' ' i: 23\n' - ' bin: "\xe0"' + ' repeated_i: []\n' + ' bin: "\xe0"\n' ' [nested_unknown_ext]: {\n' ' i: 23\n' + ' repeated_i: [1, 2]\n' ' x: x\n' ' test: "test_string"\n' ' floaty_float: -0.315\n' @@ -1485,6 +1493,7 @@ class Proto2Tests(TextFormatBase): ' i: 24\n' ' pointfloat: .3\n' ' test: "test_string"\n' + ' repeated_test: ["test_string1", "test_string2"]\n' ' floaty_float: -0.315\n' ' num: -inf\n' ' long_string: "test" "test2" \n' @@ -1931,6 +1940,16 @@ class Proto3Tests(unittest.TestCase): text_format.Merge(text, message) self.assertEqual(str(e.exception), '3:11 : Expected "}".') + def testParseExpandedAnyListValue(self): + any_msg = any_pb2.Any() + any_msg.Pack(struct_pb2.ListValue()) + msg = any_test_pb2.TestAny(any_value=any_msg) + text = ('any_value {\n' + ' [type.googleapis.com/google.protobuf.ListValue] {}\n' + '}\n') + parsed_msg = text_format.Parse(text, any_test_pb2.TestAny()) + self.assertEqual(msg, parsed_msg) + def testProto3Optional(self): msg = test_proto3_optional_pb2.TestProto3Optional() self.assertEqual(text_format.MessageToString(msg), '') diff --git a/windows/python/google/protobuf/internal/type_checkers.py b/windows/python/google/protobuf/internal/type_checkers.py index 9b9b859e1..a53e71fe8 100644 --- a/windows/python/google/protobuf/internal/type_checkers.py +++ b/windows/python/google/protobuf/internal/type_checkers.py @@ -48,7 +48,6 @@ __author__ = 'robinson@google.com (Will Robinson)' import ctypes import numbers -from google.protobuf.internal import api_implementation from google.protobuf.internal import decoder from google.protobuf.internal import encoder from google.protobuf.internal import wire_format @@ -77,7 +76,8 @@ def ToShortestFloat(original): def SupportsOpenEnums(field_descriptor): - return field_descriptor.containing_type.syntax == "proto3" + return field_descriptor.containing_type.syntax == 'proto3' + def GetTypeChecker(field): """Returns a type checker for a message field of the specified types. @@ -105,7 +105,6 @@ def GetTypeChecker(field): # subclassing builtin types and doing weird things. We're not trying to # protect against malicious clients here, just people accidentally shooting # themselves in the foot in obvious ways. - class TypeChecker(object): """Type checker used to catch type errors as early as possible @@ -124,11 +123,6 @@ class TypeChecker(object): message = ('%.1024r has type %s, but expected one of: %s' % (proposed_value, type(proposed_value), self._acceptable_types)) raise TypeError(message) - # Some field types(float, double and bool) accept other types, must - # convert to the correct type in such cases. - if self._acceptable_types: - if self._acceptable_types[0] in (bool, float): - return self._acceptable_types[0](proposed_value) return proposed_value @@ -142,6 +136,22 @@ class TypeCheckerWithDefault(TypeChecker): return self._default_value +class BoolValueChecker(object): + """Type checker used for bool fields.""" + + def CheckValue(self, proposed_value): + if not hasattr(proposed_value, '__index__') or ( + type(proposed_value).__module__ == 'numpy' and + type(proposed_value).__name__ == 'ndarray'): + message = ('%.1024r has type %s, but expected one of: %s' % + (proposed_value, type(proposed_value), (bool, int))) + raise TypeError(message) + return bool(proposed_value) + + def DefaultValue(self): + return False + + # IntValueChecker and its subclasses perform integer type-checks # and bounds-checks. class IntValueChecker(object): @@ -149,10 +159,13 @@ class IntValueChecker(object): """Checker used for integer fields. Performs type-check and range check.""" def CheckValue(self, proposed_value): - if not isinstance(proposed_value, numbers.Integral): + if not hasattr(proposed_value, '__index__') or ( + type(proposed_value).__module__ == 'numpy' and + type(proposed_value).__name__ == 'ndarray'): message = ('%.1024r has type %s, but expected one of: %s' % (proposed_value, type(proposed_value), (int,))) raise TypeError(message) + if not self._MIN <= int(proposed_value) <= self._MAX: raise ValueError('Value out of range: %d' % proposed_value) # We force all values to int to make alternate implementations where the @@ -249,20 +262,38 @@ _INF = float('inf') _NEG_INF = float('-inf') -class FloatValueChecker(object): +class DoubleValueChecker(object): + """Checker used for double fields. - """Checker used for float fields. Performs type-check and range check. + Performs type-check and range check. + """ + + def CheckValue(self, proposed_value): + """Check and convert proposed_value to float.""" + if (not hasattr(proposed_value, '__float__') and + not hasattr(proposed_value, '__index__')) or ( + type(proposed_value).__module__ == 'numpy' and + type(proposed_value).__name__ == 'ndarray'): + message = ('%.1024r has type %s, but expected one of: int, float' % + (proposed_value, type(proposed_value))) + raise TypeError(message) + return float(proposed_value) + + def DefaultValue(self): + return 0.0 + + +class FloatValueChecker(DoubleValueChecker): + """Checker used for float fields. + + Performs type-check and range check. Values exceeding a 32-bit float will be converted to inf/-inf. """ def CheckValue(self, proposed_value): """Check and convert proposed_value to float.""" - if not isinstance(proposed_value, numbers.Real): - message = ('%.1024r has type %s, but expected one of: numbers.Real' % - (proposed_value, type(proposed_value))) - raise TypeError(message) - converted_value = float(proposed_value) + converted_value = super().CheckValue(proposed_value) # This inf rounding matches the C++ proto SafeDoubleToFloat logic. if converted_value > _FLOAT_MAX: return _INF @@ -271,23 +302,17 @@ class FloatValueChecker(object): return TruncateToFourByteFloat(converted_value) - def DefaultValue(self): - return 0.0 - - # Type-checkers for all scalar CPPTYPEs. _VALUE_CHECKERS = { _FieldDescriptor.CPPTYPE_INT32: Int32ValueChecker(), _FieldDescriptor.CPPTYPE_INT64: Int64ValueChecker(), _FieldDescriptor.CPPTYPE_UINT32: Uint32ValueChecker(), _FieldDescriptor.CPPTYPE_UINT64: Uint64ValueChecker(), - _FieldDescriptor.CPPTYPE_DOUBLE: TypeCheckerWithDefault( - 0.0, float, numbers.Real), + _FieldDescriptor.CPPTYPE_DOUBLE: DoubleValueChecker(), _FieldDescriptor.CPPTYPE_FLOAT: FloatValueChecker(), - _FieldDescriptor.CPPTYPE_BOOL: TypeCheckerWithDefault( - False, bool, numbers.Integral), + _FieldDescriptor.CPPTYPE_BOOL: BoolValueChecker(), _FieldDescriptor.CPPTYPE_STRING: TypeCheckerWithDefault(b'', bytes), - } +} # Map from field type to a function F, such that F(field_num, value) diff --git a/windows/python/google/protobuf/internal/unknown_fields_test.py b/windows/python/google/protobuf/internal/unknown_fields_test.py index e8caf6bb8..64a036782 100644 --- a/windows/python/google/protobuf/internal/unknown_fields_test.py +++ b/windows/python/google/protobuf/internal/unknown_fields_test.py @@ -49,7 +49,7 @@ from google.protobuf.internal import testing_refleaks from google.protobuf.internal import type_checkers from google.protobuf.internal import wire_format from google.protobuf import descriptor - +from google.protobuf import unknown_fields try: import tracemalloc # pylint: disable=g-import-not-at-top except ImportError: @@ -106,14 +106,14 @@ class UnknownFieldsTest(unittest.TestCase): proto = message_set_extensions_pb2.TestMessageSet() proto.MergeFromString(serialized) - unknown_fields = proto.UnknownFields() - self.assertEqual(len(unknown_fields), 1) + unknown_field_set = unknown_fields.UnknownFieldSet(proto) + self.assertEqual(len(unknown_field_set), 1) # Unknown field should have wire format data which can be parsed back to # original message. - self.assertEqual(unknown_fields[0].field_number, item.type_id) - self.assertEqual(unknown_fields[0].wire_type, + self.assertEqual(unknown_field_set[0].field_number, item.type_id) + self.assertEqual(unknown_field_set[0].wire_type, wire_format.WIRETYPE_LENGTH_DELIMITED) - d = unknown_fields[0].data + d = unknown_field_set[0].data message_new = message_set_extensions_pb2.TestMessageSetExtension1() message_new.ParseFromString(d) self.assertEqual(message1, message_new) @@ -184,7 +184,7 @@ class UnknownFieldsAccessorsTest(unittest.TestCase): # serialized string is checked. # TODO(jieluo): Remove message._unknown_fields. def InternalCheckUnknownField(self, name, expected_value): - if api_implementation.Type() == 'cpp': + if api_implementation.Type() != 'python': return field_descriptor = self.descriptor.fields_by_name[name] wire_type = type_checkers.FIELD_TYPE_TO_WIRE_TYPE[field_descriptor.type] @@ -196,11 +196,11 @@ class UnknownFieldsAccessorsTest(unittest.TestCase): decoder(memoryview(value), 0, len(value), self.all_fields, result_dict) self.assertEqual(expected_value, result_dict[field_descriptor]) - def CheckUnknownField(self, name, unknown_fields, expected_value): + def CheckUnknownField(self, name, unknown_field_set, expected_value): field_descriptor = self.descriptor.fields_by_name[name] expected_type = type_checkers.FIELD_TYPE_TO_WIRE_TYPE[ field_descriptor.type] - for unknown_field in unknown_fields: + for unknown_field in unknown_field_set: if unknown_field.field_number == field_descriptor.number: self.assertEqual(expected_type, unknown_field.wire_type) if expected_type == 3: @@ -218,57 +218,57 @@ class UnknownFieldsAccessorsTest(unittest.TestCase): self.assertEqual(expected_value, unknown_field.data) def testCheckUnknownFieldValue(self): - unknown_fields = self.empty_message.UnknownFields() + unknown_field_set = unknown_fields.UnknownFieldSet(self.empty_message) # Test enum. self.CheckUnknownField('optional_nested_enum', - unknown_fields, + unknown_field_set, self.all_fields.optional_nested_enum) self.InternalCheckUnknownField('optional_nested_enum', self.all_fields.optional_nested_enum) # Test repeated enum. self.CheckUnknownField('repeated_nested_enum', - unknown_fields, + unknown_field_set, self.all_fields.repeated_nested_enum) self.InternalCheckUnknownField('repeated_nested_enum', self.all_fields.repeated_nested_enum) # Test varint. self.CheckUnknownField('optional_int32', - unknown_fields, + unknown_field_set, self.all_fields.optional_int32) self.InternalCheckUnknownField('optional_int32', self.all_fields.optional_int32) # Test fixed32. self.CheckUnknownField('optional_fixed32', - unknown_fields, + unknown_field_set, self.all_fields.optional_fixed32) self.InternalCheckUnknownField('optional_fixed32', self.all_fields.optional_fixed32) # Test fixed64. self.CheckUnknownField('optional_fixed64', - unknown_fields, + unknown_field_set, self.all_fields.optional_fixed64) self.InternalCheckUnknownField('optional_fixed64', self.all_fields.optional_fixed64) # Test length delimited. self.CheckUnknownField('optional_string', - unknown_fields, + unknown_field_set, self.all_fields.optional_string.encode('utf-8')) self.InternalCheckUnknownField('optional_string', self.all_fields.optional_string) # Test group. self.CheckUnknownField('optionalgroup', - unknown_fields, + unknown_field_set, (17, 0, 117)) self.InternalCheckUnknownField('optionalgroup', self.all_fields.optionalgroup) - self.assertEqual(97, len(unknown_fields)) + self.assertEqual(98, len(unknown_field_set)) def testCopyFrom(self): message = unittest_pb2.TestEmptyMessage() @@ -286,18 +286,14 @@ class UnknownFieldsAccessorsTest(unittest.TestCase): message.optional_int64 = 3 message.optional_uint32 = 4 destination = unittest_pb2.TestEmptyMessage() - unknown_fields = destination.UnknownFields() - self.assertEqual(0, len(unknown_fields)) + unknown_field_set = unknown_fields.UnknownFieldSet(destination) + self.assertEqual(0, len(unknown_field_set)) destination.ParseFromString(message.SerializeToString()) - # ParseFromString clears the message thus unknown fields is invalid. - with self.assertRaises(ValueError) as context: - len(unknown_fields) - self.assertIn('UnknownFields does not exist.', - str(context.exception)) - unknown_fields = destination.UnknownFields() - self.assertEqual(2, len(unknown_fields)) + self.assertEqual(0, len(unknown_field_set)) + unknown_field_set = unknown_fields.UnknownFieldSet(destination) + self.assertEqual(2, len(unknown_field_set)) destination.MergeFrom(source) - self.assertEqual(4, len(unknown_fields)) + self.assertEqual(2, len(unknown_field_set)) # Check that the fields where correctly merged, even stored in the unknown # fields set. message.ParseFromString(destination.SerializeToString()) @@ -306,14 +302,11 @@ class UnknownFieldsAccessorsTest(unittest.TestCase): self.assertEqual(message.optional_int64, 3) def testClear(self): - unknown_fields = self.empty_message.UnknownFields() + unknown_field_set = unknown_fields.UnknownFieldSet(self.empty_message) self.empty_message.Clear() # All cleared, even unknown fields. self.assertEqual(self.empty_message.SerializeToString(), b'') - with self.assertRaises(ValueError) as context: - len(unknown_fields) - self.assertIn('UnknownFields does not exist.', - str(context.exception)) + self.assertEqual(len(unknown_field_set), 98) @unittest.skipIf((sys.version_info.major, sys.version_info.minor) < (3, 4), 'tracemalloc requires python 3.4+') @@ -323,7 +316,7 @@ class UnknownFieldsAccessorsTest(unittest.TestCase): def leaking_function(): for _ in range(nb_leaks): - self.empty_message.UnknownFields() + unknown_fields.UnknownFieldSet(self.empty_message) tracemalloc.start() snapshot1 = tracemalloc.take_snapshot() @@ -340,49 +333,39 @@ class UnknownFieldsAccessorsTest(unittest.TestCase): message.optionalgroup.a = 123 destination = unittest_pb2.TestEmptyMessage() destination.ParseFromString(message.SerializeToString()) - sub_unknown_fields = destination.UnknownFields()[0].data + sub_unknown_fields = unknown_fields.UnknownFieldSet(destination)[0].data self.assertEqual(1, len(sub_unknown_fields)) self.assertEqual(sub_unknown_fields[0].data, 123) destination.Clear() - with self.assertRaises(ValueError) as context: - len(sub_unknown_fields) - self.assertIn('UnknownFields does not exist.', - str(context.exception)) - with self.assertRaises(ValueError) as context: - # pylint: disable=pointless-statement - sub_unknown_fields[0] - self.assertIn('UnknownFields does not exist.', - str(context.exception)) + self.assertEqual(1, len(sub_unknown_fields)) + self.assertEqual(sub_unknown_fields[0].data, 123) message.Clear() message.optional_uint32 = 456 nested_message = unittest_pb2.NestedTestAllTypes() nested_message.payload.optional_nested_message.ParseFromString( message.SerializeToString()) - unknown_fields = ( - nested_message.payload.optional_nested_message.UnknownFields()) - self.assertEqual(unknown_fields[0].data, 456) + unknown_field_set = unknown_fields.UnknownFieldSet( + nested_message.payload.optional_nested_message) + self.assertEqual(unknown_field_set[0].data, 456) nested_message.ClearField('payload') - self.assertEqual(unknown_fields[0].data, 456) - unknown_fields = ( - nested_message.payload.optional_nested_message.UnknownFields()) - self.assertEqual(0, len(unknown_fields)) + self.assertEqual(unknown_field_set[0].data, 456) + unknown_field_set = unknown_fields.UnknownFieldSet( + nested_message.payload.optional_nested_message) + self.assertEqual(0, len(unknown_field_set)) def testUnknownField(self): message = unittest_pb2.TestAllTypes() message.optional_int32 = 123 destination = unittest_pb2.TestEmptyMessage() destination.ParseFromString(message.SerializeToString()) - unknown_field = destination.UnknownFields()[0] + unknown_field = unknown_fields.UnknownFieldSet(destination)[0] destination.Clear() - with self.assertRaises(ValueError) as context: - unknown_field.data # pylint: disable=pointless-statement - self.assertIn('The parent message might be cleared.', - str(context.exception)) + self.assertEqual(unknown_field.data, 123) def testUnknownExtensions(self): message = unittest_pb2.TestEmptyMessageWithExtensions() message.ParseFromString(self.all_fields_data) - self.assertEqual(len(message.UnknownFields()), 97) + self.assertEqual(len(unknown_fields.UnknownFieldSet(message)), 98) self.assertEqual(message.SerializeToString(), self.all_fields_data) @@ -416,9 +399,10 @@ class UnknownEnumValuesTest(unittest.TestCase): def CheckUnknownField(self, name, expected_value): field_descriptor = self.descriptor.fields_by_name[name] - unknown_fields = self.missing_message.UnknownFields() + unknown_field_set = unknown_fields.UnknownFieldSet(self.missing_message) + self.assertIsInstance(unknown_field_set, unknown_fields.UnknownFieldSet) count = 0 - for field in unknown_fields: + for field in unknown_field_set: if field.field_number == field_descriptor.number: count += 1 if field_descriptor.label == descriptor.FieldDescriptor.LABEL_REPEATED: @@ -458,8 +442,8 @@ class UnknownEnumValuesTest(unittest.TestCase): self.assertEqual([], self.missing_message.packed_nested_enum) def testCheckUnknownFieldValueForEnum(self): - unknown_fields = self.missing_message.UnknownFields() - self.assertEqual(len(unknown_fields), 5) + unknown_field_set = unknown_fields.UnknownFieldSet(self.missing_message) + self.assertEqual(len(unknown_field_set), 5) self.CheckUnknownField('optional_nested_enum', self.message.optional_nested_enum) self.CheckUnknownField('repeated_nested_enum', diff --git a/windows/python/google/protobuf/internal/well_known_types.py b/windows/python/google/protobuf/internal/well_known_types.py index 30ff12588..8881d758a 100644 --- a/windows/python/google/protobuf/internal/well_known_types.py +++ b/windows/python/google/protobuf/internal/well_known_types.py @@ -42,8 +42,7 @@ __author__ = 'jieluo@google.com (Jie Luo)' import calendar import collections.abc -from datetime import datetime -from datetime import timedelta +import datetime from google.protobuf.descriptor import FieldDescriptor @@ -89,7 +88,9 @@ class Any(object): return '/' in self.type_url and self.TypeName() == descriptor.full_name -_EPOCH_DATETIME = datetime.utcfromtimestamp(0) +_EPOCH_DATETIME_NAIVE = datetime.datetime.utcfromtimestamp(0) +_EPOCH_DATETIME_AWARE = datetime.datetime.fromtimestamp( + 0, tz=datetime.timezone.utc) class Timestamp(object): @@ -109,7 +110,7 @@ class Timestamp(object): total_sec = self.seconds + (self.nanos - nanos) // _NANOS_PER_SECOND seconds = total_sec % _SECONDS_PER_DAY days = (total_sec - seconds) // _SECONDS_PER_DAY - dt = datetime(1970, 1, 1) + timedelta(days, seconds) + dt = datetime.datetime(1970, 1, 1) + datetime.timedelta(days, seconds) result = dt.isoformat() if (nanos % 1e9) == 0: @@ -159,8 +160,8 @@ class Timestamp(object): raise ValueError( 'time data \'{0}\' does not match format \'%Y-%m-%dT%H:%M:%S\', ' 'lowercase \'t\' is not accepted'.format(second_value)) - date_object = datetime.strptime(second_value, _TIMESTAMPFOMAT) - td = date_object - datetime(1970, 1, 1) + date_object = datetime.datetime.strptime(second_value, _TIMESTAMPFOMAT) + td = date_object - datetime.datetime(1970, 1, 1) seconds = td.seconds + td.days * _SECONDS_PER_DAY if len(nano_value) > 9: raise ValueError( @@ -191,7 +192,7 @@ class Timestamp(object): def GetCurrentTime(self): """Get the current UTC into Timestamp.""" - self.FromDatetime(datetime.utcnow()) + self.FromDatetime(datetime.datetime.utcnow()) def ToNanoseconds(self): """Converts Timestamp to nanoseconds since epoch.""" @@ -231,14 +232,32 @@ class Timestamp(object): self.seconds = seconds self.nanos = 0 - def ToDatetime(self): - """Converts Timestamp to datetime.""" - return _EPOCH_DATETIME + timedelta( - seconds=self.seconds, microseconds=_RoundTowardZero( - self.nanos, _NANOS_PER_MICROSECOND)) + def ToDatetime(self, tzinfo=None): + """Converts Timestamp to a datetime. + + Args: + tzinfo: A datetime.tzinfo subclass; defaults to None. + + Returns: + If tzinfo is None, returns a timezone-naive UTC datetime (with no timezone + information, i.e. not aware that it's UTC). + + Otherwise, returns a timezone-aware datetime in the input timezone. + """ + delta = datetime.timedelta( + seconds=self.seconds, + microseconds=_RoundTowardZero(self.nanos, _NANOS_PER_MICROSECOND)) + if tzinfo is None: + return _EPOCH_DATETIME_NAIVE + delta + else: + return _EPOCH_DATETIME_AWARE.astimezone(tzinfo) + delta def FromDatetime(self, dt): - """Converts datetime to Timestamp.""" + """Converts datetime to Timestamp. + + Args: + dt: A datetime. If it's timezone-naive, it's assumed to be in UTC. + """ # Using this guide: http://wiki.python.org/moin/WorkingWithTime # And this conversion guide: http://docs.python.org/library/time.html @@ -363,7 +382,7 @@ class Duration(object): def ToTimedelta(self): """Converts Duration to timedelta.""" - return timedelta( + return datetime.timedelta( seconds=self.seconds, microseconds=_RoundTowardZero( self.nanos, _NANOS_PER_MICROSECOND)) @@ -849,6 +868,7 @@ class ListValue(object): collections.abc.MutableSequence.register(ListValue) +# LINT.IfChange(wktbases) WKTBASES = { 'google.protobuf.Any': Any, 'google.protobuf.Duration': Duration, @@ -857,3 +877,4 @@ WKTBASES = { 'google.protobuf.Struct': Struct, 'google.protobuf.Timestamp': Timestamp, } +# LINT.ThenChange(//depot/google.protobuf/compiler/python/pyi_generator.cc:wktbases) diff --git a/windows/python/google/protobuf/internal/well_known_types_test.py b/windows/python/google/protobuf/internal/well_known_types_test.py index d2632f9ce..a32459a9e 100644 --- a/windows/python/google/protobuf/internal/well_known_types_test.py +++ b/windows/python/google/protobuf/internal/well_known_types_test.py @@ -48,9 +48,19 @@ from google.protobuf.internal import test_util from google.protobuf.internal import well_known_types from google.protobuf import descriptor from google.protobuf import text_format +from google.protobuf.internal import _parameterized + +try: + # New module in Python 3.9: + import zoneinfo # pylint:disable=g-import-not-at-top + _TZ_JAPAN = zoneinfo.ZoneInfo('Japan') + _TZ_PACIFIC = zoneinfo.ZoneInfo('US/Pacific') +except ImportError: + _TZ_JAPAN = datetime.timezone(datetime.timedelta(hours=9), 'Japan') + _TZ_PACIFIC = datetime.timezone(datetime.timedelta(hours=-8), 'US/Pacific') -class TimeUtilTestBase(unittest.TestCase): +class TimeUtilTestBase(_parameterized.TestCase): def CheckTimestampConversion(self, message, text): self.assertEqual(text, message.ToJsonString()) @@ -233,43 +243,68 @@ class TimeUtilTest(TimeUtilTestBase): message.FromNanoseconds(-1999) self.assertEqual(-1, message.ToMicroseconds()) - def testDatetimeConverison(self): + def testTimezoneNaiveDatetimeConversion(self): message = timestamp_pb2.Timestamp() - dt = datetime.datetime(1970, 1, 1) - message.FromDatetime(dt) - self.assertEqual(dt, message.ToDatetime()) + naive_utc_epoch = datetime.datetime(1970, 1, 1) + message.FromDatetime(naive_utc_epoch) + self.assertEqual(0, message.seconds) + self.assertEqual(0, message.nanos) + + self.assertEqual(naive_utc_epoch, message.ToDatetime()) + + naive_epoch_morning = datetime.datetime(1970, 1, 1, 8, 0, 0, 1) + message.FromDatetime(naive_epoch_morning) + self.assertEqual(8 * 3600, message.seconds) + self.assertEqual(1000, message.nanos) + + self.assertEqual(naive_epoch_morning, message.ToDatetime()) message.FromMilliseconds(1999) + self.assertEqual(1, message.seconds) + self.assertEqual(999_000_000, message.nanos) + self.assertEqual(datetime.datetime(1970, 1, 1, 0, 0, 1, 999000), message.ToDatetime()) - dt = datetime.datetime(2555, 2, 22, 1, 2, 3, 456789) - message.FromDatetime(dt) - self.assertEqual(dt, message.ToDatetime()) + naive_future = datetime.datetime(2555, 2, 22, 1, 2, 3, 456789) + message.FromDatetime(naive_future) + self.assertEqual(naive_future, message.ToDatetime()) - dt = datetime.datetime.max - message.FromDatetime(dt) - self.assertEqual(dt, message.ToDatetime()) + naive_end_of_time = datetime.datetime.max + message.FromDatetime(naive_end_of_time) + self.assertEqual(naive_end_of_time, message.ToDatetime()) - def testDatetimeConversionWithTimezone(self): - class TZ(datetime.tzinfo): + # Two hours after the Unix Epoch, around the world. + @_parameterized.named_parameters( + ('London', [1970, 1, 1, 2], datetime.timezone.utc), + ('Tokyo', [1970, 1, 1, 11], _TZ_JAPAN), + ('LA', [1969, 12, 31, 18], _TZ_PACIFIC), + ) + def testTimezoneAwareDatetimeConversion(self, date_parts, tzinfo): + original_datetime = datetime.datetime(*date_parts, tzinfo=tzinfo) # pylint:disable=g-tzinfo-datetime - def utcoffset(self, _): - return datetime.timedelta(hours=1) + message = timestamp_pb2.Timestamp() + message.FromDatetime(original_datetime) + self.assertEqual(7200, message.seconds) + self.assertEqual(0, message.nanos) - def dst(self, _): - return datetime.timedelta(0) + # ToDatetime() with no parameters produces a naive UTC datetime, i.e. it not + # only loses the original timezone information (e.g. US/Pacific) as it's + # "normalised" to UTC, but also drops the information that the datetime + # represents a UTC one. + naive_datetime = message.ToDatetime() + self.assertEqual(datetime.datetime(1970, 1, 1, 2), naive_datetime) + self.assertIsNone(naive_datetime.tzinfo) + self.assertNotEqual(original_datetime, naive_datetime) # not even for UTC! - def tzname(self, _): - return 'UTC+1' - - message1 = timestamp_pb2.Timestamp() - dt = datetime.datetime(1970, 1, 1, 1, tzinfo=TZ()) - message1.FromDatetime(dt) - message2 = timestamp_pb2.Timestamp() - dt = datetime.datetime(1970, 1, 1, 0) - message2.FromDatetime(dt) - self.assertEqual(message1, message2) + # In contrast, ToDatetime(tzinfo=) produces an aware datetime in the given + # timezone. + aware_datetime = message.ToDatetime(tzinfo=tzinfo) + self.assertEqual(original_datetime, aware_datetime) + self.assertEqual( + datetime.datetime(1970, 1, 1, 2, tzinfo=datetime.timezone.utc), + aware_datetime) + self.assertEqual(tzinfo, aware_datetime.tzinfo) def testTimedeltaConversion(self): message = duration_pb2.Duration() @@ -295,85 +330,64 @@ class TimeUtilTest(TimeUtilTestBase): def testInvalidTimestamp(self): message = timestamp_pb2.Timestamp() - self.assertRaisesRegexp( - ValueError, - 'Failed to parse timestamp: missing valid timezone offset.', - message.FromJsonString, - '') - self.assertRaisesRegexp( - ValueError, - 'Failed to parse timestamp: invalid trailing data ' - '1970-01-01T00:00:01Ztrail.', - message.FromJsonString, + self.assertRaisesRegex( + ValueError, 'Failed to parse timestamp: missing valid timezone offset.', + message.FromJsonString, '') + self.assertRaisesRegex( + ValueError, 'Failed to parse timestamp: invalid trailing data ' + '1970-01-01T00:00:01Ztrail.', message.FromJsonString, '1970-01-01T00:00:01Ztrail') - self.assertRaisesRegexp( - ValueError, - 'time data \'10000-01-01T00:00:00\' does not match' - ' format \'%Y-%m-%dT%H:%M:%S\'', - message.FromJsonString, '10000-01-01T00:00:00.00Z') - self.assertRaisesRegexp( - ValueError, - 'nanos 0123456789012 more than 9 fractional digits.', - message.FromJsonString, - '1970-01-01T00:00:00.0123456789012Z') - self.assertRaisesRegexp( + self.assertRaisesRegex( + ValueError, 'time data \'10000-01-01T00:00:00\' does not match' + ' format \'%Y-%m-%dT%H:%M:%S\'', message.FromJsonString, + '10000-01-01T00:00:00.00Z') + self.assertRaisesRegex( + ValueError, 'nanos 0123456789012 more than 9 fractional digits.', + message.FromJsonString, '1970-01-01T00:00:00.0123456789012Z') + self.assertRaisesRegex( ValueError, (r'Invalid timezone offset value: \+08.'), message.FromJsonString, - '1972-01-01T01:00:00.01+08',) - self.assertRaisesRegexp( - ValueError, - 'year (0 )?is out of range', - message.FromJsonString, - '0000-01-01T00:00:00Z') + '1972-01-01T01:00:00.01+08', + ) + self.assertRaisesRegex(ValueError, 'year (0 )?is out of range', + message.FromJsonString, '0000-01-01T00:00:00Z') message.seconds = 253402300800 - self.assertRaisesRegexp( - OverflowError, - 'date value out of range', - message.ToJsonString) + self.assertRaisesRegex(OverflowError, 'date value out of range', + message.ToJsonString) def testInvalidDuration(self): message = duration_pb2.Duration() - self.assertRaisesRegexp( - ValueError, - 'Duration must end with letter "s": 1.', - message.FromJsonString, '1') - self.assertRaisesRegexp( - ValueError, - 'Couldn\'t parse duration: 1...2s.', - message.FromJsonString, '1...2s') + self.assertRaisesRegex(ValueError, 'Duration must end with letter "s": 1.', + message.FromJsonString, '1') + self.assertRaisesRegex(ValueError, 'Couldn\'t parse duration: 1...2s.', + message.FromJsonString, '1...2s') text = '-315576000001.000000000s' - self.assertRaisesRegexp( + self.assertRaisesRegex( ValueError, r'Duration is not valid\: Seconds -315576000001 must be in range' - r' \[-315576000000\, 315576000000\].', - message.FromJsonString, text) + r' \[-315576000000\, 315576000000\].', message.FromJsonString, text) text = '315576000001.000000000s' - self.assertRaisesRegexp( + self.assertRaisesRegex( ValueError, r'Duration is not valid\: Seconds 315576000001 must be in range' - r' \[-315576000000\, 315576000000\].', - message.FromJsonString, text) + r' \[-315576000000\, 315576000000\].', message.FromJsonString, text) message.seconds = -315576000001 message.nanos = 0 - self.assertRaisesRegexp( + self.assertRaisesRegex( ValueError, r'Duration is not valid\: Seconds -315576000001 must be in range' - r' \[-315576000000\, 315576000000\].', - message.ToJsonString) + r' \[-315576000000\, 315576000000\].', message.ToJsonString) message.seconds = 0 message.nanos = 999999999 + 1 - self.assertRaisesRegexp( - ValueError, - r'Duration is not valid\: Nanos 1000000000 must be in range' - r' \[-999999999\, 999999999\].', - message.ToJsonString) + self.assertRaisesRegex( + ValueError, r'Duration is not valid\: Nanos 1000000000 must be in range' + r' \[-999999999\, 999999999\].', message.ToJsonString) message.seconds = -1 message.nanos = 1 - self.assertRaisesRegexp( - ValueError, - r'Duration is not valid\: Sign mismatch.', - message.ToJsonString) + self.assertRaisesRegex(ValueError, + r'Duration is not valid\: Sign mismatch.', + message.ToJsonString) class FieldMaskTest(unittest.TestCase): @@ -412,7 +426,7 @@ class FieldMaskTest(unittest.TestCase): mask = field_mask_pb2.FieldMask() msg_descriptor = unittest_pb2.TestAllTypes.DESCRIPTOR mask.AllFieldsFromDescriptor(msg_descriptor) - self.assertEqual(75, len(mask.paths)) + self.assertEqual(76, len(mask.paths)) self.assertTrue(mask.IsValidForDescriptor(msg_descriptor)) for field in msg_descriptor.fields: self.assertTrue(field.name in mask.paths) @@ -643,9 +657,9 @@ class FieldMaskTest(unittest.TestCase): # Test Merge oneof field. new_msg = unittest_pb2.TestOneof2() dst = unittest_pb2.TestOneof2() - dst.foo_message.qux_int = 1 + dst.foo_message.moo_int = 1 mask = field_mask_pb2.FieldMask() - mask.FromJsonString('fooMessage,fooLazyMessage.quxInt') + mask.FromJsonString('fooMessage,fooLazyMessage.mooInt') mask.MergeMessage(new_msg, dst) self.assertTrue(dst.HasField('foo_message')) self.assertFalse(dst.HasField('foo_lazy_message')) @@ -695,34 +709,29 @@ class FieldMaskTest(unittest.TestCase): well_known_types._SnakeCaseToCamelCase('foo3_bar')) # No uppercase letter is allowed. - self.assertRaisesRegexp( + self.assertRaisesRegex( ValueError, 'Fail to print FieldMask to Json string: Path name Foo must ' 'not contain uppercase letters.', - well_known_types._SnakeCaseToCamelCase, - 'Foo') + well_known_types._SnakeCaseToCamelCase, 'Foo') # Any character after a "_" must be a lowercase letter. # 1. "_" cannot be followed by another "_". # 2. "_" cannot be followed by a digit. # 3. "_" cannot appear as the last character. - self.assertRaisesRegexp( + self.assertRaisesRegex( ValueError, 'Fail to print FieldMask to Json string: The character after a ' '"_" must be a lowercase letter in path name foo__bar.', - well_known_types._SnakeCaseToCamelCase, - 'foo__bar') - self.assertRaisesRegexp( + well_known_types._SnakeCaseToCamelCase, 'foo__bar') + self.assertRaisesRegex( ValueError, 'Fail to print FieldMask to Json string: The character after a ' '"_" must be a lowercase letter in path name foo_3bar.', - well_known_types._SnakeCaseToCamelCase, - 'foo_3bar') - self.assertRaisesRegexp( + well_known_types._SnakeCaseToCamelCase, 'foo_3bar') + self.assertRaisesRegex( ValueError, 'Fail to print FieldMask to Json string: Trailing "_" in path ' - 'name foo_bar_.', - well_known_types._SnakeCaseToCamelCase, - 'foo_bar_') + 'name foo_bar_.', well_known_types._SnakeCaseToCamelCase, 'foo_bar_') def testCamelCaseToSnakeCase(self): self.assertEqual('foo_bar', @@ -731,11 +740,10 @@ class FieldMaskTest(unittest.TestCase): well_known_types._CamelCaseToSnakeCase('FooBar')) self.assertEqual('foo3_bar', well_known_types._CamelCaseToSnakeCase('foo3Bar')) - self.assertRaisesRegexp( + self.assertRaisesRegex( ValueError, 'Fail to parse FieldMask: Path name foo_bar must not contain "_"s.', - well_known_types._CamelCaseToSnakeCase, - 'foo_bar') + well_known_types._CamelCaseToSnakeCase, 'foo_bar') class StructTest(unittest.TestCase): diff --git a/windows/python/google/protobuf/json_format.py b/windows/python/google/protobuf/json_format.py index 21eb749b9..5024ed89d 100644 --- a/windows/python/google/protobuf/json_format.py +++ b/windows/python/google/protobuf/json_format.py @@ -95,7 +95,8 @@ def MessageToJson( sort_keys=False, use_integers_for_enums=False, descriptor_pool=None, - float_precision=None): + float_precision=None, + ensure_ascii=True): """Converts protobuf message to JSON format. Args: @@ -114,6 +115,8 @@ def MessageToJson( descriptor_pool: A Descriptor Pool for resolving types. If None use the default. float_precision: If set, use this to specify float field valid digits. + ensure_ascii: If True, strings with non-ASCII characters are escaped. + If False, Unicode strings are returned unchanged. Returns: A string containing the JSON formatted protocol buffer message. @@ -124,7 +127,7 @@ def MessageToJson( use_integers_for_enums, descriptor_pool, float_precision=float_precision) - return printer.ToJsonString(message, indent, sort_keys) + return printer.ToJsonString(message, indent, sort_keys, ensure_ascii) def MessageToDict( @@ -190,9 +193,10 @@ class _Printer(object): else: self.float_format = None - def ToJsonString(self, message, indent, sort_keys): + def ToJsonString(self, message, indent, sort_keys, ensure_ascii): js = self._MessageToJsonObject(message) - return json.dumps(js, indent=indent, sort_keys=sort_keys) + return json.dumps( + js, indent=indent, sort_keys=sort_keys, ensure_ascii=ensure_ascii) def _MessageToJsonObject(self, message): """Converts message to an object according to Proto3 JSON Specification.""" @@ -395,12 +399,16 @@ def _CreateMessageFromTypeUrl(type_url, descriptor_pool): message_descriptor = pool.FindMessageTypeByName(type_name) except KeyError: raise TypeError( - 'Can not find message descriptor by type_url: {0}.'.format(type_url)) + 'Can not find message descriptor by type_url: {0}'.format(type_url)) message_class = db.GetPrototype(message_descriptor) return message_class() -def Parse(text, message, ignore_unknown_fields=False, descriptor_pool=None): +def Parse(text, + message, + ignore_unknown_fields=False, + descriptor_pool=None, + max_recursion_depth=100): """Parses a JSON representation of a protocol message into a message. Args: @@ -408,7 +416,10 @@ def Parse(text, message, ignore_unknown_fields=False, descriptor_pool=None): message: A protocol buffer message to merge into. ignore_unknown_fields: If True, do not raise errors for unknown fields. descriptor_pool: A Descriptor Pool for resolving types. If None use the - default. + default. + max_recursion_depth: max recursion depth of JSON message to be + deserialized. JSON messages over this depth will fail to be + deserialized. Default value is 100. Returns: The same message passed as argument. @@ -422,13 +433,15 @@ def Parse(text, message, ignore_unknown_fields=False, descriptor_pool=None): js = json.loads(text, object_pairs_hook=_DuplicateChecker) except ValueError as e: raise ParseError('Failed to load JSON: {0}.'.format(str(e))) - return ParseDict(js, message, ignore_unknown_fields, descriptor_pool) + return ParseDict(js, message, ignore_unknown_fields, descriptor_pool, + max_recursion_depth) def ParseDict(js_dict, message, ignore_unknown_fields=False, - descriptor_pool=None): + descriptor_pool=None, + max_recursion_depth=100): """Parses a JSON dictionary representation into a message. Args: @@ -437,12 +450,15 @@ def ParseDict(js_dict, ignore_unknown_fields: If True, do not raise errors for unknown fields. descriptor_pool: A Descriptor Pool for resolving types. If None use the default. + max_recursion_depth: max recursion depth of JSON message to be + deserialized. JSON messages over this depth will fail to be + deserialized. Default value is 100. Returns: The same message passed as argument. """ - parser = _Parser(ignore_unknown_fields, descriptor_pool) - parser.ConvertMessage(js_dict, message) + parser = _Parser(ignore_unknown_fields, descriptor_pool, max_recursion_depth) + parser.ConvertMessage(js_dict, message, '') return message @@ -452,35 +468,47 @@ _INT_OR_FLOAT = (int, float) class _Parser(object): """JSON format parser for protocol message.""" - def __init__(self, ignore_unknown_fields, descriptor_pool): + def __init__(self, ignore_unknown_fields, descriptor_pool, + max_recursion_depth): self.ignore_unknown_fields = ignore_unknown_fields self.descriptor_pool = descriptor_pool + self.max_recursion_depth = max_recursion_depth + self.recursion_depth = 0 - def ConvertMessage(self, value, message): + def ConvertMessage(self, value, message, path): """Convert a JSON object into a message. Args: value: A JSON object. message: A WKT or regular protocol message to record the data. + path: parent path to log parse error info. Raises: ParseError: In case of convert problems. """ + self.recursion_depth += 1 + if self.recursion_depth > self.max_recursion_depth: + raise ParseError('Message too deep. Max recursion depth is {0}'.format( + self.max_recursion_depth)) message_descriptor = message.DESCRIPTOR full_name = message_descriptor.full_name + if not path: + path = message_descriptor.name if _IsWrapperMessage(message_descriptor): - self._ConvertWrapperMessage(value, message) + self._ConvertWrapperMessage(value, message, path) elif full_name in _WKTJSONMETHODS: - methodcaller(_WKTJSONMETHODS[full_name][1], value, message)(self) + methodcaller(_WKTJSONMETHODS[full_name][1], value, message, path)(self) else: - self._ConvertFieldValuePair(value, message) + self._ConvertFieldValuePair(value, message, path) + self.recursion_depth -= 1 - def _ConvertFieldValuePair(self, js, message): + def _ConvertFieldValuePair(self, js, message, path): """Convert field value pairs into regular message. Args: js: A JSON object to convert the field value pairs. message: A regular protocol message to record the data. + path: parent path to log parse error info. Raises: ParseError: In case of problems converting. @@ -496,8 +524,9 @@ class _Parser(object): field = message_descriptor.fields_by_name.get(name, None) if not field and _VALID_EXTENSION_NAME.match(name): if not message_descriptor.is_extendable: - raise ParseError('Message type {0} does not have extensions'.format( - message_descriptor.full_name)) + raise ParseError( + 'Message type {0} does not have extensions at {1}'.format( + message_descriptor.full_name, path)) identifier = name[1:-1] # strip [] brackets # pylint: disable=protected-access field = message.Extensions._FindExtensionByName(identifier) @@ -513,14 +542,14 @@ class _Parser(object): if self.ignore_unknown_fields: continue raise ParseError( - ('Message type "{0}" has no field named "{1}".\n' - ' Available Fields(except extensions): {2}').format( - message_descriptor.full_name, name, + ('Message type "{0}" has no field named "{1}" at "{2}".\n' + ' Available Fields(except extensions): "{3}"').format( + message_descriptor.full_name, name, path, [f.json_name for f in message_descriptor.fields])) if name in names: raise ParseError('Message type "{0}" should not have multiple ' - '"{1}" fields.'.format( - message.DESCRIPTOR.full_name, name)) + '"{1}" fields at "{2}".'.format( + message.DESCRIPTOR.full_name, name, path)) names.append(name) value = js[name] # Check no other oneof field is parsed. @@ -528,8 +557,9 @@ class _Parser(object): oneof_name = field.containing_oneof.name if oneof_name in names: raise ParseError('Message type "{0}" should not have multiple ' - '"{1}" oneof fields.'.format( - message.DESCRIPTOR.full_name, oneof_name)) + '"{1}" oneof fields at "{2}".'.format( + message.DESCRIPTOR.full_name, oneof_name, + path)) names.append(oneof_name) if value is None: @@ -547,42 +577,51 @@ class _Parser(object): # Parse field value. if _IsMapEntry(field): message.ClearField(field.name) - self._ConvertMapFieldValue(value, message, field) + self._ConvertMapFieldValue(value, message, field, + '{0}.{1}'.format(path, name)) elif field.label == descriptor.FieldDescriptor.LABEL_REPEATED: message.ClearField(field.name) if not isinstance(value, list): raise ParseError('repeated field {0} must be in [] which is ' - '{1}.'.format(name, value)) + '{1} at {2}'.format(name, value, path)) if field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_MESSAGE: # Repeated message field. - for item in value: + for index, item in enumerate(value): sub_message = getattr(message, field.name).add() # None is a null_value in Value. if (item is None and sub_message.DESCRIPTOR.full_name != 'google.protobuf.Value'): raise ParseError('null is not allowed to be used as an element' - ' in a repeated field.') - self.ConvertMessage(item, sub_message) + ' in a repeated field at {0}.{1}[{2}]'.format( + path, name, index)) + self.ConvertMessage(item, sub_message, + '{0}.{1}[{2}]'.format(path, name, index)) else: # Repeated scalar field. - for item in value: + for index, item in enumerate(value): if item is None: raise ParseError('null is not allowed to be used as an element' - ' in a repeated field.') + ' in a repeated field at {0}.{1}[{2}]'.format( + path, name, index)) getattr(message, field.name).append( - _ConvertScalarFieldValue(item, field)) + _ConvertScalarFieldValue( + item, field, '{0}.{1}[{2}]'.format(path, name, index))) elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_MESSAGE: if field.is_extension: sub_message = message.Extensions[field] else: sub_message = getattr(message, field.name) sub_message.SetInParent() - self.ConvertMessage(value, sub_message) + self.ConvertMessage(value, sub_message, '{0}.{1}'.format(path, name)) else: if field.is_extension: - message.Extensions[field] = _ConvertScalarFieldValue(value, field) + message.Extensions[field] = _ConvertScalarFieldValue( + value, field, '{0}.{1}'.format(path, name)) else: - setattr(message, field.name, _ConvertScalarFieldValue(value, field)) + setattr( + message, field.name, + _ConvertScalarFieldValue(value, field, + '{0}.{1}'.format(path, name))) except ParseError as e: if field and field.containing_oneof is None: raise ParseError('Failed to parse {0} field: {1}.'.format(name, e)) @@ -593,46 +632,52 @@ class _Parser(object): except TypeError as e: raise ParseError('Failed to parse {0} field: {1}.'.format(name, e)) - def _ConvertAnyMessage(self, value, message): + def _ConvertAnyMessage(self, value, message, path): """Convert a JSON representation into Any message.""" if isinstance(value, dict) and not value: return try: type_url = value['@type'] except KeyError: - raise ParseError('@type is missing when parsing any message.') + raise ParseError( + '@type is missing when parsing any message at {0}'.format(path)) - sub_message = _CreateMessageFromTypeUrl(type_url, self.descriptor_pool) + try: + sub_message = _CreateMessageFromTypeUrl(type_url, self.descriptor_pool) + except TypeError as e: + raise ParseError('{0} at {1}'.format(e, path)) message_descriptor = sub_message.DESCRIPTOR full_name = message_descriptor.full_name if _IsWrapperMessage(message_descriptor): - self._ConvertWrapperMessage(value['value'], sub_message) + self._ConvertWrapperMessage(value['value'], sub_message, + '{0}.value'.format(path)) elif full_name in _WKTJSONMETHODS: - methodcaller( - _WKTJSONMETHODS[full_name][1], value['value'], sub_message)(self) + methodcaller(_WKTJSONMETHODS[full_name][1], value['value'], sub_message, + '{0}.value'.format(path))( + self) else: del value['@type'] - self._ConvertFieldValuePair(value, sub_message) + self._ConvertFieldValuePair(value, sub_message, path) value['@type'] = type_url # Sets Any message message.value = sub_message.SerializeToString() message.type_url = type_url - def _ConvertGenericMessage(self, value, message): + def _ConvertGenericMessage(self, value, message, path): """Convert a JSON representation into message with FromJsonString.""" # Duration, Timestamp, FieldMask have a FromJsonString method to do the # conversion. Users can also call the method directly. try: message.FromJsonString(value) except ValueError as e: - raise ParseError(e) + raise ParseError('{0} at {1}'.format(e, path)) - def _ConvertValueMessage(self, value, message): + def _ConvertValueMessage(self, value, message, path): """Convert a JSON representation into Value message.""" if isinstance(value, dict): - self._ConvertStructMessage(value, message.struct_value) + self._ConvertStructMessage(value, message.struct_value, path) elif isinstance(value, list): - self. _ConvertListValueMessage(value, message.list_value) + self._ConvertListValueMessage(value, message.list_value, path) elif value is None: message.null_value = 0 elif isinstance(value, bool): @@ -642,68 +687,76 @@ class _Parser(object): elif isinstance(value, _INT_OR_FLOAT): message.number_value = value else: - raise ParseError('Value {0} has unexpected type {1}.'.format( - value, type(value))) + raise ParseError('Value {0} has unexpected type {1} at {2}'.format( + value, type(value), path)) - def _ConvertListValueMessage(self, value, message): + def _ConvertListValueMessage(self, value, message, path): """Convert a JSON representation into ListValue message.""" if not isinstance(value, list): - raise ParseError( - 'ListValue must be in [] which is {0}.'.format(value)) + raise ParseError('ListValue must be in [] which is {0} at {1}'.format( + value, path)) message.ClearField('values') - for item in value: - self._ConvertValueMessage(item, message.values.add()) + for index, item in enumerate(value): + self._ConvertValueMessage(item, message.values.add(), + '{0}[{1}]'.format(path, index)) - def _ConvertStructMessage(self, value, message): + def _ConvertStructMessage(self, value, message, path): """Convert a JSON representation into Struct message.""" if not isinstance(value, dict): - raise ParseError( - 'Struct must be in a dict which is {0}.'.format(value)) + raise ParseError('Struct must be in a dict which is {0} at {1}'.format( + value, path)) # Clear will mark the struct as modified so it will be created even if # there are no values. message.Clear() for key in value: - self._ConvertValueMessage(value[key], message.fields[key]) + self._ConvertValueMessage(value[key], message.fields[key], + '{0}.{1}'.format(path, key)) return - def _ConvertWrapperMessage(self, value, message): + def _ConvertWrapperMessage(self, value, message, path): """Convert a JSON representation into Wrapper message.""" field = message.DESCRIPTOR.fields_by_name['value'] - setattr(message, 'value', _ConvertScalarFieldValue(value, field)) + setattr( + message, 'value', + _ConvertScalarFieldValue(value, field, path='{0}.value'.format(path))) - def _ConvertMapFieldValue(self, value, message, field): + def _ConvertMapFieldValue(self, value, message, field, path): """Convert map field value for a message map field. Args: value: A JSON object to convert the map field value. message: A protocol message to record the converted data. field: The descriptor of the map field to be converted. + path: parent path to log parse error info. Raises: ParseError: In case of convert problems. """ if not isinstance(value, dict): raise ParseError( - 'Map field {0} must be in a dict which is {1}.'.format( - field.name, value)) + 'Map field {0} must be in a dict which is {1} at {2}'.format( + field.name, value, path)) key_field = field.message_type.fields_by_name['key'] value_field = field.message_type.fields_by_name['value'] for key in value: - key_value = _ConvertScalarFieldValue(key, key_field, True) + key_value = _ConvertScalarFieldValue(key, key_field, + '{0}.key'.format(path), True) if value_field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_MESSAGE: - self.ConvertMessage(value[key], getattr( - message, field.name)[key_value]) + self.ConvertMessage(value[key], + getattr(message, field.name)[key_value], + '{0}[{1}]'.format(path, key_value)) else: getattr(message, field.name)[key_value] = _ConvertScalarFieldValue( - value[key], value_field) + value[key], value_field, path='{0}[{1}]'.format(path, key_value)) -def _ConvertScalarFieldValue(value, field, require_str=False): +def _ConvertScalarFieldValue(value, field, path, require_str=False): """Convert a single scalar field value. Args: value: A scalar value to convert the scalar field value. field: The descriptor of the field to convert. + path: parent path to log parse error info. require_str: If True, the field value must be a str. Returns: @@ -712,44 +765,47 @@ def _ConvertScalarFieldValue(value, field, require_str=False): Raises: ParseError: In case of convert problems. """ - if field.cpp_type in _INT_TYPES: - return _ConvertInteger(value) - elif field.cpp_type in _FLOAT_TYPES: - return _ConvertFloat(value, field) - elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_BOOL: - return _ConvertBool(value, require_str) - elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_STRING: - if field.type == descriptor.FieldDescriptor.TYPE_BYTES: - if isinstance(value, str): - encoded = value.encode('utf-8') + try: + if field.cpp_type in _INT_TYPES: + return _ConvertInteger(value) + elif field.cpp_type in _FLOAT_TYPES: + return _ConvertFloat(value, field) + elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_BOOL: + return _ConvertBool(value, require_str) + elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_STRING: + if field.type == descriptor.FieldDescriptor.TYPE_BYTES: + if isinstance(value, str): + encoded = value.encode('utf-8') + else: + encoded = value + # Add extra padding '=' + padded_value = encoded + b'=' * (4 - len(encoded) % 4) + return base64.urlsafe_b64decode(padded_value) else: - encoded = value - # Add extra padding '=' - padded_value = encoded + b'=' * (4 - len(encoded) % 4) - return base64.urlsafe_b64decode(padded_value) - else: - # Checking for unpaired surrogates appears to be unreliable, - # depending on the specific Python version, so we check manually. - if _UNPAIRED_SURROGATE_PATTERN.search(value): - raise ParseError('Unpaired surrogate') - return value - elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_ENUM: - # Convert an enum value. - enum_value = field.enum_type.values_by_name.get(value, None) - if enum_value is None: - try: - number = int(value) - enum_value = field.enum_type.values_by_number.get(number, None) - except ValueError: - raise ParseError('Invalid enum value {0} for enum type {1}.'.format( - value, field.enum_type.full_name)) + # Checking for unpaired surrogates appears to be unreliable, + # depending on the specific Python version, so we check manually. + if _UNPAIRED_SURROGATE_PATTERN.search(value): + raise ParseError('Unpaired surrogate') + return value + elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_ENUM: + # Convert an enum value. + enum_value = field.enum_type.values_by_name.get(value, None) if enum_value is None: - if field.file.syntax == 'proto3': - # Proto3 accepts unknown enums. - return number - raise ParseError('Invalid enum value {0} for enum type {1}.'.format( - value, field.enum_type.full_name)) - return enum_value.number + try: + number = int(value) + enum_value = field.enum_type.values_by_number.get(number, None) + except ValueError: + raise ParseError('Invalid enum value {0} for enum type {1}'.format( + value, field.enum_type.full_name)) + if enum_value is None: + if field.file.syntax == 'proto3': + # Proto3 accepts unknown enums. + return number + raise ParseError('Invalid enum value {0} for enum type {1}'.format( + value, field.enum_type.full_name)) + return enum_value.number + except ParseError as e: + raise ParseError('{0} at {1}'.format(e, path)) def _ConvertInteger(value): @@ -765,14 +821,14 @@ def _ConvertInteger(value): ParseError: If an integer couldn't be consumed. """ if isinstance(value, float) and not value.is_integer(): - raise ParseError('Couldn\'t parse integer: {0}.'.format(value)) + raise ParseError('Couldn\'t parse integer: {0}'.format(value)) if isinstance(value, str) and value.find(' ') != -1: - raise ParseError('Couldn\'t parse integer: "{0}".'.format(value)) + raise ParseError('Couldn\'t parse integer: "{0}"'.format(value)) if isinstance(value, bool): raise ParseError('Bool value {0} is not acceptable for ' - 'integer field.'.format(value)) + 'integer field'.format(value)) return int(value) @@ -781,14 +837,14 @@ def _ConvertFloat(value, field): """Convert an floating point number.""" if isinstance(value, float): if math.isnan(value): - raise ParseError('Couldn\'t parse NaN, use quoted "NaN" instead.') + raise ParseError('Couldn\'t parse NaN, use quoted "NaN" instead') if math.isinf(value): if value > 0: raise ParseError('Couldn\'t parse Infinity or value too large, ' - 'use quoted "Infinity" instead.') + 'use quoted "Infinity" instead') else: raise ParseError('Couldn\'t parse -Infinity or value too small, ' - 'use quoted "-Infinity" instead.') + 'use quoted "-Infinity" instead') if field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_FLOAT: # pylint: disable=protected-access if value > type_checkers._FLOAT_MAX: @@ -797,7 +853,7 @@ def _ConvertFloat(value, field): if value < type_checkers._FLOAT_MIN: raise ParseError('Float value too small') if value == 'nan': - raise ParseError('Couldn\'t parse float "nan", use "NaN" instead.') + raise ParseError('Couldn\'t parse float "nan", use "NaN" instead') try: # Assume Python compatible syntax. return float(value) @@ -810,7 +866,7 @@ def _ConvertFloat(value, field): elif value == _NAN: return float('nan') else: - raise ParseError('Couldn\'t parse float: {0}.'.format(value)) + raise ParseError('Couldn\'t parse float: {0}'.format(value)) def _ConvertBool(value, require_str): @@ -832,10 +888,10 @@ def _ConvertBool(value, require_str): elif value == 'false': return False else: - raise ParseError('Expected "true" or "false", not {0}.'.format(value)) + raise ParseError('Expected "true" or "false", not {0}'.format(value)) if not isinstance(value, bool): - raise ParseError('Expected true or false without quotes.') + raise ParseError('Expected true or false without quotes') return value _WKTJSONMETHODS = { diff --git a/windows/python/google/protobuf/map_proto2_unittest_pb2.py b/windows/python/google/protobuf/map_proto2_unittest_pb2.py index 918770e93..37a5a3091 100644 --- a/windows/python/google/protobuf/map_proto2_unittest_pb2.py +++ b/windows/python/google/protobuf/map_proto2_unittest_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/map_proto2_unittest.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -22,229 +20,8 @@ except AttributeError: DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)google/protobuf/map_proto2_unittest.proto\x12\x11protobuf_unittest\x1a%google/protobuf/unittest_import.proto\"\xdb\x02\n\x0bTestEnumMap\x12J\n\x0fknown_map_field\x18\x65 \x03(\x0b\x32\x31.protobuf_unittest.TestEnumMap.KnownMapFieldEntry\x12N\n\x11unknown_map_field\x18\x66 \x03(\x0b\x32\x33.protobuf_unittest.TestEnumMap.UnknownMapFieldEntry\x1aV\n\x12KnownMapFieldEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12/\n\x05value\x18\x02 \x01(\x0e\x32 .protobuf_unittest.Proto2MapEnum:\x02\x38\x01\x1aX\n\x14UnknownMapFieldEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12/\n\x05value\x18\x02 \x01(\x0e\x32 .protobuf_unittest.Proto2MapEnum:\x02\x38\x01\"\x88\x03\n\x14TestEnumMapPlusExtra\x12S\n\x0fknown_map_field\x18\x65 \x03(\x0b\x32:.protobuf_unittest.TestEnumMapPlusExtra.KnownMapFieldEntry\x12W\n\x11unknown_map_field\x18\x66 \x03(\x0b\x32<.protobuf_unittest.TestEnumMapPlusExtra.UnknownMapFieldEntry\x1a_\n\x12KnownMapFieldEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\x38\n\x05value\x18\x02 \x01(\x0e\x32).protobuf_unittest.Proto2MapEnumPlusExtra:\x02\x38\x01\x1a\x61\n\x14UnknownMapFieldEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\x38\n\x05value\x18\x02 \x01(\x0e\x32).protobuf_unittest.Proto2MapEnumPlusExtra:\x02\x38\x01\"\xc7\x01\n\x11TestImportEnumMap\x12P\n\x0fimport_enum_amp\x18\x01 \x03(\x0b\x32\x37.protobuf_unittest.TestImportEnumMap.ImportEnumAmpEntry\x1a`\n\x12ImportEnumAmpEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\x39\n\x05value\x18\x02 \x01(\x0e\x32*.protobuf_unittest_import.ImportEnumForMap:\x02\x38\x01\"m\n\rTestIntIntMap\x12\x32\n\x01m\x18\x01 \x03(\x0b\x32\'.protobuf_unittest.TestIntIntMap.MEntry\x1a(\n\x06MEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"\xb8\r\n\x08TestMaps\x12\x38\n\x07m_int32\x18\x01 \x03(\x0b\x32\'.protobuf_unittest.TestMaps.MInt32Entry\x12\x38\n\x07m_int64\x18\x02 \x03(\x0b\x32\'.protobuf_unittest.TestMaps.MInt64Entry\x12:\n\x08m_uint32\x18\x03 \x03(\x0b\x32(.protobuf_unittest.TestMaps.MUint32Entry\x12:\n\x08m_uint64\x18\x04 \x03(\x0b\x32(.protobuf_unittest.TestMaps.MUint64Entry\x12:\n\x08m_sint32\x18\x05 \x03(\x0b\x32(.protobuf_unittest.TestMaps.MSint32Entry\x12:\n\x08m_sint64\x18\x06 \x03(\x0b\x32(.protobuf_unittest.TestMaps.MSint64Entry\x12<\n\tm_fixed32\x18\x07 \x03(\x0b\x32).protobuf_unittest.TestMaps.MFixed32Entry\x12<\n\tm_fixed64\x18\x08 \x03(\x0b\x32).protobuf_unittest.TestMaps.MFixed64Entry\x12>\n\nm_sfixed32\x18\t \x03(\x0b\x32*.protobuf_unittest.TestMaps.MSfixed32Entry\x12>\n\nm_sfixed64\x18\n \x03(\x0b\x32*.protobuf_unittest.TestMaps.MSfixed64Entry\x12\x36\n\x06m_bool\x18\x0b \x03(\x0b\x32&.protobuf_unittest.TestMaps.MBoolEntry\x12:\n\x08m_string\x18\x0c \x03(\x0b\x32(.protobuf_unittest.TestMaps.MStringEntry\x1aO\n\x0bMInt32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aO\n\x0bMInt64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aP\n\x0cMUint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aP\n\x0cMUint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aP\n\x0cMSint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x11\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aP\n\x0cMSint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x12\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aQ\n\rMFixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x07\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aQ\n\rMFixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x06\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aR\n\x0eMSfixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x0f\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aR\n\x0eMSfixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x10\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aN\n\nMBoolEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\x1aP\n\x0cMStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12/\n\x05value\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestIntIntMap:\x02\x38\x01\"<\n\x12TestSubmessageMaps\x12&\n\x01m\x18\x01 \x01(\x0b\x32\x1b.protobuf_unittest.TestMaps*Z\n\rProto2MapEnum\x12\x17\n\x13PROTO2_MAP_ENUM_FOO\x10\x00\x12\x17\n\x13PROTO2_MAP_ENUM_BAR\x10\x01\x12\x17\n\x13PROTO2_MAP_ENUM_BAZ\x10\x02*\x86\x01\n\x16Proto2MapEnumPlusExtra\x12\x19\n\x15\x45_PROTO2_MAP_ENUM_FOO\x10\x00\x12\x19\n\x15\x45_PROTO2_MAP_ENUM_BAR\x10\x01\x12\x19\n\x15\x45_PROTO2_MAP_ENUM_BAZ\x10\x02\x12\x1b\n\x17\x45_PROTO2_MAP_ENUM_EXTRA\x10\x03\x42\x03\xf8\x01\x01') -_PROTO2MAPENUM = DESCRIPTOR.enum_types_by_name['Proto2MapEnum'] -Proto2MapEnum = enum_type_wrapper.EnumTypeWrapper(_PROTO2MAPENUM) -_PROTO2MAPENUMPLUSEXTRA = DESCRIPTOR.enum_types_by_name['Proto2MapEnumPlusExtra'] -Proto2MapEnumPlusExtra = enum_type_wrapper.EnumTypeWrapper(_PROTO2MAPENUMPLUSEXTRA) -PROTO2_MAP_ENUM_FOO = 0 -PROTO2_MAP_ENUM_BAR = 1 -PROTO2_MAP_ENUM_BAZ = 2 -E_PROTO2_MAP_ENUM_FOO = 0 -E_PROTO2_MAP_ENUM_BAR = 1 -E_PROTO2_MAP_ENUM_BAZ = 2 -E_PROTO2_MAP_ENUM_EXTRA = 3 - - -_TESTENUMMAP = DESCRIPTOR.message_types_by_name['TestEnumMap'] -_TESTENUMMAP_KNOWNMAPFIELDENTRY = _TESTENUMMAP.nested_types_by_name['KnownMapFieldEntry'] -_TESTENUMMAP_UNKNOWNMAPFIELDENTRY = _TESTENUMMAP.nested_types_by_name['UnknownMapFieldEntry'] -_TESTENUMMAPPLUSEXTRA = DESCRIPTOR.message_types_by_name['TestEnumMapPlusExtra'] -_TESTENUMMAPPLUSEXTRA_KNOWNMAPFIELDENTRY = _TESTENUMMAPPLUSEXTRA.nested_types_by_name['KnownMapFieldEntry'] -_TESTENUMMAPPLUSEXTRA_UNKNOWNMAPFIELDENTRY = _TESTENUMMAPPLUSEXTRA.nested_types_by_name['UnknownMapFieldEntry'] -_TESTIMPORTENUMMAP = DESCRIPTOR.message_types_by_name['TestImportEnumMap'] -_TESTIMPORTENUMMAP_IMPORTENUMAMPENTRY = _TESTIMPORTENUMMAP.nested_types_by_name['ImportEnumAmpEntry'] -_TESTINTINTMAP = DESCRIPTOR.message_types_by_name['TestIntIntMap'] -_TESTINTINTMAP_MENTRY = _TESTINTINTMAP.nested_types_by_name['MEntry'] -_TESTMAPS = DESCRIPTOR.message_types_by_name['TestMaps'] -_TESTMAPS_MINT32ENTRY = _TESTMAPS.nested_types_by_name['MInt32Entry'] -_TESTMAPS_MINT64ENTRY = _TESTMAPS.nested_types_by_name['MInt64Entry'] -_TESTMAPS_MUINT32ENTRY = _TESTMAPS.nested_types_by_name['MUint32Entry'] -_TESTMAPS_MUINT64ENTRY = _TESTMAPS.nested_types_by_name['MUint64Entry'] -_TESTMAPS_MSINT32ENTRY = _TESTMAPS.nested_types_by_name['MSint32Entry'] -_TESTMAPS_MSINT64ENTRY = _TESTMAPS.nested_types_by_name['MSint64Entry'] -_TESTMAPS_MFIXED32ENTRY = _TESTMAPS.nested_types_by_name['MFixed32Entry'] -_TESTMAPS_MFIXED64ENTRY = _TESTMAPS.nested_types_by_name['MFixed64Entry'] -_TESTMAPS_MSFIXED32ENTRY = _TESTMAPS.nested_types_by_name['MSfixed32Entry'] -_TESTMAPS_MSFIXED64ENTRY = _TESTMAPS.nested_types_by_name['MSfixed64Entry'] -_TESTMAPS_MBOOLENTRY = _TESTMAPS.nested_types_by_name['MBoolEntry'] -_TESTMAPS_MSTRINGENTRY = _TESTMAPS.nested_types_by_name['MStringEntry'] -_TESTSUBMESSAGEMAPS = DESCRIPTOR.message_types_by_name['TestSubmessageMaps'] -TestEnumMap = _reflection.GeneratedProtocolMessageType('TestEnumMap', (_message.Message,), { - - 'KnownMapFieldEntry' : _reflection.GeneratedProtocolMessageType('KnownMapFieldEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTENUMMAP_KNOWNMAPFIELDENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestEnumMap.KnownMapFieldEntry) - }) - , - - 'UnknownMapFieldEntry' : _reflection.GeneratedProtocolMessageType('UnknownMapFieldEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTENUMMAP_UNKNOWNMAPFIELDENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestEnumMap.UnknownMapFieldEntry) - }) - , - 'DESCRIPTOR' : _TESTENUMMAP, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestEnumMap) - }) -_sym_db.RegisterMessage(TestEnumMap) -_sym_db.RegisterMessage(TestEnumMap.KnownMapFieldEntry) -_sym_db.RegisterMessage(TestEnumMap.UnknownMapFieldEntry) - -TestEnumMapPlusExtra = _reflection.GeneratedProtocolMessageType('TestEnumMapPlusExtra', (_message.Message,), { - - 'KnownMapFieldEntry' : _reflection.GeneratedProtocolMessageType('KnownMapFieldEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTENUMMAPPLUSEXTRA_KNOWNMAPFIELDENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestEnumMapPlusExtra.KnownMapFieldEntry) - }) - , - - 'UnknownMapFieldEntry' : _reflection.GeneratedProtocolMessageType('UnknownMapFieldEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTENUMMAPPLUSEXTRA_UNKNOWNMAPFIELDENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestEnumMapPlusExtra.UnknownMapFieldEntry) - }) - , - 'DESCRIPTOR' : _TESTENUMMAPPLUSEXTRA, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestEnumMapPlusExtra) - }) -_sym_db.RegisterMessage(TestEnumMapPlusExtra) -_sym_db.RegisterMessage(TestEnumMapPlusExtra.KnownMapFieldEntry) -_sym_db.RegisterMessage(TestEnumMapPlusExtra.UnknownMapFieldEntry) - -TestImportEnumMap = _reflection.GeneratedProtocolMessageType('TestImportEnumMap', (_message.Message,), { - - 'ImportEnumAmpEntry' : _reflection.GeneratedProtocolMessageType('ImportEnumAmpEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTIMPORTENUMMAP_IMPORTENUMAMPENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestImportEnumMap.ImportEnumAmpEntry) - }) - , - 'DESCRIPTOR' : _TESTIMPORTENUMMAP, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestImportEnumMap) - }) -_sym_db.RegisterMessage(TestImportEnumMap) -_sym_db.RegisterMessage(TestImportEnumMap.ImportEnumAmpEntry) - -TestIntIntMap = _reflection.GeneratedProtocolMessageType('TestIntIntMap', (_message.Message,), { - - 'MEntry' : _reflection.GeneratedProtocolMessageType('MEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTINTINTMAP_MENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestIntIntMap.MEntry) - }) - , - 'DESCRIPTOR' : _TESTINTINTMAP, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestIntIntMap) - }) -_sym_db.RegisterMessage(TestIntIntMap) -_sym_db.RegisterMessage(TestIntIntMap.MEntry) - -TestMaps = _reflection.GeneratedProtocolMessageType('TestMaps', (_message.Message,), { - - 'MInt32Entry' : _reflection.GeneratedProtocolMessageType('MInt32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MINT32ENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MInt32Entry) - }) - , - - 'MInt64Entry' : _reflection.GeneratedProtocolMessageType('MInt64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MINT64ENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MInt64Entry) - }) - , - - 'MUint32Entry' : _reflection.GeneratedProtocolMessageType('MUint32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MUINT32ENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MUint32Entry) - }) - , - - 'MUint64Entry' : _reflection.GeneratedProtocolMessageType('MUint64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MUINT64ENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MUint64Entry) - }) - , - - 'MSint32Entry' : _reflection.GeneratedProtocolMessageType('MSint32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MSINT32ENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MSint32Entry) - }) - , - - 'MSint64Entry' : _reflection.GeneratedProtocolMessageType('MSint64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MSINT64ENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MSint64Entry) - }) - , - - 'MFixed32Entry' : _reflection.GeneratedProtocolMessageType('MFixed32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MFIXED32ENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MFixed32Entry) - }) - , - - 'MFixed64Entry' : _reflection.GeneratedProtocolMessageType('MFixed64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MFIXED64ENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MFixed64Entry) - }) - , - - 'MSfixed32Entry' : _reflection.GeneratedProtocolMessageType('MSfixed32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MSFIXED32ENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MSfixed32Entry) - }) - , - - 'MSfixed64Entry' : _reflection.GeneratedProtocolMessageType('MSfixed64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MSFIXED64ENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MSfixed64Entry) - }) - , - - 'MBoolEntry' : _reflection.GeneratedProtocolMessageType('MBoolEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MBOOLENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MBoolEntry) - }) - , - - 'MStringEntry' : _reflection.GeneratedProtocolMessageType('MStringEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPS_MSTRINGENTRY, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps.MStringEntry) - }) - , - 'DESCRIPTOR' : _TESTMAPS, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMaps) - }) -_sym_db.RegisterMessage(TestMaps) -_sym_db.RegisterMessage(TestMaps.MInt32Entry) -_sym_db.RegisterMessage(TestMaps.MInt64Entry) -_sym_db.RegisterMessage(TestMaps.MUint32Entry) -_sym_db.RegisterMessage(TestMaps.MUint64Entry) -_sym_db.RegisterMessage(TestMaps.MSint32Entry) -_sym_db.RegisterMessage(TestMaps.MSint64Entry) -_sym_db.RegisterMessage(TestMaps.MFixed32Entry) -_sym_db.RegisterMessage(TestMaps.MFixed64Entry) -_sym_db.RegisterMessage(TestMaps.MSfixed32Entry) -_sym_db.RegisterMessage(TestMaps.MSfixed64Entry) -_sym_db.RegisterMessage(TestMaps.MBoolEntry) -_sym_db.RegisterMessage(TestMaps.MStringEntry) - -TestSubmessageMaps = _reflection.GeneratedProtocolMessageType('TestSubmessageMaps', (_message.Message,), { - 'DESCRIPTOR' : _TESTSUBMESSAGEMAPS, - '__module__' : 'google.protobuf.map_proto2_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestSubmessageMaps) - }) -_sym_db.RegisterMessage(TestSubmessageMaps) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.map_proto2_unittest_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/map_unittest_pb2.py b/windows/python/google/protobuf/map_unittest_pb2.py index 7f75d147b..e93a82fa2 100644 --- a/windows/python/google/protobuf/map_unittest_pb2.py +++ b/windows/python/google/protobuf/map_unittest_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/map_unittest.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -18,473 +16,8 @@ from google.protobuf import unittest_pb2 as google_dot_protobuf_dot_unittest__pb DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"google/protobuf/map_unittest.proto\x12\x11protobuf_unittest\x1a\x1egoogle/protobuf/unittest.proto\"\xff\x14\n\x07TestMap\x12\x46\n\x0fmap_int32_int32\x18\x01 \x03(\x0b\x32-.protobuf_unittest.TestMap.MapInt32Int32Entry\x12\x46\n\x0fmap_int64_int64\x18\x02 \x03(\x0b\x32-.protobuf_unittest.TestMap.MapInt64Int64Entry\x12J\n\x11map_uint32_uint32\x18\x03 \x03(\x0b\x32/.protobuf_unittest.TestMap.MapUint32Uint32Entry\x12J\n\x11map_uint64_uint64\x18\x04 \x03(\x0b\x32/.protobuf_unittest.TestMap.MapUint64Uint64Entry\x12J\n\x11map_sint32_sint32\x18\x05 \x03(\x0b\x32/.protobuf_unittest.TestMap.MapSint32Sint32Entry\x12J\n\x11map_sint64_sint64\x18\x06 \x03(\x0b\x32/.protobuf_unittest.TestMap.MapSint64Sint64Entry\x12N\n\x13map_fixed32_fixed32\x18\x07 \x03(\x0b\x32\x31.protobuf_unittest.TestMap.MapFixed32Fixed32Entry\x12N\n\x13map_fixed64_fixed64\x18\x08 \x03(\x0b\x32\x31.protobuf_unittest.TestMap.MapFixed64Fixed64Entry\x12R\n\x15map_sfixed32_sfixed32\x18\t \x03(\x0b\x32\x33.protobuf_unittest.TestMap.MapSfixed32Sfixed32Entry\x12R\n\x15map_sfixed64_sfixed64\x18\n \x03(\x0b\x32\x33.protobuf_unittest.TestMap.MapSfixed64Sfixed64Entry\x12\x46\n\x0fmap_int32_float\x18\x0b \x03(\x0b\x32-.protobuf_unittest.TestMap.MapInt32FloatEntry\x12H\n\x10map_int32_double\x18\x0c \x03(\x0b\x32..protobuf_unittest.TestMap.MapInt32DoubleEntry\x12\x42\n\rmap_bool_bool\x18\r \x03(\x0b\x32+.protobuf_unittest.TestMap.MapBoolBoolEntry\x12J\n\x11map_string_string\x18\x0e \x03(\x0b\x32/.protobuf_unittest.TestMap.MapStringStringEntry\x12\x46\n\x0fmap_int32_bytes\x18\x0f \x03(\x0b\x32-.protobuf_unittest.TestMap.MapInt32BytesEntry\x12\x44\n\x0emap_int32_enum\x18\x10 \x03(\x0b\x32,.protobuf_unittest.TestMap.MapInt32EnumEntry\x12Y\n\x19map_int32_foreign_message\x18\x11 \x03(\x0b\x32\x36.protobuf_unittest.TestMap.MapInt32ForeignMessageEntry\x12[\n\x1amap_string_foreign_message\x18\x12 \x03(\x0b\x32\x37.protobuf_unittest.TestMap.MapStringForeignMessageEntry\x12M\n\x13map_int32_all_types\x18\x13 \x03(\x0b\x32\x30.protobuf_unittest.TestMap.MapInt32AllTypesEntry\x1a\x34\n\x12MapInt32Int32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x34\n\x12MapInt64Int64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x36\n\x14MapUint32Uint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\x1a\x36\n\x14MapUint64Uint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x04:\x02\x38\x01\x1a\x36\n\x14MapSint32Sint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x11\x12\r\n\x05value\x18\x02 \x01(\x11:\x02\x38\x01\x1a\x36\n\x14MapSint64Sint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x12\x12\r\n\x05value\x18\x02 \x01(\x12:\x02\x38\x01\x1a\x38\n\x16MapFixed32Fixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x07\x12\r\n\x05value\x18\x02 \x01(\x07:\x02\x38\x01\x1a\x38\n\x16MapFixed64Fixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x06\x12\r\n\x05value\x18\x02 \x01(\x06:\x02\x38\x01\x1a:\n\x18MapSfixed32Sfixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x0f\x12\r\n\x05value\x18\x02 \x01(\x0f:\x02\x38\x01\x1a:\n\x18MapSfixed64Sfixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x10\x12\r\n\x05value\x18\x02 \x01(\x10:\x02\x38\x01\x1a\x34\n\x12MapInt32FloatEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x1a\x35\n\x13MapInt32DoubleEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x32\n\x10MapBoolBoolEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\x1a\x36\n\x14MapStringStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12MapInt32BytesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\x1aO\n\x11MapInt32EnumEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12)\n\x05value\x18\x02 \x01(\x0e\x32\x1a.protobuf_unittest.MapEnum:\x02\x38\x01\x1a`\n\x1bMapInt32ForeignMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\x30\n\x05value\x18\x02 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage:\x02\x38\x01\x1a\x61\n\x1cMapStringForeignMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x30\n\x05value\x18\x02 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage:\x02\x38\x01\x1aX\n\x15MapInt32AllTypesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes:\x02\x38\x01\"A\n\x11TestMapSubmessage\x12,\n\x08test_map\x18\x01 \x01(\x0b\x32\x1a.protobuf_unittest.TestMap\"\xbc\x01\n\x0eTestMessageMap\x12Q\n\x11map_int32_message\x18\x01 \x03(\x0b\x32\x36.protobuf_unittest.TestMessageMap.MapInt32MessageEntry\x1aW\n\x14MapInt32MessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes:\x02\x38\x01\"\xe3\x01\n\x0fTestSameTypeMap\x12:\n\x04map1\x18\x01 \x03(\x0b\x32,.protobuf_unittest.TestSameTypeMap.Map1Entry\x12:\n\x04map2\x18\x02 \x03(\x0b\x32,.protobuf_unittest.TestSameTypeMap.Map2Entry\x1a+\n\tMap1Entry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a+\n\tMap2Entry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"\xb6\x01\n\x16TestRequiredMessageMap\x12J\n\tmap_field\x18\x01 \x03(\x0b\x32\x37.protobuf_unittest.TestRequiredMessageMap.MapFieldEntry\x1aP\n\rMapFieldEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.protobuf_unittest.TestRequired:\x02\x38\x01\"\xf0\x12\n\x0cTestArenaMap\x12K\n\x0fmap_int32_int32\x18\x01 \x03(\x0b\x32\x32.protobuf_unittest.TestArenaMap.MapInt32Int32Entry\x12K\n\x0fmap_int64_int64\x18\x02 \x03(\x0b\x32\x32.protobuf_unittest.TestArenaMap.MapInt64Int64Entry\x12O\n\x11map_uint32_uint32\x18\x03 \x03(\x0b\x32\x34.protobuf_unittest.TestArenaMap.MapUint32Uint32Entry\x12O\n\x11map_uint64_uint64\x18\x04 \x03(\x0b\x32\x34.protobuf_unittest.TestArenaMap.MapUint64Uint64Entry\x12O\n\x11map_sint32_sint32\x18\x05 \x03(\x0b\x32\x34.protobuf_unittest.TestArenaMap.MapSint32Sint32Entry\x12O\n\x11map_sint64_sint64\x18\x06 \x03(\x0b\x32\x34.protobuf_unittest.TestArenaMap.MapSint64Sint64Entry\x12S\n\x13map_fixed32_fixed32\x18\x07 \x03(\x0b\x32\x36.protobuf_unittest.TestArenaMap.MapFixed32Fixed32Entry\x12S\n\x13map_fixed64_fixed64\x18\x08 \x03(\x0b\x32\x36.protobuf_unittest.TestArenaMap.MapFixed64Fixed64Entry\x12W\n\x15map_sfixed32_sfixed32\x18\t \x03(\x0b\x32\x38.protobuf_unittest.TestArenaMap.MapSfixed32Sfixed32Entry\x12W\n\x15map_sfixed64_sfixed64\x18\n \x03(\x0b\x32\x38.protobuf_unittest.TestArenaMap.MapSfixed64Sfixed64Entry\x12K\n\x0fmap_int32_float\x18\x0b \x03(\x0b\x32\x32.protobuf_unittest.TestArenaMap.MapInt32FloatEntry\x12M\n\x10map_int32_double\x18\x0c \x03(\x0b\x32\x33.protobuf_unittest.TestArenaMap.MapInt32DoubleEntry\x12G\n\rmap_bool_bool\x18\r \x03(\x0b\x32\x30.protobuf_unittest.TestArenaMap.MapBoolBoolEntry\x12O\n\x11map_string_string\x18\x0e \x03(\x0b\x32\x34.protobuf_unittest.TestArenaMap.MapStringStringEntry\x12K\n\x0fmap_int32_bytes\x18\x0f \x03(\x0b\x32\x32.protobuf_unittest.TestArenaMap.MapInt32BytesEntry\x12I\n\x0emap_int32_enum\x18\x10 \x03(\x0b\x32\x31.protobuf_unittest.TestArenaMap.MapInt32EnumEntry\x12^\n\x19map_int32_foreign_message\x18\x11 \x03(\x0b\x32;.protobuf_unittest.TestArenaMap.MapInt32ForeignMessageEntry\x1a\x34\n\x12MapInt32Int32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x34\n\x12MapInt64Int64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x36\n\x14MapUint32Uint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\x1a\x36\n\x14MapUint64Uint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x04:\x02\x38\x01\x1a\x36\n\x14MapSint32Sint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x11\x12\r\n\x05value\x18\x02 \x01(\x11:\x02\x38\x01\x1a\x36\n\x14MapSint64Sint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x12\x12\r\n\x05value\x18\x02 \x01(\x12:\x02\x38\x01\x1a\x38\n\x16MapFixed32Fixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x07\x12\r\n\x05value\x18\x02 \x01(\x07:\x02\x38\x01\x1a\x38\n\x16MapFixed64Fixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x06\x12\r\n\x05value\x18\x02 \x01(\x06:\x02\x38\x01\x1a:\n\x18MapSfixed32Sfixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x0f\x12\r\n\x05value\x18\x02 \x01(\x0f:\x02\x38\x01\x1a:\n\x18MapSfixed64Sfixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x10\x12\r\n\x05value\x18\x02 \x01(\x10:\x02\x38\x01\x1a\x34\n\x12MapInt32FloatEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x1a\x35\n\x13MapInt32DoubleEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x32\n\x10MapBoolBoolEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\x1a\x36\n\x14MapStringStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12MapInt32BytesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\x1aO\n\x11MapInt32EnumEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12)\n\x05value\x18\x02 \x01(\x0e\x32\x1a.protobuf_unittest.MapEnum:\x02\x38\x01\x1a`\n\x1bMapInt32ForeignMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\x30\n\x05value\x18\x02 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage:\x02\x38\x01\"\xe4\x01\n\x1fMessageContainingEnumCalledType\x12J\n\x04type\x18\x01 \x03(\x0b\x32<.protobuf_unittest.MessageContainingEnumCalledType.TypeEntry\x1a_\n\tTypeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.protobuf_unittest.MessageContainingEnumCalledType:\x02\x38\x01\"\x14\n\x04Type\x12\x0c\n\x08TYPE_FOO\x10\x00\"\x9d\x01\n\x1fMessageContainingMapCalledEntry\x12L\n\x05\x65ntry\x18\x01 \x03(\x0b\x32=.protobuf_unittest.MessageContainingMapCalledEntry.EntryEntry\x1a,\n\nEntryEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"\xad\x01\n\x17TestRecursiveMapMessage\x12<\n\x01\x61\x18\x01 \x03(\x0b\x32\x31.protobuf_unittest.TestRecursiveMapMessage.AEntry\x1aT\n\x06\x41\x45ntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32*.protobuf_unittest.TestRecursiveMapMessage:\x02\x38\x01*?\n\x07MapEnum\x12\x10\n\x0cMAP_ENUM_FOO\x10\x00\x12\x10\n\x0cMAP_ENUM_BAR\x10\x01\x12\x10\n\x0cMAP_ENUM_BAZ\x10\x02\x42\x03\xf8\x01\x01\x62\x06proto3') -_MAPENUM = DESCRIPTOR.enum_types_by_name['MapEnum'] -MapEnum = enum_type_wrapper.EnumTypeWrapper(_MAPENUM) -MAP_ENUM_FOO = 0 -MAP_ENUM_BAR = 1 -MAP_ENUM_BAZ = 2 - - -_TESTMAP = DESCRIPTOR.message_types_by_name['TestMap'] -_TESTMAP_MAPINT32INT32ENTRY = _TESTMAP.nested_types_by_name['MapInt32Int32Entry'] -_TESTMAP_MAPINT64INT64ENTRY = _TESTMAP.nested_types_by_name['MapInt64Int64Entry'] -_TESTMAP_MAPUINT32UINT32ENTRY = _TESTMAP.nested_types_by_name['MapUint32Uint32Entry'] -_TESTMAP_MAPUINT64UINT64ENTRY = _TESTMAP.nested_types_by_name['MapUint64Uint64Entry'] -_TESTMAP_MAPSINT32SINT32ENTRY = _TESTMAP.nested_types_by_name['MapSint32Sint32Entry'] -_TESTMAP_MAPSINT64SINT64ENTRY = _TESTMAP.nested_types_by_name['MapSint64Sint64Entry'] -_TESTMAP_MAPFIXED32FIXED32ENTRY = _TESTMAP.nested_types_by_name['MapFixed32Fixed32Entry'] -_TESTMAP_MAPFIXED64FIXED64ENTRY = _TESTMAP.nested_types_by_name['MapFixed64Fixed64Entry'] -_TESTMAP_MAPSFIXED32SFIXED32ENTRY = _TESTMAP.nested_types_by_name['MapSfixed32Sfixed32Entry'] -_TESTMAP_MAPSFIXED64SFIXED64ENTRY = _TESTMAP.nested_types_by_name['MapSfixed64Sfixed64Entry'] -_TESTMAP_MAPINT32FLOATENTRY = _TESTMAP.nested_types_by_name['MapInt32FloatEntry'] -_TESTMAP_MAPINT32DOUBLEENTRY = _TESTMAP.nested_types_by_name['MapInt32DoubleEntry'] -_TESTMAP_MAPBOOLBOOLENTRY = _TESTMAP.nested_types_by_name['MapBoolBoolEntry'] -_TESTMAP_MAPSTRINGSTRINGENTRY = _TESTMAP.nested_types_by_name['MapStringStringEntry'] -_TESTMAP_MAPINT32BYTESENTRY = _TESTMAP.nested_types_by_name['MapInt32BytesEntry'] -_TESTMAP_MAPINT32ENUMENTRY = _TESTMAP.nested_types_by_name['MapInt32EnumEntry'] -_TESTMAP_MAPINT32FOREIGNMESSAGEENTRY = _TESTMAP.nested_types_by_name['MapInt32ForeignMessageEntry'] -_TESTMAP_MAPSTRINGFOREIGNMESSAGEENTRY = _TESTMAP.nested_types_by_name['MapStringForeignMessageEntry'] -_TESTMAP_MAPINT32ALLTYPESENTRY = _TESTMAP.nested_types_by_name['MapInt32AllTypesEntry'] -_TESTMAPSUBMESSAGE = DESCRIPTOR.message_types_by_name['TestMapSubmessage'] -_TESTMESSAGEMAP = DESCRIPTOR.message_types_by_name['TestMessageMap'] -_TESTMESSAGEMAP_MAPINT32MESSAGEENTRY = _TESTMESSAGEMAP.nested_types_by_name['MapInt32MessageEntry'] -_TESTSAMETYPEMAP = DESCRIPTOR.message_types_by_name['TestSameTypeMap'] -_TESTSAMETYPEMAP_MAP1ENTRY = _TESTSAMETYPEMAP.nested_types_by_name['Map1Entry'] -_TESTSAMETYPEMAP_MAP2ENTRY = _TESTSAMETYPEMAP.nested_types_by_name['Map2Entry'] -_TESTREQUIREDMESSAGEMAP = DESCRIPTOR.message_types_by_name['TestRequiredMessageMap'] -_TESTREQUIREDMESSAGEMAP_MAPFIELDENTRY = _TESTREQUIREDMESSAGEMAP.nested_types_by_name['MapFieldEntry'] -_TESTARENAMAP = DESCRIPTOR.message_types_by_name['TestArenaMap'] -_TESTARENAMAP_MAPINT32INT32ENTRY = _TESTARENAMAP.nested_types_by_name['MapInt32Int32Entry'] -_TESTARENAMAP_MAPINT64INT64ENTRY = _TESTARENAMAP.nested_types_by_name['MapInt64Int64Entry'] -_TESTARENAMAP_MAPUINT32UINT32ENTRY = _TESTARENAMAP.nested_types_by_name['MapUint32Uint32Entry'] -_TESTARENAMAP_MAPUINT64UINT64ENTRY = _TESTARENAMAP.nested_types_by_name['MapUint64Uint64Entry'] -_TESTARENAMAP_MAPSINT32SINT32ENTRY = _TESTARENAMAP.nested_types_by_name['MapSint32Sint32Entry'] -_TESTARENAMAP_MAPSINT64SINT64ENTRY = _TESTARENAMAP.nested_types_by_name['MapSint64Sint64Entry'] -_TESTARENAMAP_MAPFIXED32FIXED32ENTRY = _TESTARENAMAP.nested_types_by_name['MapFixed32Fixed32Entry'] -_TESTARENAMAP_MAPFIXED64FIXED64ENTRY = _TESTARENAMAP.nested_types_by_name['MapFixed64Fixed64Entry'] -_TESTARENAMAP_MAPSFIXED32SFIXED32ENTRY = _TESTARENAMAP.nested_types_by_name['MapSfixed32Sfixed32Entry'] -_TESTARENAMAP_MAPSFIXED64SFIXED64ENTRY = _TESTARENAMAP.nested_types_by_name['MapSfixed64Sfixed64Entry'] -_TESTARENAMAP_MAPINT32FLOATENTRY = _TESTARENAMAP.nested_types_by_name['MapInt32FloatEntry'] -_TESTARENAMAP_MAPINT32DOUBLEENTRY = _TESTARENAMAP.nested_types_by_name['MapInt32DoubleEntry'] -_TESTARENAMAP_MAPBOOLBOOLENTRY = _TESTARENAMAP.nested_types_by_name['MapBoolBoolEntry'] -_TESTARENAMAP_MAPSTRINGSTRINGENTRY = _TESTARENAMAP.nested_types_by_name['MapStringStringEntry'] -_TESTARENAMAP_MAPINT32BYTESENTRY = _TESTARENAMAP.nested_types_by_name['MapInt32BytesEntry'] -_TESTARENAMAP_MAPINT32ENUMENTRY = _TESTARENAMAP.nested_types_by_name['MapInt32EnumEntry'] -_TESTARENAMAP_MAPINT32FOREIGNMESSAGEENTRY = _TESTARENAMAP.nested_types_by_name['MapInt32ForeignMessageEntry'] -_MESSAGECONTAININGENUMCALLEDTYPE = DESCRIPTOR.message_types_by_name['MessageContainingEnumCalledType'] -_MESSAGECONTAININGENUMCALLEDTYPE_TYPEENTRY = _MESSAGECONTAININGENUMCALLEDTYPE.nested_types_by_name['TypeEntry'] -_MESSAGECONTAININGMAPCALLEDENTRY = DESCRIPTOR.message_types_by_name['MessageContainingMapCalledEntry'] -_MESSAGECONTAININGMAPCALLEDENTRY_ENTRYENTRY = _MESSAGECONTAININGMAPCALLEDENTRY.nested_types_by_name['EntryEntry'] -_TESTRECURSIVEMAPMESSAGE = DESCRIPTOR.message_types_by_name['TestRecursiveMapMessage'] -_TESTRECURSIVEMAPMESSAGE_AENTRY = _TESTRECURSIVEMAPMESSAGE.nested_types_by_name['AEntry'] -_MESSAGECONTAININGENUMCALLEDTYPE_TYPE = _MESSAGECONTAININGENUMCALLEDTYPE.enum_types_by_name['Type'] -TestMap = _reflection.GeneratedProtocolMessageType('TestMap', (_message.Message,), { - - 'MapInt32Int32Entry' : _reflection.GeneratedProtocolMessageType('MapInt32Int32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPINT32INT32ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapInt32Int32Entry) - }) - , - - 'MapInt64Int64Entry' : _reflection.GeneratedProtocolMessageType('MapInt64Int64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPINT64INT64ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapInt64Int64Entry) - }) - , - - 'MapUint32Uint32Entry' : _reflection.GeneratedProtocolMessageType('MapUint32Uint32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPUINT32UINT32ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapUint32Uint32Entry) - }) - , - - 'MapUint64Uint64Entry' : _reflection.GeneratedProtocolMessageType('MapUint64Uint64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPUINT64UINT64ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapUint64Uint64Entry) - }) - , - - 'MapSint32Sint32Entry' : _reflection.GeneratedProtocolMessageType('MapSint32Sint32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPSINT32SINT32ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapSint32Sint32Entry) - }) - , - - 'MapSint64Sint64Entry' : _reflection.GeneratedProtocolMessageType('MapSint64Sint64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPSINT64SINT64ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapSint64Sint64Entry) - }) - , - - 'MapFixed32Fixed32Entry' : _reflection.GeneratedProtocolMessageType('MapFixed32Fixed32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPFIXED32FIXED32ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapFixed32Fixed32Entry) - }) - , - - 'MapFixed64Fixed64Entry' : _reflection.GeneratedProtocolMessageType('MapFixed64Fixed64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPFIXED64FIXED64ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapFixed64Fixed64Entry) - }) - , - - 'MapSfixed32Sfixed32Entry' : _reflection.GeneratedProtocolMessageType('MapSfixed32Sfixed32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPSFIXED32SFIXED32ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapSfixed32Sfixed32Entry) - }) - , - - 'MapSfixed64Sfixed64Entry' : _reflection.GeneratedProtocolMessageType('MapSfixed64Sfixed64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPSFIXED64SFIXED64ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapSfixed64Sfixed64Entry) - }) - , - - 'MapInt32FloatEntry' : _reflection.GeneratedProtocolMessageType('MapInt32FloatEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPINT32FLOATENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapInt32FloatEntry) - }) - , - - 'MapInt32DoubleEntry' : _reflection.GeneratedProtocolMessageType('MapInt32DoubleEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPINT32DOUBLEENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapInt32DoubleEntry) - }) - , - - 'MapBoolBoolEntry' : _reflection.GeneratedProtocolMessageType('MapBoolBoolEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPBOOLBOOLENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapBoolBoolEntry) - }) - , - - 'MapStringStringEntry' : _reflection.GeneratedProtocolMessageType('MapStringStringEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPSTRINGSTRINGENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapStringStringEntry) - }) - , - - 'MapInt32BytesEntry' : _reflection.GeneratedProtocolMessageType('MapInt32BytesEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPINT32BYTESENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapInt32BytesEntry) - }) - , - - 'MapInt32EnumEntry' : _reflection.GeneratedProtocolMessageType('MapInt32EnumEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPINT32ENUMENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapInt32EnumEntry) - }) - , - - 'MapInt32ForeignMessageEntry' : _reflection.GeneratedProtocolMessageType('MapInt32ForeignMessageEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPINT32FOREIGNMESSAGEENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapInt32ForeignMessageEntry) - }) - , - - 'MapStringForeignMessageEntry' : _reflection.GeneratedProtocolMessageType('MapStringForeignMessageEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPSTRINGFOREIGNMESSAGEENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapStringForeignMessageEntry) - }) - , - - 'MapInt32AllTypesEntry' : _reflection.GeneratedProtocolMessageType('MapInt32AllTypesEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_MAPINT32ALLTYPESENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap.MapInt32AllTypesEntry) - }) - , - 'DESCRIPTOR' : _TESTMAP, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMap) - }) -_sym_db.RegisterMessage(TestMap) -_sym_db.RegisterMessage(TestMap.MapInt32Int32Entry) -_sym_db.RegisterMessage(TestMap.MapInt64Int64Entry) -_sym_db.RegisterMessage(TestMap.MapUint32Uint32Entry) -_sym_db.RegisterMessage(TestMap.MapUint64Uint64Entry) -_sym_db.RegisterMessage(TestMap.MapSint32Sint32Entry) -_sym_db.RegisterMessage(TestMap.MapSint64Sint64Entry) -_sym_db.RegisterMessage(TestMap.MapFixed32Fixed32Entry) -_sym_db.RegisterMessage(TestMap.MapFixed64Fixed64Entry) -_sym_db.RegisterMessage(TestMap.MapSfixed32Sfixed32Entry) -_sym_db.RegisterMessage(TestMap.MapSfixed64Sfixed64Entry) -_sym_db.RegisterMessage(TestMap.MapInt32FloatEntry) -_sym_db.RegisterMessage(TestMap.MapInt32DoubleEntry) -_sym_db.RegisterMessage(TestMap.MapBoolBoolEntry) -_sym_db.RegisterMessage(TestMap.MapStringStringEntry) -_sym_db.RegisterMessage(TestMap.MapInt32BytesEntry) -_sym_db.RegisterMessage(TestMap.MapInt32EnumEntry) -_sym_db.RegisterMessage(TestMap.MapInt32ForeignMessageEntry) -_sym_db.RegisterMessage(TestMap.MapStringForeignMessageEntry) -_sym_db.RegisterMessage(TestMap.MapInt32AllTypesEntry) - -TestMapSubmessage = _reflection.GeneratedProtocolMessageType('TestMapSubmessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAPSUBMESSAGE, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMapSubmessage) - }) -_sym_db.RegisterMessage(TestMapSubmessage) - -TestMessageMap = _reflection.GeneratedProtocolMessageType('TestMessageMap', (_message.Message,), { - - 'MapInt32MessageEntry' : _reflection.GeneratedProtocolMessageType('MapInt32MessageEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGEMAP_MAPINT32MESSAGEENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageMap.MapInt32MessageEntry) - }) - , - 'DESCRIPTOR' : _TESTMESSAGEMAP, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageMap) - }) -_sym_db.RegisterMessage(TestMessageMap) -_sym_db.RegisterMessage(TestMessageMap.MapInt32MessageEntry) - -TestSameTypeMap = _reflection.GeneratedProtocolMessageType('TestSameTypeMap', (_message.Message,), { - - 'Map1Entry' : _reflection.GeneratedProtocolMessageType('Map1Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTSAMETYPEMAP_MAP1ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestSameTypeMap.Map1Entry) - }) - , - - 'Map2Entry' : _reflection.GeneratedProtocolMessageType('Map2Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTSAMETYPEMAP_MAP2ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestSameTypeMap.Map2Entry) - }) - , - 'DESCRIPTOR' : _TESTSAMETYPEMAP, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestSameTypeMap) - }) -_sym_db.RegisterMessage(TestSameTypeMap) -_sym_db.RegisterMessage(TestSameTypeMap.Map1Entry) -_sym_db.RegisterMessage(TestSameTypeMap.Map2Entry) - -TestRequiredMessageMap = _reflection.GeneratedProtocolMessageType('TestRequiredMessageMap', (_message.Message,), { - - 'MapFieldEntry' : _reflection.GeneratedProtocolMessageType('MapFieldEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTREQUIREDMESSAGEMAP_MAPFIELDENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequiredMessageMap.MapFieldEntry) - }) - , - 'DESCRIPTOR' : _TESTREQUIREDMESSAGEMAP, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequiredMessageMap) - }) -_sym_db.RegisterMessage(TestRequiredMessageMap) -_sym_db.RegisterMessage(TestRequiredMessageMap.MapFieldEntry) - -TestArenaMap = _reflection.GeneratedProtocolMessageType('TestArenaMap', (_message.Message,), { - - 'MapInt32Int32Entry' : _reflection.GeneratedProtocolMessageType('MapInt32Int32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPINT32INT32ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapInt32Int32Entry) - }) - , - - 'MapInt64Int64Entry' : _reflection.GeneratedProtocolMessageType('MapInt64Int64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPINT64INT64ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapInt64Int64Entry) - }) - , - - 'MapUint32Uint32Entry' : _reflection.GeneratedProtocolMessageType('MapUint32Uint32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPUINT32UINT32ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapUint32Uint32Entry) - }) - , - - 'MapUint64Uint64Entry' : _reflection.GeneratedProtocolMessageType('MapUint64Uint64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPUINT64UINT64ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapUint64Uint64Entry) - }) - , - - 'MapSint32Sint32Entry' : _reflection.GeneratedProtocolMessageType('MapSint32Sint32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPSINT32SINT32ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapSint32Sint32Entry) - }) - , - - 'MapSint64Sint64Entry' : _reflection.GeneratedProtocolMessageType('MapSint64Sint64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPSINT64SINT64ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapSint64Sint64Entry) - }) - , - - 'MapFixed32Fixed32Entry' : _reflection.GeneratedProtocolMessageType('MapFixed32Fixed32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPFIXED32FIXED32ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapFixed32Fixed32Entry) - }) - , - - 'MapFixed64Fixed64Entry' : _reflection.GeneratedProtocolMessageType('MapFixed64Fixed64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPFIXED64FIXED64ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapFixed64Fixed64Entry) - }) - , - - 'MapSfixed32Sfixed32Entry' : _reflection.GeneratedProtocolMessageType('MapSfixed32Sfixed32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPSFIXED32SFIXED32ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapSfixed32Sfixed32Entry) - }) - , - - 'MapSfixed64Sfixed64Entry' : _reflection.GeneratedProtocolMessageType('MapSfixed64Sfixed64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPSFIXED64SFIXED64ENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapSfixed64Sfixed64Entry) - }) - , - - 'MapInt32FloatEntry' : _reflection.GeneratedProtocolMessageType('MapInt32FloatEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPINT32FLOATENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapInt32FloatEntry) - }) - , - - 'MapInt32DoubleEntry' : _reflection.GeneratedProtocolMessageType('MapInt32DoubleEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPINT32DOUBLEENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapInt32DoubleEntry) - }) - , - - 'MapBoolBoolEntry' : _reflection.GeneratedProtocolMessageType('MapBoolBoolEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPBOOLBOOLENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapBoolBoolEntry) - }) - , - - 'MapStringStringEntry' : _reflection.GeneratedProtocolMessageType('MapStringStringEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPSTRINGSTRINGENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapStringStringEntry) - }) - , - - 'MapInt32BytesEntry' : _reflection.GeneratedProtocolMessageType('MapInt32BytesEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPINT32BYTESENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapInt32BytesEntry) - }) - , - - 'MapInt32EnumEntry' : _reflection.GeneratedProtocolMessageType('MapInt32EnumEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPINT32ENUMENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapInt32EnumEntry) - }) - , - - 'MapInt32ForeignMessageEntry' : _reflection.GeneratedProtocolMessageType('MapInt32ForeignMessageEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTARENAMAP_MAPINT32FOREIGNMESSAGEENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap.MapInt32ForeignMessageEntry) - }) - , - 'DESCRIPTOR' : _TESTARENAMAP, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestArenaMap) - }) -_sym_db.RegisterMessage(TestArenaMap) -_sym_db.RegisterMessage(TestArenaMap.MapInt32Int32Entry) -_sym_db.RegisterMessage(TestArenaMap.MapInt64Int64Entry) -_sym_db.RegisterMessage(TestArenaMap.MapUint32Uint32Entry) -_sym_db.RegisterMessage(TestArenaMap.MapUint64Uint64Entry) -_sym_db.RegisterMessage(TestArenaMap.MapSint32Sint32Entry) -_sym_db.RegisterMessage(TestArenaMap.MapSint64Sint64Entry) -_sym_db.RegisterMessage(TestArenaMap.MapFixed32Fixed32Entry) -_sym_db.RegisterMessage(TestArenaMap.MapFixed64Fixed64Entry) -_sym_db.RegisterMessage(TestArenaMap.MapSfixed32Sfixed32Entry) -_sym_db.RegisterMessage(TestArenaMap.MapSfixed64Sfixed64Entry) -_sym_db.RegisterMessage(TestArenaMap.MapInt32FloatEntry) -_sym_db.RegisterMessage(TestArenaMap.MapInt32DoubleEntry) -_sym_db.RegisterMessage(TestArenaMap.MapBoolBoolEntry) -_sym_db.RegisterMessage(TestArenaMap.MapStringStringEntry) -_sym_db.RegisterMessage(TestArenaMap.MapInt32BytesEntry) -_sym_db.RegisterMessage(TestArenaMap.MapInt32EnumEntry) -_sym_db.RegisterMessage(TestArenaMap.MapInt32ForeignMessageEntry) - -MessageContainingEnumCalledType = _reflection.GeneratedProtocolMessageType('MessageContainingEnumCalledType', (_message.Message,), { - - 'TypeEntry' : _reflection.GeneratedProtocolMessageType('TypeEntry', (_message.Message,), { - 'DESCRIPTOR' : _MESSAGECONTAININGENUMCALLEDTYPE_TYPEENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.MessageContainingEnumCalledType.TypeEntry) - }) - , - 'DESCRIPTOR' : _MESSAGECONTAININGENUMCALLEDTYPE, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.MessageContainingEnumCalledType) - }) -_sym_db.RegisterMessage(MessageContainingEnumCalledType) -_sym_db.RegisterMessage(MessageContainingEnumCalledType.TypeEntry) - -MessageContainingMapCalledEntry = _reflection.GeneratedProtocolMessageType('MessageContainingMapCalledEntry', (_message.Message,), { - - 'EntryEntry' : _reflection.GeneratedProtocolMessageType('EntryEntry', (_message.Message,), { - 'DESCRIPTOR' : _MESSAGECONTAININGMAPCALLEDENTRY_ENTRYENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.MessageContainingMapCalledEntry.EntryEntry) - }) - , - 'DESCRIPTOR' : _MESSAGECONTAININGMAPCALLEDENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.MessageContainingMapCalledEntry) - }) -_sym_db.RegisterMessage(MessageContainingMapCalledEntry) -_sym_db.RegisterMessage(MessageContainingMapCalledEntry.EntryEntry) - -TestRecursiveMapMessage = _reflection.GeneratedProtocolMessageType('TestRecursiveMapMessage', (_message.Message,), { - - 'AEntry' : _reflection.GeneratedProtocolMessageType('AEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTRECURSIVEMAPMESSAGE_AENTRY, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRecursiveMapMessage.AEntry) - }) - , - 'DESCRIPTOR' : _TESTRECURSIVEMAPMESSAGE, - '__module__' : 'google.protobuf.map_unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRecursiveMapMessage) - }) -_sym_db.RegisterMessage(TestRecursiveMapMessage) -_sym_db.RegisterMessage(TestRecursiveMapMessage.AEntry) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.map_unittest_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/message.py b/windows/python/google/protobuf/message.py index ee46d0e4c..76c6802f7 100644 --- a/windows/python/google/protobuf/message.py +++ b/windows/python/google/protobuf/message.py @@ -194,6 +194,9 @@ class Message(object): """Parse serialized protocol buffer data into this message. Like :func:`MergeFromString()`, except we clear the object first. + + Raises: + message.DecodeError if the input cannot be parsed. """ self.Clear() return self.MergeFromString(serialized) diff --git a/windows/python/google/protobuf/message_factory.py b/windows/python/google/protobuf/message_factory.py index 3656fa687..8d6520458 100644 --- a/windows/python/google/protobuf/message_factory.py +++ b/windows/python/google/protobuf/message_factory.py @@ -43,10 +43,10 @@ from google.protobuf.internal import api_implementation from google.protobuf import descriptor_pool from google.protobuf import message -if api_implementation.Type() == 'cpp': - from google.protobuf.pyext import cpp_message as message_impl -else: +if api_implementation.Type() == 'python': from google.protobuf.internal import python_message as message_impl +else: + from google.protobuf.pyext import cpp_message as message_impl # pylint: disable=g-import-not-at-top # The type of all Message classes. @@ -118,6 +118,8 @@ class MessageFactory(object): self.GetPrototype(extension.containing_type) extended_class = self._classes[extension.containing_type] extended_class.RegisterExtension(extension) + if extension.message_type: + self.GetPrototype(extension.message_type) return result_class def GetMessages(self, files): @@ -154,6 +156,8 @@ class MessageFactory(object): self.GetPrototype(extension.containing_type) extended_class = self._classes[extension.containing_type] extended_class.RegisterExtension(extension) + if extension.message_type: + self.GetPrototype(extension.message_type) return result diff --git a/windows/python/google/protobuf/proto_api.h b/windows/python/google/protobuf/proto_api.h index 2e2156a56..9969a91f4 100644 --- a/windows/python/google/protobuf/proto_api.h +++ b/windows/python/google/protobuf/proto_api.h @@ -45,6 +45,7 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__ #define GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__ +#define PY_SSIZE_T_CLEAN #include #include diff --git a/windows/python/google/protobuf/pyext/cpp_message.py b/windows/python/google/protobuf/pyext/cpp_message.py index fc8eb32d7..ca290299f 100644 --- a/windows/python/google/protobuf/pyext/cpp_message.py +++ b/windows/python/google/protobuf/pyext/cpp_message.py @@ -36,7 +36,14 @@ Descriptor objects at runtime backed by the protocol buffer C++ API. __author__ = 'tibell@google.com (Johan Tibell)' -from google.protobuf.pyext import _message +from google.protobuf.internal import api_implementation + + +# pylint: disable=protected-access +_message = api_implementation._c_module +# TODO(jieluo): Remove this import after fix api_implementation +if _message is None: + from google.protobuf.pyext import _message class GeneratedProtocolMessageType(_message.MessageMeta): diff --git a/windows/python/google/protobuf/pyext/descriptor.cc b/windows/python/google/protobuf/pyext/descriptor.cc index 9708b8401..162531226 100644 --- a/windows/python/google/protobuf/pyext/descriptor.cc +++ b/windows/python/google/protobuf/pyext/descriptor.cc @@ -32,6 +32,7 @@ #include +#define PY_SSIZE_T_CLEAN #include #include @@ -49,12 +50,13 @@ #include #include -#define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob) ? ((*(charpp) = const_cast( \ - PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL \ - ? -1 \ - : 0) \ - : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) +#define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob) \ + ? ((*(charpp) = const_cast( \ + PyUnicode_AsUTF8AndSize(ob, (sizep)))) == nullptr \ + ? -1 \ + : 0) \ + : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) namespace google { namespace protobuf { @@ -94,17 +96,17 @@ bool _CalledFromGeneratedFile(int stacklevel) { // This check is not critical and is somewhat difficult to implement correctly // in PyPy. PyFrameObject* frame = PyEval_GetFrame(); - if (frame == NULL) { + if (frame == nullptr) { return false; } while (stacklevel-- > 0) { frame = frame->f_back; - if (frame == NULL) { + if (frame == nullptr) { return false; } } - if (frame->f_code->co_filename == NULL) { + if (frame->f_code->co_filename == nullptr) { return false; } char* filename; @@ -235,23 +237,23 @@ static PyObject* GetOrBuildOptions(const DescriptorClass *descriptor) { const Descriptor *message_type = options.GetDescriptor(); CMessageClass* message_class = message_factory::GetOrCreateMessageClass( message_factory, message_type); - if (message_class == NULL) { + if (message_class == nullptr) { PyErr_Format(PyExc_TypeError, "Could not retrieve class for Options: %s", message_type->full_name().c_str()); - return NULL; + return nullptr; } ScopedPyObjectPtr args(PyTuple_New(0)); ScopedPyObjectPtr value( - PyObject_Call(message_class->AsPyObject(), args.get(), NULL)); + PyObject_Call(message_class->AsPyObject(), args.get(), nullptr)); Py_DECREF(message_class); - if (value == NULL) { - return NULL; + if (value == nullptr) { + return nullptr; } if (!PyObject_TypeCheck(value.get(), CMessage_Type)) { PyErr_Format(PyExc_TypeError, "Invalid class for %s: %s", message_type->full_name().c_str(), Py_TYPE(value.get())->tp_name); - return NULL; + return nullptr; } CMessage* cmsg = reinterpret_cast(value.get()); @@ -263,7 +265,7 @@ static PyObject* GetOrBuildOptions(const DescriptorClass *descriptor) { // Reparse options string! XXX call cmessage::MergeFromString if (!Reparse(message_factory, options, cmsg->message)) { PyErr_Format(PyExc_ValueError, "Error reparsing Options message"); - return NULL; + return nullptr; } } @@ -287,7 +289,7 @@ static PyObject* CopyToPythonProto(const DescriptorClass *descriptor, message->message->GetDescriptor() != self_descriptor) { PyErr_Format(PyExc_TypeError, "Not a %s message", self_descriptor->full_name().c_str()); - return NULL; + return nullptr; } cmessage::AssureWritable(message); DescriptorProtoClass* descriptor_message = @@ -323,7 +325,7 @@ typedef struct PyBaseDescriptor { typedef struct PyFileDescriptor { PyBaseDescriptor base; - // The cached version of serialized pb. Either NULL, or a Bytes string. + // The cached version of serialized pb. Either null, or a Bytes string. // We own the reference. PyObject *serialized_pb; } PyFileDescriptor; @@ -344,9 +346,9 @@ PyObject* NewInternedDescriptor(PyTypeObject* type, if (was_created) { *was_created = false; } - if (descriptor == NULL) { + if (descriptor == nullptr) { PyErr_BadInternalCall(); - return NULL; + return nullptr; } // See if the object is in the map of interned descriptors @@ -360,8 +362,8 @@ PyObject* NewInternedDescriptor(PyTypeObject* type, // Create a new descriptor object PyBaseDescriptor* py_descriptor = PyObject_GC_New( PyBaseDescriptor, type); - if (py_descriptor == NULL) { - return NULL; + if (py_descriptor == nullptr) { + return nullptr; } py_descriptor->descriptor = descriptor; @@ -372,10 +374,10 @@ PyObject* NewInternedDescriptor(PyTypeObject* type, // Ensures that the DescriptorPool stays alive. PyDescriptorPool* pool = GetDescriptorPool_FromPool( GetFileDescriptor(descriptor)->pool()); - if (pool == NULL) { + if (pool == nullptr) { // Don't DECREF, the object is not fully initialized. PyObject_Del(py_descriptor); - return NULL; + return nullptr; } Py_INCREF(pool); py_descriptor->pool = pool; @@ -409,39 +411,43 @@ static int GcClear(PyObject* pself) { } static PyGetSetDef Getters[] = { - {NULL} + {nullptr}, }; PyTypeObject PyBaseDescriptor_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME - ".DescriptorBase", // tp_name - sizeof(PyBaseDescriptor), // tp_basicsize - 0, // tp_itemsize - (destructor)Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer + ".DescriptorBase", // tp_name + sizeof(PyBaseDescriptor), // tp_basicsize + 0, // tp_itemsize + (destructor)Dealloc, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, // tp_flags "Descriptors base class", // tp_doc GcTraverse, // tp_traverse GcClear, // tp_clear - 0, // tp_richcompare + nullptr, // tp_richcompare 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - 0, // tp_methods - 0, // tp_members + nullptr, // tp_iter + nullptr, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members Getters, // tp_getset }; @@ -450,7 +456,7 @@ PyTypeObject PyBaseDescriptor_Type = { const void* PyDescriptor_AsVoidPtr(PyObject* obj) { if (!PyObject_TypeCheck(obj, &descriptor::PyBaseDescriptor_Type)) { PyErr_SetString(PyExc_TypeError, "Not a BaseDescriptor"); - return NULL; + return nullptr; } return reinterpret_cast(obj)->descriptor; } @@ -612,19 +618,18 @@ static PyObject* CopyToProto(PyBaseDescriptor *self, PyObject *target) { static PyObject* EnumValueName(PyBaseDescriptor *self, PyObject *args) { const char *enum_name; int number; - if (!PyArg_ParseTuple(args, "si", &enum_name, &number)) - return NULL; + if (!PyArg_ParseTuple(args, "si", &enum_name, &number)) return nullptr; const EnumDescriptor *enum_type = _GetDescriptor(self)->FindEnumTypeByName(enum_name); - if (enum_type == NULL) { + if (enum_type == nullptr) { PyErr_SetString(PyExc_KeyError, enum_name); - return NULL; + return nullptr; } const EnumValueDescriptor *enum_value = enum_type->FindValueByNumber(number); - if (enum_value == NULL) { + if (enum_value == nullptr) { PyErr_Format(PyExc_KeyError, "%d", number); - return NULL; + return nullptr; } return PyString_FromCppString(enum_value->name()); } @@ -635,94 +640,102 @@ static PyObject* GetSyntax(PyBaseDescriptor *self, void *closure) { } static PyGetSetDef Getters[] = { - { "name", (getter)GetName, NULL, "Last name"}, - { "full_name", (getter)GetFullName, NULL, "Full name"}, - { "_concrete_class", (getter)GetConcreteClass, NULL, "concrete class"}, - { "file", (getter)GetFile, NULL, "File descriptor"}, + {"name", (getter)GetName, nullptr, "Last name"}, + {"full_name", (getter)GetFullName, nullptr, "Full name"}, + {"_concrete_class", (getter)GetConcreteClass, nullptr, "concrete class"}, + {"file", (getter)GetFile, nullptr, "File descriptor"}, - { "fields", (getter)GetFieldsSeq, NULL, "Fields sequence"}, - { "fields_by_name", (getter)GetFieldsByName, NULL, "Fields by name"}, - { "fields_by_camelcase_name", (getter)GetFieldsByCamelcaseName, NULL, - "Fields by camelCase name"}, - { "fields_by_number", (getter)GetFieldsByNumber, NULL, "Fields by number"}, - { "nested_types", (getter)GetNestedTypesSeq, NULL, "Nested types sequence"}, - { "nested_types_by_name", (getter)GetNestedTypesByName, NULL, - "Nested types by name"}, - { "extensions", (getter)GetExtensions, NULL, "Extensions Sequence"}, - { "extensions_by_name", (getter)GetExtensionsByName, NULL, - "Extensions by name"}, - { "extension_ranges", (getter)GetExtensionRanges, NULL, "Extension ranges"}, - { "enum_types", (getter)GetEnumsSeq, NULL, "Enum sequence"}, - { "enum_types_by_name", (getter)GetEnumTypesByName, NULL, - "Enum types by name"}, - { "enum_values_by_name", (getter)GetEnumValuesByName, NULL, - "Enum values by name"}, - { "oneofs_by_name", (getter)GetOneofsByName, NULL, "Oneofs by name"}, - { "oneofs", (getter)GetOneofsSeq, NULL, "Oneofs by name"}, - { "containing_type", (getter)GetContainingType, (setter)SetContainingType, - "Containing type"}, - { "is_extendable", (getter)IsExtendable, (setter)NULL}, - { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"}, - { "_options", (getter)NULL, (setter)SetOptions, "Options"}, - { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions, - "Serialized Options"}, - { "syntax", (getter)GetSyntax, (setter)NULL, "Syntax"}, - {NULL} + {"fields", (getter)GetFieldsSeq, nullptr, "Fields sequence"}, + {"fields_by_name", (getter)GetFieldsByName, nullptr, "Fields by name"}, + {"fields_by_camelcase_name", (getter)GetFieldsByCamelcaseName, nullptr, + "Fields by camelCase name"}, + {"fields_by_number", (getter)GetFieldsByNumber, nullptr, + "Fields by number"}, + {"nested_types", (getter)GetNestedTypesSeq, nullptr, + "Nested types sequence"}, + {"nested_types_by_name", (getter)GetNestedTypesByName, nullptr, + "Nested types by name"}, + {"extensions", (getter)GetExtensions, nullptr, "Extensions Sequence"}, + {"extensions_by_name", (getter)GetExtensionsByName, nullptr, + "Extensions by name"}, + {"extension_ranges", (getter)GetExtensionRanges, nullptr, + "Extension ranges"}, + {"enum_types", (getter)GetEnumsSeq, nullptr, "Enum sequence"}, + {"enum_types_by_name", (getter)GetEnumTypesByName, nullptr, + "Enum types by name"}, + {"enum_values_by_name", (getter)GetEnumValuesByName, nullptr, + "Enum values by name"}, + {"oneofs_by_name", (getter)GetOneofsByName, nullptr, "Oneofs by name"}, + {"oneofs", (getter)GetOneofsSeq, nullptr, "Oneofs by name"}, + {"containing_type", (getter)GetContainingType, (setter)SetContainingType, + "Containing type"}, + {"is_extendable", (getter)IsExtendable, (setter) nullptr}, + {"has_options", (getter)GetHasOptions, (setter)SetHasOptions, + "Has Options"}, + {"_options", (getter) nullptr, (setter)SetOptions, "Options"}, + {"_serialized_options", (getter) nullptr, (setter)SetSerializedOptions, + "Serialized Options"}, + {"syntax", (getter)GetSyntax, (setter) nullptr, "Syntax"}, + {nullptr}, }; static PyMethodDef Methods[] = { - { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, }, - { "CopyToProto", (PyCFunction)CopyToProto, METH_O, }, - { "EnumValueName", (PyCFunction)EnumValueName, METH_VARARGS, }, - {NULL} + {"GetOptions", (PyCFunction)GetOptions, METH_NOARGS}, + {"CopyToProto", (PyCFunction)CopyToProto, METH_O}, + {"EnumValueName", (PyCFunction)EnumValueName, METH_VARARGS}, + {nullptr}, }; } // namespace message_descriptor PyTypeObject PyMessageDescriptor_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".MessageDescriptor", // tp_name - sizeof(PyBaseDescriptor), // tp_basicsize - 0, // tp_itemsize - 0, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A Message Descriptor", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - message_descriptor::Methods, // tp_methods - 0, // tp_members - message_descriptor::Getters, // tp_getset - &descriptor::PyBaseDescriptor_Type, // tp_base + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".MessageDescriptor", // tp_name + sizeof(PyBaseDescriptor), // tp_basicsize + 0, // tp_itemsize + nullptr, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A Message Descriptor", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + message_descriptor::Methods, // tp_methods + nullptr, // tp_members + message_descriptor::Getters, // tp_getset + &descriptor::PyBaseDescriptor_Type, // tp_base }; PyObject* PyMessageDescriptor_FromDescriptor( const Descriptor* message_descriptor) { - return descriptor::NewInternedDescriptor( - &PyMessageDescriptor_Type, message_descriptor, NULL); + return descriptor::NewInternedDescriptor(&PyMessageDescriptor_Type, + message_descriptor, nullptr); } const Descriptor* PyMessageDescriptor_AsDescriptor(PyObject* obj) { if (!PyObject_TypeCheck(obj, &PyMessageDescriptor_Type)) { PyErr_SetString(PyExc_TypeError, "Not a MessageDescriptor"); - return NULL; + return nullptr; } return reinterpret_cast( reinterpret_cast(obj)->descriptor); @@ -850,7 +863,7 @@ static PyObject* GetDefaultValue(PyBaseDescriptor *self, void *closure) { default: PyErr_Format(PyExc_NotImplementedError, "default value for %s", _GetDescriptor(self)->full_name().c_str()); - return NULL; + return nullptr; } return result; } @@ -941,6 +954,14 @@ static int SetHasOptions(PyBaseDescriptor *self, PyObject *value, return CheckCalledFromGeneratedFile("has_options"); } +static PyObject* GetHasPresence(PyBaseDescriptor* self, void* closure) { + if (_GetDescriptor(self)->has_presence()) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; + } +} + static PyObject* GetOptions(PyBaseDescriptor *self) { return GetOrBuildOptions(_GetDescriptor(self)); } @@ -956,89 +977,95 @@ static int SetSerializedOptions(PyBaseDescriptor *self, PyObject *value, } static PyGetSetDef Getters[] = { - { "full_name", (getter)GetFullName, NULL, "Full name"}, - { "name", (getter)GetName, NULL, "Unqualified name"}, - { "camelcase_name", (getter)GetCamelcaseName, NULL, "Camelcase name"}, - { "json_name", (getter)GetJsonName, NULL, "Json name"}, - { "file", (getter)GetFile, NULL, "File Descriptor"}, - { "type", (getter)GetType, NULL, "C++ Type"}, - { "cpp_type", (getter)GetCppType, NULL, "C++ Type"}, - { "label", (getter)GetLabel, NULL, "Label"}, - { "number", (getter)GetNumber, NULL, "Number"}, - { "index", (getter)GetIndex, NULL, "Index"}, - { "default_value", (getter)GetDefaultValue, NULL, "Default Value"}, - { "has_default_value", (getter)HasDefaultValue}, - { "is_extension", (getter)IsExtension, NULL, "ID"}, - { "id", (getter)GetID, NULL, "ID"}, - { "_cdescriptor", (getter)GetCDescriptor, NULL, "HAACK REMOVE ME"}, + {"full_name", (getter)GetFullName, nullptr, "Full name"}, + {"name", (getter)GetName, nullptr, "Unqualified name"}, + {"camelcase_name", (getter)GetCamelcaseName, nullptr, "Camelcase name"}, + {"json_name", (getter)GetJsonName, nullptr, "Json name"}, + {"file", (getter)GetFile, nullptr, "File Descriptor"}, + {"type", (getter)GetType, nullptr, "C++ Type"}, + {"cpp_type", (getter)GetCppType, nullptr, "C++ Type"}, + {"label", (getter)GetLabel, nullptr, "Label"}, + {"number", (getter)GetNumber, nullptr, "Number"}, + {"index", (getter)GetIndex, nullptr, "Index"}, + {"default_value", (getter)GetDefaultValue, nullptr, "Default Value"}, + {"has_default_value", (getter)HasDefaultValue}, + {"is_extension", (getter)IsExtension, nullptr, "ID"}, + {"id", (getter)GetID, nullptr, "ID"}, + {"_cdescriptor", (getter)GetCDescriptor, nullptr, "HAACK REMOVE ME"}, - { "message_type", (getter)GetMessageType, (setter)SetMessageType, - "Message type"}, - { "enum_type", (getter)GetEnumType, (setter)SetEnumType, "Enum type"}, - { "containing_type", (getter)GetContainingType, (setter)SetContainingType, - "Containing type"}, - { "extension_scope", (getter)GetExtensionScope, (setter)NULL, - "Extension scope"}, - { "containing_oneof", (getter)GetContainingOneof, (setter)SetContainingOneof, - "Containing oneof"}, - { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"}, - { "_options", (getter)NULL, (setter)SetOptions, "Options"}, - { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions, - "Serialized Options"}, - {NULL} + {"message_type", (getter)GetMessageType, (setter)SetMessageType, + "Message type"}, + {"enum_type", (getter)GetEnumType, (setter)SetEnumType, "Enum type"}, + {"containing_type", (getter)GetContainingType, (setter)SetContainingType, + "Containing type"}, + {"extension_scope", (getter)GetExtensionScope, (setter) nullptr, + "Extension scope"}, + {"containing_oneof", (getter)GetContainingOneof, (setter)SetContainingOneof, + "Containing oneof"}, + {"has_options", (getter)GetHasOptions, (setter)SetHasOptions, + "Has Options"}, + {"has_presence", (getter)GetHasPresence, (setter) nullptr, "Has Presence"}, + {"_options", (getter) nullptr, (setter)SetOptions, "Options"}, + {"_serialized_options", (getter) nullptr, (setter)SetSerializedOptions, + "Serialized Options"}, + {nullptr}, }; static PyMethodDef Methods[] = { - { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, }, - {NULL} + {"GetOptions", (PyCFunction)GetOptions, METH_NOARGS}, + {nullptr}, }; } // namespace field_descriptor PyTypeObject PyFieldDescriptor_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".FieldDescriptor", // tp_name - sizeof(PyBaseDescriptor), // tp_basicsize - 0, // tp_itemsize - 0, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A Field Descriptor", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - field_descriptor::Methods, // tp_methods - 0, // tp_members - field_descriptor::Getters, // tp_getset - &descriptor::PyBaseDescriptor_Type, // tp_base + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".FieldDescriptor", // tp_name + sizeof(PyBaseDescriptor), // tp_basicsize + 0, // tp_itemsize + nullptr, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A Field Descriptor", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + field_descriptor::Methods, // tp_methods + nullptr, // tp_members + field_descriptor::Getters, // tp_getset + &descriptor::PyBaseDescriptor_Type, // tp_base }; PyObject* PyFieldDescriptor_FromDescriptor( const FieldDescriptor* field_descriptor) { - return descriptor::NewInternedDescriptor( - &PyFieldDescriptor_Type, field_descriptor, NULL); + return descriptor::NewInternedDescriptor(&PyFieldDescriptor_Type, + field_descriptor, nullptr); } const FieldDescriptor* PyFieldDescriptor_AsDescriptor(PyObject* obj) { if (!PyObject_TypeCheck(obj, &PyFieldDescriptor_Type)) { PyErr_SetString(PyExc_TypeError, "Not a FieldDescriptor"); - return NULL; + return nullptr; } return reinterpret_cast( reinterpret_cast(obj)->descriptor); @@ -1124,76 +1151,81 @@ static PyObject* CopyToProto(PyBaseDescriptor *self, PyObject *target) { } static PyMethodDef Methods[] = { - { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, }, - { "CopyToProto", (PyCFunction)CopyToProto, METH_O, }, - {NULL} + {"GetOptions", (PyCFunction)GetOptions, METH_NOARGS}, + {"CopyToProto", (PyCFunction)CopyToProto, METH_O}, + {nullptr}, }; static PyGetSetDef Getters[] = { - { "full_name", (getter)GetFullName, NULL, "Full name"}, - { "name", (getter)GetName, NULL, "last name"}, - { "file", (getter)GetFile, NULL, "File descriptor"}, - { "values", (getter)GetEnumvaluesSeq, NULL, "values"}, - { "values_by_name", (getter)GetEnumvaluesByName, NULL, - "Enum values by name"}, - { "values_by_number", (getter)GetEnumvaluesByNumber, NULL, - "Enum values by number"}, + {"full_name", (getter)GetFullName, nullptr, "Full name"}, + {"name", (getter)GetName, nullptr, "last name"}, + {"file", (getter)GetFile, nullptr, "File descriptor"}, + {"values", (getter)GetEnumvaluesSeq, nullptr, "values"}, + {"values_by_name", (getter)GetEnumvaluesByName, nullptr, + "Enum values by name"}, + {"values_by_number", (getter)GetEnumvaluesByNumber, nullptr, + "Enum values by number"}, - { "containing_type", (getter)GetContainingType, (setter)SetContainingType, - "Containing type"}, - { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"}, - { "_options", (getter)NULL, (setter)SetOptions, "Options"}, - { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions, - "Serialized Options"}, - {NULL} + {"containing_type", (getter)GetContainingType, (setter)SetContainingType, + "Containing type"}, + {"has_options", (getter)GetHasOptions, (setter)SetHasOptions, + "Has Options"}, + {"_options", (getter) nullptr, (setter)SetOptions, "Options"}, + {"_serialized_options", (getter) nullptr, (setter)SetSerializedOptions, + "Serialized Options"}, + {nullptr}, }; } // namespace enum_descriptor PyTypeObject PyEnumDescriptor_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".EnumDescriptor", // tp_name - sizeof(PyBaseDescriptor), // tp_basicsize - 0, // tp_itemsize - 0, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A Enum Descriptor", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - enum_descriptor::Methods, // tp_methods - 0, // tp_members - enum_descriptor::Getters, // tp_getset - &descriptor::PyBaseDescriptor_Type, // tp_base + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".EnumDescriptor", // tp_name + sizeof(PyBaseDescriptor), // tp_basicsize + 0, // tp_itemsize + nullptr, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A Enum Descriptor", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + enum_descriptor::Methods, // tp_methods + nullptr, // tp_members + enum_descriptor::Getters, // tp_getset + &descriptor::PyBaseDescriptor_Type, // tp_base }; PyObject* PyEnumDescriptor_FromDescriptor( const EnumDescriptor* enum_descriptor) { - return descriptor::NewInternedDescriptor( - &PyEnumDescriptor_Type, enum_descriptor, NULL); + return descriptor::NewInternedDescriptor(&PyEnumDescriptor_Type, + enum_descriptor, nullptr); } const EnumDescriptor* PyEnumDescriptor_AsDescriptor(PyObject* obj) { if (!PyObject_TypeCheck(obj, &PyEnumDescriptor_Type)) { PyErr_SetString(PyExc_TypeError, "Not an EnumDescriptor"); - return NULL; + return nullptr; } return reinterpret_cast( reinterpret_cast(obj)->descriptor); @@ -1251,63 +1283,68 @@ static int SetSerializedOptions(PyBaseDescriptor *self, PyObject *value, } static PyGetSetDef Getters[] = { - { "name", (getter)GetName, NULL, "name"}, - { "number", (getter)GetNumber, NULL, "number"}, - { "index", (getter)GetIndex, NULL, "index"}, - { "type", (getter)GetType, NULL, "index"}, + {"name", (getter)GetName, nullptr, "name"}, + {"number", (getter)GetNumber, nullptr, "number"}, + {"index", (getter)GetIndex, nullptr, "index"}, + {"type", (getter)GetType, nullptr, "index"}, - { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"}, - { "_options", (getter)NULL, (setter)SetOptions, "Options"}, - { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions, - "Serialized Options"}, - {NULL} + {"has_options", (getter)GetHasOptions, (setter)SetHasOptions, + "Has Options"}, + {"_options", (getter) nullptr, (setter)SetOptions, "Options"}, + {"_serialized_options", (getter) nullptr, (setter)SetSerializedOptions, + "Serialized Options"}, + {nullptr}, }; static PyMethodDef Methods[] = { - { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, }, - {NULL} + {"GetOptions", (PyCFunction)GetOptions, METH_NOARGS}, + {nullptr}, }; } // namespace enumvalue_descriptor PyTypeObject PyEnumValueDescriptor_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".EnumValueDescriptor", // tp_name - sizeof(PyBaseDescriptor), // tp_basicsize - 0, // tp_itemsize - 0, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A EnumValue Descriptor", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - enumvalue_descriptor::Methods, // tp_methods - 0, // tp_members - enumvalue_descriptor::Getters, // tp_getset - &descriptor::PyBaseDescriptor_Type, // tp_base + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".EnumValueDescriptor", // tp_name + sizeof(PyBaseDescriptor), // tp_basicsize + 0, // tp_itemsize + nullptr, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A EnumValue Descriptor", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + enumvalue_descriptor::Methods, // tp_methods + nullptr, // tp_members + enumvalue_descriptor::Getters, // tp_getset + &descriptor::PyBaseDescriptor_Type, // tp_base }; PyObject* PyEnumValueDescriptor_FromDescriptor( const EnumValueDescriptor* enumvalue_descriptor) { - return descriptor::NewInternedDescriptor( - &PyEnumValueDescriptor_Type, enumvalue_descriptor, NULL); + return descriptor::NewInternedDescriptor(&PyEnumValueDescriptor_Type, + enumvalue_descriptor, nullptr); } namespace file_descriptor { @@ -1339,7 +1376,7 @@ static PyObject* GetPackage(PyFileDescriptor *self, void *closure) { static PyObject* GetSerializedPb(PyFileDescriptor *self, void *closure) { PyObject *serialized_pb = self->serialized_pb; - if (serialized_pb != NULL) { + if (serialized_pb != nullptr) { Py_INCREF(serialized_pb); return serialized_pb; } @@ -1349,8 +1386,8 @@ static PyObject* GetSerializedPb(PyFileDescriptor *self, void *closure) { file_proto.SerializePartialToString(&contents); self->serialized_pb = PyBytes_FromStringAndSize( contents.c_str(), contents.size()); - if (self->serialized_pb == NULL) { - return NULL; + if (self->serialized_pb == nullptr) { + return nullptr; } Py_INCREF(self->serialized_pb); return self->serialized_pb; @@ -1393,6 +1430,10 @@ static int SetHasOptions(PyFileDescriptor *self, PyObject *value, return CheckCalledFromGeneratedFile("has_options"); } +static PyObject* GetDebugString(PyFileDescriptor* self) { + return PyString_FromCppString(_GetDescriptor(self)->DebugString()); +} + static PyObject* GetOptions(PyFileDescriptor *self) { return GetOrBuildOptions(_GetDescriptor(self)); } @@ -1417,31 +1458,36 @@ static PyObject* CopyToProto(PyFileDescriptor *self, PyObject *target) { } static PyGetSetDef Getters[] = { - { "pool", (getter)GetPool, NULL, "pool"}, - { "name", (getter)GetName, NULL, "name"}, - { "package", (getter)GetPackage, NULL, "package"}, - { "serialized_pb", (getter)GetSerializedPb}, - { "message_types_by_name", (getter)GetMessageTypesByName, NULL, - "Messages by name"}, - { "enum_types_by_name", (getter)GetEnumTypesByName, NULL, "Enums by name"}, - { "extensions_by_name", (getter)GetExtensionsByName, NULL, - "Extensions by name"}, - { "services_by_name", (getter)GetServicesByName, NULL, "Services by name"}, - { "dependencies", (getter)GetDependencies, NULL, "Dependencies"}, - { "public_dependencies", (getter)GetPublicDependencies, NULL, "Dependencies"}, + {"pool", (getter)GetPool, nullptr, "pool"}, + {"name", (getter)GetName, nullptr, "name"}, + {"package", (getter)GetPackage, nullptr, "package"}, + {"serialized_pb", (getter)GetSerializedPb}, + {"message_types_by_name", (getter)GetMessageTypesByName, nullptr, + "Messages by name"}, + {"enum_types_by_name", (getter)GetEnumTypesByName, nullptr, + "Enums by name"}, + {"extensions_by_name", (getter)GetExtensionsByName, nullptr, + "Extensions by name"}, + {"services_by_name", (getter)GetServicesByName, nullptr, + "Services by name"}, + {"dependencies", (getter)GetDependencies, nullptr, "Dependencies"}, + {"public_dependencies", (getter)GetPublicDependencies, nullptr, + "Dependencies"}, - { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"}, - { "_options", (getter)NULL, (setter)SetOptions, "Options"}, - { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions, - "Serialized Options"}, - { "syntax", (getter)GetSyntax, (setter)NULL, "Syntax"}, - {NULL} + {"has_options", (getter)GetHasOptions, (setter)SetHasOptions, + "Has Options"}, + {"_options", (getter) nullptr, (setter)SetOptions, "Options"}, + {"_serialized_options", (getter) nullptr, (setter)SetSerializedOptions, + "Serialized Options"}, + {"syntax", (getter)GetSyntax, (setter) nullptr, "Syntax"}, + {nullptr}, }; static PyMethodDef Methods[] = { - { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, }, - { "CopyToProto", (PyCFunction)CopyToProto, METH_O, }, - {NULL} + {"GetDebugString", (PyCFunction)GetDebugString, METH_NOARGS}, + {"GetOptions", (PyCFunction)GetOptions, METH_NOARGS}, + {"CopyToProto", (PyCFunction)CopyToProto, METH_O}, + {nullptr}, }; } // namespace file_descriptor @@ -1452,46 +1498,50 @@ PyTypeObject PyFileDescriptor_Type = { sizeof(PyFileDescriptor), // tp_basicsize 0, // tp_itemsize (destructor)file_descriptor::Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A File Descriptor", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - file_descriptor::Methods, // tp_methods - 0, // tp_members - file_descriptor::Getters, // tp_getset - &descriptor::PyBaseDescriptor_Type, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc - 0, // tp_new - PyObject_GC_Del, // tp_free +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A File Descriptor", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + file_descriptor::Methods, // tp_methods + nullptr, // tp_members + file_descriptor::Getters, // tp_getset + &descriptor::PyBaseDescriptor_Type, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init + nullptr, // tp_alloc + nullptr, // tp_new + PyObject_GC_Del, // tp_free }; PyObject* PyFileDescriptor_FromDescriptor( const FileDescriptor* file_descriptor) { return PyFileDescriptor_FromDescriptorWithSerializedPb(file_descriptor, - NULL); + nullptr); } PyObject* PyFileDescriptor_FromDescriptorWithSerializedPb( @@ -1499,8 +1549,8 @@ PyObject* PyFileDescriptor_FromDescriptorWithSerializedPb( bool was_created; PyObject* py_descriptor = descriptor::NewInternedDescriptor( &PyFileDescriptor_Type, file_descriptor, &was_created); - if (py_descriptor == NULL) { - return NULL; + if (py_descriptor == nullptr) { + return nullptr; } if (was_created) { PyFileDescriptor* cfile_descriptor = @@ -1517,7 +1567,7 @@ PyObject* PyFileDescriptor_FromDescriptorWithSerializedPb( const FileDescriptor* PyFileDescriptor_AsDescriptor(PyObject* obj) { if (!PyObject_TypeCheck(obj, &PyFileDescriptor_Type)) { PyErr_SetString(PyExc_TypeError, "Not a FileDescriptor"); - return NULL; + return nullptr; } return reinterpret_cast( reinterpret_cast(obj)->descriptor); @@ -1565,6 +1615,7 @@ static PyObject* GetHasOptions(PyBaseDescriptor *self, void *closure) { Py_RETURN_FALSE; } } + static int SetHasOptions(PyBaseDescriptor *self, PyObject *value, void *closure) { return CheckCalledFromGeneratedFile("has_options"); @@ -1585,64 +1636,69 @@ static int SetSerializedOptions(PyBaseDescriptor *self, PyObject *value, } static PyGetSetDef Getters[] = { - { "name", (getter)GetName, NULL, "Name"}, - { "full_name", (getter)GetFullName, NULL, "Full name"}, - { "index", (getter)GetIndex, NULL, "Index"}, + {"name", (getter)GetName, nullptr, "Name"}, + {"full_name", (getter)GetFullName, nullptr, "Full name"}, + {"index", (getter)GetIndex, nullptr, "Index"}, - { "containing_type", (getter)GetContainingType, NULL, "Containing type"}, - { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"}, - { "_options", (getter)NULL, (setter)SetOptions, "Options"}, - { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions, - "Serialized Options"}, - { "fields", (getter)GetFields, NULL, "Fields"}, - {NULL} + {"containing_type", (getter)GetContainingType, nullptr, "Containing type"}, + {"has_options", (getter)GetHasOptions, (setter)SetHasOptions, + "Has Options"}, + {"_options", (getter) nullptr, (setter)SetOptions, "Options"}, + {"_serialized_options", (getter) nullptr, (setter)SetSerializedOptions, + "Serialized Options"}, + {"fields", (getter)GetFields, nullptr, "Fields"}, + {nullptr}, }; static PyMethodDef Methods[] = { - { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS }, - {NULL} + {"GetOptions", (PyCFunction)GetOptions, METH_NOARGS}, + {nullptr}, }; } // namespace oneof_descriptor PyTypeObject PyOneofDescriptor_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".OneofDescriptor", // tp_name - sizeof(PyBaseDescriptor), // tp_basicsize - 0, // tp_itemsize - 0, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A Oneof Descriptor", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - oneof_descriptor::Methods, // tp_methods - 0, // tp_members - oneof_descriptor::Getters, // tp_getset - &descriptor::PyBaseDescriptor_Type, // tp_base + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".OneofDescriptor", // tp_name + sizeof(PyBaseDescriptor), // tp_basicsize + 0, // tp_itemsize + nullptr, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A Oneof Descriptor", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + oneof_descriptor::Methods, // tp_methods + nullptr, // tp_members + oneof_descriptor::Getters, // tp_getset + &descriptor::PyBaseDescriptor_Type, // tp_base }; PyObject* PyOneofDescriptor_FromDescriptor( const OneofDescriptor* oneof_descriptor) { - return descriptor::NewInternedDescriptor( - &PyOneofDescriptor_Type, oneof_descriptor, NULL); + return descriptor::NewInternedDescriptor(&PyOneofDescriptor_Type, + oneof_descriptor, nullptr); } namespace service_descriptor { @@ -1681,14 +1737,14 @@ static PyObject* FindMethodByName(PyBaseDescriptor *self, PyObject* arg) { Py_ssize_t name_size; char* name; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } const MethodDescriptor* method_descriptor = _GetDescriptor(self)->FindMethodByName(StringParam(name, name_size)); - if (method_descriptor == NULL) { + if (method_descriptor == nullptr) { PyErr_Format(PyExc_KeyError, "Couldn't find method %.200s", name); - return NULL; + return nullptr; } return PyMethodDescriptor_FromDescriptor(method_descriptor); @@ -1704,69 +1760,73 @@ static PyObject* CopyToProto(PyBaseDescriptor *self, PyObject *target) { } static PyGetSetDef Getters[] = { - { "name", (getter)GetName, NULL, "Name", NULL}, - { "full_name", (getter)GetFullName, NULL, "Full name", NULL}, - { "file", (getter)GetFile, NULL, "File descriptor"}, - { "index", (getter)GetIndex, NULL, "Index", NULL}, - - { "methods", (getter)GetMethods, NULL, "Methods", NULL}, - { "methods_by_name", (getter)GetMethodsByName, NULL, "Methods by name", NULL}, - {NULL} + {"name", (getter)GetName, nullptr, "Name", nullptr}, + {"full_name", (getter)GetFullName, nullptr, "Full name", nullptr}, + {"file", (getter)GetFile, nullptr, "File descriptor"}, + {"index", (getter)GetIndex, nullptr, "Index", nullptr}, + {"methods", (getter)GetMethods, nullptr, "Methods", nullptr}, + {"methods_by_name", (getter)GetMethodsByName, nullptr, "Methods by name", + nullptr}, + {nullptr}, }; static PyMethodDef Methods[] = { - { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS }, - { "CopyToProto", (PyCFunction)CopyToProto, METH_O, }, - { "FindMethodByName", (PyCFunction)FindMethodByName, METH_O }, - {NULL} + {"GetOptions", (PyCFunction)GetOptions, METH_NOARGS}, + {"CopyToProto", (PyCFunction)CopyToProto, METH_O}, + {"FindMethodByName", (PyCFunction)FindMethodByName, METH_O}, + {nullptr}, }; } // namespace service_descriptor PyTypeObject PyServiceDescriptor_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".ServiceDescriptor", // tp_name - sizeof(PyBaseDescriptor), // tp_basicsize - 0, // tp_itemsize - 0, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A Service Descriptor", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - service_descriptor::Methods, // tp_methods - 0, // tp_members - service_descriptor::Getters, // tp_getset - &descriptor::PyBaseDescriptor_Type, // tp_base + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".ServiceDescriptor", // tp_name + sizeof(PyBaseDescriptor), // tp_basicsize + 0, // tp_itemsize + nullptr, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A Service Descriptor", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + service_descriptor::Methods, // tp_methods + nullptr, // tp_members + service_descriptor::Getters, // tp_getset + &descriptor::PyBaseDescriptor_Type, // tp_base }; PyObject* PyServiceDescriptor_FromDescriptor( const ServiceDescriptor* service_descriptor) { - return descriptor::NewInternedDescriptor( - &PyServiceDescriptor_Type, service_descriptor, NULL); + return descriptor::NewInternedDescriptor(&PyServiceDescriptor_Type, + service_descriptor, nullptr); } const ServiceDescriptor* PyServiceDescriptor_AsDescriptor(PyObject* obj) { if (!PyObject_TypeCheck(obj, &PyServiceDescriptor_Type)) { PyErr_SetString(PyExc_TypeError, "Not a ServiceDescriptor"); - return NULL; + return nullptr; } return reinterpret_cast( reinterpret_cast(obj)->descriptor); @@ -1808,6 +1868,14 @@ static PyObject* GetOutputType(PyBaseDescriptor *self, void *closure) { return PyMessageDescriptor_FromDescriptor(output_type); } +static PyObject* GetClientStreaming(PyBaseDescriptor* self, void* closure) { + return PyBool_FromLong(_GetDescriptor(self)->client_streaming() ? 1 : 0); +} + +static PyObject* GetServerStreaming(PyBaseDescriptor* self, void* closure) { + return PyBool_FromLong(_GetDescriptor(self)->server_streaming() ? 1 : 0); +} + static PyObject* GetOptions(PyBaseDescriptor *self) { return GetOrBuildOptions(_GetDescriptor(self)); } @@ -1817,62 +1885,70 @@ static PyObject* CopyToProto(PyBaseDescriptor *self, PyObject *target) { } static PyGetSetDef Getters[] = { - { "name", (getter)GetName, NULL, "Name", NULL}, - { "full_name", (getter)GetFullName, NULL, "Full name", NULL}, - { "index", (getter)GetIndex, NULL, "Index", NULL}, - { "containing_service", (getter)GetContainingService, NULL, - "Containing service", NULL}, - { "input_type", (getter)GetInputType, NULL, "Input type", NULL}, - { "output_type", (getter)GetOutputType, NULL, "Output type", NULL}, - {NULL} + {"name", (getter)GetName, nullptr, "Name", nullptr}, + {"full_name", (getter)GetFullName, nullptr, "Full name", nullptr}, + {"index", (getter)GetIndex, nullptr, "Index", nullptr}, + {"containing_service", (getter)GetContainingService, nullptr, + "Containing service", nullptr}, + {"input_type", (getter)GetInputType, nullptr, "Input type", nullptr}, + {"output_type", (getter)GetOutputType, nullptr, "Output type", nullptr}, + {"client_streaming", (getter)GetClientStreaming, nullptr, + "Client streaming", nullptr}, + {"server_streaming", (getter)GetServerStreaming, nullptr, + "Server streaming", nullptr}, + {nullptr}, }; static PyMethodDef Methods[] = { - { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, }, - { "CopyToProto", (PyCFunction)CopyToProto, METH_O, }, - {NULL} + {"GetOptions", (PyCFunction)GetOptions, METH_NOARGS}, + {"CopyToProto", (PyCFunction)CopyToProto, METH_O}, + {nullptr}, }; } // namespace method_descriptor PyTypeObject PyMethodDescriptor_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".MethodDescriptor", // tp_name - sizeof(PyBaseDescriptor), // tp_basicsize - 0, // tp_itemsize - 0, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A Method Descriptor", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - method_descriptor::Methods, // tp_methods - 0, // tp_members - method_descriptor::Getters, // tp_getset - &descriptor::PyBaseDescriptor_Type, // tp_base + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".MethodDescriptor", // tp_name + sizeof(PyBaseDescriptor), // tp_basicsize + 0, // tp_itemsize + nullptr, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A Method Descriptor", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + method_descriptor::Methods, // tp_methods + nullptr, // tp_members + method_descriptor::Getters, // tp_getset + &descriptor::PyBaseDescriptor_Type, // tp_base }; PyObject* PyMethodDescriptor_FromDescriptor( const MethodDescriptor* method_descriptor) { - return descriptor::NewInternedDescriptor( - &PyMethodDescriptor_Type, method_descriptor, NULL); + return descriptor::NewInternedDescriptor(&PyMethodDescriptor_Type, + method_descriptor, nullptr); } // Add a enum values to a type dictionary. @@ -1881,7 +1957,7 @@ static bool AddEnumValues(PyTypeObject *type, for (int i = 0; i < enum_descriptor->value_count(); ++i) { const EnumValueDescriptor* value = enum_descriptor->value(i); ScopedPyObjectPtr obj(PyLong_FromLong(value->number())); - if (obj == NULL) { + if (obj == nullptr) { return false; } if (PyDict_SetItemString(type->tp_dict, value->name().c_str(), obj.get()) < diff --git a/windows/python/google/protobuf/pyext/descriptor.h b/windows/python/google/protobuf/pyext/descriptor.h index b99209dd1..d97e2f810 100644 --- a/windows/python/google/protobuf/pyext/descriptor.h +++ b/windows/python/google/protobuf/pyext/descriptor.h @@ -33,6 +33,7 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__ +#define PY_SSIZE_T_CLEAN #include #include diff --git a/windows/python/google/protobuf/pyext/descriptor_containers.cc b/windows/python/google/protobuf/pyext/descriptor_containers.cc index b084f5b81..a87155bc4 100644 --- a/windows/python/google/protobuf/pyext/descriptor_containers.cc +++ b/windows/python/google/protobuf/pyext/descriptor_containers.cc @@ -49,6 +49,7 @@ // because the Python API is based on C, and does not play well with C++ // inheritance. +#define PY_SSIZE_T_CLEAN #include #include @@ -57,12 +58,13 @@ #include #include -#define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob) ? ((*(charpp) = const_cast( \ - PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL \ - ? -1 \ - : 0) \ - : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) +#define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob) \ + ? ((*(charpp) = const_cast( \ + PyUnicode_AsUTF8AndSize(ob, (sizep)))) == nullptr \ + ? -1 \ + : 0) \ + : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) namespace google { namespace protobuf { @@ -157,59 +159,56 @@ namespace descriptor { // Returns the C++ item descriptor for a given Python key. // When the descriptor is found, return true and set *item. -// When the descriptor is not found, return true, but set *item to NULL. +// When the descriptor is not found, return true, but set *item to null. // On error, returns false with an exception set. static bool _GetItemByKey(PyContainer* self, PyObject* key, const void** item) { switch (self->kind) { - case PyContainer::KIND_BYNAME: - { - char* name; - Py_ssize_t name_size; - if (PyString_AsStringAndSize(key, &name, &name_size) < 0) { - if (PyErr_ExceptionMatches(PyExc_TypeError)) { - // Not a string, cannot be in the container. - PyErr_Clear(); - *item = NULL; - return true; - } - return false; + case PyContainer::KIND_BYNAME: { + char* name; + Py_ssize_t name_size; + if (PyString_AsStringAndSize(key, &name, &name_size) < 0) { + if (PyErr_ExceptionMatches(PyExc_TypeError)) { + // Not a string, cannot be in the container. + PyErr_Clear(); + *item = nullptr; + return true; } - *item = self->container_def->get_by_name_fn( - self, StringParam(name, name_size)); - return true; + return false; } - case PyContainer::KIND_BYCAMELCASENAME: - { - char* camelcase_name; - Py_ssize_t name_size; - if (PyString_AsStringAndSize(key, &camelcase_name, &name_size) < 0) { - if (PyErr_ExceptionMatches(PyExc_TypeError)) { - // Not a string, cannot be in the container. - PyErr_Clear(); - *item = NULL; - return true; - } - return false; + *item = self->container_def->get_by_name_fn(self, + StringParam(name, name_size)); + return true; + } + case PyContainer::KIND_BYCAMELCASENAME: { + char* camelcase_name; + Py_ssize_t name_size; + if (PyString_AsStringAndSize(key, &camelcase_name, &name_size) < 0) { + if (PyErr_ExceptionMatches(PyExc_TypeError)) { + // Not a string, cannot be in the container. + PyErr_Clear(); + *item = nullptr; + return true; } - *item = self->container_def->get_by_camelcase_name_fn( - self, StringParam(camelcase_name, name_size)); - return true; + return false; } - case PyContainer::KIND_BYNUMBER: - { - Py_ssize_t number = PyNumber_AsSsize_t(key, NULL); - if (number == -1 && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_TypeError)) { - // Not a number, cannot be in the container. - PyErr_Clear(); - *item = NULL; - return true; - } - return false; + *item = self->container_def->get_by_camelcase_name_fn( + self, StringParam(camelcase_name, name_size)); + return true; + } + case PyContainer::KIND_BYNUMBER: { + Py_ssize_t number = PyNumber_AsSsize_t(key, nullptr); + if (number == -1 && PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_TypeError)) { + // Not a number, cannot be in the container. + PyErr_Clear(); + *item = nullptr; + return true; } - *item = self->container_def->get_by_number_fn(self, number); - return true; + return false; } + *item = self->container_def->get_by_number_fn(self, number); + return true; + } default: PyErr_SetNone(PyExc_NotImplementedError); return false; @@ -221,25 +220,22 @@ static bool _GetItemByKey(PyContainer* self, PyObject* key, const void** item) { static PyObject* _NewKey_ByIndex(PyContainer* self, Py_ssize_t index) { const void* item = self->container_def->get_by_index_fn(self, index); switch (self->kind) { - case PyContainer::KIND_BYNAME: - { + case PyContainer::KIND_BYNAME: { const std::string& name(self->container_def->get_item_name_fn(item)); return PyUnicode_FromStringAndSize(name.c_str(), name.size()); - } - case PyContainer::KIND_BYCAMELCASENAME: - { + } + case PyContainer::KIND_BYCAMELCASENAME: { const std::string& name( self->container_def->get_item_camelcase_name_fn(item)); return PyUnicode_FromStringAndSize(name.c_str(), name.size()); - } - case PyContainer::KIND_BYNUMBER: - { - int value = self->container_def->get_item_number_fn(item); - return PyLong_FromLong(value); - } + } + case PyContainer::KIND_BYNUMBER: { + int value = self->container_def->get_item_number_fn(item); + return PyLong_FromLong(value); + } default: PyErr_SetNone(PyExc_NotImplementedError); - return NULL; + return nullptr; } } @@ -257,13 +253,13 @@ static Py_ssize_t Length(PyContainer* self) { // The DescriptorMapping type. static PyObject* Subscript(PyContainer* self, PyObject* key) { - const void* item = NULL; + const void* item = nullptr; if (!_GetItemByKey(self, key, &item)) { - return NULL; + return nullptr; } if (!item) { PyErr_SetObject(PyExc_KeyError, key); - return NULL; + return nullptr; } return self->container_def->new_object_from_item_fn(item); } @@ -285,7 +281,7 @@ static PyMappingMethods MappingMappingMethods = { }; static int Contains(PyContainer* self, PyObject* key) { - const void* item = NULL; + const void* item = nullptr; if (!_GetItemByKey(self, key, &item)) { return -1; } @@ -344,11 +340,11 @@ static int DescriptorSequence_Equal(PyContainer* self, PyObject* other) { } for (int index = 0; index < size; index++) { ScopedPyObjectPtr value1(_NewObj_ByIndex(self, index)); - if (value1 == NULL) { + if (value1 == nullptr) { return -1; } PyObject* value2 = PyList_GetItem(other, index); - if (value2 == NULL) { + if (value2 == nullptr) { return -1; } int cmp = PyObject_RichCompareBool(value1.get(), value2, Py_EQ); @@ -388,15 +384,15 @@ static int DescriptorMapping_Equal(PyContainer* self, PyObject* other) { } for (int index = 0; index < size; index++) { ScopedPyObjectPtr key(_NewKey_ByIndex(self, index)); - if (key == NULL) { + if (key == nullptr) { return -1; } ScopedPyObjectPtr value1(_NewObj_ByIndex(self, index)); - if (value1 == NULL) { + if (value1 == nullptr) { return -1; } PyObject* value2 = PyDict_GetItem(other, key.get()); - if (value2 == NULL) { + if (value2 == nullptr) { // Not found in the other dictionary return 0; } @@ -426,7 +422,7 @@ static PyObject* RichCompare(PyContainer* self, PyObject* other, int opid) { result = DescriptorMapping_Equal(self, other); } if (result < 0) { - return NULL; + return nullptr; } if (result ^ (opid == Py_NE)) { Py_RETURN_TRUE; @@ -436,28 +432,28 @@ static PyObject* RichCompare(PyContainer* self, PyObject* other, int opid) { } static PySequenceMethods MappingSequenceMethods = { - 0, // sq_length - 0, // sq_concat - 0, // sq_repeat - 0, // sq_item - 0, // sq_slice - 0, // sq_ass_item - 0, // sq_ass_slice - (objobjproc)Contains, // sq_contains + nullptr, // sq_length + nullptr, // sq_concat + nullptr, // sq_repeat + nullptr, // sq_item + nullptr, // sq_slice + nullptr, // sq_ass_item + nullptr, // sq_ass_slice + (objobjproc)Contains, // sq_contains }; static PyObject* Get(PyContainer* self, PyObject* args) { PyObject* key; PyObject* default_value = Py_None; if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &default_value)) { - return NULL; + return nullptr; } const void* item; if (!_GetItemByKey(self, key, &item)) { - return NULL; + return nullptr; } - if (item == NULL) { + if (item == nullptr) { Py_INCREF(default_value); return default_value; } @@ -467,13 +463,13 @@ static PyObject* Get(PyContainer* self, PyObject* args) { static PyObject* Keys(PyContainer* self, PyObject* args) { Py_ssize_t count = Length(self); ScopedPyObjectPtr list(PyList_New(count)); - if (list == NULL) { - return NULL; + if (list == nullptr) { + return nullptr; } for (Py_ssize_t index = 0; index < count; ++index) { PyObject* key = _NewKey_ByIndex(self, index); - if (key == NULL) { - return NULL; + if (key == nullptr) { + return nullptr; } PyList_SET_ITEM(list.get(), index, key); } @@ -483,13 +479,13 @@ static PyObject* Keys(PyContainer* self, PyObject* args) { static PyObject* Values(PyContainer* self, PyObject* args) { Py_ssize_t count = Length(self); ScopedPyObjectPtr list(PyList_New(count)); - if (list == NULL) { - return NULL; + if (list == nullptr) { + return nullptr; } for (Py_ssize_t index = 0; index < count; ++index) { PyObject* value = _NewObj_ByIndex(self, index); - if (value == NULL) { - return NULL; + if (value == nullptr) { + return nullptr; } PyList_SET_ITEM(list.get(), index, value); } @@ -499,22 +495,22 @@ static PyObject* Values(PyContainer* self, PyObject* args) { static PyObject* Items(PyContainer* self, PyObject* args) { Py_ssize_t count = Length(self); ScopedPyObjectPtr list(PyList_New(count)); - if (list == NULL) { - return NULL; + if (list == nullptr) { + return nullptr; } for (Py_ssize_t index = 0; index < count; ++index) { ScopedPyObjectPtr obj(PyTuple_New(2)); - if (obj == NULL) { - return NULL; + if (obj == nullptr) { + return nullptr; } PyObject* key = _NewKey_ByIndex(self, index); - if (key == NULL) { - return NULL; + if (key == nullptr) { + return nullptr; } PyTuple_SET_ITEM(obj.get(), 0, key); PyObject* value = _NewObj_ByIndex(self, index); - if (value == NULL) { - return NULL; + if (value == nullptr) { + return nullptr; } PyTuple_SET_ITEM(obj.get(), 1, value); PyList_SET_ITEM(list.get(), index, obj.release()); @@ -539,56 +535,59 @@ static PyObject* IterItems(PyContainer* self, PyObject* args) { } static PyMethodDef MappingMethods[] = { - { "get", (PyCFunction)Get, METH_VARARGS, }, - { "keys", (PyCFunction)Keys, METH_NOARGS, }, - { "values", (PyCFunction)Values, METH_NOARGS, }, - { "items", (PyCFunction)Items, METH_NOARGS, }, - { "iterkeys", (PyCFunction)IterKeys, METH_NOARGS, }, - { "itervalues", (PyCFunction)IterValues, METH_NOARGS, }, - { "iteritems", (PyCFunction)IterItems, METH_NOARGS, }, - {NULL} + {"get", (PyCFunction)Get, METH_VARARGS}, + {"keys", (PyCFunction)Keys, METH_NOARGS}, + {"values", (PyCFunction)Values, METH_NOARGS}, + {"items", (PyCFunction)Items, METH_NOARGS}, + {"iterkeys", (PyCFunction)IterKeys, METH_NOARGS}, + {"itervalues", (PyCFunction)IterValues, METH_NOARGS}, + {"iteritems", (PyCFunction)IterItems, METH_NOARGS}, + {nullptr}, }; PyTypeObject DescriptorMapping_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - "DescriptorMapping", // tp_name - sizeof(PyContainer), // tp_basicsize - 0, // tp_itemsize - 0, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - (reprfunc)ContainerRepr, // tp_repr - 0, // tp_as_number - &MappingSequenceMethods, // tp_as_sequence - &MappingMappingMethods, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - 0, // tp_doc - 0, // tp_traverse - 0, // tp_clear - (richcmpfunc)RichCompare, // tp_richcompare - 0, // tp_weaklistoffset - (getiterfunc)Iter, // tp_iter - 0, // tp_iternext - MappingMethods, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc - 0, // tp_new - 0, // tp_free + PyVarObject_HEAD_INIT(&PyType_Type, 0) "DescriptorMapping", // tp_name + sizeof(PyContainer), // tp_basicsize + 0, // tp_itemsize + nullptr, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + (reprfunc)ContainerRepr, // tp_repr + nullptr, // tp_as_number + &MappingSequenceMethods, // tp_as_sequence + &MappingMappingMethods, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + nullptr, // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + (richcmpfunc)RichCompare, // tp_richcompare + 0, // tp_weaklistoffset + (getiterfunc)Iter, // tp_iter + nullptr, // tp_iternext + MappingMethods, // tp_methods + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init + nullptr, // tp_alloc + nullptr, // tp_new + nullptr, // tp_free }; // The DescriptorSequence type. @@ -599,7 +598,7 @@ static PyObject* GetItem(PyContainer* self, Py_ssize_t index) { } if (index < 0 || index >= Length(self)) { PyErr_SetString(PyExc_IndexError, "index out of range"); - return NULL; + return nullptr; } return _NewObj_ByIndex(self, index); } @@ -609,15 +608,14 @@ SeqSubscript(PyContainer* self, PyObject* item) { if (PyIndex_Check(item)) { Py_ssize_t index; index = PyNumber_AsSsize_t(item, PyExc_IndexError); - if (index == -1 && PyErr_Occurred()) - return NULL; + if (index == -1 && PyErr_Occurred()) return nullptr; return GetItem(self, index); } // Materialize the list and delegate the operation to it. ScopedPyObjectPtr list(PyObject_CallFunctionObjArgs( - reinterpret_cast(&PyList_Type), self, NULL)); - if (list == NULL) { - return NULL; + reinterpret_cast(&PyList_Type), self, nullptr)); + if (list == nullptr) { + return nullptr; } return Py_TYPE(list.get())->tp_as_mapping->mp_subscript(list.get(), item); } @@ -632,7 +630,7 @@ int Find(PyContainer* self, PyObject* item) { // a specific item belongs to only one sequence, depending on its position in // the .proto file definition. const void* descriptor_ptr = PyDescriptor_AsVoidPtr(item); - if (descriptor_ptr == NULL) { + if (descriptor_ptr == nullptr) { PyErr_Clear(); // Not a descriptor, it cannot be in the list. return -1; @@ -668,7 +666,7 @@ static PyObject* Index(PyContainer* self, PyObject* item) { if (position < 0) { // Not found PyErr_SetNone(PyExc_ValueError); - return NULL; + return nullptr; } else { return PyLong_FromLong(position); } @@ -701,7 +699,7 @@ static PyObject* Append(PyContainer* self, PyObject* args) { PyErr_Format(PyExc_TypeError, "'%.200s' object is not a mutable sequence", Py_TYPE(self)->tp_name); - return NULL; + return nullptr; } static PyObject* Reversed(PyContainer* self, PyObject* args) { @@ -710,77 +708,80 @@ static PyObject* Reversed(PyContainer* self, PyObject* args) { } static PyMethodDef SeqMethods[] = { - { "index", (PyCFunction)Index, METH_O, }, - { "count", (PyCFunction)Count, METH_O, }, - { "append", (PyCFunction)Append, METH_O, }, - { "__reversed__", (PyCFunction)Reversed, METH_NOARGS, }, - {NULL} + {"index", (PyCFunction)Index, METH_O}, + {"count", (PyCFunction)Count, METH_O}, + {"append", (PyCFunction)Append, METH_O}, + {"__reversed__", (PyCFunction)Reversed, METH_NOARGS}, + {nullptr}, }; static PySequenceMethods SeqSequenceMethods = { - (lenfunc)Length, // sq_length - 0, // sq_concat - 0, // sq_repeat - (ssizeargfunc)GetItem, // sq_item - 0, // sq_slice - 0, // sq_ass_item - 0, // sq_ass_slice - (objobjproc)SeqContains, // sq_contains + (lenfunc)Length, // sq_length + nullptr, // sq_concat + nullptr, // sq_repeat + (ssizeargfunc)GetItem, // sq_item + nullptr, // sq_slice + nullptr, // sq_ass_item + nullptr, // sq_ass_slice + (objobjproc)SeqContains, // sq_contains }; static PyMappingMethods SeqMappingMethods = { - (lenfunc)Length, // mp_length - (binaryfunc)SeqSubscript, // mp_subscript - 0, // mp_ass_subscript + (lenfunc)Length, // mp_length + (binaryfunc)SeqSubscript, // mp_subscript + nullptr, // mp_ass_subscript }; PyTypeObject DescriptorSequence_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - "DescriptorSequence", // tp_name - sizeof(PyContainer), // tp_basicsize - 0, // tp_itemsize - 0, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - (reprfunc)ContainerRepr, // tp_repr - 0, // tp_as_number - &SeqSequenceMethods, // tp_as_sequence - &SeqMappingMethods, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - 0, // tp_doc - 0, // tp_traverse - 0, // tp_clear - (richcmpfunc)RichCompare, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - SeqMethods, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc - 0, // tp_new - 0, // tp_free + PyVarObject_HEAD_INIT(&PyType_Type, 0) "DescriptorSequence", // tp_name + sizeof(PyContainer), // tp_basicsize + 0, // tp_itemsize + nullptr, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + (reprfunc)ContainerRepr, // tp_repr + nullptr, // tp_as_number + &SeqSequenceMethods, // tp_as_sequence + &SeqMappingMethods, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + nullptr, // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + (richcmpfunc)RichCompare, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + SeqMethods, // tp_methods + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init + nullptr, // tp_alloc + nullptr, // tp_new + nullptr, // tp_free }; static PyObject* NewMappingByName( DescriptorContainerDef* container_def, const void* descriptor) { PyContainer* self = PyObject_New(PyContainer, &DescriptorMapping_Type); - if (self == NULL) { - return NULL; + if (self == nullptr) { + return nullptr; } self->descriptor = descriptor; self->container_def = container_def; @@ -791,8 +792,8 @@ static PyObject* NewMappingByName( static PyObject* NewMappingByCamelcaseName( DescriptorContainerDef* container_def, const void* descriptor) { PyContainer* self = PyObject_New(PyContainer, &DescriptorMapping_Type); - if (self == NULL) { - return NULL; + if (self == nullptr) { + return nullptr; } self->descriptor = descriptor; self->container_def = container_def; @@ -802,14 +803,14 @@ static PyObject* NewMappingByCamelcaseName( static PyObject* NewMappingByNumber( DescriptorContainerDef* container_def, const void* descriptor) { - if (container_def->get_by_number_fn == NULL || - container_def->get_item_number_fn == NULL) { + if (container_def->get_by_number_fn == nullptr || + container_def->get_item_number_fn == nullptr) { PyErr_SetNone(PyExc_NotImplementedError); - return NULL; + return nullptr; } PyContainer* self = PyObject_New(PyContainer, &DescriptorMapping_Type); - if (self == NULL) { - return NULL; + if (self == nullptr) { + return nullptr; } self->descriptor = descriptor; self->container_def = container_def; @@ -820,8 +821,8 @@ static PyObject* NewMappingByNumber( static PyObject* NewSequence( DescriptorContainerDef* container_def, const void* descriptor) { PyContainer* self = PyObject_New(PyContainer, &DescriptorSequence_Type); - if (self == NULL) { - return NULL; + if (self == nullptr) { + return nullptr; } self->descriptor = descriptor; self->container_def = container_def; @@ -839,8 +840,8 @@ static void Iterator_Dealloc(PyContainerIterator* self) { static PyObject* Iterator_Next(PyContainerIterator* self) { int count = self->container->container_def->count_fn(self->container); if (self->index >= count) { - // Return NULL with no exception to indicate the end. - return NULL; + // Return null with no exception to indicate the end. + return nullptr; } int index = self->index; self->index += 1; @@ -851,80 +852,83 @@ static PyObject* Iterator_Next(PyContainerIterator* self) { return _NewObj_ByIndex(self->container, index); case PyContainerIterator::KIND_ITERVALUE_REVERSED: return _NewObj_ByIndex(self->container, count - index - 1); - case PyContainerIterator::KIND_ITERITEM: - { - PyObject* obj = PyTuple_New(2); - if (obj == NULL) { - return NULL; - } - PyObject* key = _NewKey_ByIndex(self->container, index); - if (key == NULL) { - Py_DECREF(obj); - return NULL; - } - PyTuple_SET_ITEM(obj, 0, key); - PyObject* value = _NewObj_ByIndex(self->container, index); - if (value == NULL) { - Py_DECREF(obj); - return NULL; - } - PyTuple_SET_ITEM(obj, 1, value); - return obj; + case PyContainerIterator::KIND_ITERITEM: { + PyObject* obj = PyTuple_New(2); + if (obj == nullptr) { + return nullptr; } + PyObject* key = _NewKey_ByIndex(self->container, index); + if (key == nullptr) { + Py_DECREF(obj); + return nullptr; + } + PyTuple_SET_ITEM(obj, 0, key); + PyObject* value = _NewObj_ByIndex(self->container, index); + if (value == nullptr) { + Py_DECREF(obj); + return nullptr; + } + PyTuple_SET_ITEM(obj, 1, value); + return obj; + } default: PyErr_SetNone(PyExc_NotImplementedError); - return NULL; + return nullptr; } } static PyTypeObject ContainerIterator_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - "DescriptorContainerIterator", // tp_name - sizeof(PyContainerIterator), // tp_basicsize - 0, // tp_itemsize - (destructor)Iterator_Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - 0, // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - PyObject_SelfIter, // tp_iter - (iternextfunc)Iterator_Next, // tp_iternext - 0, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc - 0, // tp_new - 0, // tp_free + PyVarObject_HEAD_INIT(&PyType_Type, + 0) "DescriptorContainerIterator", // tp_name + sizeof(PyContainerIterator), // tp_basicsize + 0, // tp_itemsize + (destructor)Iterator_Dealloc, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + nullptr, // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + PyObject_SelfIter, // tp_iter + (iternextfunc)Iterator_Next, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init + nullptr, // tp_alloc + nullptr, // tp_new + nullptr, // tp_free }; static PyObject* NewContainerIterator(PyContainer* container, PyContainerIterator::IterKind kind) { PyContainerIterator* self = PyObject_New(PyContainerIterator, &ContainerIterator_Type); - if (self == NULL) { - return NULL; + if (self == nullptr) { + return nullptr; } Py_INCREF(container); self->container = container; @@ -992,17 +996,9 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "MessageFields", - Count, - GetByIndex, - GetByName, - GetByCamelcaseName, - GetByNumber, - NewObjectFromItem, - GetItemName, - GetItemCamelcaseName, - GetItemNumber, - GetItemIndex, + "MessageFields", Count, GetByIndex, GetByName, + GetByCamelcaseName, GetByNumber, NewObjectFromItem, GetItemName, + GetItemCamelcaseName, GetItemNumber, GetItemIndex, }; } // namespace fields @@ -1053,17 +1049,17 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "MessageNestedTypes", - Count, - GetByIndex, - GetByName, - NULL, - NULL, - NewObjectFromItem, - GetItemName, - NULL, - NULL, - GetItemIndex, + "MessageNestedTypes", + Count, + GetByIndex, + GetByName, + nullptr, + nullptr, + NewObjectFromItem, + GetItemName, + nullptr, + nullptr, + GetItemIndex, }; } // namespace nested_types @@ -1105,17 +1101,17 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "MessageNestedEnums", - Count, - GetByIndex, - GetByName, - NULL, - NULL, - NewObjectFromItem, - GetItemName, - NULL, - NULL, - GetItemIndex, + "MessageNestedEnums", + Count, + GetByIndex, + GetByName, + nullptr, + nullptr, + NewObjectFromItem, + GetItemName, + nullptr, + nullptr, + GetItemIndex, }; } // namespace enums @@ -1154,7 +1150,7 @@ static const void* GetByName(PyContainer* self, ConstStringParam name) { static const void* GetByIndex(PyContainer* self, int index) { // This is not optimal, but the number of enums *types* in a given message // is small. This function is only used when iterating over the mapping. - const EnumDescriptor* enum_type = NULL; + const EnumDescriptor* enum_type = nullptr; int enum_type_count = GetDescriptor(self)->enum_type_count(); for (int i = 0; i < enum_type_count; ++i) { enum_type = GetDescriptor(self)->enum_type(i); @@ -1180,17 +1176,8 @@ static const std::string& GetItemName(const void* item) { } static DescriptorContainerDef ContainerDef = { - "MessageEnumValues", - Count, - GetByIndex, - GetByName, - NULL, - NULL, - NewObjectFromItem, - GetItemName, - NULL, - NULL, - NULL, + "MessageEnumValues", Count, GetByIndex, GetByName, nullptr, nullptr, + NewObjectFromItem, GetItemName, nullptr, nullptr, nullptr, }; } // namespace enumvalues @@ -1228,17 +1215,17 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "MessageExtensions", - Count, - GetByIndex, - GetByName, - NULL, - NULL, - NewObjectFromItem, - GetItemName, - NULL, - NULL, - GetItemIndex, + "MessageExtensions", + Count, + GetByIndex, + GetByName, + nullptr, + nullptr, + NewObjectFromItem, + GetItemName, + nullptr, + nullptr, + GetItemIndex, }; } // namespace extensions @@ -1280,17 +1267,9 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "MessageOneofs", - Count, - GetByIndex, - GetByName, - NULL, - NULL, - NewObjectFromItem, - GetItemName, - NULL, - NULL, - GetItemIndex, + "MessageOneofs", Count, GetByIndex, GetByName, + nullptr, nullptr, NewObjectFromItem, GetItemName, + nullptr, nullptr, GetItemIndex, }; } // namespace oneofs @@ -1351,17 +1330,9 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "EnumValues", - Count, - GetByIndex, - GetByName, - NULL, - GetByNumber, - NewObjectFromItem, - GetItemName, - NULL, - GetItemNumber, - GetItemIndex, + "EnumValues", Count, GetByIndex, GetByName, + nullptr, GetByNumber, NewObjectFromItem, GetItemName, + nullptr, GetItemNumber, GetItemIndex, }; } // namespace enumvalues @@ -1409,17 +1380,8 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "OneofFields", - Count, - GetByIndex, - NULL, - NULL, - NULL, - NewObjectFromItem, - NULL, - NULL, - NULL, - GetItemIndex, + "OneofFields", Count, GetByIndex, nullptr, nullptr, nullptr, + NewObjectFromItem, nullptr, nullptr, nullptr, GetItemIndex, }; } // namespace fields @@ -1467,17 +1429,9 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "ServiceMethods", - Count, - GetByIndex, - GetByName, - NULL, - NULL, - NewObjectFromItem, - GetItemName, - NULL, - NULL, - GetItemIndex, + "ServiceMethods", Count, GetByIndex, GetByName, + nullptr, nullptr, NewObjectFromItem, GetItemName, + nullptr, nullptr, GetItemIndex, }; } // namespace methods @@ -1529,17 +1483,9 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "FileMessages", - Count, - GetByIndex, - GetByName, - NULL, - NULL, - NewObjectFromItem, - GetItemName, - NULL, - NULL, - GetItemIndex, + "FileMessages", Count, GetByIndex, GetByName, + nullptr, nullptr, NewObjectFromItem, GetItemName, + nullptr, nullptr, GetItemIndex, }; } // namespace messages @@ -1577,17 +1523,9 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "FileEnums", - Count, - GetByIndex, - GetByName, - NULL, - NULL, - NewObjectFromItem, - GetItemName, - NULL, - NULL, - GetItemIndex, + "FileEnums", Count, GetByIndex, GetByName, + nullptr, nullptr, NewObjectFromItem, GetItemName, + nullptr, nullptr, GetItemIndex, }; } // namespace enums @@ -1625,17 +1563,9 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "FileExtensions", - Count, - GetByIndex, - GetByName, - NULL, - NULL, - NewObjectFromItem, - GetItemName, - NULL, - NULL, - GetItemIndex, + "FileExtensions", Count, GetByIndex, GetByName, + nullptr, nullptr, NewObjectFromItem, GetItemName, + nullptr, nullptr, GetItemIndex, }; } // namespace extensions @@ -1673,17 +1603,9 @@ static int GetItemIndex(const void* item) { } static DescriptorContainerDef ContainerDef = { - "FileServices", - Count, - GetByIndex, - GetByName, - NULL, - NULL, - NewObjectFromItem, - GetItemName, - NULL, - NULL, - GetItemIndex, + "FileServices", Count, GetByIndex, GetByName, + nullptr, nullptr, NewObjectFromItem, GetItemName, + nullptr, nullptr, GetItemIndex, }; } // namespace services @@ -1709,17 +1631,8 @@ static PyObject* NewObjectFromItem(const void* item) { } static DescriptorContainerDef ContainerDef = { - "FileDependencies", - Count, - GetByIndex, - NULL, - NULL, - NULL, - NewObjectFromItem, - NULL, - NULL, - NULL, - NULL, + "FileDependencies", Count, GetByIndex, nullptr, nullptr, nullptr, + NewObjectFromItem, nullptr, nullptr, nullptr, nullptr, }; } // namespace dependencies @@ -1745,17 +1658,8 @@ static PyObject* NewObjectFromItem(const void* item) { } static DescriptorContainerDef ContainerDef = { - "FilePublicDependencies", - Count, - GetByIndex, - NULL, - NULL, - NULL, - NewObjectFromItem, - NULL, - NULL, - NULL, - NULL, + "FilePublicDependencies", Count, GetByIndex, nullptr, nullptr, nullptr, + NewObjectFromItem, nullptr, nullptr, nullptr, nullptr, }; } // namespace public_dependencies diff --git a/windows/python/google/protobuf/pyext/descriptor_containers.h b/windows/python/google/protobuf/pyext/descriptor_containers.h index 4e05c58e2..cf2cf4ad0 100644 --- a/windows/python/google/protobuf/pyext/descriptor_containers.h +++ b/windows/python/google/protobuf/pyext/descriptor_containers.h @@ -34,6 +34,7 @@ // Mappings and Sequences of descriptors. // They implement containers like fields_by_name, EnumDescriptor.values... // See descriptor_containers.cc for more description. +#define PY_SSIZE_T_CLEAN #include namespace google { diff --git a/windows/python/google/protobuf/pyext/descriptor_database.cc b/windows/python/google/protobuf/pyext/descriptor_database.cc index da1c84a46..f87f23d77 100644 --- a/windows/python/google/protobuf/pyext/descriptor_database.cc +++ b/windows/python/google/protobuf/pyext/descriptor_database.cc @@ -56,7 +56,7 @@ PyDescriptorDatabase::~PyDescriptorDatabase() { Py_DECREF(py_database_); } // Handles all kinds of Python errors, which are simply logged. static bool GetFileDescriptorProto(PyObject* py_descriptor, FileDescriptorProto* output) { - if (py_descriptor == NULL) { + if (py_descriptor == nullptr) { if (PyErr_ExceptionMatches(PyExc_KeyError)) { // Expected error: item was simply not found. PyErr_Clear(); @@ -83,8 +83,8 @@ static bool GetFileDescriptorProto(PyObject* py_descriptor, // Slow path: serialize the message. This allows to use databases which // use a different implementation of FileDescriptorProto. ScopedPyObjectPtr serialized_pb( - PyObject_CallMethod(py_descriptor, "SerializeToString", NULL)); - if (serialized_pb == NULL) { + PyObject_CallMethod(py_descriptor, "SerializeToString", nullptr)); + if (serialized_pb == nullptr) { GOOGLE_LOG(ERROR) << "DescriptorDatabase method did not return a FileDescriptorProto"; PyErr_Print(); @@ -134,7 +134,7 @@ bool PyDescriptorDatabase::FindFileContainingExtension( FileDescriptorProto* output) { ScopedPyObjectPtr py_method( PyObject_GetAttrString(py_database_, "FindFileContainingExtension")); - if (py_method == NULL) { + if (py_method == nullptr) { // This method is not implemented, returns without error. PyErr_Clear(); return false; @@ -153,7 +153,7 @@ bool PyDescriptorDatabase::FindAllExtensionNumbers( const std::string& containing_type, std::vector* output) { ScopedPyObjectPtr py_method( PyObject_GetAttrString(py_database_, "FindAllExtensionNumbers")); - if (py_method == NULL) { + if (py_method == nullptr) { // This method is not implemented, returns without error. PyErr_Clear(); return false; @@ -161,7 +161,7 @@ bool PyDescriptorDatabase::FindAllExtensionNumbers( ScopedPyObjectPtr py_list( PyObject_CallFunction(py_method.get(), "s#", containing_type.c_str(), containing_type.size())); - if (py_list == NULL) { + if (py_list == nullptr) { PyErr_Print(); return false; } diff --git a/windows/python/google/protobuf/pyext/descriptor_database.h b/windows/python/google/protobuf/pyext/descriptor_database.h index d2d9f8e50..5621a229e 100644 --- a/windows/python/google/protobuf/pyext/descriptor_database.h +++ b/windows/python/google/protobuf/pyext/descriptor_database.h @@ -31,6 +31,7 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__ +#define PY_SSIZE_T_CLEAN #include #include @@ -42,17 +43,18 @@ namespace python { class PyDescriptorDatabase : public DescriptorDatabase { public: explicit PyDescriptorDatabase(PyObject* py_database); - ~PyDescriptorDatabase(); + ~PyDescriptorDatabase() override; // Implement the abstract interface. All these functions fill the output // with a copy of FileDescriptorProto. // Find a file by file name. - bool FindFileByName(const std::string& filename, FileDescriptorProto* output); + bool FindFileByName(const std::string& filename, + FileDescriptorProto* output) override; // Find the file that declares the given fully-qualified symbol name. bool FindFileContainingSymbol(const std::string& symbol_name, - FileDescriptorProto* output); + FileDescriptorProto* output) override; // Find the file which defines an extension extending the given message type // with the given field number. @@ -60,14 +62,14 @@ class PyDescriptorDatabase : public DescriptorDatabase { // Python objects are not required to implement this method. bool FindFileContainingExtension(const std::string& containing_type, int field_number, - FileDescriptorProto* output); + FileDescriptorProto* output) override; // Finds the tag numbers used by all known extensions of // containing_type, and appends them to output in an undefined // order. // Python objects are not required to implement this method. bool FindAllExtensionNumbers(const std::string& containing_type, - std::vector* output); + std::vector* output) override; private: // The python object that implements the database. The reference is owned. diff --git a/windows/python/google/protobuf/pyext/descriptor_pool.cc b/windows/python/google/protobuf/pyext/descriptor_pool.cc index 5ec6269cd..2f3928183 100644 --- a/windows/python/google/protobuf/pyext/descriptor_pool.cc +++ b/windows/python/google/protobuf/pyext/descriptor_pool.cc @@ -32,6 +32,7 @@ #include +#define PY_SSIZE_T_CLEAN #include #include @@ -43,12 +44,13 @@ #include #include -#define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob) ? ((*(charpp) = const_cast( \ - PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL \ - ? -1 \ - : 0) \ - : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) +#define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob) \ + ? ((*(charpp) = const_cast( \ + PyUnicode_AsUTF8AndSize(ob, (sizep)))) == nullptr \ + ? -1 \ + : 0) \ + : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) namespace google { namespace protobuf { @@ -98,13 +100,13 @@ class BuildFileErrorCollector : public DescriptorPool::ErrorCollector { static PyDescriptorPool* _CreateDescriptorPool() { PyDescriptorPool* cpool = PyObject_GC_New( PyDescriptorPool, &PyDescriptorPool_Type); - if (cpool == NULL) { - return NULL; + if (cpool == nullptr) { + return nullptr; } cpool->error_collector = nullptr; - cpool->underlay = NULL; - cpool->database = NULL; + cpool->underlay = nullptr; + cpool->database = nullptr; cpool->is_owned = false; cpool->is_mutable = false; @@ -112,9 +114,9 @@ static PyDescriptorPool* _CreateDescriptorPool() { cpool->py_message_factory = message_factory::NewMessageFactory( &PyMessageFactory_Type, cpool); - if (cpool->py_message_factory == NULL) { + if (cpool->py_message_factory == nullptr) { Py_DECREF(cpool); - return NULL; + return nullptr; } PyObject_GC_Track(cpool); @@ -130,8 +132,8 @@ static PyDescriptorPool* _CreateDescriptorPool() { static PyDescriptorPool* PyDescriptorPool_NewWithUnderlay( const DescriptorPool* underlay) { PyDescriptorPool* cpool = _CreateDescriptorPool(); - if (cpool == NULL) { - return NULL; + if (cpool == nullptr) { + return nullptr; } cpool->pool = new DescriptorPool(underlay); cpool->is_owned = true; @@ -142,7 +144,7 @@ static PyDescriptorPool* PyDescriptorPool_NewWithUnderlay( std::make_pair(cpool->pool, cpool)).second) { // Should never happen -- would indicate an internal error / bug. PyErr_SetString(PyExc_ValueError, "DescriptorPool already registered"); - return NULL; + return nullptr; } return cpool; @@ -151,10 +153,10 @@ static PyDescriptorPool* PyDescriptorPool_NewWithUnderlay( static PyDescriptorPool* PyDescriptorPool_NewWithDatabase( DescriptorDatabase* database) { PyDescriptorPool* cpool = _CreateDescriptorPool(); - if (cpool == NULL) { - return NULL; + if (cpool == nullptr) { + return nullptr; } - if (database != NULL) { + if (database != nullptr) { cpool->error_collector = new BuildFileErrorCollector(); cpool->pool = new DescriptorPool(database, cpool->error_collector); cpool->is_mutable = false; @@ -168,7 +170,7 @@ static PyDescriptorPool* PyDescriptorPool_NewWithDatabase( if (!descriptor_pool_map->insert(std::make_pair(cpool->pool, cpool)).second) { // Should never happen -- would indicate an internal error / bug. PyErr_SetString(PyExc_ValueError, "DescriptorPool already registered"); - return NULL; + return nullptr; } return cpool; @@ -177,13 +179,13 @@ static PyDescriptorPool* PyDescriptorPool_NewWithDatabase( // The public DescriptorPool constructor. static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { - static const char* kwlist[] = {"descriptor_db", 0}; - PyObject* py_database = NULL; + static const char* kwlist[] = {"descriptor_db", nullptr}; + PyObject* py_database = nullptr; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", const_cast(kwlist), &py_database)) { - return NULL; + return nullptr; } - DescriptorDatabase* database = NULL; + DescriptorDatabase* database = nullptr; if (py_database && py_database != Py_None) { database = new PyDescriptorDatabase(py_database); } @@ -229,24 +231,24 @@ PyObject* SetErrorFromCollector(DescriptorPool::ErrorCollector* self, PyErr_Format(PyExc_KeyError, "Couldn't build file for %s %.200s\n%s", error_type, name, error_collector->error_message.c_str()); error_collector->Clear(); - return NULL; + return nullptr; } PyErr_Format(PyExc_KeyError, "Couldn't find %s %.200s", error_type, name); - return NULL; + return nullptr; } static PyObject* FindMessageByName(PyObject* self, PyObject* arg) { Py_ssize_t name_size; char* name; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } const Descriptor* message_descriptor = reinterpret_cast(self)->pool->FindMessageTypeByName( StringParam(name, name_size)); - if (message_descriptor == NULL) { + if (message_descriptor == nullptr) { return SetErrorFromCollector( reinterpret_cast(self)->error_collector, name, "message"); @@ -263,14 +265,14 @@ static PyObject* FindFileByName(PyObject* self, PyObject* arg) { Py_ssize_t name_size; char* name; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } PyDescriptorPool* py_pool = reinterpret_cast(self); const FileDescriptor* file_descriptor = py_pool->pool->FindFileByName(StringParam(name, name_size)); - if (file_descriptor == NULL) { + if (file_descriptor == nullptr) { return SetErrorFromCollector(py_pool->error_collector, name, "file"); } return PyFileDescriptor_FromDescriptor(file_descriptor); @@ -280,12 +282,12 @@ PyObject* FindFieldByName(PyDescriptorPool* self, PyObject* arg) { Py_ssize_t name_size; char* name; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } const FieldDescriptor* field_descriptor = self->pool->FindFieldByName(StringParam(name, name_size)); - if (field_descriptor == NULL) { + if (field_descriptor == nullptr) { return SetErrorFromCollector(self->error_collector, name, "field"); } @@ -301,12 +303,12 @@ PyObject* FindExtensionByName(PyDescriptorPool* self, PyObject* arg) { Py_ssize_t name_size; char* name; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } const FieldDescriptor* field_descriptor = self->pool->FindExtensionByName(StringParam(name, name_size)); - if (field_descriptor == NULL) { + if (field_descriptor == nullptr) { return SetErrorFromCollector(self->error_collector, name, "extension field"); } @@ -323,12 +325,12 @@ PyObject* FindEnumTypeByName(PyDescriptorPool* self, PyObject* arg) { Py_ssize_t name_size; char* name; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } const EnumDescriptor* enum_descriptor = self->pool->FindEnumTypeByName(StringParam(name, name_size)); - if (enum_descriptor == NULL) { + if (enum_descriptor == nullptr) { return SetErrorFromCollector(self->error_collector, name, "enum"); } @@ -344,12 +346,12 @@ PyObject* FindOneofByName(PyDescriptorPool* self, PyObject* arg) { Py_ssize_t name_size; char* name; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } const OneofDescriptor* oneof_descriptor = self->pool->FindOneofByName(StringParam(name, name_size)); - if (oneof_descriptor == NULL) { + if (oneof_descriptor == nullptr) { return SetErrorFromCollector(self->error_collector, name, "oneof"); } @@ -365,13 +367,13 @@ static PyObject* FindServiceByName(PyObject* self, PyObject* arg) { Py_ssize_t name_size; char* name; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } const ServiceDescriptor* service_descriptor = reinterpret_cast(self)->pool->FindServiceByName( StringParam(name, name_size)); - if (service_descriptor == NULL) { + if (service_descriptor == nullptr) { return SetErrorFromCollector( reinterpret_cast(self)->error_collector, name, "service"); @@ -385,13 +387,13 @@ static PyObject* FindMethodByName(PyObject* self, PyObject* arg) { Py_ssize_t name_size; char* name; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } const MethodDescriptor* method_descriptor = reinterpret_cast(self)->pool->FindMethodByName( StringParam(name, name_size)); - if (method_descriptor == NULL) { + if (method_descriptor == nullptr) { return SetErrorFromCollector( reinterpret_cast(self)->error_collector, name, "method"); @@ -405,13 +407,13 @@ static PyObject* FindFileContainingSymbol(PyObject* self, PyObject* arg) { Py_ssize_t name_size; char* name; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } const FileDescriptor* file_descriptor = reinterpret_cast(self)->pool->FindFileContainingSymbol( StringParam(name, name_size)); - if (file_descriptor == NULL) { + if (file_descriptor == nullptr) { return SetErrorFromCollector( reinterpret_cast(self)->error_collector, name, "symbol"); @@ -425,18 +427,18 @@ static PyObject* FindExtensionByNumber(PyObject* self, PyObject* args) { PyObject* message_descriptor; int number; if (!PyArg_ParseTuple(args, "Oi", &message_descriptor, &number)) { - return NULL; + return nullptr; } const Descriptor* descriptor = PyMessageDescriptor_AsDescriptor( message_descriptor); - if (descriptor == NULL) { - return NULL; + if (descriptor == nullptr) { + return nullptr; } const FieldDescriptor* extension_descriptor = reinterpret_cast(self)->pool->FindExtensionByNumber( descriptor, number); - if (extension_descriptor == NULL) { + if (extension_descriptor == nullptr) { BuildFileErrorCollector* error_collector = reinterpret_cast( reinterpret_cast(self)->error_collector); @@ -444,10 +446,10 @@ static PyObject* FindExtensionByNumber(PyObject* self, PyObject* args) { PyErr_Format(PyExc_KeyError, "Couldn't build file for Extension %.d\n%s", number, error_collector->error_message.c_str()); error_collector->Clear(); - return NULL; + return nullptr; } PyErr_Format(PyExc_KeyError, "Couldn't find Extension %d", number); - return NULL; + return nullptr; } @@ -456,8 +458,8 @@ static PyObject* FindExtensionByNumber(PyObject* self, PyObject* args) { static PyObject* FindAllExtensions(PyObject* self, PyObject* arg) { const Descriptor* descriptor = PyMessageDescriptor_AsDescriptor(arg); - if (descriptor == NULL) { - return NULL; + if (descriptor == nullptr) { + return nullptr; } std::vector extensions; @@ -465,13 +467,13 @@ static PyObject* FindAllExtensions(PyObject* self, PyObject* arg) { descriptor, &extensions); ScopedPyObjectPtr result(PyList_New(extensions.size())); - if (result == NULL) { - return NULL; + if (result == nullptr) { + return nullptr; } for (int i = 0; i < extensions.size(); i++) { PyObject* extension = PyFieldDescriptor_FromDescriptor(extensions[i]); - if (extension == NULL) { - return NULL; + if (extension == nullptr) { + return nullptr; } PyList_SET_ITEM(result.get(), i, extension); // Steals the reference. } @@ -491,7 +493,7 @@ static PyObject* AddFileDescriptor(PyObject* self, PyObject* descriptor) { const FileDescriptor* file_descriptor = PyFileDescriptor_AsDescriptor(descriptor); if (!file_descriptor) { - return NULL; + return nullptr; } if (file_descriptor != reinterpret_cast(self)->pool->FindFileByName( @@ -499,7 +501,7 @@ static PyObject* AddFileDescriptor(PyObject* self, PyObject* descriptor) { PyErr_Format(PyExc_ValueError, "The file descriptor %s does not belong to this pool", file_descriptor->name().c_str()); - return NULL; + return nullptr; } Py_RETURN_NONE; } @@ -508,7 +510,7 @@ static PyObject* AddDescriptor(PyObject* self, PyObject* descriptor) { const Descriptor* message_descriptor = PyMessageDescriptor_AsDescriptor(descriptor); if (!message_descriptor) { - return NULL; + return nullptr; } if (message_descriptor != reinterpret_cast(self)->pool->FindMessageTypeByName( @@ -516,7 +518,7 @@ static PyObject* AddDescriptor(PyObject* self, PyObject* descriptor) { PyErr_Format(PyExc_ValueError, "The message descriptor %s does not belong to this pool", message_descriptor->full_name().c_str()); - return NULL; + return nullptr; } Py_RETURN_NONE; } @@ -525,7 +527,7 @@ static PyObject* AddEnumDescriptor(PyObject* self, PyObject* descriptor) { const EnumDescriptor* enum_descriptor = PyEnumDescriptor_AsDescriptor(descriptor); if (!enum_descriptor) { - return NULL; + return nullptr; } if (enum_descriptor != reinterpret_cast(self)->pool->FindEnumTypeByName( @@ -533,7 +535,7 @@ static PyObject* AddEnumDescriptor(PyObject* self, PyObject* descriptor) { PyErr_Format(PyExc_ValueError, "The enum descriptor %s does not belong to this pool", enum_descriptor->full_name().c_str()); - return NULL; + return nullptr; } Py_RETURN_NONE; } @@ -542,7 +544,7 @@ static PyObject* AddExtensionDescriptor(PyObject* self, PyObject* descriptor) { const FieldDescriptor* extension_descriptor = PyFieldDescriptor_AsDescriptor(descriptor); if (!extension_descriptor) { - return NULL; + return nullptr; } if (extension_descriptor != reinterpret_cast(self)->pool->FindExtensionByName( @@ -550,7 +552,7 @@ static PyObject* AddExtensionDescriptor(PyObject* self, PyObject* descriptor) { PyErr_Format(PyExc_ValueError, "The extension descriptor %s does not belong to this pool", extension_descriptor->full_name().c_str()); - return NULL; + return nullptr; } Py_RETURN_NONE; } @@ -559,7 +561,7 @@ static PyObject* AddServiceDescriptor(PyObject* self, PyObject* descriptor) { const ServiceDescriptor* service_descriptor = PyServiceDescriptor_AsDescriptor(descriptor); if (!service_descriptor) { - return NULL; + return nullptr; } if (service_descriptor != reinterpret_cast(self)->pool->FindServiceByName( @@ -567,7 +569,7 @@ static PyObject* AddServiceDescriptor(PyObject* self, PyObject* descriptor) { PyErr_Format(PyExc_ValueError, "The service descriptor %s does not belong to this pool", service_descriptor->full_name().c_str()); - return NULL; + return nullptr; } Py_RETURN_NONE; } @@ -578,12 +580,12 @@ static PyObject* AddSerializedFile(PyObject* pself, PyObject* serialized_pb) { char* message_type; Py_ssize_t message_len; - if (self->database != NULL) { + if (self->database != nullptr) { PyErr_SetString( PyExc_ValueError, "Cannot call Add on a DescriptorPool that uses a DescriptorDatabase. " "Add your file to the underlying database."); - return NULL; + return nullptr; } if (!self->is_mutable) { PyErr_SetString( @@ -593,22 +595,22 @@ static PyObject* AddSerializedFile(PyObject* pself, PyObject* serialized_pb) { } if (PyBytes_AsStringAndSize(serialized_pb, &message_type, &message_len) < 0) { - return NULL; + return nullptr; } FileDescriptorProto file_proto; if (!file_proto.ParseFromArray(message_type, message_len)) { PyErr_SetString(PyExc_TypeError, "Couldn't parse file content!"); - return NULL; + return nullptr; } // If the file was already part of a C++ library, all its descriptors are in // the underlying pool. No need to do anything else. - const FileDescriptor* generated_file = NULL; + const FileDescriptor* generated_file = nullptr; if (self->underlay) { generated_file = self->underlay->FindFileByName(file_proto.name()); } - if (generated_file != NULL) { + if (generated_file != nullptr) { return PyFileDescriptor_FromDescriptorWithSerializedPb( generated_file, serialized_pb); } @@ -618,11 +620,11 @@ static PyObject* AddSerializedFile(PyObject* pself, PyObject* serialized_pb) { // Pool is mutable, we can remove the "const". const_cast(self->pool) ->BuildFileCollectingErrors(file_proto, &error_collector); - if (descriptor == NULL) { + if (descriptor == nullptr) { PyErr_Format(PyExc_TypeError, "Couldn't build proto file into descriptor pool!\n%s", error_collector.error_message.c_str()); - return NULL; + return nullptr; } @@ -632,105 +634,109 @@ static PyObject* AddSerializedFile(PyObject* pself, PyObject* serialized_pb) { static PyObject* Add(PyObject* self, PyObject* file_descriptor_proto) { ScopedPyObjectPtr serialized_pb( - PyObject_CallMethod(file_descriptor_proto, "SerializeToString", NULL)); - if (serialized_pb == NULL) { - return NULL; + PyObject_CallMethod(file_descriptor_proto, "SerializeToString", nullptr)); + if (serialized_pb == nullptr) { + return nullptr; } return AddSerializedFile(self, serialized_pb.get()); } static PyMethodDef Methods[] = { - { "Add", Add, METH_O, - "Adds the FileDescriptorProto and its types to this pool." }, - { "AddSerializedFile", AddSerializedFile, METH_O, - "Adds a serialized FileDescriptorProto to this pool." }, + {"Add", Add, METH_O, + "Adds the FileDescriptorProto and its types to this pool."}, + {"AddSerializedFile", AddSerializedFile, METH_O, + "Adds a serialized FileDescriptorProto to this pool."}, - // TODO(amauryfa): Understand why the Python implementation differs from - // this one, ask users to use another API and deprecate these functions. - { "AddFileDescriptor", AddFileDescriptor, METH_O, - "No-op. Add() must have been called before." }, - { "AddDescriptor", AddDescriptor, METH_O, - "No-op. Add() must have been called before." }, - { "AddEnumDescriptor", AddEnumDescriptor, METH_O, - "No-op. Add() must have been called before." }, - { "AddExtensionDescriptor", AddExtensionDescriptor, METH_O, - "No-op. Add() must have been called before." }, - { "AddServiceDescriptor", AddServiceDescriptor, METH_O, - "No-op. Add() must have been called before." }, + // TODO(amauryfa): Understand why the Python implementation differs from + // this one, ask users to use another API and deprecate these functions. + {"AddFileDescriptor", AddFileDescriptor, METH_O, + "No-op. Add() must have been called before."}, + {"AddDescriptor", AddDescriptor, METH_O, + "No-op. Add() must have been called before."}, + {"AddEnumDescriptor", AddEnumDescriptor, METH_O, + "No-op. Add() must have been called before."}, + {"AddExtensionDescriptor", AddExtensionDescriptor, METH_O, + "No-op. Add() must have been called before."}, + {"AddServiceDescriptor", AddServiceDescriptor, METH_O, + "No-op. Add() must have been called before."}, - { "FindFileByName", FindFileByName, METH_O, - "Searches for a file descriptor by its .proto name." }, - { "FindMessageTypeByName", FindMessageByName, METH_O, - "Searches for a message descriptor by full name." }, - { "FindFieldByName", FindFieldByNameMethod, METH_O, - "Searches for a field descriptor by full name." }, - { "FindExtensionByName", FindExtensionByNameMethod, METH_O, - "Searches for extension descriptor by full name." }, - { "FindEnumTypeByName", FindEnumTypeByNameMethod, METH_O, - "Searches for enum type descriptor by full name." }, - { "FindOneofByName", FindOneofByNameMethod, METH_O, - "Searches for oneof descriptor by full name." }, - { "FindServiceByName", FindServiceByName, METH_O, - "Searches for service descriptor by full name." }, - { "FindMethodByName", FindMethodByName, METH_O, - "Searches for method descriptor by full name." }, + {"FindFileByName", FindFileByName, METH_O, + "Searches for a file descriptor by its .proto name."}, + {"FindMessageTypeByName", FindMessageByName, METH_O, + "Searches for a message descriptor by full name."}, + {"FindFieldByName", FindFieldByNameMethod, METH_O, + "Searches for a field descriptor by full name."}, + {"FindExtensionByName", FindExtensionByNameMethod, METH_O, + "Searches for extension descriptor by full name."}, + {"FindEnumTypeByName", FindEnumTypeByNameMethod, METH_O, + "Searches for enum type descriptor by full name."}, + {"FindOneofByName", FindOneofByNameMethod, METH_O, + "Searches for oneof descriptor by full name."}, + {"FindServiceByName", FindServiceByName, METH_O, + "Searches for service descriptor by full name."}, + {"FindMethodByName", FindMethodByName, METH_O, + "Searches for method descriptor by full name."}, - { "FindFileContainingSymbol", FindFileContainingSymbol, METH_O, - "Gets the FileDescriptor containing the specified symbol." }, - { "FindExtensionByNumber", FindExtensionByNumber, METH_VARARGS, - "Gets the extension descriptor for the given number." }, - { "FindAllExtensions", FindAllExtensions, METH_O, - "Gets all known extensions of the given message descriptor." }, - {NULL} + {"FindFileContainingSymbol", FindFileContainingSymbol, METH_O, + "Gets the FileDescriptor containing the specified symbol."}, + {"FindExtensionByNumber", FindExtensionByNumber, METH_VARARGS, + "Gets the extension descriptor for the given number."}, + {"FindAllExtensions", FindAllExtensions, METH_O, + "Gets all known extensions of the given message descriptor."}, + {nullptr}, }; } // namespace cdescriptor_pool PyTypeObject PyDescriptorPool_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME - ".DescriptorPool", // tp_name - sizeof(PyDescriptorPool), // tp_basicsize - 0, // tp_itemsize - cdescriptor_pool::Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer + ".DescriptorPool", // tp_name + sizeof(PyDescriptorPool), // tp_basicsize + 0, // tp_itemsize + cdescriptor_pool::Dealloc, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, // tp_flags "A Descriptor Pool", // tp_doc cdescriptor_pool::GcTraverse, // tp_traverse cdescriptor_pool::GcClear, // tp_clear - 0, // tp_richcompare + nullptr, // tp_richcompare 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext + nullptr, // tp_iter + nullptr, // tp_iternext cdescriptor_pool::Methods, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc + nullptr, // tp_init + nullptr, // tp_alloc cdescriptor_pool::New, // tp_new PyObject_GC_Del, // tp_free }; // This is the DescriptorPool which contains all the definitions from the // generated _pb2.py modules. -static PyDescriptorPool* python_generated_pool = NULL; +static PyDescriptorPool* python_generated_pool = nullptr; bool InitDescriptorPool() { if (PyType_Ready(&PyDescriptorPool_Type) < 0) @@ -743,7 +749,7 @@ bool InitDescriptorPool() { new std::unordered_map; python_generated_pool = cdescriptor_pool::PyDescriptorPool_NewWithUnderlay( DescriptorPool::generated_pool()); - if (python_generated_pool == NULL) { + if (python_generated_pool == nullptr) { delete descriptor_pool_map; return false; } @@ -774,7 +780,7 @@ PyDescriptorPool* GetDescriptorPool_FromPool(const DescriptorPool* pool) { descriptor_pool_map->find(pool); if (it == descriptor_pool_map->end()) { PyErr_SetString(PyExc_KeyError, "Unknown descriptor pool"); - return NULL; + return nullptr; } return it->second; } diff --git a/windows/python/google/protobuf/pyext/descriptor_pool.h b/windows/python/google/protobuf/pyext/descriptor_pool.h index 48658d3e8..5d3c3a95c 100644 --- a/windows/python/google/protobuf/pyext/descriptor_pool.h +++ b/windows/python/google/protobuf/pyext/descriptor_pool.h @@ -31,6 +31,7 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__ +#define PY_SSIZE_T_CLEAN #include #include diff --git a/windows/python/google/protobuf/pyext/extension_dict.cc b/windows/python/google/protobuf/pyext/extension_dict.cc index b36c72326..66703da89 100644 --- a/windows/python/google/protobuf/pyext/extension_dict.cc +++ b/windows/python/google/protobuf/pyext/extension_dict.cc @@ -49,12 +49,13 @@ #include #include -#define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob) ? ((*(charpp) = const_cast( \ - PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL \ - ? -1 \ - : 0) \ - : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) +#define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob) \ + ? ((*(charpp) = const_cast( \ + PyUnicode_AsUTF8AndSize(ob, (sizep)))) == nullptr \ + ? -1 \ + : 0) \ + : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) namespace google { namespace protobuf { @@ -130,11 +131,11 @@ static void DeallocExtensionIterator(PyObject* _self) { PyObject* subscript(ExtensionDict* self, PyObject* key) { const FieldDescriptor* descriptor = cmessage::GetExtensionDescriptor(key); - if (descriptor == NULL) { - return NULL; + if (descriptor == nullptr) { + return nullptr; } if (!CheckFieldBelongsToMessage(descriptor, self->parent->message)) { - return NULL; + return nullptr; } if (descriptor->label() != FieldDescriptor::LABEL_REPEATED && @@ -154,8 +155,8 @@ PyObject* subscript(ExtensionDict* self, PyObject* key) { // TODO(plabatut): consider building the class on the fly! ContainerBase* sub_message = cmessage::InternalGetSubMessage( self->parent, descriptor); - if (sub_message == NULL) { - return NULL; + if (sub_message == nullptr) { + return nullptr; } (*self->parent->composite_fields)[descriptor] = sub_message; return sub_message->AsPyObject(); @@ -178,33 +179,33 @@ PyObject* subscript(ExtensionDict* self, PyObject* key) { descriptor->message_type()); ScopedPyObjectPtr message_class_handler( reinterpret_cast(message_class)); - if (message_class == NULL) { - return NULL; + if (message_class == nullptr) { + return nullptr; } ContainerBase* py_container = repeated_composite_container::NewContainer( self->parent, descriptor, message_class); - if (py_container == NULL) { - return NULL; + if (py_container == nullptr) { + return nullptr; } (*self->parent->composite_fields)[descriptor] = py_container; return py_container->AsPyObject(); } else { ContainerBase* py_container = repeated_scalar_container::NewContainer( self->parent, descriptor); - if (py_container == NULL) { - return NULL; + if (py_container == nullptr) { + return nullptr; } (*self->parent->composite_fields)[descriptor] = py_container; return py_container->AsPyObject(); } } PyErr_SetString(PyExc_ValueError, "control reached unexpected line"); - return NULL; + return nullptr; } int ass_subscript(ExtensionDict* self, PyObject* key, PyObject* value) { const FieldDescriptor* descriptor = cmessage::GetExtensionDescriptor(key); - if (descriptor == NULL) { + if (descriptor == nullptr) { return -1; } if (!CheckFieldBelongsToMessage(descriptor, self->parent->message)) { @@ -232,13 +233,13 @@ PyObject* _FindExtensionByName(ExtensionDict* self, PyObject* arg) { char* name; Py_ssize_t name_size; if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) { - return NULL; + return nullptr; } PyDescriptorPool* pool = cmessage::GetFactoryForMessage(self->parent)->pool; const FieldDescriptor* message_extension = pool->pool->FindExtensionByName(StringParam(name, name_size)); - if (message_extension == NULL) { + if (message_extension == nullptr) { // Is is the name of a message set extension? const Descriptor* message_descriptor = pool->pool->FindMessageTypeByName(StringParam(name, name_size)); @@ -252,7 +253,7 @@ PyObject* _FindExtensionByName(ExtensionDict* self, PyObject* arg) { } } } - if (message_extension == NULL) { + if (message_extension == nullptr) { Py_RETURN_NONE; } @@ -262,13 +263,13 @@ PyObject* _FindExtensionByName(ExtensionDict* self, PyObject* arg) { PyObject* _FindExtensionByNumber(ExtensionDict* self, PyObject* arg) { int64_t number = PyLong_AsLong(arg); if (number == -1 && PyErr_Occurred()) { - return NULL; + return nullptr; } PyDescriptorPool* pool = cmessage::GetFactoryForMessage(self->parent)->pool; const FieldDescriptor* message_extension = pool->pool->FindExtensionByNumber( self->parent->message->GetDescriptor(), number); - if (message_extension == NULL) { + if (message_extension == nullptr) { Py_RETURN_NONE; } @@ -307,8 +308,8 @@ static int Contains(PyObject* _self, PyObject* key) { ExtensionDict* NewExtensionDict(CMessage *parent) { ExtensionDict* self = reinterpret_cast( PyType_GenericAlloc(&ExtensionDict_Type, 0)); - if (self == NULL) { - return NULL; + if (self == nullptr) { + return nullptr; } Py_INCREF(parent); @@ -330,7 +331,7 @@ static PyObject* RichCompare(ExtensionDict* self, PyObject* other, int opid) { } bool equals = false; if (PyObject_TypeCheck(other, &ExtensionDict_Type)) { - equals = self->parent == reinterpret_cast(other)->parent;; + equals = self->parent == reinterpret_cast(other)->parent; } if (equals ^ (opid == Py_EQ)) { Py_RETURN_FALSE; @@ -340,12 +341,12 @@ static PyObject* RichCompare(ExtensionDict* self, PyObject* other, int opid) { } static PySequenceMethods SeqMethods = { (lenfunc)len, // sq_length - 0, // sq_concat - 0, // sq_repeat - 0, // sq_item - 0, // sq_slice - 0, // sq_ass_item - 0, // sq_ass_slice + nullptr, // sq_concat + nullptr, // sq_repeat + nullptr, // sq_item + nullptr, // sq_slice + nullptr, // sq_ass_item + nullptr, // sq_ass_slice (objobjproc)Contains, // sq_contains }; @@ -360,48 +361,52 @@ static PyMethodDef Methods[] = { EDMETHOD(_FindExtensionByName, METH_O, "Finds an extension by name."), EDMETHOD(_FindExtensionByNumber, METH_O, "Finds an extension by field number."), - {NULL, NULL}, + {nullptr, nullptr}, }; } // namespace extension_dict PyTypeObject ExtensionDict_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) // - FULL_MODULE_NAME ".ExtensionDict", // tp_name - sizeof(ExtensionDict), // tp_basicsize - 0, // tp_itemsize - (destructor)extension_dict::dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number + PyVarObject_HEAD_INIT(&PyType_Type, 0) // + FULL_MODULE_NAME ".ExtensionDict", // tp_name + sizeof(ExtensionDict), // tp_basicsize + 0, // tp_itemsize + (destructor)extension_dict::dealloc, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number &extension_dict::SeqMethods, // tp_as_sequence &extension_dict::MpMethods, // tp_as_mapping PyObject_HashNotImplemented, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer Py_TPFLAGS_DEFAULT, // tp_flags "An extension dict", // tp_doc - 0, // tp_traverse - 0, // tp_clear + nullptr, // tp_traverse + nullptr, // tp_clear (richcmpfunc)extension_dict::RichCompare, // tp_richcompare 0, // tp_weaklistoffset extension_dict::GetIter, // tp_iter - 0, // tp_iternext + nullptr, // tp_iternext extension_dict::Methods, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set 0, // tp_dictoffset - 0, // tp_init + nullptr, // tp_init }; PyObject* IterNext(PyObject* _self) { @@ -438,37 +443,41 @@ PyTypeObject ExtensionIterator_Type = { sizeof(extension_dict::ExtensionIterator), // tp_basicsize 0, // tp_itemsize extension_dict::DeallocExtensionIterator, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A scalar map iterator", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - PyObject_SelfIter, // tp_iter - IterNext, // tp_iternext - 0, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A scalar map iterator", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + PyObject_SelfIter, // tp_iter + IterNext, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init }; } // namespace python } // namespace protobuf diff --git a/windows/python/google/protobuf/pyext/extension_dict.h b/windows/python/google/protobuf/pyext/extension_dict.h index c9da44316..86d2451a0 100644 --- a/windows/python/google/protobuf/pyext/extension_dict.h +++ b/windows/python/google/protobuf/pyext/extension_dict.h @@ -34,10 +34,9 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__ +#define PY_SSIZE_T_CLEAN #include -#include - #include namespace google { diff --git a/windows/python/google/protobuf/pyext/field.cc b/windows/python/google/protobuf/pyext/field.cc index 5eab3ef2b..0d3b0b960 100644 --- a/windows/python/google/protobuf/pyext/field.cc +++ b/windows/python/google/protobuf/pyext/field.cc @@ -47,7 +47,7 @@ static PyObject* Repr(PyMessageFieldProperty* self) { static PyObject* DescrGet(PyMessageFieldProperty* self, PyObject* obj, PyObject* type) { - if (obj == NULL) { + if (obj == nullptr) { Py_INCREF(self); return reinterpret_cast(self); } @@ -57,7 +57,7 @@ static PyObject* DescrGet(PyMessageFieldProperty* self, PyObject* obj, static int DescrSet(PyMessageFieldProperty* self, PyObject* obj, PyObject* value) { - if (value == NULL) { + if (value == nullptr) { PyErr_SetString(PyExc_AttributeError, "Cannot delete field attribute"); return -1; } @@ -75,50 +75,55 @@ static PyObject* GetDoc(PyMessageFieldProperty* self, void* closure) { } static PyGetSetDef Getters[] = { - {"DESCRIPTOR", (getter)GetDescriptor, NULL, "Field descriptor"}, - {"__doc__", (getter)GetDoc, NULL, NULL}, - {NULL}}; + {"DESCRIPTOR", (getter)GetDescriptor, nullptr, "Field descriptor"}, + {"__doc__", (getter)GetDoc, nullptr, nullptr}, + {nullptr}, +}; } // namespace field static PyTypeObject _CFieldProperty_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) // head - FULL_MODULE_NAME ".FieldProperty", // tp_name - sizeof(PyMessageFieldProperty), // tp_basicsize - 0, // tp_itemsize - 0, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - (reprfunc)field::Repr, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "Field property of a Message", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - 0, // tp_methods - 0, // tp_members - field::Getters, // tp_getset - 0, // tp_base - 0, // tp_dict - (descrgetfunc)field::DescrGet, // tp_descr_get - (descrsetfunc)field::DescrSet, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc - 0, // tp_new + PyVarObject_HEAD_INIT(&PyType_Type, 0) // head + FULL_MODULE_NAME ".FieldProperty", // tp_name + sizeof(PyMessageFieldProperty), // tp_basicsize + 0, // tp_itemsize + nullptr, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + (reprfunc)field::Repr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "Field property of a Message", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members + field::Getters, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + (descrgetfunc)field::DescrGet, // tp_descr_get + (descrsetfunc)field::DescrSet, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init + nullptr, // tp_alloc + nullptr, // tp_new }; PyTypeObject* CFieldProperty_Type = &_CFieldProperty_Type; @@ -126,8 +131,8 @@ PyObject* NewFieldProperty(const FieldDescriptor* field_descriptor) { // Create a new descriptor object PyMessageFieldProperty* property = PyObject_New(PyMessageFieldProperty, CFieldProperty_Type); - if (property == NULL) { - return NULL; + if (property == nullptr) { + return nullptr; } property->field_descriptor = field_descriptor; return reinterpret_cast(property); diff --git a/windows/python/google/protobuf/pyext/field.h b/windows/python/google/protobuf/pyext/field.h index 7b4660cab..f9f94c498 100644 --- a/windows/python/google/protobuf/pyext/field.h +++ b/windows/python/google/protobuf/pyext/field.h @@ -31,6 +31,7 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__ +#define PY_SSIZE_T_CLEAN #include namespace google { diff --git a/windows/python/google/protobuf/pyext/map_container.cc b/windows/python/google/protobuf/pyext/map_container.cc index 053a78e4f..e8a6888e2 100644 --- a/windows/python/google/protobuf/pyext/map_container.cc +++ b/windows/python/google/protobuf/pyext/map_container.cc @@ -187,7 +187,7 @@ static PyObject* MapKeyToPython(MapContainer* self, const MapKey& key) { PyErr_Format( PyExc_SystemError, "Couldn't convert type %d to value", field_descriptor->cpp_type()); - return NULL; + return nullptr; } } @@ -219,7 +219,7 @@ PyObject* MapValueRefToPython(MapContainer* self, const MapValueRef& value) { PyErr_Format( PyExc_SystemError, "Couldn't convert type %d to value", field_descriptor->cpp_type()); - return NULL; + return nullptr; } } @@ -264,7 +264,7 @@ static bool PythonToMapValueRef(MapContainer* self, PyObject* obj, case FieldDescriptor::CPPTYPE_BOOL: { GOOGLE_CHECK_GET_BOOL(obj, value, false); value_ref->SetBoolValue(value); - return true;; + return true; } case FieldDescriptor::CPPTYPE_STRING: { std::string str; @@ -283,7 +283,7 @@ static bool PythonToMapValueRef(MapContainer* self, PyObject* obj, const EnumDescriptor* enum_descriptor = field_descriptor->enum_type(); const EnumValueDescriptor* enum_value = enum_descriptor->FindValueByNumber(value); - if (enum_value != NULL) { + if (enum_value != nullptr) { value_ref->SetEnumValue(value); return true; } else { @@ -362,7 +362,7 @@ PyObject* MapReflectionFriend::Contains(PyObject* _self, PyObject* key) { MapKey map_key; if (!PythonToMapKey(self, key, &map_key)) { - return NULL; + return nullptr; } if (reflection->ContainsMapKey(*message, self->parent_field_descriptor, @@ -378,14 +378,14 @@ PyObject* MapReflectionFriend::Contains(PyObject* _self, PyObject* key) { MapContainer* NewScalarMapContainer( CMessage* parent, const google::protobuf::FieldDescriptor* parent_field_descriptor) { if (!CheckFieldBelongsToMessage(parent_field_descriptor, parent->message)) { - return NULL; + return nullptr; } PyObject* obj(PyType_GenericAlloc(ScalarMapContainer_Type, 0)); - if (obj == NULL) { + if (obj == nullptr) { PyErr_Format(PyExc_RuntimeError, "Could not allocate new container."); - return NULL; + return nullptr; } MapContainer* self = GetMap(obj); @@ -408,7 +408,7 @@ PyObject* MapReflectionFriend::ScalarMapGetItem(PyObject* _self, MapValueRef value; if (!PythonToMapKey(self, key, &map_key)) { - return NULL; + return nullptr; } if (reflection->InsertOrLookupMapValue(message, self->parent_field_descriptor, @@ -432,12 +432,12 @@ int MapReflectionFriend::ScalarMapSetItem(PyObject* _self, PyObject* key, return -1; } - self->version++; - if (v) { // Set item to v. - reflection->InsertOrLookupMapValue(message, self->parent_field_descriptor, - map_key, &value); + if (reflection->InsertOrLookupMapValue( + message, self->parent_field_descriptor, map_key, &value)) { + self->version++; + } if (!PythonToMapValueRef(self, v, reflection->SupportsUnknownEnumValues(), &value)) { @@ -448,6 +448,7 @@ int MapReflectionFriend::ScalarMapSetItem(PyObject* _self, PyObject* key, // Delete key from map. if (reflection->DeleteMapValue(message, self->parent_field_descriptor, map_key)) { + self->version++; return 0; } else { PyErr_Format(PyExc_KeyError, "Key not present in map"); @@ -460,22 +461,22 @@ static PyObject* ScalarMapGet(PyObject* self, PyObject* args, PyObject* kwargs) { static const char* kwlist[] = {"key", "default", nullptr}; PyObject* key; - PyObject* default_value = NULL; + PyObject* default_value = nullptr; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O", const_cast(kwlist), &key, &default_value)) { - return NULL; + return nullptr; } ScopedPyObjectPtr is_present(MapReflectionFriend::Contains(self, key)); - if (is_present.get() == NULL) { - return NULL; + if (is_present.get() == nullptr) { + return nullptr; } if (PyObject_IsTrue(is_present.get())) { return MapReflectionFriend::ScalarMapGetItem(self, key); } else { - if (default_value != NULL) { + if (default_value != nullptr) { Py_INCREF(default_value); return default_value; } else { @@ -486,8 +487,8 @@ static PyObject* ScalarMapGet(PyObject* self, PyObject* args, PyObject* MapReflectionFriend::ScalarMapToStr(PyObject* _self) { ScopedPyObjectPtr dict(PyDict_New()); - if (dict == NULL) { - return NULL; + if (dict == nullptr) { + return nullptr; } ScopedPyObjectPtr key; ScopedPyObjectPtr value; @@ -500,15 +501,15 @@ PyObject* MapReflectionFriend::ScalarMapToStr(PyObject* _self) { it != reflection->MapEnd(message, self->parent_field_descriptor); ++it) { key.reset(MapKeyToPython(self, it.GetKey())); - if (key == NULL) { - return NULL; + if (key == nullptr) { + return nullptr; } value.reset(MapValueRefToPython(self, it.GetValueRef())); - if (value == NULL) { - return NULL; + if (value == nullptr) { + return nullptr; } if (PyDict_SetItem(dict.get(), key.get(), value.get()) < 0) { - return NULL; + return nullptr; } } return PyObject_Repr(dict.get()); @@ -542,7 +543,7 @@ static PyMethodDef ScalarMapMethods[] = { { "__reduce__", (PyCFunction)Reduce, METH_NOARGS, "Outputs picklable representation of the repeated field." }, */ - {NULL, NULL}, + {nullptr, nullptr}, }; PyTypeObject* ScalarMapContainer_Type; @@ -554,7 +555,7 @@ static PyType_Slot ScalarMapContainer_Type_slots[] = { {Py_tp_methods, (void*)ScalarMapMethods}, {Py_tp_iter, (void*)MapReflectionFriend::GetIterator}, {Py_tp_repr, (void*)MapReflectionFriend::ScalarMapToStr}, - {0, 0}, + {0, nullptr}, }; PyType_Spec ScalarMapContainer_Type_spec = { @@ -579,13 +580,13 @@ MessageMapContainer* NewMessageMapContainer( CMessage* parent, const google::protobuf::FieldDescriptor* parent_field_descriptor, CMessageClass* message_class) { if (!CheckFieldBelongsToMessage(parent_field_descriptor, parent->message)) { - return NULL; + return nullptr; } PyObject* obj = PyType_GenericAlloc(MessageMapContainer_Type, 0); - if (obj == NULL) { + if (obj == nullptr) { PyErr_SetString(PyExc_RuntimeError, "Could not allocate new container."); - return NULL; + return nullptr; } MessageMapContainer* self = GetMessageMap(obj); @@ -660,7 +661,7 @@ PyObject* MapReflectionFriend::MessageMapGetItem(PyObject* _self, MapValueRef value; if (!PythonToMapKey(self, key, &map_key)) { - return NULL; + return nullptr; } if (reflection->InsertOrLookupMapValue(message, self->parent_field_descriptor, @@ -673,8 +674,8 @@ PyObject* MapReflectionFriend::MessageMapGetItem(PyObject* _self, PyObject* MapReflectionFriend::MessageMapToStr(PyObject* _self) { ScopedPyObjectPtr dict(PyDict_New()); - if (dict == NULL) { - return NULL; + if (dict == nullptr) { + return nullptr; } ScopedPyObjectPtr key; ScopedPyObjectPtr value; @@ -687,15 +688,15 @@ PyObject* MapReflectionFriend::MessageMapToStr(PyObject* _self) { it != reflection->MapEnd(message, self->parent_field_descriptor); ++it) { key.reset(MapKeyToPython(self, it.GetKey())); - if (key == NULL) { - return NULL; + if (key == nullptr) { + return nullptr; } value.reset(GetCMessage(self, it.MutableValueRef()->MutableMessageValue())); - if (value == NULL) { - return NULL; + if (value == nullptr) { + return nullptr; } if (PyDict_SetItem(dict.get(), key.get(), value.get()) < 0) { - return NULL; + return nullptr; } } return PyObject_Repr(dict.get()); @@ -704,22 +705,22 @@ PyObject* MapReflectionFriend::MessageMapToStr(PyObject* _self) { PyObject* MessageMapGet(PyObject* self, PyObject* args, PyObject* kwargs) { static const char* kwlist[] = {"key", "default", nullptr}; PyObject* key; - PyObject* default_value = NULL; + PyObject* default_value = nullptr; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O", const_cast(kwlist), &key, &default_value)) { - return NULL; + return nullptr; } ScopedPyObjectPtr is_present(MapReflectionFriend::Contains(self, key)); - if (is_present.get() == NULL) { - return NULL; + if (is_present.get() == nullptr) { + return nullptr; } if (PyObject_IsTrue(is_present.get())) { return MapReflectionFriend::MessageMapGetItem(self, key); } else { - if (default_value != NULL) { + if (default_value != nullptr) { Py_INCREF(default_value); return default_value; } else { @@ -759,7 +760,7 @@ static PyMethodDef MessageMapMethods[] = { { "__reduce__", (PyCFunction)Reduce, METH_NOARGS, "Outputs picklable representation of the repeated field." }, */ - {NULL, NULL}, + {nullptr, nullptr}, }; PyTypeObject* MessageMapContainer_Type; @@ -771,7 +772,7 @@ static PyType_Slot MessageMapContainer_Type_slots[] = { {Py_tp_methods, (void*)MessageMapMethods}, {Py_tp_iter, (void*)MapReflectionFriend::GetIterator}, {Py_tp_repr, (void*)MapReflectionFriend::MessageMapToStr}, - {0, 0}}; + {0, nullptr}}; PyType_Spec MessageMapContainer_Type_spec = { FULL_MODULE_NAME ".MessageMapContainer", sizeof(MessageMapContainer), 0, @@ -787,7 +788,7 @@ PyObject* MapReflectionFriend::GetIterator(PyObject *_self) { MapContainer* self = GetMap(_self); ScopedPyObjectPtr obj(PyType_GenericAlloc(&MapIterator_Type, 0)); - if (obj == NULL) { + if (obj == nullptr) { return PyErr_Format(PyExc_KeyError, "Could not allocate iterator"); } @@ -824,8 +825,8 @@ PyObject* MapReflectionFriend::IterNext(PyObject* _self) { "Map cleared during iteration."); } - if (self->iter.get() == NULL) { - return NULL; + if (self->iter.get() == nullptr) { + return nullptr; } Message* message = self->container->GetMutableMessage(); @@ -833,7 +834,7 @@ PyObject* MapReflectionFriend::IterNext(PyObject* _self) { if (*self->iter == reflection->MapEnd(message, self->container->parent_field_descriptor)) { - return NULL; + return nullptr; } PyObject* ret = MapKeyToPython(self->container, self->iter->GetKey()); @@ -852,60 +853,64 @@ static void DeallocMapIterator(PyObject* _self) { } PyTypeObject MapIterator_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".MapIterator", // tp_name - sizeof(MapIterator), // tp_basicsize - 0, // tp_itemsize - DeallocMapIterator, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A scalar map iterator", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - PyObject_SelfIter, // tp_iter - MapReflectionFriend::IterNext, // tp_iternext - 0, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".MapIterator", // tp_name + sizeof(MapIterator), // tp_basicsize + 0, // tp_itemsize + DeallocMapIterator, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A scalar map iterator", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + PyObject_SelfIter, // tp_iter + MapReflectionFriend::IterNext, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init }; bool InitMapContainers() { // ScalarMapContainer_Type derives from our MutableMapping type. ScopedPyObjectPtr abc(PyImport_ImportModule("collections.abc")); - if (abc == NULL) { + if (abc == nullptr) { return false; } ScopedPyObjectPtr mutable_mapping( PyObject_GetAttrString(abc.get(), "MutableMapping")); - if (mutable_mapping == NULL) { + if (mutable_mapping == nullptr) { return false; } Py_INCREF(mutable_mapping.get()); ScopedPyObjectPtr bases(PyTuple_Pack(1, mutable_mapping.get())); - if (bases == NULL) { + if (bases == nullptr) { return false; } diff --git a/windows/python/google/protobuf/pyext/map_container.h b/windows/python/google/protobuf/pyext/map_container.h index 842602e79..af334d2e7 100644 --- a/windows/python/google/protobuf/pyext/map_container.h +++ b/windows/python/google/protobuf/pyext/map_container.h @@ -31,10 +31,10 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__ +#define PY_SSIZE_T_CLEAN #include #include -#include #include #include diff --git a/windows/python/google/protobuf/pyext/message.cc b/windows/python/google/protobuf/pyext/message.cc index cb48faa44..2c4a9573e 100644 --- a/windows/python/google/protobuf/pyext/message.cc +++ b/windows/python/google/protobuf/pyext/message.cc @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -79,12 +80,13 @@ #define PyString_AsString(ob) \ (PyUnicode_Check(ob) ? PyUnicode_AsUTF8(ob) : PyBytes_AsString(ob)) -#define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob) ? ((*(charpp) = const_cast( \ - PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL \ - ? -1 \ - : 0) \ - : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) +#define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob) \ + ? ((*(charpp) = const_cast( \ + PyUnicode_AsUTF8AndSize(ob, (sizep)))) == nullptr \ + ? -1 \ + : 0) \ + : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) namespace google { namespace protobuf { @@ -108,7 +110,7 @@ static PyObject* kDESCRIPTOR; PyObject* EnumTypeWrapper_class; static PyObject* PythonMessage_class; static PyObject* kEmptyWeakref; -static PyObject* WKT_classes = NULL; +static PyObject* WKT_classes = nullptr; namespace message_meta { @@ -129,7 +131,7 @@ static int AddDescriptors(PyObject* cls, const Descriptor* descriptor) { for (int i = 0; i < descriptor->field_count(); ++i) { const FieldDescriptor* field_descriptor = descriptor->field(i); ScopedPyObjectPtr property(NewFieldProperty(field_descriptor)); - if (property == NULL) { + if (property == nullptr) { return -1; } if (PyObject_SetAttrString(cls, field_descriptor->name().c_str(), @@ -143,13 +145,13 @@ static int AddDescriptors(PyObject* cls, const Descriptor* descriptor) { const EnumDescriptor* enum_descriptor = descriptor->enum_type(i); ScopedPyObjectPtr enum_type( PyEnumDescriptor_FromDescriptor(enum_descriptor)); - if (enum_type == NULL) { + if (enum_type == nullptr) { return -1; } // Add wrapped enum type to message class. ScopedPyObjectPtr wrapped(PyObject_CallFunctionObjArgs( - EnumTypeWrapper_class, enum_type.get(), NULL)); - if (wrapped == NULL) { + EnumTypeWrapper_class, enum_type.get(), nullptr)); + if (wrapped == nullptr) { return -1; } if (PyObject_SetAttrString( @@ -163,7 +165,7 @@ static int AddDescriptors(PyObject* cls, const Descriptor* descriptor) { enum_descriptor->value(j); ScopedPyObjectPtr value_number( PyLong_FromLong(enum_value_descriptor->number())); - if (value_number == NULL) { + if (value_number == nullptr) { return -1; } if (PyObject_SetAttrString(cls, enum_value_descriptor->name().c_str(), @@ -181,7 +183,7 @@ static int AddDescriptors(PyObject* cls, const Descriptor* descriptor) { for (int i = 0; i < descriptor->extension_count(); ++i) { const google::protobuf::FieldDescriptor* field = descriptor->extension(i); ScopedPyObjectPtr extension_field(PyFieldDescriptor_FromDescriptor(field)); - if (extension_field == NULL) { + if (extension_field == nullptr) { return -1; } @@ -196,7 +198,7 @@ static int AddDescriptors(PyObject* cls, const Descriptor* descriptor) { } static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { - static const char* kwlist[] = {"name", "bases", "dict", 0}; + static const char* kwlist[] = {"name", "bases", "dict", nullptr}; PyObject *bases, *dict; const char* name; @@ -204,7 +206,7 @@ static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { if (!PyArg_ParseTupleAndKeywords( args, kwargs, "sO!O!:type", const_cast(kwlist), &name, &PyTuple_Type, &bases, &PyDict_Type, &dict)) { - return NULL; + return nullptr; } // Check bases: only (), or (message.Message,) are allowed @@ -213,7 +215,7 @@ static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { PyTuple_GET_ITEM(bases, 0) == PythonMessage_class))) { PyErr_SetString(PyExc_TypeError, "A Message class can only inherit from Message"); - return NULL; + return nullptr; } // Check dict['DESCRIPTOR'] @@ -236,25 +238,25 @@ static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { // Messages have no __dict__ ScopedPyObjectPtr slots(PyTuple_New(0)); if (PyDict_SetItemString(dict, "__slots__", slots.get()) < 0) { - return NULL; + return nullptr; } // Build the arguments to the base metaclass. // We change the __bases__ classes. ScopedPyObjectPtr new_args; - if (WKT_classes == NULL) { + if (WKT_classes == nullptr) { ScopedPyObjectPtr well_known_types(PyImport_ImportModule( "google.protobuf.internal.well_known_types")); - GOOGLE_DCHECK(well_known_types != NULL); + GOOGLE_DCHECK(well_known_types != nullptr); WKT_classes = PyObject_GetAttrString(well_known_types.get(), "WKTBASES"); - GOOGLE_DCHECK(WKT_classes != NULL); + GOOGLE_DCHECK(WKT_classes != nullptr); } PyObject* well_known_class = PyDict_GetItemString( WKT_classes, message_descriptor->full_name().c_str()); - if (well_known_class == NULL) { + if (well_known_class == nullptr) { new_args.reset(Py_BuildValue("s(OO)O", name, CMessage_Type, PythonMessage_class, dict)); } else { @@ -262,21 +264,21 @@ static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { PythonMessage_class, well_known_class, dict)); } - if (new_args == NULL) { - return NULL; + if (new_args == nullptr) { + return nullptr; } // Call the base metaclass. - ScopedPyObjectPtr result(PyType_Type.tp_new(type, new_args.get(), NULL)); - if (result == NULL) { - return NULL; + ScopedPyObjectPtr result(PyType_Type.tp_new(type, new_args.get(), nullptr)); + if (result == nullptr) { + return nullptr; } CMessageClass* newtype = reinterpret_cast(result.get()); // Cache the descriptor, both as Python object and as C++ pointer. const Descriptor* descriptor = PyMessageDescriptor_AsDescriptor(py_descriptor); - if (descriptor == NULL) { - return NULL; + if (descriptor == nullptr) { + return nullptr; } Py_INCREF(py_descriptor); newtype->py_message_descriptor = py_descriptor; @@ -285,8 +287,8 @@ static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { // use the MessageFactory optionally passed in the class dict. PyDescriptorPool* py_descriptor_pool = GetDescriptorPool_FromPool(descriptor->file()->pool()); - if (py_descriptor_pool == NULL) { - return NULL; + if (py_descriptor_pool == nullptr) { + return nullptr; } newtype->py_message_factory = py_descriptor_pool->py_message_factory; Py_INCREF(newtype->py_message_factory); @@ -296,12 +298,12 @@ static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { // MessageFactory is fully implemented in C++. if (message_factory::RegisterMessageClass(newtype->py_message_factory, descriptor, newtype) < 0) { - return NULL; + return nullptr; } // Continue with type initialization: add other descriptors, enum values... if (AddDescriptors(result.get(), descriptor) < 0) { - return NULL; + return nullptr; } return result.release(); } @@ -329,11 +331,11 @@ static int GcClear(PyObject* pself) { // The _extensions_by_name dictionary is built on every access. // TODO(amauryfa): Migrate all users to pool.FindAllExtensions() static PyObject* GetExtensionsByName(CMessageClass *self, void *closure) { - if (self->message_descriptor == NULL) { + if (self->message_descriptor == nullptr) { // This is the base Message object, simply raise AttributeError. PyErr_SetString(PyExc_AttributeError, "Base Message class has no DESCRIPTOR"); - return NULL; + return nullptr; } const PyDescriptorPool* pool = self->py_message_factory->pool; @@ -345,12 +347,12 @@ static PyObject* GetExtensionsByName(CMessageClass *self, void *closure) { for (int i = 0; i < extensions.size(); i++) { ScopedPyObjectPtr extension( PyFieldDescriptor_FromDescriptor(extensions[i])); - if (extension == NULL) { - return NULL; + if (extension == nullptr) { + return nullptr; } if (PyDict_SetItemString(result.get(), extensions[i]->full_name().c_str(), extension.get()) < 0) { - return NULL; + return nullptr; } } return result.release(); @@ -359,11 +361,11 @@ static PyObject* GetExtensionsByName(CMessageClass *self, void *closure) { // The _extensions_by_number dictionary is built on every access. // TODO(amauryfa): Migrate all users to pool.FindExtensionByNumber() static PyObject* GetExtensionsByNumber(CMessageClass *self, void *closure) { - if (self->message_descriptor == NULL) { + if (self->message_descriptor == nullptr) { // This is the base Message object, simply raise AttributeError. PyErr_SetString(PyExc_AttributeError, "Base Message class has no DESCRIPTOR"); - return NULL; + return nullptr; } const PyDescriptorPool* pool = self->py_message_factory->pool; @@ -375,24 +377,24 @@ static PyObject* GetExtensionsByNumber(CMessageClass *self, void *closure) { for (int i = 0; i < extensions.size(); i++) { ScopedPyObjectPtr extension( PyFieldDescriptor_FromDescriptor(extensions[i])); - if (extension == NULL) { - return NULL; + if (extension == nullptr) { + return nullptr; } ScopedPyObjectPtr number(PyLong_FromLong(extensions[i]->number())); - if (number == NULL) { - return NULL; + if (number == nullptr) { + return nullptr; } if (PyDict_SetItem(result.get(), number.get(), extension.get()) < 0) { - return NULL; + return nullptr; } } return result.release(); } static PyGetSetDef Getters[] = { - {"_extensions_by_name", (getter)GetExtensionsByName, NULL}, - {"_extensions_by_number", (getter)GetExtensionsByNumber, NULL}, - {NULL} + {"_extensions_by_name", (getter)GetExtensionsByName, nullptr}, + {"_extensions_by_number", (getter)GetExtensionsByNumber, nullptr}, + {nullptr}, }; // Compute some class attributes on the fly: @@ -420,17 +422,17 @@ static PyObject* GetClassAttribute(CMessageClass *self, PyObject* name) { } } PyErr_SetObject(PyExc_AttributeError, name); - return NULL; + return nullptr; } static PyObject* GetAttr(CMessageClass* self, PyObject* name) { PyObject* result = CMessageClass_Type->tp_base->tp_getattro( reinterpret_cast(self), name); - if (result != NULL) { + if (result != nullptr) { return result; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { - return NULL; + return nullptr; } PyErr_Clear(); @@ -453,42 +455,46 @@ static bool allow_oversize_protos = false; static PyTypeObject _CMessageClass_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME - ".MessageMeta", // tp_name - sizeof(CMessageClass), // tp_basicsize - 0, // tp_itemsize - message_meta::Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str + ".MessageMeta", // tp_name + sizeof(CMessageClass), // tp_basicsize + 0, // tp_itemsize + message_meta::Dealloc, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, /* tp_print */ +#else + 0, /* tp_vectorcall_offset */ +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str (getattrofunc)message_meta::GetAttr, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer + nullptr, // tp_setattro + nullptr, // tp_as_buffer Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, // tp_flags "The metaclass of ProtocolMessages", // tp_doc message_meta::GcTraverse, // tp_traverse message_meta::GcClear, // tp_clear - 0, // tp_richcompare + nullptr, // tp_richcompare 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - 0, // tp_methods - 0, // tp_members + nullptr, // tp_iter + nullptr, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members message_meta::Getters, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc + nullptr, // tp_init + nullptr, // tp_alloc message_meta::New, // tp_new }; PyTypeObject* CMessageClass_Type = &_CMessageClass_Type; @@ -496,15 +502,15 @@ PyTypeObject* CMessageClass_Type = &_CMessageClass_Type; static CMessageClass* CheckMessageClass(PyTypeObject* cls) { if (!PyObject_TypeCheck(cls, CMessageClass_Type)) { PyErr_Format(PyExc_TypeError, "Class %s is not a Message", cls->tp_name); - return NULL; + return nullptr; } return reinterpret_cast(cls); } static const Descriptor* GetMessageDescriptor(PyTypeObject* cls) { CMessageClass* type = CheckMessageClass(cls); - if (type == NULL) { - return NULL; + if (type == nullptr) { + return nullptr; } return type->message_descriptor; } @@ -571,32 +577,24 @@ template bool CheckAndGetInteger(PyObject* arg, T* value) { // This effectively defines an integer as "an object that can be cast as // an integer and can be used as an ordinal number". - // This definition includes everything that implements numbers.Integral + // This definition includes everything with a valid __index__() implementation // and shouldn't cast the net too wide. - if (PROTOBUF_PREDICT_FALSE(!PyIndex_Check(arg))) { - FormatTypeError(arg, "int, long"); + if (!strcmp(Py_TYPE(arg)->tp_name, "numpy.ndarray") || + PROTOBUF_PREDICT_FALSE(!PyIndex_Check(arg))) { + FormatTypeError(arg, "int"); + return false; + } + + PyObject* arg_py_int = PyNumber_Index(arg); + if (PyErr_Occurred()) { + // Propagate existing error. return false; } - // Now we have an integral number so we can safely use PyLong_ functions. - // We need to treat the signed and unsigned cases differently in case arg is - // holding a value above the maximum for signed longs. if (std::numeric_limits::min() == 0) { // Unsigned case. - unsigned PY_LONG_LONG ulong_result; - if (PyLong_Check(arg)) { - ulong_result = PyLong_AsUnsignedLongLong(arg); - } else { - // Unlike PyLong_AsLongLong, PyLong_AsUnsignedLongLong is very - // picky about the exact type. - PyObject* casted = PyNumber_Long(arg); - if (PROTOBUF_PREDICT_FALSE(casted == nullptr)) { - // Propagate existing error. - return false; - } - ulong_result = PyLong_AsUnsignedLongLong(casted); - Py_DECREF(casted); - } + unsigned PY_LONG_LONG ulong_result = PyLong_AsUnsignedLongLong(arg_py_int); + Py_DECREF(arg_py_int); if (VerifyIntegerCastAndRange(arg, ulong_result)) { *value = static_cast(ulong_result); @@ -605,30 +603,14 @@ bool CheckAndGetInteger(PyObject* arg, T* value) { } } else { // Signed case. - PY_LONG_LONG long_result; - PyNumberMethods *nb; - if ((nb = arg->ob_type->tp_as_number) != NULL && nb->nb_int != NULL) { - // PyLong_AsLongLong requires it to be a long or to have an __int__() - // method. - long_result = PyLong_AsLongLong(arg); - } else { - // Valid subclasses of numbers.Integral should have a __long__() method - // so fall back to that. - PyObject* casted = PyNumber_Long(arg); - if (PROTOBUF_PREDICT_FALSE(casted == nullptr)) { - // Propagate existing error. - return false; - } - long_result = PyLong_AsLongLong(casted); - Py_DECREF(casted); - } + Py_DECREF(arg_py_int); + PY_LONG_LONG long_result = PyLong_AsLongLong(arg); if (VerifyIntegerCastAndRange(arg, long_result)) { *value = static_cast(long_result); } else { return false; } } - return true; } @@ -641,8 +623,9 @@ template bool CheckAndGetInteger(PyObject*, uint64*); bool CheckAndGetDouble(PyObject* arg, double* value) { *value = PyFloat_AsDouble(arg); - if (PROTOBUF_PREDICT_FALSE(*value == -1 && PyErr_Occurred())) { - FormatTypeError(arg, "int, long, float"); + if (!strcmp(Py_TYPE(arg)->tp_name, "numpy.ndarray") || + PROTOBUF_PREDICT_FALSE(*value == -1 && PyErr_Occurred())) { + FormatTypeError(arg, "int, float"); return false; } return true; @@ -659,8 +642,9 @@ bool CheckAndGetFloat(PyObject* arg, float* value) { bool CheckAndGetBool(PyObject* arg, bool* value) { long long_value = PyLong_AsLong(arg); // NOLINT - if (long_value == -1 && PyErr_Occurred()) { - FormatTypeError(arg, "int, long, bool"); + if (!strcmp(Py_TYPE(arg)->tp_name, "numpy.ndarray") || + (long_value == -1 && PyErr_Occurred())) { + FormatTypeError(arg, "int, bool"); return false; } *value = static_cast(long_value); @@ -672,7 +656,7 @@ bool CheckAndGetBool(PyObject* arg, bool* value) { // valid UTF-8. bool IsValidUTF8(PyObject* obj) { if (PyBytes_Check(obj)) { - PyObject* unicode = PyUnicode_FromEncodedObject(obj, "utf-8", NULL); + PyObject* unicode = PyUnicode_FromEncodedObject(obj, "utf-8", nullptr); // Clear the error indicator; we report our own error when desired. PyErr_Clear(); @@ -697,7 +681,7 @@ PyObject* CheckString(PyObject* arg, const FieldDescriptor* descriptor) { if (descriptor->type() == FieldDescriptor::TYPE_STRING) { if (!PyBytes_Check(arg) && !PyUnicode_Check(arg)) { FormatTypeError(arg, "bytes, unicode"); - return NULL; + return nullptr; } if (!IsValidUTF8(arg) && !AllowInvalidUTF8(descriptor)) { @@ -708,21 +692,21 @@ PyObject* CheckString(PyObject* arg, const FieldDescriptor* descriptor) { "unicode objects before being added.", PyString_AsString(repr)); Py_DECREF(repr); - return NULL; + return nullptr; } } else if (!PyBytes_Check(arg)) { FormatTypeError(arg, "bytes"); - return NULL; + return nullptr; } - PyObject* encoded_string = NULL; + PyObject* encoded_string = nullptr; if (descriptor->type() == FieldDescriptor::TYPE_STRING) { if (PyBytes_Check(arg)) { // The bytes were already validated as correctly encoded UTF-8 above. encoded_string = arg; // Already encoded. Py_INCREF(encoded_string); } else { - encoded_string = PyUnicode_AsEncodedString(arg, "utf-8", NULL); + encoded_string = PyUnicode_AsEncodedString(arg, "utf-8", nullptr); } } else { // In this case field type is "bytes". @@ -741,7 +725,7 @@ bool CheckAndSetString( int index) { ScopedPyObjectPtr encoded_string(CheckString(arg, descriptor)); - if (encoded_string.get() == NULL) { + if (encoded_string.get() == nullptr) { return false; } @@ -769,12 +753,13 @@ PyObject* ToStringObject(const FieldDescriptor* descriptor, return PyBytes_FromStringAndSize(value.c_str(), value.length()); } - PyObject* result = PyUnicode_DecodeUTF8(value.c_str(), value.length(), NULL); + PyObject* result = + PyUnicode_DecodeUTF8(value.c_str(), value.length(), nullptr); // If the string can't be decoded in UTF-8, just return a string object that // contains the raw bytes. This can't happen if the value was assigned using // the members of the Python message object, but can happen if the values were // parsed from the wire (binary). - if (result == NULL) { + if (result == nullptr) { PyErr_Clear(); result = PyBytes_FromStringAndSize(value.c_str(), value.length()); } @@ -802,7 +787,6 @@ PyMessageFactory* GetFactoryForMessage(CMessage* message) { static int MaybeReleaseOverlappingOneofField( CMessage* cmessage, const FieldDescriptor* field) { -#ifdef GOOGLE_PROTOBUF_HAS_ONEOF Message* message = cmessage->message; const Reflection* reflection = message->GetReflection(); if (!field->containing_oneof() || @@ -822,7 +806,6 @@ static int MaybeReleaseOverlappingOneofField( if (InternalReleaseFieldByDescriptor(cmessage, existing_field) < 0) { return -1; } -#endif return 0; } @@ -864,7 +847,7 @@ int FixupMessageAfterMerge(CMessage* self) { // Making a message writable int AssureWritable(CMessage* self) { - if (self == NULL || !self->read_only) { + if (self == nullptr || !self->read_only) { return 0; } @@ -887,7 +870,7 @@ int AssureWritable(CMessage* self) { Message* mutable_message = reflection->MutableMessage( parent_message, self->parent_field_descriptor, GetFactoryForMessage(self->parent)->message_factory); - if (mutable_message == NULL) { + if (mutable_message == nullptr) { return -1; } self->message = mutable_message; @@ -906,7 +889,7 @@ const FieldDescriptor* GetExtensionDescriptor(PyObject* extension) { // allow input which is not a field descriptor, and simply pretend it does // not exist. PyErr_SetObject(PyExc_KeyError, extension); - return NULL; + return nullptr; } return PyFieldDescriptor_AsDescriptor(extension); } @@ -917,20 +900,20 @@ static PyObject* GetIntegerEnumValue(const FieldDescriptor& descriptor, PyObject* value) { if (PyUnicode_Check(value)) { const EnumDescriptor* enum_descriptor = descriptor.enum_type(); - if (enum_descriptor == NULL) { + if (enum_descriptor == nullptr) { PyErr_SetString(PyExc_TypeError, "not an enum field"); - return NULL; + return nullptr; } char* enum_label; Py_ssize_t size; if (PyString_AsStringAndSize(value, &enum_label, &size) < 0) { - return NULL; + return nullptr; } const EnumValueDescriptor* enum_value_descriptor = enum_descriptor->FindValueByName(StringParam(enum_label, size)); - if (enum_value_descriptor == NULL) { + if (enum_value_descriptor == nullptr) { PyErr_Format(PyExc_ValueError, "unknown enum label \"%s\"", enum_label); - return NULL; + return nullptr; } return PyLong_FromLong(enum_value_descriptor->number()); } @@ -1000,7 +983,7 @@ int DeleteRepeatedField( } } - Arena* arena = Arena::InternalHelper::GetArenaForAllocation(message); + Arena* arena = Arena::InternalGetArenaForAllocation(message); GOOGLE_DCHECK_EQ(arena, nullptr) << "python protobuf is expected to be allocated from heap"; // Remove items, starting from the end. @@ -1038,12 +1021,12 @@ int DeleteRepeatedField( // Initializes fields of a message. Used in constructors. int InitAttributes(CMessage* self, PyObject* args, PyObject* kwargs) { - if (args != NULL && PyTuple_Size(args) != 0) { + if (args != nullptr && PyTuple_Size(args) != 0) { PyErr_SetString(PyExc_TypeError, "No positional arguments allowed"); return -1; } - if (kwargs == NULL) { + if (kwargs == nullptr) { return 0; } @@ -1057,7 +1040,7 @@ int InitAttributes(CMessage* self, PyObject* args, PyObject* kwargs) { } ScopedPyObjectPtr property( PyObject_GetAttr(reinterpret_cast(Py_TYPE(self)), name)); - if (property == NULL || + if (property == nullptr || !PyObject_TypeCheck(property.get(), CFieldProperty_Type)) { PyErr_Format(PyExc_ValueError, "Protocol message %s has no \"%s\" field.", self->message->GetDescriptor()->name().c_str(), @@ -1074,23 +1057,24 @@ int InitAttributes(CMessage* self, PyObject* args, PyObject* kwargs) { if (descriptor->is_map()) { ScopedPyObjectPtr map(GetFieldValue(self, descriptor)); const FieldDescriptor* value_descriptor = - descriptor->message_type()->FindFieldByName("value"); + descriptor->message_type()->map_value(); if (value_descriptor->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { ScopedPyObjectPtr iter(PyObject_GetIter(value)); - if (iter == NULL) { - PyErr_Format(PyExc_TypeError, "Argument %s is not iterable", PyString_AsString(name)); + if (iter == nullptr) { + PyErr_Format(PyExc_TypeError, "Argument %s is not iterable", + PyString_AsString(name)); return -1; } ScopedPyObjectPtr next; - while ((next.reset(PyIter_Next(iter.get()))) != NULL) { + while ((next.reset(PyIter_Next(iter.get()))) != nullptr) { ScopedPyObjectPtr source_value(PyObject_GetItem(value, next.get())); ScopedPyObjectPtr dest_value(PyObject_GetItem(map.get(), next.get())); - if (source_value.get() == NULL || dest_value.get() == NULL) { + if (source_value.get() == nullptr || dest_value.get() == nullptr) { return -1; } ScopedPyObjectPtr ok(PyObject_CallMethod( dest_value.get(), "MergeFrom", "O", source_value.get())); - if (ok.get() == NULL) { + if (ok.get() == nullptr) { return -1; } } @@ -1098,36 +1082,36 @@ int InitAttributes(CMessage* self, PyObject* args, PyObject* kwargs) { ScopedPyObjectPtr function_return; function_return.reset( PyObject_CallMethod(map.get(), "update", "O", value)); - if (function_return.get() == NULL) { + if (function_return.get() == nullptr) { return -1; } } } else if (descriptor->label() == FieldDescriptor::LABEL_REPEATED) { ScopedPyObjectPtr container(GetFieldValue(self, descriptor)); - if (container == NULL) { + if (container == nullptr) { return -1; } if (descriptor->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { RepeatedCompositeContainer* rc_container = reinterpret_cast(container.get()); ScopedPyObjectPtr iter(PyObject_GetIter(value)); - if (iter == NULL) { + if (iter == nullptr) { PyErr_SetString(PyExc_TypeError, "Value must be iterable"); return -1; } ScopedPyObjectPtr next; - while ((next.reset(PyIter_Next(iter.get()))) != NULL) { - PyObject* kwargs = (PyDict_Check(next.get()) ? next.get() : NULL); + while ((next.reset(PyIter_Next(iter.get()))) != nullptr) { + PyObject* kwargs = (PyDict_Check(next.get()) ? next.get() : nullptr); ScopedPyObjectPtr new_msg( - repeated_composite_container::Add(rc_container, NULL, kwargs)); - if (new_msg == NULL) { + repeated_composite_container::Add(rc_container, nullptr, kwargs)); + if (new_msg == nullptr) { return -1; } - if (kwargs == NULL) { + if (kwargs == nullptr) { // next was not a dict, it's a message we need to merge ScopedPyObjectPtr merged(MergeFrom( reinterpret_cast(new_msg.get()), next.get())); - if (merged.get() == NULL) { + if (merged.get() == nullptr) { return -1; } } @@ -1140,20 +1124,20 @@ int InitAttributes(CMessage* self, PyObject* args, PyObject* kwargs) { RepeatedScalarContainer* rs_container = reinterpret_cast(container.get()); ScopedPyObjectPtr iter(PyObject_GetIter(value)); - if (iter == NULL) { + if (iter == nullptr) { PyErr_SetString(PyExc_TypeError, "Value must be iterable"); return -1; } ScopedPyObjectPtr next; - while ((next.reset(PyIter_Next(iter.get()))) != NULL) { + while ((next.reset(PyIter_Next(iter.get()))) != nullptr) { ScopedPyObjectPtr enum_value( GetIntegerEnumValue(*descriptor, next.get())); - if (enum_value == NULL) { + if (enum_value == nullptr) { return -1; } ScopedPyObjectPtr new_msg(repeated_scalar_container::Append( rs_container, enum_value.get())); - if (new_msg == NULL) { + if (new_msg == nullptr) { return -1; } } @@ -1164,26 +1148,25 @@ int InitAttributes(CMessage* self, PyObject* args, PyObject* kwargs) { } else { if (ScopedPyObjectPtr(repeated_scalar_container::Extend( reinterpret_cast(container.get()), - value)) == - NULL) { + value)) == nullptr) { return -1; } } } else if (descriptor->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { ScopedPyObjectPtr message(GetFieldValue(self, descriptor)); - if (message == NULL) { + if (message == nullptr) { return -1; } CMessage* cmessage = reinterpret_cast(message.get()); if (PyDict_Check(value)) { // Make the message exist even if the dict is empty. AssureWritable(cmessage); - if (InitAttributes(cmessage, NULL, value) < 0) { + if (InitAttributes(cmessage, nullptr, value) < 0) { return -1; } } else { ScopedPyObjectPtr merged(MergeFrom(cmessage, value)); - if (merged == NULL) { + if (merged == nullptr) { return -1; } } @@ -1191,7 +1174,7 @@ int InitAttributes(CMessage* self, PyObject* args, PyObject* kwargs) { ScopedPyObjectPtr new_val; if (descriptor->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { new_val.reset(GetIntegerEnumValue(*descriptor, value)); - if (new_val == NULL) { + if (new_val == nullptr) { return -1; } value = new_val.get(); @@ -1209,19 +1192,19 @@ int InitAttributes(CMessage* self, PyObject* args, PyObject* kwargs) { CMessage* NewEmptyMessage(CMessageClass* type) { CMessage* self = reinterpret_cast( PyType_GenericAlloc(&type->super.ht_type, 0)); - if (self == NULL) { - return NULL; + if (self == nullptr) { + return nullptr; } - self->message = NULL; - self->parent = NULL; - self->parent_field_descriptor = NULL; + self->message = nullptr; + self->parent = nullptr; + self->parent_field_descriptor = nullptr; self->read_only = false; - self->composite_fields = NULL; - self->child_submessages = NULL; + self->composite_fields = nullptr; + self->child_submessages = nullptr; - self->unknown_field_set = NULL; + self->unknown_field_set = nullptr; return self; } @@ -1313,30 +1296,27 @@ static void Dealloc(CMessage* self) { PyObject* IsInitialized(CMessage* self, PyObject* args) { - PyObject* errors = NULL; + PyObject* errors = nullptr; if (!PyArg_ParseTuple(args, "|O", &errors)) { - return NULL; + return nullptr; } if (self->message->IsInitialized()) { Py_RETURN_TRUE; } - if (errors != NULL) { + if (errors != nullptr) { ScopedPyObjectPtr initialization_errors( FindInitializationErrors(self)); - if (initialization_errors == NULL) { - return NULL; + if (initialization_errors == nullptr) { + return nullptr; } ScopedPyObjectPtr extend_name(PyUnicode_FromString("extend")); - if (extend_name == NULL) { - return NULL; + if (extend_name == nullptr) { + return nullptr; } ScopedPyObjectPtr result(PyObject_CallMethodObjArgs( - errors, - extend_name.get(), - initialization_errors.get(), - NULL)); - if (result == NULL) { - return NULL; + errors, extend_name.get(), initialization_errors.get(), nullptr)); + if (result == nullptr) { + return nullptr; } } Py_RETURN_FALSE; @@ -1363,17 +1343,17 @@ const FieldDescriptor* FindFieldWithOneofs(const Message* message, const Descriptor* descriptor = message->GetDescriptor(); const FieldDescriptor* field_descriptor = descriptor->FindFieldByName(field_name); - if (field_descriptor != NULL) { + if (field_descriptor != nullptr) { return field_descriptor; } const OneofDescriptor* oneof_desc = descriptor->FindOneofByName(field_name); - if (oneof_desc != NULL) { + if (oneof_desc != nullptr) { *in_oneof = true; return message->GetReflection()->GetOneofFieldDescriptor(*message, oneof_desc); } - return NULL; + return nullptr; } bool CheckHasPresence(const FieldDescriptor* field_descriptor, bool in_oneof) { @@ -1401,25 +1381,25 @@ PyObject* HasField(CMessage* self, PyObject* arg) { Py_ssize_t size; field_name = const_cast(PyUnicode_AsUTF8AndSize(arg, &size)); if (!field_name) { - return NULL; + return nullptr; } Message* message = self->message; bool is_in_oneof; const FieldDescriptor* field_descriptor = FindFieldWithOneofs(message, StringParam(field_name, size), &is_in_oneof); - if (field_descriptor == NULL) { + if (field_descriptor == nullptr) { if (!is_in_oneof) { PyErr_Format(PyExc_ValueError, "Protocol message %s has no field %s.", message->GetDescriptor()->name().c_str(), field_name); - return NULL; + return nullptr; } else { Py_RETURN_FALSE; } } if (!CheckHasPresence(field_descriptor, is_in_oneof)) { - return NULL; + return nullptr; } if (message->GetReflection()->HasField(*message, field_descriptor)) { @@ -1431,8 +1411,8 @@ PyObject* HasField(CMessage* self, PyObject* arg) { PyObject* ClearExtension(CMessage* self, PyObject* extension) { const FieldDescriptor* descriptor = GetExtensionDescriptor(extension); - if (descriptor == NULL) { - return NULL; + if (descriptor == nullptr) { + return nullptr; } if (ClearFieldByDescriptor(self, descriptor) < 0) { return nullptr; @@ -1442,8 +1422,8 @@ PyObject* ClearExtension(CMessage* self, PyObject* extension) { PyObject* HasExtension(CMessage* self, PyObject* extension) { const FieldDescriptor* descriptor = GetExtensionDescriptor(extension); - if (descriptor == NULL) { - return NULL; + if (descriptor == nullptr) { + return nullptr; } int has_field = HasFieldByDescriptor(self, descriptor); if (has_field < 0) { @@ -1586,20 +1566,20 @@ PyObject* ClearField(CMessage* self, PyObject* arg) { char* field_name; Py_ssize_t field_size; if (PyString_AsStringAndSize(arg, &field_name, &field_size) < 0) { - return NULL; + return nullptr; } AssureWritable(self); bool is_in_oneof; const FieldDescriptor* field_descriptor = FindFieldWithOneofs( self->message, StringParam(field_name, field_size), &is_in_oneof); - if (field_descriptor == NULL) { + if (field_descriptor == nullptr) { if (is_in_oneof) { // We gave the name of a oneof, and none of its fields are set. Py_RETURN_NONE; } else { PyErr_Format(PyExc_ValueError, "Protocol message has no \"%s\" field.", field_name); - return NULL; + return nullptr; } } @@ -1626,7 +1606,7 @@ PyObject* Clear(CMessage* self) { } if (InternalReparentFields(self, messages_to_release, containers_to_release) < 0) { - return NULL; + return nullptr; } if (self->unknown_field_set) { unknown_fields::Clear( @@ -1640,7 +1620,7 @@ PyObject* Clear(CMessage* self) { // --------------------------------------------------------------------- static std::string GetMessageName(CMessage* self) { - if (self->parent_field_descriptor != NULL) { + if (self->parent_field_descriptor != nullptr) { return self->parent_field_descriptor->full_name(); } else { return self->message->GetDescriptor()->full_name(); @@ -1651,33 +1631,33 @@ static PyObject* InternalSerializeToString( CMessage* self, PyObject* args, PyObject* kwargs, bool require_initialized) { // Parse the "deterministic" kwarg; defaults to False. - static const char* kwlist[] = {"deterministic", 0}; + static const char* kwlist[] = {"deterministic", nullptr}; PyObject* deterministic_obj = Py_None; if (!PyArg_ParseTupleAndKeywords( args, kwargs, "|O", const_cast(kwlist), &deterministic_obj)) { - return NULL; + return nullptr; } // Preemptively convert to a bool first, so we don't need to back out of // allocating memory if this raises an exception. // NOTE: This is unused later if deterministic == Py_None, but that's fine. int deterministic = PyObject_IsTrue(deterministic_obj); if (deterministic < 0) { - return NULL; + return nullptr; } if (require_initialized && !self->message->IsInitialized()) { ScopedPyObjectPtr errors(FindInitializationErrors(self)); - if (errors == NULL) { - return NULL; + if (errors == nullptr) { + return nullptr; } ScopedPyObjectPtr comma(PyUnicode_FromString(",")); - if (comma == NULL) { - return NULL; + if (comma == nullptr) { + return nullptr; } ScopedPyObjectPtr joined( PyObject_CallMethod(comma.get(), "join", "O", errors.get())); - if (joined == NULL) { - return NULL; + if (joined == nullptr) { + return nullptr; } // TODO(haberman): this is a (hopefully temporary) hack. The unit testing @@ -1689,19 +1669,19 @@ static PyObject* InternalSerializeToString( // again every time. ScopedPyObjectPtr message_module(PyImport_ImportModule( "google.protobuf.message")); - if (message_module.get() == NULL) { - return NULL; + if (message_module.get() == nullptr) { + return nullptr; } ScopedPyObjectPtr encode_error( PyObject_GetAttrString(message_module.get(), "EncodeError")); - if (encode_error.get() == NULL) { - return NULL; + if (encode_error.get() == nullptr) { + return nullptr; } PyErr_Format(encode_error.get(), "Message %s is missing required fields: %s", GetMessageName(self).c_str(), PyString_AsString(joined.get())); - return NULL; + return nullptr; } // Ok, arguments parsed and errors checked, now encode to a string @@ -1718,9 +1698,9 @@ static PyObject* InternalSerializeToString( return nullptr; } - PyObject* result = PyBytes_FromStringAndSize(NULL, size); - if (result == NULL) { - return NULL; + PyObject* result = PyBytes_FromStringAndSize(nullptr, size); + if (result == nullptr) { + return nullptr; } io::ArrayOutputStream out(PyBytes_AS_STRING(result), size); io::CodedOutputStream coded_out(&out); @@ -1794,7 +1774,7 @@ static PyObject* ToStr(CMessage* self) { std::string output; if (!printer.PrintToString(*self->message, &output)) { PyErr_SetString(PyExc_ValueError, "Unable to convert message to str"); - return NULL; + return nullptr; } return PyUnicode_FromString(output.c_str()); } @@ -1807,7 +1787,7 @@ PyObject* MergeFrom(CMessage* self, PyObject* arg) { "expected %s got %s.", self->message->GetDescriptor()->full_name().c_str(), Py_TYPE(arg)->tp_name); - return NULL; + return nullptr; } other_message = reinterpret_cast(arg); @@ -1818,7 +1798,7 @@ PyObject* MergeFrom(CMessage* self, PyObject* arg) { "expected %s got %s.", self->message->GetDescriptor()->full_name().c_str(), other_message->message->GetDescriptor()->full_name().c_str()); - return NULL; + return nullptr; } AssureWritable(self); @@ -1826,7 +1806,7 @@ PyObject* MergeFrom(CMessage* self, PyObject* arg) { // Child message might be lazily created before MergeFrom. Make sure they // are mutable at this point if child messages are really created. if (FixupMessageAfterMerge(self) < 0) { - return NULL; + return nullptr; } Py_RETURN_NONE; @@ -1840,7 +1820,7 @@ static PyObject* CopyFrom(CMessage* self, PyObject* arg) { "expected %s got %s.", self->message->GetDescriptor()->full_name().c_str(), Py_TYPE(arg)->tp_name); - return NULL; + return nullptr; } other_message = reinterpret_cast(arg); @@ -1856,7 +1836,7 @@ static PyObject* CopyFrom(CMessage* self, PyObject* arg) { "expected %s got %s.", self->message->GetDescriptor()->full_name().c_str(), other_message->message->GetDescriptor()->full_name().c_str()); - return NULL; + return nullptr; } AssureWritable(self); @@ -1876,7 +1856,7 @@ PyObject* SetAllowOversizeProtos(PyObject* m, PyObject* arg) { if (!arg || !PyBool_Check(arg)) { PyErr_SetString(PyExc_TypeError, "Argument to SetAllowOversizeProtos must be boolean"); - return NULL; + return nullptr; } allow_oversize_protos = PyObject_IsTrue(arg); if (allow_oversize_protos) { @@ -1889,7 +1869,7 @@ PyObject* SetAllowOversizeProtos(PyObject* m, PyObject* arg) { static PyObject* MergeFromString(CMessage* self, PyObject* arg) { Py_buffer data; if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) < 0) { - return NULL; + return nullptr; } AssureWritable(self); @@ -1911,19 +1891,29 @@ static PyObject* MergeFromString(CMessage* self, PyObject* arg) { // Child message might be lazily created before MergeFrom. Make sure they // are mutable at this point if child messages are really created. if (FixupMessageAfterMerge(self) < 0) { - return NULL; + return nullptr; } // Python makes distinction in error message, between a general parse failure // and in-correct ending on a terminating tag. Hence we need to be a bit more // explicit in our correctness checks. - if (ptr == nullptr || ctx.BytesUntilLimit(ptr) < 0) { - // Parse error or the parser overshoot the limit. + if (ptr == nullptr) { + // Parse error. PyErr_Format( DecodeError_class, "Error parsing message with type '%s'", self->GetMessageClass()->message_descriptor->full_name().c_str()); - return NULL; + return nullptr; } + if (ctx.BytesUntilLimit(ptr) < 0) { + // The parser overshot the limit. + PyErr_Format( + DecodeError_class, + "Error parsing message as the message exceeded the protobuf limit " + "with type '%s'", + self->GetMessageClass()->message_descriptor->full_name().c_str()); + return nullptr; + } + // ctx has an explicit limit set (length of string_view), so we have to // check we ended at that limit. if (!ctx.EndedAtLimit()) { @@ -1936,8 +1926,8 @@ static PyObject* MergeFromString(CMessage* self, PyObject* arg) { } static PyObject* ParseFromString(CMessage* self, PyObject* arg) { - if (ScopedPyObjectPtr(Clear(self)) == NULL) { - return NULL; + if (ScopedPyObjectPtr(Clear(self)) == nullptr) { + return nullptr; } return MergeFromString(self, arg); } @@ -1949,25 +1939,25 @@ static PyObject* ByteSize(CMessage* self, PyObject* args) { PyObject* RegisterExtension(PyObject* cls, PyObject* extension_handle) { const FieldDescriptor* descriptor = GetExtensionDescriptor(extension_handle); - if (descriptor == NULL) { - return NULL; + if (descriptor == nullptr) { + return nullptr; } if (!PyObject_TypeCheck(cls, CMessageClass_Type)) { PyErr_Format(PyExc_TypeError, "Expected a message class, got %s", cls->ob_type->tp_name); - return NULL; + return nullptr; } CMessageClass *message_class = reinterpret_cast(cls); - if (message_class == NULL) { - return NULL; + if (message_class == nullptr) { + return nullptr; } // If the extension was already registered, check that it is the same. const FieldDescriptor* existing_extension = message_class->py_message_factory->pool->pool->FindExtensionByNumber( descriptor->containing_type(), descriptor->number()); - if (existing_extension != NULL && existing_extension != descriptor) { + if (existing_extension != nullptr && existing_extension != descriptor) { PyErr_SetString(PyExc_ValueError, "Double registration of Extensions"); - return NULL; + return nullptr; } Py_RETURN_NONE; } @@ -1980,20 +1970,19 @@ static PyObject* SetInParent(CMessage* self, PyObject* args) { static PyObject* WhichOneof(CMessage* self, PyObject* arg) { Py_ssize_t name_size; char *name_data; - if (PyString_AsStringAndSize(arg, &name_data, &name_size) < 0) - return NULL; + if (PyString_AsStringAndSize(arg, &name_data, &name_size) < 0) return nullptr; const OneofDescriptor* oneof_desc = self->message->GetDescriptor()->FindOneofByName( StringParam(name_data, name_size)); - if (oneof_desc == NULL) { + if (oneof_desc == nullptr) { PyErr_Format(PyExc_ValueError, "Protocol message has no oneof \"%s\" field.", name_data); - return NULL; + return nullptr; } const FieldDescriptor* field_in_oneof = self->message->GetReflection()->GetOneofFieldDescriptor( *self->message, oneof_desc); - if (field_in_oneof == NULL) { + if (field_in_oneof == nullptr) { Py_RETURN_NONE; } else { const std::string& name = field_in_oneof->name(); @@ -2009,8 +1998,8 @@ static PyObject* ListFields(CMessage* self) { // Normally, the list will be exactly the size of the fields. ScopedPyObjectPtr all_fields(PyList_New(fields.size())); - if (all_fields == NULL) { - return NULL; + if (all_fields == nullptr) { + return nullptr; } // When there are unknown extensions, the py list will *not* contain @@ -2019,36 +2008,36 @@ static PyObject* ListFields(CMessage* self) { Py_ssize_t actual_size = 0; for (size_t i = 0; i < fields.size(); ++i) { ScopedPyObjectPtr t(PyTuple_New(2)); - if (t == NULL) { - return NULL; + if (t == nullptr) { + return nullptr; } if (fields[i]->is_extension()) { ScopedPyObjectPtr extension_field( PyFieldDescriptor_FromDescriptor(fields[i])); - if (extension_field == NULL) { - return NULL; + if (extension_field == nullptr) { + return nullptr; } // With C++ descriptors, the field can always be retrieved, but for // unknown extensions which have not been imported in Python code, there // is no message class and we cannot retrieve the value. // TODO(amauryfa): consider building the class on the fly! - if (fields[i]->message_type() != NULL && - message_factory::GetMessageClass( - GetFactoryForMessage(self), - fields[i]->message_type()) == NULL) { + if (fields[i]->message_type() != nullptr && + message_factory::GetMessageClass(GetFactoryForMessage(self), + fields[i]->message_type()) == + nullptr) { PyErr_Clear(); continue; } - ScopedPyObjectPtr extensions(GetExtensionDict(self, NULL)); - if (extensions == NULL) { - return NULL; + ScopedPyObjectPtr extensions(GetExtensionDict(self, nullptr)); + if (extensions == nullptr) { + return nullptr; } // 'extension' reference later stolen by PyTuple_SET_ITEM. PyObject* extension = PyObject_GetItem( extensions.get(), extension_field.get()); - if (extension == NULL) { - return NULL; + if (extension == nullptr) { + return nullptr; } PyTuple_SET_ITEM(t.get(), 0, extension_field.release()); // Steals reference to 'extension' @@ -2057,14 +2046,14 @@ static PyObject* ListFields(CMessage* self) { // Normal field ScopedPyObjectPtr field_descriptor( PyFieldDescriptor_FromDescriptor(fields[i])); - if (field_descriptor == NULL) { - return NULL; + if (field_descriptor == nullptr) { + return nullptr; } PyObject* field_value = GetFieldValue(self, fields[i]); - if (field_value == NULL) { + if (field_value == nullptr) { PyErr_SetString(PyExc_ValueError, fields[i]->name().c_str()); - return NULL; + return nullptr; } PyTuple_SET_ITEM(t.get(), 0, field_descriptor.release()); PyTuple_SET_ITEM(t.get(), 1, field_value); @@ -2073,9 +2062,9 @@ static PyObject* ListFields(CMessage* self) { ++actual_size; } if (static_cast(actual_size) != fields.size() && - (PyList_SetSlice(all_fields.get(), actual_size, fields.size(), NULL) < + (PyList_SetSlice(all_fields.get(), actual_size, fields.size(), nullptr) < 0)) { - return NULL; + return nullptr; } return all_fields.release(); } @@ -2092,16 +2081,16 @@ PyObject* FindInitializationErrors(CMessage* self) { message->FindInitializationErrors(&errors); PyObject* error_list = PyList_New(errors.size()); - if (error_list == NULL) { - return NULL; + if (error_list == nullptr) { + return nullptr; } for (size_t i = 0; i < errors.size(); ++i) { const std::string& error = errors[i]; PyObject* error_string = PyUnicode_FromStringAndSize(error.c_str(), error.length()); - if (error_string == NULL) { + if (error_string == nullptr) { Py_DECREF(error_list); - return NULL; + return nullptr; } PyList_SET_ITEM(error_list, i, error_string); } @@ -2147,10 +2136,10 @@ PyObject* InternalGetScalar(const Message* message, const Reflection* reflection = message->GetReflection(); if (!CheckFieldBelongsToMessage(field_descriptor, message)) { - return NULL; + return nullptr; } - PyObject* result = NULL; + PyObject* result = nullptr; switch (field_descriptor->cpp_type()) { case FieldDescriptor::CPPTYPE_INT32: { int32_t value = reflection->GetInt32(*message, field_descriptor); @@ -2218,13 +2207,13 @@ CMessage* InternalGetSubMessage( factory, field_descriptor->message_type()); ScopedPyObjectPtr message_class_owner( reinterpret_cast(message_class)); - if (message_class == NULL) { - return NULL; + if (message_class == nullptr) { + return nullptr; } CMessage* cmsg = cmessage::NewEmptyMessage(message_class); - if (cmsg == NULL) { - return NULL; + if (cmsg == nullptr) { + return nullptr; } Py_INCREF(self); @@ -2310,7 +2299,7 @@ int InternalSetNonOneofScalar( const EnumDescriptor* enum_descriptor = field_descriptor->enum_type(); const EnumValueDescriptor* enum_value = enum_descriptor->FindValueByNumber(value); - if (enum_value != NULL) { + if (enum_value != nullptr) { reflection->SetEnum(message, field_descriptor, enum_value); } else { PyErr_Format(PyExc_ValueError, "Unknown enum value: %d", value); @@ -2345,37 +2334,37 @@ int InternalSetScalar( } PyObject* FromString(PyTypeObject* cls, PyObject* serialized) { - PyObject* py_cmsg = PyObject_CallObject( - reinterpret_cast(cls), NULL); - if (py_cmsg == NULL) { - return NULL; + PyObject* py_cmsg = + PyObject_CallObject(reinterpret_cast(cls), nullptr); + if (py_cmsg == nullptr) { + return nullptr; } CMessage* cmsg = reinterpret_cast(py_cmsg); ScopedPyObjectPtr py_length(MergeFromString(cmsg, serialized)); - if (py_length == NULL) { + if (py_length == nullptr) { Py_DECREF(py_cmsg); - return NULL; + return nullptr; } return py_cmsg; } PyObject* DeepCopy(CMessage* self, PyObject* arg) { - PyObject* clone = PyObject_CallObject( - reinterpret_cast(Py_TYPE(self)), NULL); - if (clone == NULL) { - return NULL; + PyObject* clone = + PyObject_CallObject(reinterpret_cast(Py_TYPE(self)), nullptr); + if (clone == nullptr) { + return nullptr; } if (!PyObject_TypeCheck(clone, CMessage_Type)) { Py_DECREF(clone); - return NULL; + return nullptr; } - if (ScopedPyObjectPtr(MergeFrom( - reinterpret_cast(clone), - reinterpret_cast(self))) == NULL) { + if (ScopedPyObjectPtr(MergeFrom(reinterpret_cast(clone), + reinterpret_cast(self))) == + nullptr) { Py_DECREF(clone); - return NULL; + return nullptr; } return clone; } @@ -2384,23 +2373,24 @@ PyObject* ToUnicode(CMessage* self) { // Lazy import to prevent circular dependencies ScopedPyObjectPtr text_format( PyImport_ImportModule("google.protobuf.text_format")); - if (text_format == NULL) { - return NULL; + if (text_format == nullptr) { + return nullptr; } ScopedPyObjectPtr method_name(PyUnicode_FromString("MessageToString")); - if (method_name == NULL) { - return NULL; + if (method_name == nullptr) { + return nullptr; } Py_INCREF(Py_True); ScopedPyObjectPtr encoded(PyObject_CallMethodObjArgs( - text_format.get(), method_name.get(), self, Py_True, NULL)); + text_format.get(), method_name.get(), self, Py_True, nullptr)); Py_DECREF(Py_True); - if (encoded == NULL) { - return NULL; + if (encoded == nullptr) { + return nullptr; } - PyObject* decoded = PyUnicode_FromEncodedObject(encoded.get(), "utf-8", NULL); - if (decoded == NULL) { - return NULL; + PyObject* decoded = + PyUnicode_FromEncodedObject(encoded.get(), "utf-8", nullptr); + if (decoded == nullptr) { + return nullptr; } return decoded; } @@ -2412,7 +2402,7 @@ PyObject* _CheckCalledFromGeneratedFile(PyObject* unused, PyErr_SetString(PyExc_TypeError, "Descriptors should not be created directly, " "but only retrieved from their parent."); - return NULL; + return nullptr; } Py_RETURN_NONE; } @@ -2423,20 +2413,20 @@ static PyObject* GetExtensionDict(CMessage* self, void *closure) { const Descriptor* descriptor = GetMessageDescriptor(Py_TYPE(self)); if (!descriptor->extension_range_count()) { PyErr_SetNone(PyExc_AttributeError); - return NULL; + return nullptr; } if (!self->composite_fields) { self->composite_fields = new CMessage::CompositeFieldsMap(); } if (!self->composite_fields) { - return NULL; + return nullptr; } ExtensionDict* extension_dict = extension_dict::NewExtensionDict(self); return reinterpret_cast(extension_dict); } -static PyObject* UnknownFieldSet(CMessage* self) { - if (self->unknown_field_set == NULL) { +static PyObject* GetUnknownFields(CMessage* self) { + if (self->unknown_field_set == nullptr) { self->unknown_field_set = unknown_fields::NewPyUnknownFields(self); } else { Py_INCREF(self->unknown_field_set); @@ -2455,75 +2445,70 @@ static PyObject* GetExtensionsByNumber(CMessage *self, void *closure) { } static PyGetSetDef Getters[] = { - {"Extensions", (getter)GetExtensionDict, NULL, "Extension dict"}, - {"_extensions_by_name", (getter)GetExtensionsByName, NULL}, - {"_extensions_by_number", (getter)GetExtensionsByNumber, NULL}, - {NULL} + {"Extensions", (getter)GetExtensionDict, nullptr, "Extension dict"}, + {"_extensions_by_name", (getter)GetExtensionsByName, nullptr}, + {"_extensions_by_number", (getter)GetExtensionsByNumber, nullptr}, + {nullptr}, }; - static PyMethodDef Methods[] = { - { "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS, - "Makes a deep copy of the class." }, - { "__unicode__", (PyCFunction)ToUnicode, METH_NOARGS, - "Outputs a unicode representation of the message." }, - { "ByteSize", (PyCFunction)ByteSize, METH_NOARGS, - "Returns the size of the message in bytes." }, - { "Clear", (PyCFunction)Clear, METH_NOARGS, - "Clears the message." }, - { "ClearExtension", (PyCFunction)ClearExtension, METH_O, - "Clears a message field." }, - { "ClearField", (PyCFunction)ClearField, METH_O, - "Clears a message field." }, - { "CopyFrom", (PyCFunction)CopyFrom, METH_O, - "Copies a protocol message into the current message." }, - { "DiscardUnknownFields", (PyCFunction)DiscardUnknownFields, METH_NOARGS, - "Discards the unknown fields." }, - { "FindInitializationErrors", (PyCFunction)FindInitializationErrors, - METH_NOARGS, - "Finds unset required fields." }, - { "FromString", (PyCFunction)FromString, METH_O | METH_CLASS, - "Creates new method instance from given serialized data." }, - { "HasExtension", (PyCFunction)HasExtension, METH_O, - "Checks if a message field is set." }, - { "HasField", (PyCFunction)HasField, METH_O, - "Checks if a message field is set." }, - { "IsInitialized", (PyCFunction)IsInitialized, METH_VARARGS, - "Checks if all required fields of a protocol message are set." }, - { "ListFields", (PyCFunction)ListFields, METH_NOARGS, - "Lists all set fields of a message." }, - { "MergeFrom", (PyCFunction)MergeFrom, METH_O, - "Merges a protocol message into the current message." }, - { "MergeFromString", (PyCFunction)MergeFromString, METH_O, - "Merges a serialized message into the current message." }, - { "ParseFromString", (PyCFunction)ParseFromString, METH_O, - "Parses a serialized message into the current message." }, - { "RegisterExtension", (PyCFunction)RegisterExtension, METH_O | METH_CLASS, - "Registers an extension with the current message." }, - { "SerializePartialToString", (PyCFunction)SerializePartialToString, - METH_VARARGS | METH_KEYWORDS, - "Serializes the message to a string, even if it isn't initialized." }, - { "SerializeToString", (PyCFunction)SerializeToString, - METH_VARARGS | METH_KEYWORDS, - "Serializes the message to a string, only for initialized messages." }, - { "SetInParent", (PyCFunction)SetInParent, METH_NOARGS, - "Sets the has bit of the given field in its parent message." }, - { "UnknownFields", (PyCFunction)UnknownFieldSet, METH_NOARGS, - "Parse unknown field set"}, - { "WhichOneof", (PyCFunction)WhichOneof, METH_O, - "Returns the name of the field set inside a oneof, " - "or None if no field is set." }, + {"__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS, + "Makes a deep copy of the class."}, + {"__unicode__", (PyCFunction)ToUnicode, METH_NOARGS, + "Outputs a unicode representation of the message."}, + {"ByteSize", (PyCFunction)ByteSize, METH_NOARGS, + "Returns the size of the message in bytes."}, + {"Clear", (PyCFunction)Clear, METH_NOARGS, "Clears the message."}, + {"ClearExtension", (PyCFunction)ClearExtension, METH_O, + "Clears a message field."}, + {"ClearField", (PyCFunction)ClearField, METH_O, "Clears a message field."}, + {"CopyFrom", (PyCFunction)CopyFrom, METH_O, + "Copies a protocol message into the current message."}, + {"DiscardUnknownFields", (PyCFunction)DiscardUnknownFields, METH_NOARGS, + "Discards the unknown fields."}, + {"FindInitializationErrors", (PyCFunction)FindInitializationErrors, + METH_NOARGS, "Finds unset required fields."}, + {"FromString", (PyCFunction)FromString, METH_O | METH_CLASS, + "Creates new method instance from given serialized data."}, + {"HasExtension", (PyCFunction)HasExtension, METH_O, + "Checks if a message field is set."}, + {"HasField", (PyCFunction)HasField, METH_O, + "Checks if a message field is set."}, + {"IsInitialized", (PyCFunction)IsInitialized, METH_VARARGS, + "Checks if all required fields of a protocol message are set."}, + {"ListFields", (PyCFunction)ListFields, METH_NOARGS, + "Lists all set fields of a message."}, + {"MergeFrom", (PyCFunction)MergeFrom, METH_O, + "Merges a protocol message into the current message."}, + {"MergeFromString", (PyCFunction)MergeFromString, METH_O, + "Merges a serialized message into the current message."}, + {"ParseFromString", (PyCFunction)ParseFromString, METH_O, + "Parses a serialized message into the current message."}, + {"RegisterExtension", (PyCFunction)RegisterExtension, METH_O | METH_CLASS, + "Registers an extension with the current message."}, + {"SerializePartialToString", (PyCFunction)SerializePartialToString, + METH_VARARGS | METH_KEYWORDS, + "Serializes the message to a string, even if it isn't initialized."}, + {"SerializeToString", (PyCFunction)SerializeToString, + METH_VARARGS | METH_KEYWORDS, + "Serializes the message to a string, only for initialized messages."}, + {"SetInParent", (PyCFunction)SetInParent, METH_NOARGS, + "Sets the has bit of the given field in its parent message."}, + {"UnknownFields", (PyCFunction)GetUnknownFields, METH_NOARGS, + "Parse unknown field set"}, + {"WhichOneof", (PyCFunction)WhichOneof, METH_O, + "Returns the name of the field set inside a oneof, " + "or None if no field is set."}, - // Static Methods. - { "_CheckCalledFromGeneratedFile", (PyCFunction)_CheckCalledFromGeneratedFile, - METH_NOARGS | METH_STATIC, - "Raises TypeError if the caller is not in a _pb2.py file."}, - { NULL, NULL} -}; + // Static Methods. + {"_CheckCalledFromGeneratedFile", + (PyCFunction)_CheckCalledFromGeneratedFile, METH_NOARGS | METH_STATIC, + "Raises TypeError if the caller is not in a _pb2.py file."}, + {nullptr, nullptr}}; bool SetCompositeField(CMessage* self, const FieldDescriptor* field, ContainerBase* value) { - if (self->composite_fields == NULL) { + if (self->composite_fields == nullptr) { self->composite_fields = new CMessage::CompositeFieldsMap(); } (*self->composite_fields)[field] = value; @@ -2531,7 +2516,7 @@ bool SetCompositeField(CMessage* self, const FieldDescriptor* field, } bool SetSubmessage(CMessage* self, CMessage* submessage) { - if (self->child_submessages == NULL) { + if (self->child_submessages == nullptr) { self->child_submessages = new CMessage::SubMessagesMap(); } (*self->child_submessages)[submessage->message] = submessage; @@ -2542,11 +2527,11 @@ PyObject* GetAttr(PyObject* pself, PyObject* name) { CMessage* self = reinterpret_cast(pself); PyObject* result = PyObject_GenericGetAttr( reinterpret_cast(self), name); - if (result != NULL) { + if (result != nullptr) { return result; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { - return NULL; + return nullptr; } PyErr_Clear(); @@ -2571,7 +2556,7 @@ PyObject* GetFieldValue(CMessage* self, "descriptor to field '%s' doesn't apply to '%s' object", field_descriptor->full_name().c_str(), Py_TYPE(self)->tp_name); - return NULL; + return nullptr; } if (!field_descriptor->is_repeated() && @@ -2582,12 +2567,12 @@ PyObject* GetFieldValue(CMessage* self, ContainerBase* py_container = nullptr; if (field_descriptor->is_map()) { const Descriptor* entry_type = field_descriptor->message_type(); - const FieldDescriptor* value_type = entry_type->FindFieldByName("value"); + const FieldDescriptor* value_type = entry_type->map_value(); if (value_type->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { CMessageClass* value_class = message_factory::GetMessageClass( GetFactoryForMessage(self), value_type->message_type()); - if (value_class == NULL) { - return NULL; + if (value_class == nullptr) { + return nullptr; } py_container = NewMessageMapContainer(self, field_descriptor, value_class); @@ -2598,8 +2583,8 @@ PyObject* GetFieldValue(CMessage* self, if (field_descriptor->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { CMessageClass* message_class = message_factory::GetMessageClass( GetFactoryForMessage(self), field_descriptor->message_type()); - if (message_class == NULL) { - return NULL; + if (message_class == nullptr) { + return nullptr; } py_container = repeated_composite_container::NewContainer( self, field_descriptor, message_class); @@ -2614,12 +2599,12 @@ PyObject* GetFieldValue(CMessage* self, PyErr_SetString(PyExc_SystemError, "Should never happen"); } - if (py_container == NULL) { - return NULL; + if (py_container == nullptr) { + return nullptr; } if (!SetCompositeField(self, field_descriptor, py_container)) { Py_DECREF(py_container); - return NULL; + return nullptr; } return py_container->AsPyObject(); } @@ -2695,8 +2680,8 @@ CMessage* CMessage::BuildSubMessageFromPointer( } else { cmsg = cmessage::NewEmptyMessage(message_class); - if (cmsg == NULL) { - return NULL; + if (cmsg == nullptr) { + return nullptr; } cmsg->message = sub_message; Py_INCREF(this); @@ -2725,47 +2710,51 @@ CMessage* CMessage::MaybeReleaseSubMessage(Message* sub_message) { return released; } -static CMessageClass _CMessage_Type = { { { - PyVarObject_HEAD_INIT(&_CMessageClass_Type, 0) - FULL_MODULE_NAME ".CMessage", // tp_name - sizeof(CMessage), // tp_basicsize - 0, // tp_itemsize - (destructor)cmessage::Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - (reprfunc)cmessage::ToStr, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - PyObject_HashNotImplemented, // tp_hash - 0, // tp_call - (reprfunc)cmessage::ToStr, // tp_str - cmessage::GetAttr, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE - | Py_TPFLAGS_HAVE_VERSION_TAG, // tp_flags - "A ProtocolMessage", // tp_doc - 0, // tp_traverse - 0, // tp_clear - (richcmpfunc)cmessage::RichCompare, // tp_richcompare - offsetof(CMessage, weakreflist), // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - cmessage::Methods, // tp_methods - 0, // tp_members - cmessage::Getters, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - (initproc)cmessage::Init, // tp_init - 0, // tp_alloc - cmessage::New, // tp_new -} } }; +static CMessageClass _CMessage_Type = {{{ + PyVarObject_HEAD_INIT(&_CMessageClass_Type, 0) FULL_MODULE_NAME + ".CMessage", // tp_name + sizeof(CMessage), // tp_basicsize + 0, // tp_itemsize + (destructor)cmessage::Dealloc, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + (reprfunc)cmessage::ToStr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + PyObject_HashNotImplemented, // tp_hash + nullptr, // tp_call + (reprfunc)cmessage::ToStr, // tp_str + cmessage::GetAttr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | + Py_TPFLAGS_HAVE_VERSION_TAG, // tp_flags + "A ProtocolMessage", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + (richcmpfunc)cmessage::RichCompare, // tp_richcompare + offsetof(CMessage, weakreflist), // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + cmessage::Methods, // tp_methods + nullptr, // tp_members + cmessage::Getters, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + (initproc)cmessage::Init, // tp_init + nullptr, // tp_alloc + cmessage::New, // tp_new +}}}; PyTypeObject* CMessage_Type = &_CMessage_Type.super.ht_type; // --- Exposing the C proto living inside Python proto to C code: @@ -2775,18 +2764,18 @@ Message* (*MutableCProtoInsidePyProtoPtr)(PyObject* msg); static const Message* GetCProtoInsidePyProtoImpl(PyObject* msg) { const Message* message = PyMessage_GetMessagePointer(msg); - if (message == NULL) { + if (message == nullptr) { PyErr_Clear(); - return NULL; + return nullptr; } return message; } static Message* MutableCProtoInsidePyProtoImpl(PyObject* msg) { Message* message = PyMessage_GetMutableMessagePointer(msg); - if (message == NULL) { + if (message == nullptr) { PyErr_Clear(); - return NULL; + return nullptr; } return message; } @@ -2794,7 +2783,7 @@ static Message* MutableCProtoInsidePyProtoImpl(PyObject* msg) { const Message* PyMessage_GetMessagePointer(PyObject* msg) { if (!PyObject_TypeCheck(msg, CMessage_Type)) { PyErr_SetString(PyExc_TypeError, "Not a Message instance"); - return NULL; + return nullptr; } CMessage* cmsg = reinterpret_cast(msg); return cmsg->message; @@ -2803,7 +2792,7 @@ const Message* PyMessage_GetMessagePointer(PyObject* msg) { Message* PyMessage_GetMutableMessagePointer(PyObject* msg) { if (!PyObject_TypeCheck(msg, CMessage_Type)) { PyErr_SetString(PyExc_TypeError, "Not a Message instance"); - return NULL; + return nullptr; } CMessage* cmsg = reinterpret_cast(msg); @@ -2817,7 +2806,7 @@ Message* PyMessage_GetMutableMessagePointer(PyObject* msg) { PyErr_SetString(PyExc_ValueError, "Cannot reliably get a mutable pointer " "to a message with extra references"); - return NULL; + return nullptr; } cmessage::AssureWritable(cmsg); return cmsg->message; @@ -2890,8 +2879,8 @@ void InitGlobals() { // also be freed and reset to NULL during finalization. kDESCRIPTOR = PyUnicode_FromString("DESCRIPTOR"); - PyObject *dummy_obj = PySet_New(NULL); - kEmptyWeakref = PyWeakref_NewRef(dummy_obj, NULL); + PyObject* dummy_obj = PySet_New(nullptr); + kEmptyWeakref = PyWeakref_NewRef(dummy_obj, nullptr); Py_DECREF(dummy_obj); } @@ -2958,22 +2947,22 @@ bool InitProto2MessageModule(PyObject *m) { // Register them as MutableSequence. ScopedPyObjectPtr collections(PyImport_ImportModule("collections.abc")); - if (collections == NULL) { + if (collections == nullptr) { return false; } ScopedPyObjectPtr mutable_sequence( PyObject_GetAttrString(collections.get(), "MutableSequence")); - if (mutable_sequence == NULL) { + if (mutable_sequence == nullptr) { return false; } if (ScopedPyObjectPtr( PyObject_CallMethod(mutable_sequence.get(), "register", "O", - &RepeatedScalarContainer_Type)) == NULL) { + &RepeatedScalarContainer_Type)) == nullptr) { return false; } if (ScopedPyObjectPtr( PyObject_CallMethod(mutable_sequence.get(), "register", "O", - &RepeatedCompositeContainer_Type)) == NULL) { + &RepeatedCompositeContainer_Type)) == nullptr) { return false; } } @@ -2982,15 +2971,20 @@ bool InitProto2MessageModule(PyObject *m) { return false; } + if (PyType_Ready(&PyUnknownFieldSet_Type) < 0) { + return false; + } + PyModule_AddObject(m, "UnknownFieldSet", - reinterpret_cast(&PyUnknownFields_Type)); + reinterpret_cast(&PyUnknownFieldSet_Type)); if (PyType_Ready(&PyUnknownFieldRef_Type) < 0) { return false; } - PyModule_AddObject(m, "UnknownField", - reinterpret_cast(&PyUnknownFieldRef_Type)); + if (PyType_Ready(&PyUnknownField_Type) < 0) { + return false; + } // Initialize Map container types. if (!InitMapContainers()) { @@ -3042,7 +3036,7 @@ bool InitProto2MessageModule(PyObject *m) { PyObject* enum_type_wrapper = PyImport_ImportModule( "google.protobuf.internal.enum_type_wrapper"); - if (enum_type_wrapper == NULL) { + if (enum_type_wrapper == nullptr) { return false; } EnumTypeWrapper_class = @@ -3051,7 +3045,7 @@ bool InitProto2MessageModule(PyObject *m) { PyObject* message_module = PyImport_ImportModule( "google.protobuf.message"); - if (message_module == NULL) { + if (message_module == nullptr) { return false; } EncodeError_class = PyObject_GetAttrString(message_module, "EncodeError"); @@ -3060,7 +3054,7 @@ bool InitProto2MessageModule(PyObject *m) { Py_DECREF(message_module); PyObject* pickle_module = PyImport_ImportModule("pickle"); - if (pickle_module == NULL) { + if (pickle_module == nullptr) { return false; } PickleError_class = PyObject_GetAttrString(pickle_module, "PickleError"); diff --git a/windows/python/google/protobuf/pyext/message.h b/windows/python/google/protobuf/pyext/message.h index 29af25515..b17daa580 100644 --- a/windows/python/google/protobuf/pyext/message.h +++ b/windows/python/google/protobuf/pyext/message.h @@ -34,6 +34,7 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__ +#define PY_SSIZE_T_CLEAN #include #include diff --git a/windows/python/google/protobuf/pyext/message_factory.cc b/windows/python/google/protobuf/pyext/message_factory.cc index 30dfab88d..bc44dd457 100644 --- a/windows/python/google/protobuf/pyext/message_factory.cc +++ b/windows/python/google/protobuf/pyext/message_factory.cc @@ -30,6 +30,7 @@ #include +#define PY_SSIZE_T_CLEAN #include #include @@ -38,12 +39,13 @@ #include #include -#define PyString_AsStringAndSize(ob, charpp, sizep) \ - (PyUnicode_Check(ob) ? ((*(charpp) = const_cast( \ - PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL \ - ? -1 \ - : 0) \ - : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) +#define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob) \ + ? ((*(charpp) = const_cast( \ + PyUnicode_AsUTF8AndSize(ob, (sizep)))) == nullptr \ + ? -1 \ + : 0) \ + : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) namespace google { namespace protobuf { @@ -54,8 +56,8 @@ namespace message_factory { PyMessageFactory* NewMessageFactory(PyTypeObject* type, PyDescriptorPool* pool) { PyMessageFactory* factory = reinterpret_cast( PyType_GenericAlloc(type, 0)); - if (factory == NULL) { - return NULL; + if (factory == nullptr) { + return nullptr; } DynamicMessageFactory* message_factory = new DynamicMessageFactory(); @@ -72,25 +74,25 @@ PyMessageFactory* NewMessageFactory(PyTypeObject* type, PyDescriptorPool* pool) } PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { - static const char* kwlist[] = {"pool", 0}; - PyObject* pool = NULL; + static const char* kwlist[] = {"pool", nullptr}; + PyObject* pool = nullptr; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", const_cast(kwlist), &pool)) { - return NULL; + return nullptr; } ScopedPyObjectPtr owned_pool; - if (pool == NULL || pool == Py_None) { + if (pool == nullptr || pool == Py_None) { owned_pool.reset(PyObject_CallFunction( - reinterpret_cast(&PyDescriptorPool_Type), NULL)); - if (owned_pool == NULL) { - return NULL; + reinterpret_cast(&PyDescriptorPool_Type), nullptr)); + if (owned_pool == nullptr) { + return nullptr; } pool = owned_pool.get(); } else { if (!PyObject_TypeCheck(pool, &PyDescriptorPool_Type)) { PyErr_Format(PyExc_TypeError, "Expected a DescriptorPool, got %s", pool->ob_type->tp_name); - return NULL; + return nullptr; } } @@ -161,8 +163,8 @@ CMessageClass* GetOrCreateMessageClass(PyMessageFactory* self, } ScopedPyObjectPtr py_descriptor( PyMessageDescriptor_FromDescriptor(descriptor)); - if (py_descriptor == NULL) { - return NULL; + if (py_descriptor == nullptr) { + return nullptr; } // Create a new message class. ScopedPyObjectPtr args(Py_BuildValue( @@ -170,24 +172,24 @@ CMessageClass* GetOrCreateMessageClass(PyMessageFactory* self, "DESCRIPTOR", py_descriptor.get(), "__module__", Py_None, "message_factory", self)); - if (args == NULL) { - return NULL; + if (args == nullptr) { + return nullptr; } ScopedPyObjectPtr message_class(PyObject_CallObject( reinterpret_cast(CMessageClass_Type), args.get())); - if (message_class == NULL) { - return NULL; + if (message_class == nullptr) { + return nullptr; } // Create messages class for the messages used by the fields, and registers // all extensions for these messages during the recursion. for (int field_idx = 0; field_idx < descriptor->field_count(); field_idx++) { const Descriptor* sub_descriptor = descriptor->field(field_idx)->message_type(); - // It is NULL if the field type is not a message. - if (sub_descriptor != NULL) { + // It is null if the field type is not a message. + if (sub_descriptor != nullptr) { CMessageClass* result = GetOrCreateMessageClass(self, sub_descriptor); - if (result == NULL) { - return NULL; + if (result == nullptr) { + return nullptr; } Py_DECREF(result); } @@ -199,17 +201,17 @@ CMessageClass* GetOrCreateMessageClass(PyMessageFactory* self, ScopedPyObjectPtr py_extended_class( GetOrCreateMessageClass(self, extension->containing_type()) ->AsPyObject()); - if (py_extended_class == NULL) { - return NULL; + if (py_extended_class == nullptr) { + return nullptr; } ScopedPyObjectPtr py_extension(PyFieldDescriptor_FromDescriptor(extension)); - if (py_extension == NULL) { - return NULL; + if (py_extension == nullptr) { + return nullptr; } ScopedPyObjectPtr result(cmessage::RegisterExtension( py_extended_class.get(), py_extension.get())); - if (result == NULL) { - return NULL; + if (result == nullptr) { + return nullptr; } } return reinterpret_cast(message_class.release()); @@ -223,14 +225,15 @@ CMessageClass* GetMessageClass(PyMessageFactory* self, if (ret == self->classes_by_descriptor->end()) { PyErr_Format(PyExc_TypeError, "No message class registered for '%s'", message_descriptor->full_name().c_str()); - return NULL; + return nullptr; } else { return ret->second; } } static PyMethodDef Methods[] = { - {NULL}}; + {nullptr}, +}; static PyObject* GetPool(PyMessageFactory* self, void* closure) { Py_INCREF(self->pool); @@ -238,8 +241,8 @@ static PyObject* GetPool(PyMessageFactory* self, void* closure) { } static PyGetSetDef Getters[] = { - {"pool", (getter)GetPool, NULL, "DescriptorPool"}, - {NULL} + {"pool", (getter)GetPool, nullptr, "DescriptorPool"}, + {nullptr}, }; } // namespace message_factory @@ -250,38 +253,42 @@ PyTypeObject PyMessageFactory_Type = { sizeof(PyMessageFactory), // tp_basicsize 0, // tp_itemsize message_factory::Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, // tp_flags "A static Message Factory", // tp_doc message_factory::GcTraverse, // tp_traverse message_factory::GcClear, // tp_clear - 0, // tp_richcompare + nullptr, // tp_richcompare 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext + nullptr, // tp_iter + nullptr, // tp_iternext message_factory::Methods, // tp_methods - 0, // tp_members + nullptr, // tp_members message_factory::Getters, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc + nullptr, // tp_init + nullptr, // tp_alloc message_factory::New, // tp_new PyObject_GC_Del, // tp_free }; diff --git a/windows/python/google/protobuf/pyext/message_factory.h b/windows/python/google/protobuf/pyext/message_factory.h index 515c29cdb..7dfe425dd 100644 --- a/windows/python/google/protobuf/pyext/message_factory.h +++ b/windows/python/google/protobuf/pyext/message_factory.h @@ -31,6 +31,7 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__ +#define PY_SSIZE_T_CLEAN #include #include diff --git a/windows/python/google/protobuf/pyext/message_module.cc b/windows/python/google/protobuf/pyext/message_module.cc index 971d2bad7..2d3c1d208 100644 --- a/windows/python/google/protobuf/pyext/message_module.cc +++ b/windows/python/google/protobuf/pyext/message_module.cc @@ -28,6 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#define PY_SSIZE_T_CLEAN #include #include @@ -93,28 +94,28 @@ static PyMethodDef ModuleMethods[] = { (PyCFunction)google::protobuf::python::cmessage::SetAllowOversizeProtos, METH_O, "Enable/disable oversize proto parsing."}, // DO NOT USE: For migration and testing only. - {NULL, NULL}}; + {nullptr, nullptr}}; static struct PyModuleDef _module = {PyModuleDef_HEAD_INIT, "_message", module_docstring, -1, ModuleMethods, /* m_methods */ - NULL, - NULL, - NULL, - NULL}; + nullptr, + nullptr, + nullptr, + nullptr}; PyMODINIT_FUNC PyInit__message() { PyObject* m; m = PyModule_Create(&_module); - if (m == NULL) { - return NULL; + if (m == nullptr) { + return nullptr; } if (!google::protobuf::python::InitProto2MessageModule(m)) { Py_DECREF(m); - return NULL; + return nullptr; } // Adds the C++ API @@ -126,7 +127,7 @@ PyMODINIT_FUNC PyInit__message() { })) { PyModule_AddObject(m, "proto_API", api); } else { - return NULL; + return nullptr; } return m; diff --git a/windows/python/google/protobuf/pyext/python_pb2.py b/windows/python/google/protobuf/pyext/python_pb2.py index 2e932742d..2c6ecf4c9 100644 --- a/windows/python/google/protobuf/pyext/python_pb2.py +++ b/windows/python/google/protobuf/pyext/python_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/pyext/python.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,45 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"google/protobuf/pyext/python.proto\x12\x1fgoogle.protobuf.python.internal\"\xbc\x02\n\x0cTestAllTypes\x12\\\n\x17repeated_nested_message\x18\x01 \x03(\x0b\x32;.google.protobuf.python.internal.TestAllTypes.NestedMessage\x12\\\n\x17optional_nested_message\x18\x02 \x01(\x0b\x32;.google.protobuf.python.internal.TestAllTypes.NestedMessage\x12\x16\n\x0eoptional_int32\x18\x03 \x01(\x05\x1aX\n\rNestedMessage\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05\x12;\n\x02\x63\x63\x18\x02 \x01(\x0b\x32/.google.protobuf.python.internal.ForeignMessage\"&\n\x0e\x46oreignMessage\x12\t\n\x01\x63\x18\x01 \x01(\x05\x12\t\n\x01\x64\x18\x02 \x03(\x05\"\x1d\n\x11TestAllExtensions*\x08\x08\x01\x10\x80\x80\x80\x80\x02:\x9a\x01\n!optional_nested_message_extension\x12\x32.google.protobuf.python.internal.TestAllExtensions\x18\x01 \x01(\x0b\x32;.google.protobuf.python.internal.TestAllTypes.NestedMessage:\x9a\x01\n!repeated_nested_message_extension\x12\x32.google.protobuf.python.internal.TestAllExtensions\x18\x02 \x03(\x0b\x32;.google.protobuf.python.internal.TestAllTypes.NestedMessageB\x02H\x01') - -OPTIONAL_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER = 1 -optional_nested_message_extension = DESCRIPTOR.extensions_by_name['optional_nested_message_extension'] -REPEATED_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER = 2 -repeated_nested_message_extension = DESCRIPTOR.extensions_by_name['repeated_nested_message_extension'] - -_TESTALLTYPES = DESCRIPTOR.message_types_by_name['TestAllTypes'] -_TESTALLTYPES_NESTEDMESSAGE = _TESTALLTYPES.nested_types_by_name['NestedMessage'] -_FOREIGNMESSAGE = DESCRIPTOR.message_types_by_name['ForeignMessage'] -_TESTALLEXTENSIONS = DESCRIPTOR.message_types_by_name['TestAllExtensions'] -TestAllTypes = _reflection.GeneratedProtocolMessageType('TestAllTypes', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPES_NESTEDMESSAGE, - '__module__' : 'google.protobuf.pyext.python_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.TestAllTypes.NestedMessage) - }) - , - 'DESCRIPTOR' : _TESTALLTYPES, - '__module__' : 'google.protobuf.pyext.python_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.TestAllTypes) - }) -_sym_db.RegisterMessage(TestAllTypes) -_sym_db.RegisterMessage(TestAllTypes.NestedMessage) - -ForeignMessage = _reflection.GeneratedProtocolMessageType('ForeignMessage', (_message.Message,), { - 'DESCRIPTOR' : _FOREIGNMESSAGE, - '__module__' : 'google.protobuf.pyext.python_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.ForeignMessage) - }) -_sym_db.RegisterMessage(ForeignMessage) - -TestAllExtensions = _reflection.GeneratedProtocolMessageType('TestAllExtensions', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLEXTENSIONS, - '__module__' : 'google.protobuf.pyext.python_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.TestAllExtensions) - }) -_sym_db.RegisterMessage(TestAllExtensions) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.pyext.python_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: TestAllExtensions.RegisterExtension(optional_nested_message_extension) TestAllExtensions.RegisterExtension(repeated_nested_message_extension) diff --git a/windows/python/google/protobuf/pyext/repeated_composite_container.cc b/windows/python/google/protobuf/pyext/repeated_composite_container.cc index 2e8ff4b42..0b63f8225 100644 --- a/windows/python/google/protobuf/pyext/repeated_composite_container.cc +++ b/windows/python/google/protobuf/pyext/repeated_composite_container.cc @@ -40,12 +40,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include namespace google { @@ -74,17 +74,15 @@ PyObject* Add(RepeatedCompositeContainer* self, PyObject* args, if (cmessage::AssureWritable(self->parent) == -1) return nullptr; Message* message = self->parent->message; - Message* sub_message = - message->GetReflection()->AddMessage( - message, - self->parent_field_descriptor, - self->child_message_class->py_message_factory->message_factory); + Message* sub_message = message->GetReflection()->AddMessage( + message, self->parent_field_descriptor, + self->child_message_class->py_message_factory->message_factory); CMessage* cmsg = self->parent->BuildSubMessageFromPointer( self->parent_field_descriptor, sub_message, self->child_message_class); if (cmessage::InitAttributes(cmsg, args, kwargs) < 0) { - message->GetReflection()->RemoveLast( - message, self->parent_field_descriptor); + message->GetReflection()->RemoveLast(message, + self->parent_field_descriptor); Py_DECREF(cmsg); return nullptr; } @@ -108,8 +106,7 @@ static PyObject* AddMessage(RepeatedCompositeContainer* self, PyObject* value) { if (py_cmsg == nullptr) return nullptr; CMessage* cmsg = reinterpret_cast(py_cmsg); if (ScopedPyObjectPtr(cmessage::MergeFrom(cmsg, value)) == nullptr) { - reflection->RemoveLast( - message, self->parent_field_descriptor); + reflection->RemoveLast(message, self->parent_field_descriptor); Py_DECREF(cmsg); return nullptr; } @@ -152,7 +149,7 @@ static PyObject* Insert(PyObject* pself, PyObject* args) { Py_ssize_t end_index = index; if (end_index < 0) end_index += length; if (end_index < 0) end_index = 0; - for (Py_ssize_t i = length; i > end_index; i --) { + for (Py_ssize_t i = length; i > end_index; i--) { reflection->SwapElements(message, field_descriptor, i, i - 1); } @@ -268,8 +265,7 @@ static PyObject* SubscriptMethod(PyObject* self, PyObject* slice) { return Subscript(reinterpret_cast(self), slice); } -int AssignSubscript(RepeatedCompositeContainer* self, - PyObject* slice, +int AssignSubscript(RepeatedCompositeContainer* self, PyObject* slice, PyObject* value) { if (value != nullptr) { PyErr_SetString(PyExc_TypeError, "does not support assignment"); @@ -368,27 +364,22 @@ static void ReorderAttached(RepeatedCompositeContainer* self, const FieldDescriptor* descriptor = self->parent_field_descriptor; const Py_ssize_t length = Length(reinterpret_cast(self)); - // We need to rearrange things to match python's sort order. Because there - // was already an O(n*log(n)) step in python and a bunch of reflection, we - // expect an O(n**2) step in C++ won't hurt too much. + // We need to rearrange things to match python's sort order. + for (Py_ssize_t i = 0; i < length; ++i) { + reflection->UnsafeArenaReleaseLast(message, descriptor); + } for (Py_ssize_t i = 0; i < length; ++i) { Message* child_message = reinterpret_cast(PyList_GET_ITEM(child_list, i))->message; - for (Py_ssize_t j = i; j < length; ++j) { - if (child_message == - &reflection->GetRepeatedMessage(*message, descriptor, j)) { - reflection->SwapElements(message, descriptor, i, j); - break; - } - } + reflection->UnsafeArenaAddAllocatedMessage(message, descriptor, + child_message); } } // Returns 0 if successful; returns -1 and sets an exception if // unsuccessful. -static int SortPythonMessages(RepeatedCompositeContainer* self, - PyObject* args, - PyObject* kwds) { +static int SortPythonMessages(RepeatedCompositeContainer* self, PyObject* args, + PyObject* kwds) { ScopedPyObjectPtr child_list( PySequence_List(reinterpret_cast(self))); if (child_list == nullptr) { @@ -486,9 +477,8 @@ PyObject* DeepCopy(PyObject* pself, PyObject* arg) { } // The private constructor of RepeatedCompositeContainer objects. -RepeatedCompositeContainer *NewContainer( - CMessage* parent, - const FieldDescriptor* parent_field_descriptor, +RepeatedCompositeContainer* NewContainer( + CMessage* parent, const FieldDescriptor* parent_field_descriptor, CMessageClass* child_message_class) { if (!CheckFieldBelongsToMessage(parent_field_descriptor, parent->message)) { return nullptr; @@ -525,9 +515,9 @@ static PySequenceMethods SqMethods = { }; static PyMappingMethods MpMethods = { - Length, /* mp_length */ - SubscriptMethod, /* mp_subscript */ - AssignSubscriptMethod, /* mp_ass_subscript */ + Length, /* mp_length */ + SubscriptMethod, /* mp_subscript */ + AssignSubscriptMethod, /* mp_ass_subscript */ }; static PyMethodDef Methods[] = { @@ -555,14 +545,14 @@ static PyMethodDef Methods[] = { PyTypeObject RepeatedCompositeContainer_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME - ".RepeatedCompositeContainer", // tp_name - sizeof(RepeatedCompositeContainer), // tp_basicsize - 0, // tp_itemsize - repeated_composite_container::Dealloc, // tp_dealloc + ".RepeatedCompositeContainer", // tp_name + sizeof(RepeatedCompositeContainer), // tp_basicsize + 0, // tp_itemsize + repeated_composite_container::Dealloc, // tp_dealloc #if PY_VERSION_HEX >= 0x03080000 - 0, // tp_vectorcall_offset + 0, // tp_vectorcall_offset #else - nullptr, // tp_print + nullptr, // tp_print #endif nullptr, // tp_getattr nullptr, // tp_setattr diff --git a/windows/python/google/protobuf/pyext/repeated_composite_container.h b/windows/python/google/protobuf/pyext/repeated_composite_container.h index e241827ef..6fa6e176f 100644 --- a/windows/python/google/protobuf/pyext/repeated_composite_container.h +++ b/windows/python/google/protobuf/pyext/repeated_composite_container.h @@ -34,12 +34,9 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__ +#define PY_SSIZE_T_CLEAN #include -#include -#include -#include - #include namespace google { diff --git a/windows/python/google/protobuf/pyext/repeated_scalar_container.cc b/windows/python/google/protobuf/pyext/repeated_scalar_container.cc index 4b6d12a9f..f4a8df2c4 100644 --- a/windows/python/google/protobuf/pyext/repeated_scalar_container.cc +++ b/windows/python/google/protobuf/pyext/repeated_scalar_container.cc @@ -274,6 +274,11 @@ static PyObject* Subscript(PyObject* pself, PyObject* slice) { bool return_list = false; if (PyLong_Check(slice)) { from = to = PyLong_AsLong(slice); + } else if (PyIndex_Check(slice)) { + from = to = PyNumber_AsSsize_t(slice, PyExc_ValueError); + if (from == -1 && PyErr_Occurred()) { + return nullptr; + } } else if (PySlice_Check(slice)) { length = Len(pself); if (PySlice_GetIndicesEx(slice, length, &from, &to, &step, &slicelength) == diff --git a/windows/python/google/protobuf/pyext/repeated_scalar_container.h b/windows/python/google/protobuf/pyext/repeated_scalar_container.h index f9f0ea8f3..67423ab4c 100644 --- a/windows/python/google/protobuf/pyext/repeated_scalar_container.h +++ b/windows/python/google/protobuf/pyext/repeated_scalar_container.h @@ -34,10 +34,9 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__ +#define PY_SSIZE_T_CLEAN #include -#include - #include #include diff --git a/windows/python/google/protobuf/pyext/scoped_pyobject_ptr.h b/windows/python/google/protobuf/pyext/scoped_pyobject_ptr.h index 6f7fc2981..ad3fa9462 100644 --- a/windows/python/google/protobuf/pyext/scoped_pyobject_ptr.h +++ b/windows/python/google/protobuf/pyext/scoped_pyobject_ptr.h @@ -35,6 +35,7 @@ #include +#define PY_SSIZE_T_CLEAN #include namespace google { namespace protobuf { @@ -47,7 +48,7 @@ class ScopedPythonPtr { public: // Takes the ownership of the specified object to ScopedPythonPtr. // The reference count of the specified py_object is not incremented. - explicit ScopedPythonPtr(PyObjectStruct* py_object = NULL) + explicit ScopedPythonPtr(PyObjectStruct* py_object = nullptr) : ptr_(py_object) {} // If a PyObject is owned, decrement its reference count. @@ -59,7 +60,7 @@ class ScopedPythonPtr { // This function must be called with a reference that you own. // this->reset(this->get()) is wrong! // this->reset(this->release()) is OK. - PyObjectStruct* reset(PyObjectStruct* p = NULL) { + PyObjectStruct* reset(PyObjectStruct* p = nullptr) { Py_XDECREF(ptr_); ptr_ = p; return ptr_; @@ -69,7 +70,7 @@ class ScopedPythonPtr { // The caller now owns the returned reference. PyObjectStruct* release() { PyObject* p = ptr_; - ptr_ = NULL; + ptr_ = nullptr; return p; } diff --git a/windows/python/google/protobuf/pyext/unknown_field_set.cc b/windows/python/google/protobuf/pyext/unknown_field_set.cc new file mode 100644 index 000000000..42f9bbcb0 --- /dev/null +++ b/windows/python/google/protobuf/pyext/unknown_field_set.cc @@ -0,0 +1,355 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#define PY_SSIZE_T_CLEAN +#include + +#include +#include + +#include +#include +#include +#include +#include + +namespace google { +namespace protobuf { +namespace python { + +namespace unknown_field_set { + +static Py_ssize_t Len(PyObject* pself) { + PyUnknownFieldSet* self = reinterpret_cast(pself); + if (self->fields == nullptr) { + PyErr_Format(PyExc_ValueError, "UnknownFieldSet does not exist. "); + return -1; + } + return self->fields->field_count(); +} + +PyObject* NewPyUnknownField(PyUnknownFieldSet* parent, Py_ssize_t index); + +static PyObject* Item(PyObject* pself, Py_ssize_t index) { + PyUnknownFieldSet* self = reinterpret_cast(pself); + if (self->fields == nullptr) { + PyErr_Format(PyExc_ValueError, "UnknownFieldSet does not exist. "); + return nullptr; + } + Py_ssize_t total_size = self->fields->field_count(); + if (index < 0) { + index = total_size + index; + } + if (index < 0 || index >= total_size) { + PyErr_Format(PyExc_IndexError, "index (%zd) out of range", index); + return nullptr; + } + return unknown_field_set::NewPyUnknownField(self, index); +} + +PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { + if (args == nullptr || PyTuple_Size(args) != 1) { + PyErr_SetString(PyExc_TypeError, + "Must provide a message to create UnknownFieldSet"); + return nullptr; + } + + PyObject* c_message; + if (!PyArg_ParseTuple(args, "O", &c_message)) { + PyErr_SetString(PyExc_TypeError, + "Must provide a message to create UnknownFieldSet"); + return nullptr; + } + + if (!PyObject_TypeCheck(c_message, CMessage_Type)) { + PyErr_Format(PyExc_TypeError, + "Parameter to UnknownFieldSet() must be a message " + "got %s.", + Py_TYPE(c_message)->tp_name); + return nullptr; + } + + PyUnknownFieldSet* self = reinterpret_cast( + PyType_GenericAlloc(&PyUnknownFieldSet_Type, 0)); + if (self == nullptr) { + return nullptr; + } + + // Top UnknownFieldSet should set parent nullptr. + self->parent = nullptr; + + // Copy c_message's UnknownFieldSet. + Message* message = reinterpret_cast(c_message)->message; + const Reflection* reflection = message->GetReflection(); + self->fields = new google::protobuf::UnknownFieldSet; + self->fields->MergeFrom(reflection->GetUnknownFields(*message)); + return reinterpret_cast(self); +} + +PyObject* NewPyUnknownField(PyUnknownFieldSet* parent, Py_ssize_t index) { + PyUnknownField* self = reinterpret_cast( + PyType_GenericAlloc(&PyUnknownField_Type, 0)); + if (self == nullptr) { + return nullptr; + } + + Py_INCREF(parent); + self->parent = parent; + self->index = index; + + return reinterpret_cast(self); +} + +static void Dealloc(PyObject* pself) { + PyUnknownFieldSet* self = reinterpret_cast(pself); + if (self->parent == nullptr) { + delete self->fields; + } else { + Py_CLEAR(self->parent); + } + auto* py_type = Py_TYPE(pself); + self->~PyUnknownFieldSet(); + py_type->tp_free(pself); +} + +static PySequenceMethods SqMethods = { + Len, /* sq_length */ + nullptr, /* sq_concat */ + nullptr, /* sq_repeat */ + Item, /* sq_item */ + nullptr, /* sq_slice */ + nullptr, /* sq_ass_item */ +}; + +} // namespace unknown_field_set + +PyTypeObject PyUnknownFieldSet_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".PyUnknownFieldSet", // tp_name + sizeof(PyUnknownFieldSet), // tp_basicsize + 0, // tp_itemsize + unknown_field_set::Dealloc, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + &unknown_field_set::SqMethods, // tp_as_sequence + nullptr, // tp_as_mapping + PyObject_HashNotImplemented, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "unknown field set", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init + nullptr, // tp_alloc + unknown_field_set::New, // tp_new +}; + +namespace unknown_field { +static PyObject* PyUnknownFieldSet_FromUnknownFieldSet( + PyUnknownFieldSet* parent, const UnknownFieldSet& fields) { + PyUnknownFieldSet* self = reinterpret_cast( + PyType_GenericAlloc(&PyUnknownFieldSet_Type, 0)); + if (self == nullptr) { + return nullptr; + } + + Py_INCREF(parent); + self->parent = parent; + self->fields = const_cast(&fields); + + return reinterpret_cast(self); +} + +const UnknownField* GetUnknownField(PyUnknownField* self) { + const UnknownFieldSet* fields = self->parent->fields; + if (fields == nullptr) { + PyErr_Format(PyExc_ValueError, "UnknownField does not exist. "); + return nullptr; + } + Py_ssize_t total_size = fields->field_count(); + if (self->index >= total_size) { + PyErr_Format(PyExc_ValueError, "UnknownField does not exist. "); + return nullptr; + } + return &fields->field(self->index); +} + +static PyObject* GetFieldNumber(PyUnknownField* self, void* closure) { + const UnknownField* unknown_field = GetUnknownField(self); + if (unknown_field == nullptr) { + return nullptr; + } + return PyLong_FromLong(unknown_field->number()); +} + +using internal::WireFormatLite; +static PyObject* GetWireType(PyUnknownField* self, void* closure) { + const UnknownField* unknown_field = GetUnknownField(self); + if (unknown_field == nullptr) { + return nullptr; + } + + // Assign a default value to suppress may-uninitialized warnings (errors + // when built in some places). + WireFormatLite::WireType wire_type = WireFormatLite::WIRETYPE_VARINT; + switch (unknown_field->type()) { + case UnknownField::TYPE_VARINT: + wire_type = WireFormatLite::WIRETYPE_VARINT; + break; + case UnknownField::TYPE_FIXED32: + wire_type = WireFormatLite::WIRETYPE_FIXED32; + break; + case UnknownField::TYPE_FIXED64: + wire_type = WireFormatLite::WIRETYPE_FIXED64; + break; + case UnknownField::TYPE_LENGTH_DELIMITED: + wire_type = WireFormatLite::WIRETYPE_LENGTH_DELIMITED; + break; + case UnknownField::TYPE_GROUP: + wire_type = WireFormatLite::WIRETYPE_START_GROUP; + break; + } + return PyLong_FromLong(wire_type); +} + +static PyObject* GetData(PyUnknownField* self, void* closure) { + const UnknownField* field = GetUnknownField(self); + if (field == nullptr) { + return nullptr; + } + PyObject* data = nullptr; + switch (field->type()) { + case UnknownField::TYPE_VARINT: + data = PyLong_FromUnsignedLongLong(field->varint()); + break; + case UnknownField::TYPE_FIXED32: + data = PyLong_FromUnsignedLong(field->fixed32()); + break; + case UnknownField::TYPE_FIXED64: + data = PyLong_FromUnsignedLongLong(field->fixed64()); + break; + case UnknownField::TYPE_LENGTH_DELIMITED: + data = PyBytes_FromStringAndSize(field->length_delimited().data(), + field->GetLengthDelimitedSize()); + break; + case UnknownField::TYPE_GROUP: + data = + PyUnknownFieldSet_FromUnknownFieldSet(self->parent, field->group()); + break; + } + return data; +} + +static void Dealloc(PyObject* pself) { + PyUnknownField* self = reinterpret_cast(pself); + Py_CLEAR(self->parent); +} + +static PyGetSetDef Getters[] = { + {"field_number", (getter)GetFieldNumber, nullptr}, + {"wire_type", (getter)GetWireType, nullptr}, + {"data", (getter)GetData, nullptr}, + {nullptr}, +}; + +} // namespace unknown_field + +PyTypeObject PyUnknownField_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".PyUnknownField", // tp_name + sizeof(PyUnknownField), // tp_basicsize + 0, // tp_itemsize + unknown_field::Dealloc, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + PyObject_HashNotImplemented, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "unknown field", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members + unknown_field::Getters, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init +}; + +} // namespace python +} // namespace protobuf +} // namespace google diff --git a/windows/python/google/protobuf/pyext/unknown_field_set.h b/windows/python/google/protobuf/pyext/unknown_field_set.h new file mode 100644 index 000000000..3fa764d01 --- /dev/null +++ b/windows/python/google/protobuf/pyext/unknown_field_set.h @@ -0,0 +1,78 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__ +#define GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__ + +#define PY_SSIZE_T_CLEAN +#include + +#include +#include + +#include + +namespace google { +namespace protobuf { + +class UnknownField; +class UnknownFieldSet; + +namespace python { +struct CMessage; + +struct PyUnknownFieldSet { + PyObject_HEAD; + // If parent is nullptr, it is a top UnknownFieldSet. + PyUnknownFieldSet* parent; + + // Top UnknownFieldSet owns fields pointer. Sub UnknownFieldSet + // does not own fields pointer. + UnknownFieldSet* fields; +}; + +struct PyUnknownField { + PyObject_HEAD; + // Every Python PyUnknownField holds a reference to its parent + // PyUnknownFieldSet in order to keep it alive. + PyUnknownFieldSet* parent; + + // The UnknownField index in UnknownFieldSet. + Py_ssize_t index; +}; + +extern PyTypeObject PyUnknownFieldSet_Type; +extern PyTypeObject PyUnknownField_Type; + +} // namespace python +} // namespace protobuf +} // namespace google + +#endif // GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__ diff --git a/windows/python/google/protobuf/pyext/unknown_fields.cc b/windows/python/google/protobuf/pyext/unknown_fields.cc index 7f4fb23ed..dcd63b2e2 100644 --- a/windows/python/google/protobuf/pyext/unknown_fields.cc +++ b/windows/python/google/protobuf/pyext/unknown_fields.cc @@ -30,6 +30,7 @@ #include +#define PY_SSIZE_T_CLEAN #include #include #include @@ -49,7 +50,7 @@ namespace unknown_fields { static Py_ssize_t Len(PyObject* pself) { PyUnknownFields* self = reinterpret_cast(pself); - if (self->fields == NULL) { + if (self->fields == nullptr) { PyErr_Format(PyExc_ValueError, "UnknownFields does not exist. " "The parent message might be cleared."); @@ -64,7 +65,7 @@ void Clear(PyUnknownFields* self) { it != self->sub_unknown_fields.end(); it++) { Clear(*it); } - self->fields = NULL; + self->fields = nullptr; self->sub_unknown_fields.clear(); } @@ -74,11 +75,11 @@ PyObject* NewPyUnknownFieldRef(PyUnknownFields* parent, static PyObject* Item(PyObject* pself, Py_ssize_t index) { PyUnknownFields* self = reinterpret_cast(pself); - if (self->fields == NULL) { + if (self->fields == nullptr) { PyErr_Format(PyExc_ValueError, "UnknownFields does not exist. " "The parent message might be cleared."); - return NULL; + return nullptr; } Py_ssize_t total_size = self->fields->field_count(); if (index < 0) { @@ -88,7 +89,7 @@ static PyObject* Item(PyObject* pself, Py_ssize_t index) { PyErr_Format(PyExc_IndexError, "index (%zd) out of range", index); - return NULL; + return nullptr; } return unknown_fields::NewPyUnknownFieldRef(self, index); @@ -97,8 +98,8 @@ static PyObject* Item(PyObject* pself, Py_ssize_t index) { PyObject* NewPyUnknownFields(CMessage* c_message) { PyUnknownFields* self = reinterpret_cast( PyType_GenericAlloc(&PyUnknownFields_Type, 0)); - if (self == NULL) { - return NULL; + if (self == nullptr) { + return nullptr; } // Call "placement new" to initialize PyUnknownFields. new (self) PyUnknownFields; @@ -116,8 +117,8 @@ PyObject* NewPyUnknownFieldRef(PyUnknownFields* parent, Py_ssize_t index) { PyUnknownFieldRef* self = reinterpret_cast( PyType_GenericAlloc(&PyUnknownFieldRef_Type, 0)); - if (self == NULL) { - return NULL; + if (self == nullptr) { + return nullptr; } Py_INCREF(parent); @@ -137,58 +138,63 @@ static void Dealloc(PyObject* pself) { reinterpret_cast(self->parent)->unknown_field_set = nullptr; } Py_CLEAR(self->parent); + auto* py_type = Py_TYPE(pself); self->~PyUnknownFields(); - Py_TYPE(pself)->tp_free(pself); + py_type->tp_free(pself); } static PySequenceMethods SqMethods = { - Len, /* sq_length */ - 0, /* sq_concat */ - 0, /* sq_repeat */ - Item, /* sq_item */ - 0, /* sq_slice */ - 0, /* sq_ass_item */ + Len, /* sq_length */ + nullptr, /* sq_concat */ + nullptr, /* sq_repeat */ + Item, /* sq_item */ + nullptr, /* sq_slice */ + nullptr, /* sq_ass_item */ }; } // namespace unknown_fields PyTypeObject PyUnknownFields_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".PyUnknownFields", // tp_name - sizeof(PyUnknownFields), // tp_basicsize - 0, // tp_itemsize - unknown_fields::Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - &unknown_fields::SqMethods, // tp_as_sequence - 0, // tp_as_mapping - PyObject_HashNotImplemented, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "unknown field set", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - 0, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".PyUnknownFields", // tp_name + sizeof(PyUnknownFields), // tp_basicsize + 0, // tp_itemsize + unknown_fields::Dealloc, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + &unknown_fields::SqMethods, // tp_as_sequence + nullptr, // tp_as_mapping + PyObject_HashNotImplemented, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "unknown field set", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init }; namespace unknown_field { @@ -196,8 +202,8 @@ static PyObject* PyUnknownFields_FromUnknownFieldSet( PyUnknownFields* parent, const UnknownFieldSet& fields) { PyUnknownFields* self = reinterpret_cast( PyType_GenericAlloc(&PyUnknownFields_Type, 0)); - if (self == NULL) { - return NULL; + if (self == nullptr) { + return nullptr; } // Call "placement new" to initialize PyUnknownFields. new (self) PyUnknownFields; @@ -212,26 +218,26 @@ static PyObject* PyUnknownFields_FromUnknownFieldSet( const UnknownField* GetUnknownField(PyUnknownFieldRef* self) { const UnknownFieldSet* fields = self->parent->fields; - if (fields == NULL) { + if (fields == nullptr) { PyErr_Format(PyExc_ValueError, "UnknownField does not exist. " "The parent message might be cleared."); - return NULL; + return nullptr; } - ssize_t total_size = fields->field_count(); + Py_ssize_t total_size = fields->field_count(); if (self->index >= total_size) { PyErr_Format(PyExc_ValueError, "UnknownField does not exist. " "The parent message might be cleared."); - return NULL; + return nullptr; } return &fields->field(self->index); } static PyObject* GetFieldNumber(PyUnknownFieldRef* self, void *closure) { const UnknownField* unknown_field = GetUnknownField(self); - if (unknown_field == NULL) { - return NULL; + if (unknown_field == nullptr) { + return nullptr; } return PyLong_FromLong(unknown_field->number()); } @@ -239,8 +245,8 @@ static PyObject* GetFieldNumber(PyUnknownFieldRef* self, void *closure) { using internal::WireFormatLite; static PyObject* GetWireType(PyUnknownFieldRef* self, void *closure) { const UnknownField* unknown_field = GetUnknownField(self); - if (unknown_field == NULL) { - return NULL; + if (unknown_field == nullptr) { + return nullptr; } // Assign a default value to suppress may-uninitialized warnings (errors @@ -268,19 +274,19 @@ static PyObject* GetWireType(PyUnknownFieldRef* self, void *closure) { static PyObject* GetData(PyUnknownFieldRef* self, void *closure) { const UnknownField* field = GetUnknownField(self); - if (field == NULL) { - return NULL; + if (field == nullptr) { + return nullptr; } - PyObject* data = NULL; + PyObject* data = nullptr; switch (field->type()) { case UnknownField::TYPE_VARINT: - data = PyLong_FromLong(field->varint()); + data = PyLong_FromUnsignedLongLong(field->varint()); break; case UnknownField::TYPE_FIXED32: - data = PyLong_FromLong(field->fixed32()); + data = PyLong_FromUnsignedLong(field->fixed32()); break; case UnknownField::TYPE_FIXED64: - data = PyLong_FromLong(field->fixed64()); + data = PyLong_FromUnsignedLongLong(field->fixed64()); break; case UnknownField::TYPE_LENGTH_DELIMITED: data = PyBytes_FromStringAndSize(field->length_delimited().data(), @@ -301,54 +307,57 @@ static void Dealloc(PyObject* pself) { } static PyGetSetDef Getters[] = { - {"field_number", (getter)GetFieldNumber, NULL}, - {"wire_type", (getter)GetWireType, NULL}, - {"data", (getter)GetData, NULL}, - {NULL} + {"field_number", (getter)GetFieldNumber, nullptr}, + {"wire_type", (getter)GetWireType, nullptr}, + {"data", (getter)GetData, nullptr}, + {nullptr}, }; } // namespace unknown_field PyTypeObject PyUnknownFieldRef_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".PyUnknownFieldRef", // tp_name - sizeof(PyUnknownFieldRef), // tp_basicsize - 0, // tp_itemsize - unknown_field::Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - 0, // tp_as_mapping - PyObject_HashNotImplemented, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "unknown field", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - 0, // tp_methods - 0, // tp_members - unknown_field::Getters, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init + PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME + ".PyUnknownFieldRef", // tp_name + sizeof(PyUnknownFieldRef), // tp_basicsize + 0, // tp_itemsize + unknown_field::Dealloc, // tp_dealloc +#if PY_VERSION_HEX < 0x03080000 + nullptr, // tp_print +#else + 0, // tp_vectorcall_offset +#endif + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence + nullptr, // tp_as_mapping + PyObject_HashNotImplemented, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "unknown field", // tp_doc + nullptr, // tp_traverse + nullptr, // tp_clear + nullptr, // tp_richcompare + 0, // tp_weaklistoffset + nullptr, // tp_iter + nullptr, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members + unknown_field::Getters, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set + 0, // tp_dictoffset + nullptr, // tp_init }; - } // namespace python } // namespace protobuf } // namespace google diff --git a/windows/python/google/protobuf/pyext/unknown_fields.h b/windows/python/google/protobuf/pyext/unknown_fields.h index 94d55e148..e7b0b35c4 100644 --- a/windows/python/google/protobuf/pyext/unknown_fields.h +++ b/windows/python/google/protobuf/pyext/unknown_fields.h @@ -31,6 +31,7 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__ #define GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__ +#define PY_SSIZE_T_CLEAN #include #include diff --git a/windows/python/google/protobuf/python_protobuf.h b/windows/python/google/protobuf/python_protobuf.h index 8db1ffb75..4fcf06540 100644 --- a/windows/python/google/protobuf/python_protobuf.h +++ b/windows/python/google/protobuf/python_protobuf.h @@ -36,6 +36,7 @@ #ifndef GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__ #define GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__ +#define PY_SSIZE_T_CLEAN #include namespace google { diff --git a/windows/python/google/protobuf/service_reflection.py b/windows/python/google/protobuf/service_reflection.py index 75c51ff32..f82ab7145 100644 --- a/windows/python/google/protobuf/service_reflection.py +++ b/windows/python/google/protobuf/service_reflection.py @@ -133,7 +133,7 @@ class _ServiceBuilder(object): """ self.descriptor = service_descriptor - def BuildService(self, cls): + def BuildService(builder, cls): """Constructs the service class. Args: @@ -143,18 +143,26 @@ class _ServiceBuilder(object): # CallMethod needs to operate with an instance of the Service class. This # internal wrapper function exists only to be able to pass the service # instance to the method that does the real CallMethod work. - def _WrapCallMethod(srvc, method_descriptor, - rpc_controller, request, callback): - return self._CallMethod(srvc, method_descriptor, - rpc_controller, request, callback) - self.cls = cls + # Making sure to use exact argument names from the abstract interface in + # service.py to match the type signature + def _WrapCallMethod(self, method_descriptor, rpc_controller, request, done): + return builder._CallMethod(self, method_descriptor, rpc_controller, + request, done) + + def _WrapGetRequestClass(self, method_descriptor): + return builder._GetRequestClass(method_descriptor) + + def _WrapGetResponseClass(self, method_descriptor): + return builder._GetResponseClass(method_descriptor) + + builder.cls = cls cls.CallMethod = _WrapCallMethod - cls.GetDescriptor = staticmethod(lambda: self.descriptor) - cls.GetDescriptor.__doc__ = "Returns the service descriptor." - cls.GetRequestClass = self._GetRequestClass - cls.GetResponseClass = self._GetResponseClass - for method in self.descriptor.methods: - setattr(cls, method.name, self._GenerateNonImplementedMethod(method)) + cls.GetDescriptor = staticmethod(lambda: builder.descriptor) + cls.GetDescriptor.__doc__ = 'Returns the service descriptor.' + cls.GetRequestClass = _WrapGetRequestClass + cls.GetResponseClass = _WrapGetResponseClass + for method in builder.descriptor.methods: + setattr(cls, method.name, builder._GenerateNonImplementedMethod(method)) def _CallMethod(self, srvc, method_descriptor, rpc_controller, request, callback): diff --git a/windows/python/google/protobuf/source_context_pb2.py b/windows/python/google/protobuf/source_context_pb2.py index e2a03753d..30cca2e06 100644 --- a/windows/python/google/protobuf/source_context_pb2.py +++ b/windows/python/google/protobuf/source_context_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/source_context.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,16 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$google/protobuf/source_context.proto\x12\x0fgoogle.protobuf\"\"\n\rSourceContext\x12\x11\n\tfile_name\x18\x01 \x01(\tB\x8a\x01\n\x13\x63om.google.protobufB\x12SourceContextProtoP\x01Z6google.golang.org/protobuf/types/known/sourcecontextpb\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3') - - -_SOURCECONTEXT = DESCRIPTOR.message_types_by_name['SourceContext'] -SourceContext = _reflection.GeneratedProtocolMessageType('SourceContext', (_message.Message,), { - 'DESCRIPTOR' : _SOURCECONTEXT, - '__module__' : 'google.protobuf.source_context_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.SourceContext) - }) -_sym_db.RegisterMessage(SourceContext) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.source_context_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/struct_pb2.py b/windows/python/google/protobuf/struct_pb2.py index 9285b3e63..149728ca0 100644 --- a/windows/python/google/protobuf/struct_pb2.py +++ b/windows/python/google/protobuf/struct_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/struct.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,44 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cgoogle/protobuf/struct.proto\x12\x0fgoogle.protobuf\"\x84\x01\n\x06Struct\x12\x33\n\x06\x66ields\x18\x01 \x03(\x0b\x32#.google.protobuf.Struct.FieldsEntry\x1a\x45\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"\xea\x01\n\x05Value\x12\x30\n\nnull_value\x18\x01 \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12\x16\n\x0cnumber_value\x18\x02 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x04 \x01(\x08H\x00\x12/\n\x0cstruct_value\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x30\n\nlist_value\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.ListValueH\x00\x42\x06\n\x04kind\"3\n\tListValue\x12&\n\x06values\x18\x01 \x03(\x0b\x32\x16.google.protobuf.Value*\x1b\n\tNullValue\x12\x0e\n\nNULL_VALUE\x10\x00\x42\x7f\n\x13\x63om.google.protobufB\x0bStructProtoP\x01Z/google.golang.org/protobuf/types/known/structpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3') -_NULLVALUE = DESCRIPTOR.enum_types_by_name['NullValue'] -NullValue = enum_type_wrapper.EnumTypeWrapper(_NULLVALUE) -NULL_VALUE = 0 - - -_STRUCT = DESCRIPTOR.message_types_by_name['Struct'] -_STRUCT_FIELDSENTRY = _STRUCT.nested_types_by_name['FieldsEntry'] -_VALUE = DESCRIPTOR.message_types_by_name['Value'] -_LISTVALUE = DESCRIPTOR.message_types_by_name['ListValue'] -Struct = _reflection.GeneratedProtocolMessageType('Struct', (_message.Message,), { - - 'FieldsEntry' : _reflection.GeneratedProtocolMessageType('FieldsEntry', (_message.Message,), { - 'DESCRIPTOR' : _STRUCT_FIELDSENTRY, - '__module__' : 'google.protobuf.struct_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Struct.FieldsEntry) - }) - , - 'DESCRIPTOR' : _STRUCT, - '__module__' : 'google.protobuf.struct_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Struct) - }) -_sym_db.RegisterMessage(Struct) -_sym_db.RegisterMessage(Struct.FieldsEntry) - -Value = _reflection.GeneratedProtocolMessageType('Value', (_message.Message,), { - 'DESCRIPTOR' : _VALUE, - '__module__' : 'google.protobuf.struct_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Value) - }) -_sym_db.RegisterMessage(Value) - -ListValue = _reflection.GeneratedProtocolMessageType('ListValue', (_message.Message,), { - 'DESCRIPTOR' : _LISTVALUE, - '__module__' : 'google.protobuf.struct_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.ListValue) - }) -_sym_db.RegisterMessage(ListValue) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.struct_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/test_messages_proto2_pb2.py b/windows/python/google/protobuf/test_messages_proto2_pb2.py index 9c07cad42..5f3686f00 100644 --- a/windows/python/google/protobuf/test_messages_proto2_pb2.py +++ b/windows/python/google/protobuf/test_messages_proto2_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/test_messages_proto2.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -15,284 +13,10 @@ _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*google/protobuf/test_messages_proto2.proto\x12\x1dprotobuf_test_messages.proto2\"\xa4>\n\x12TestAllTypesProto2\x12\x16\n\x0eoptional_int32\x18\x01 \x01(\x05\x12\x16\n\x0eoptional_int64\x18\x02 \x01(\x03\x12\x17\n\x0foptional_uint32\x18\x03 \x01(\r\x12\x17\n\x0foptional_uint64\x18\x04 \x01(\x04\x12\x17\n\x0foptional_sint32\x18\x05 \x01(\x11\x12\x17\n\x0foptional_sint64\x18\x06 \x01(\x12\x12\x18\n\x10optional_fixed32\x18\x07 \x01(\x07\x12\x18\n\x10optional_fixed64\x18\x08 \x01(\x06\x12\x19\n\x11optional_sfixed32\x18\t \x01(\x0f\x12\x19\n\x11optional_sfixed64\x18\n \x01(\x10\x12\x16\n\x0eoptional_float\x18\x0b \x01(\x02\x12\x17\n\x0foptional_double\x18\x0c \x01(\x01\x12\x15\n\roptional_bool\x18\r \x01(\x08\x12\x17\n\x0foptional_string\x18\x0e \x01(\t\x12\x16\n\x0eoptional_bytes\x18\x0f \x01(\x0c\x12`\n\x17optional_nested_message\x18\x12 \x01(\x0b\x32?.protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage\x12U\n\x18optional_foreign_message\x18\x13 \x01(\x0b\x32\x33.protobuf_test_messages.proto2.ForeignMessageProto2\x12Z\n\x14optional_nested_enum\x18\x15 \x01(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum\x12O\n\x15optional_foreign_enum\x18\x16 \x01(\x0e\x32\x30.protobuf_test_messages.proto2.ForeignEnumProto2\x12!\n\x15optional_string_piece\x18\x18 \x01(\tB\x02\x08\x02\x12\x19\n\roptional_cord\x18\x19 \x01(\tB\x02\x08\x01\x12L\n\x11recursive_message\x18\x1b \x01(\x0b\x32\x31.protobuf_test_messages.proto2.TestAllTypesProto2\x12\x16\n\x0erepeated_int32\x18\x1f \x03(\x05\x12\x16\n\x0erepeated_int64\x18 \x03(\x03\x12\x17\n\x0frepeated_uint32\x18! \x03(\r\x12\x17\n\x0frepeated_uint64\x18\" \x03(\x04\x12\x17\n\x0frepeated_sint32\x18# \x03(\x11\x12\x17\n\x0frepeated_sint64\x18$ \x03(\x12\x12\x18\n\x10repeated_fixed32\x18% \x03(\x07\x12\x18\n\x10repeated_fixed64\x18& \x03(\x06\x12\x19\n\x11repeated_sfixed32\x18\' \x03(\x0f\x12\x19\n\x11repeated_sfixed64\x18( \x03(\x10\x12\x16\n\x0erepeated_float\x18) \x03(\x02\x12\x17\n\x0frepeated_double\x18* \x03(\x01\x12\x15\n\rrepeated_bool\x18+ \x03(\x08\x12\x17\n\x0frepeated_string\x18, \x03(\t\x12\x16\n\x0erepeated_bytes\x18- \x03(\x0c\x12`\n\x17repeated_nested_message\x18\x30 \x03(\x0b\x32?.protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage\x12U\n\x18repeated_foreign_message\x18\x31 \x03(\x0b\x32\x33.protobuf_test_messages.proto2.ForeignMessageProto2\x12Z\n\x14repeated_nested_enum\x18\x33 \x03(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum\x12O\n\x15repeated_foreign_enum\x18\x34 \x03(\x0e\x32\x30.protobuf_test_messages.proto2.ForeignEnumProto2\x12!\n\x15repeated_string_piece\x18\x36 \x03(\tB\x02\x08\x02\x12\x19\n\rrepeated_cord\x18\x37 \x03(\tB\x02\x08\x01\x12\x18\n\x0cpacked_int32\x18K \x03(\x05\x42\x02\x10\x01\x12\x18\n\x0cpacked_int64\x18L \x03(\x03\x42\x02\x10\x01\x12\x19\n\rpacked_uint32\x18M \x03(\rB\x02\x10\x01\x12\x19\n\rpacked_uint64\x18N \x03(\x04\x42\x02\x10\x01\x12\x19\n\rpacked_sint32\x18O \x03(\x11\x42\x02\x10\x01\x12\x19\n\rpacked_sint64\x18P \x03(\x12\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed32\x18Q \x03(\x07\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed64\x18R \x03(\x06\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed32\x18S \x03(\x0f\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed64\x18T \x03(\x10\x42\x02\x10\x01\x12\x18\n\x0cpacked_float\x18U \x03(\x02\x42\x02\x10\x01\x12\x19\n\rpacked_double\x18V \x03(\x01\x42\x02\x10\x01\x12\x17\n\x0bpacked_bool\x18W \x03(\x08\x42\x02\x10\x01\x12\\\n\x12packed_nested_enum\x18X \x03(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnumB\x02\x10\x01\x12\x1a\n\x0eunpacked_int32\x18Y \x03(\x05\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_int64\x18Z \x03(\x03\x42\x02\x10\x00\x12\x1b\n\x0funpacked_uint32\x18[ \x03(\rB\x02\x10\x00\x12\x1b\n\x0funpacked_uint64\x18\\ \x03(\x04\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint32\x18] \x03(\x11\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint64\x18^ \x03(\x12\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed32\x18_ \x03(\x07\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed64\x18` \x03(\x06\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed32\x18\x61 \x03(\x0f\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed64\x18\x62 \x03(\x10\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_float\x18\x63 \x03(\x02\x42\x02\x10\x00\x12\x1b\n\x0funpacked_double\x18\x64 \x03(\x01\x42\x02\x10\x00\x12\x19\n\runpacked_bool\x18\x65 \x03(\x08\x42\x02\x10\x00\x12^\n\x14unpacked_nested_enum\x18\x66 \x03(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnumB\x02\x10\x00\x12]\n\x0fmap_int32_int32\x18\x38 \x03(\x0b\x32\x44.protobuf_test_messages.proto2.TestAllTypesProto2.MapInt32Int32Entry\x12]\n\x0fmap_int64_int64\x18\x39 \x03(\x0b\x32\x44.protobuf_test_messages.proto2.TestAllTypesProto2.MapInt64Int64Entry\x12\x61\n\x11map_uint32_uint32\x18: \x03(\x0b\x32\x46.protobuf_test_messages.proto2.TestAllTypesProto2.MapUint32Uint32Entry\x12\x61\n\x11map_uint64_uint64\x18; \x03(\x0b\x32\x46.protobuf_test_messages.proto2.TestAllTypesProto2.MapUint64Uint64Entry\x12\x61\n\x11map_sint32_sint32\x18< \x03(\x0b\x32\x46.protobuf_test_messages.proto2.TestAllTypesProto2.MapSint32Sint32Entry\x12\x61\n\x11map_sint64_sint64\x18= \x03(\x0b\x32\x46.protobuf_test_messages.proto2.TestAllTypesProto2.MapSint64Sint64Entry\x12\x65\n\x13map_fixed32_fixed32\x18> \x03(\x0b\x32H.protobuf_test_messages.proto2.TestAllTypesProto2.MapFixed32Fixed32Entry\x12\x65\n\x13map_fixed64_fixed64\x18? \x03(\x0b\x32H.protobuf_test_messages.proto2.TestAllTypesProto2.MapFixed64Fixed64Entry\x12i\n\x15map_sfixed32_sfixed32\x18@ \x03(\x0b\x32J.protobuf_test_messages.proto2.TestAllTypesProto2.MapSfixed32Sfixed32Entry\x12i\n\x15map_sfixed64_sfixed64\x18\x41 \x03(\x0b\x32J.protobuf_test_messages.proto2.TestAllTypesProto2.MapSfixed64Sfixed64Entry\x12]\n\x0fmap_int32_float\x18\x42 \x03(\x0b\x32\x44.protobuf_test_messages.proto2.TestAllTypesProto2.MapInt32FloatEntry\x12_\n\x10map_int32_double\x18\x43 \x03(\x0b\x32\x45.protobuf_test_messages.proto2.TestAllTypesProto2.MapInt32DoubleEntry\x12Y\n\rmap_bool_bool\x18\x44 \x03(\x0b\x32\x42.protobuf_test_messages.proto2.TestAllTypesProto2.MapBoolBoolEntry\x12\x61\n\x11map_string_string\x18\x45 \x03(\x0b\x32\x46.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringStringEntry\x12_\n\x10map_string_bytes\x18\x46 \x03(\x0b\x32\x45.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringBytesEntry\x12p\n\x19map_string_nested_message\x18G \x03(\x0b\x32M.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringNestedMessageEntry\x12r\n\x1amap_string_foreign_message\x18H \x03(\x0b\x32N.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringForeignMessageEntry\x12j\n\x16map_string_nested_enum\x18I \x03(\x0b\x32J.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringNestedEnumEntry\x12l\n\x17map_string_foreign_enum\x18J \x03(\x0b\x32K.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringForeignEnumEntry\x12\x16\n\x0coneof_uint32\x18o \x01(\rH\x00\x12_\n\x14oneof_nested_message\x18p \x01(\x0b\x32?.protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessageH\x00\x12\x16\n\x0coneof_string\x18q \x01(\tH\x00\x12\x15\n\x0boneof_bytes\x18r \x01(\x0cH\x00\x12\x14\n\noneof_bool\x18s \x01(\x08H\x00\x12\x16\n\x0coneof_uint64\x18t \x01(\x04H\x00\x12\x15\n\x0boneof_float\x18u \x01(\x02H\x00\x12\x16\n\x0coneof_double\x18v \x01(\x01H\x00\x12R\n\noneof_enum\x18w \x01(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnumH\x00\x12\x45\n\x04\x64\x61ta\x18\xc9\x01 \x01(\n26.protobuf_test_messages.proto2.TestAllTypesProto2.Data\x12\"\n\rdefault_int32\x18\xf1\x01 \x01(\x05:\n-123456789\x12,\n\rdefault_int64\x18\xf2\x01 \x01(\x03:\x14-9123456789123456789\x12#\n\x0e\x64\x65\x66\x61ult_uint32\x18\xf3\x01 \x01(\r:\n2123456789\x12-\n\x0e\x64\x65\x66\x61ult_uint64\x18\xf4\x01 \x01(\x04:\x14\x31\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x31\x32\x33\x34\x35\x36\x37\x38\x39\x12#\n\x0e\x64\x65\x66\x61ult_sint32\x18\xf5\x01 \x01(\x11:\n-123456789\x12-\n\x0e\x64\x65\x66\x61ult_sint64\x18\xf6\x01 \x01(\x12:\x14-9123456789123456789\x12$\n\x0f\x64\x65\x66\x61ult_fixed32\x18\xf7\x01 \x01(\x07:\n2123456789\x12.\n\x0f\x64\x65\x66\x61ult_fixed64\x18\xf8\x01 \x01(\x06:\x14\x31\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x31\x32\x33\x34\x35\x36\x37\x38\x39\x12%\n\x10\x64\x65\x66\x61ult_sfixed32\x18\xf9\x01 \x01(\x0f:\n-123456789\x12/\n\x10\x64\x65\x66\x61ult_sfixed64\x18\xfa\x01 \x01(\x10:\x14-9123456789123456789\x12\x1d\n\rdefault_float\x18\xfb\x01 \x01(\x02:\x05\x39\x65+09\x12\x1e\n\x0e\x64\x65\x66\x61ult_double\x18\xfc\x01 \x01(\x01:\x05\x37\x65+22\x12\x1b\n\x0c\x64\x65\x66\x61ult_bool\x18\xfd\x01 \x01(\x08:\x04true\x12 \n\x0e\x64\x65\x66\x61ult_string\x18\xfe\x01 \x01(\t:\x07Rosebud\x12\x13\n\nfieldname1\x18\x91\x03 \x01(\x05\x12\x14\n\x0b\x66ield_name2\x18\x92\x03 \x01(\x05\x12\x15\n\x0c_field_name3\x18\x93\x03 \x01(\x05\x12\x16\n\rfield__name4_\x18\x94\x03 \x01(\x05\x12\x14\n\x0b\x66ield0name5\x18\x95\x03 \x01(\x05\x12\x16\n\rfield_0_name6\x18\x96\x03 \x01(\x05\x12\x13\n\nfieldName7\x18\x97\x03 \x01(\x05\x12\x13\n\nFieldName8\x18\x98\x03 \x01(\x05\x12\x14\n\x0b\x66ield_Name9\x18\x99\x03 \x01(\x05\x12\x15\n\x0c\x46ield_Name10\x18\x9a\x03 \x01(\x05\x12\x15\n\x0c\x46IELD_NAME11\x18\x9b\x03 \x01(\x05\x12\x15\n\x0c\x46IELD_name12\x18\x9c\x03 \x01(\x05\x12\x17\n\x0e__field_name13\x18\x9d\x03 \x01(\x05\x12\x17\n\x0e__Field_name14\x18\x9e\x03 \x01(\x05\x12\x16\n\rfield__name15\x18\x9f\x03 \x01(\x05\x12\x16\n\rfield__Name16\x18\xa0\x03 \x01(\x05\x12\x17\n\x0e\x66ield_name17__\x18\xa1\x03 \x01(\x05\x12\x17\n\x0e\x46ield_name18__\x18\xa2\x03 \x01(\x05\x1a\x62\n\rNestedMessage\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\x46\n\x0b\x63orecursive\x18\x02 \x01(\x0b\x32\x31.protobuf_test_messages.proto2.TestAllTypesProto2\x1a\x34\n\x12MapInt32Int32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x34\n\x12MapInt64Int64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x36\n\x14MapUint32Uint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\x1a\x36\n\x14MapUint64Uint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x04:\x02\x38\x01\x1a\x36\n\x14MapSint32Sint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x11\x12\r\n\x05value\x18\x02 \x01(\x11:\x02\x38\x01\x1a\x36\n\x14MapSint64Sint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x12\x12\r\n\x05value\x18\x02 \x01(\x12:\x02\x38\x01\x1a\x38\n\x16MapFixed32Fixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x07\x12\r\n\x05value\x18\x02 \x01(\x07:\x02\x38\x01\x1a\x38\n\x16MapFixed64Fixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x06\x12\r\n\x05value\x18\x02 \x01(\x06:\x02\x38\x01\x1a:\n\x18MapSfixed32Sfixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x0f\x12\r\n\x05value\x18\x02 \x01(\x0f:\x02\x38\x01\x1a:\n\x18MapSfixed64Sfixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x10\x12\r\n\x05value\x18\x02 \x01(\x10:\x02\x38\x01\x1a\x34\n\x12MapInt32FloatEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x1a\x35\n\x13MapInt32DoubleEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x32\n\x10MapBoolBoolEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\x1a\x36\n\x14MapStringStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13MapStringBytesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\x1a~\n\x1bMapStringNestedMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12N\n\x05value\x18\x02 \x01(\x0b\x32?.protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage:\x02\x38\x01\x1as\n\x1cMapStringForeignMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x42\n\x05value\x18\x02 \x01(\x0b\x32\x33.protobuf_test_messages.proto2.ForeignMessageProto2:\x02\x38\x01\x1ax\n\x18MapStringNestedEnumEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12K\n\x05value\x18\x02 \x01(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum:\x02\x38\x01\x1am\n\x19MapStringForeignEnumEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0e\x32\x30.protobuf_test_messages.proto2.ForeignEnumProto2:\x02\x38\x01\x1a\x33\n\x04\x44\x61ta\x12\x14\n\x0bgroup_int32\x18\xca\x01 \x01(\x05\x12\x15\n\x0cgroup_uint32\x18\xcb\x01 \x01(\r\x1a!\n\x11MessageSetCorrect*\x08\x08\x04\x10\xff\xff\xff\xff\x07:\x02\x08\x01\x1a\xe0\x01\n\x1bMessageSetCorrectExtension1\x12\x0b\n\x03str\x18\x19 \x01(\t2\xb3\x01\n\x15message_set_extension\x12\x43.protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrect\x18\xf9\xbb^ \x01(\x0b\x32M.protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1\x1a\xdf\x01\n\x1bMessageSetCorrectExtension2\x12\t\n\x01i\x18\t \x01(\x05\x32\xb4\x01\n\x15message_set_extension\x12\x43.protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrect\x18\x90\xb3\xfc\x01 \x01(\x0b\x32M.protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2\"9\n\nNestedEnum\x12\x07\n\x03\x46OO\x10\x00\x12\x07\n\x03\x42\x41R\x10\x01\x12\x07\n\x03\x42\x41Z\x10\x02\x12\x10\n\x03NEG\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01*\x05\x08x\x10\xc9\x01\x42\r\n\x0boneof_fieldJ\x06\x08\xe8\x07\x10\x90N\"!\n\x14\x46oreignMessageProto2\x12\t\n\x01\x63\x18\x01 \x01(\x05\"\xc1\x02\n\x15UnknownToTestAllTypes\x12\x17\n\x0eoptional_int32\x18\xe9\x07 \x01(\x05\x12\x18\n\x0foptional_string\x18\xea\x07 \x01(\t\x12L\n\x0enested_message\x18\xeb\x07 \x01(\x0b\x32\x33.protobuf_test_messages.proto2.ForeignMessageProto2\x12Z\n\roptionalgroup\x18\xec\x07 \x01(\n2B.protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup\x12\x16\n\roptional_bool\x18\xee\x07 \x01(\x08\x12\x17\n\x0erepeated_int32\x18\xf3\x07 \x03(\x05\x1a\x1a\n\rOptionalGroup\x12\t\n\x01\x61\x18\x01 \x01(\x05\"\x16\n\x14NullHypothesisProto2\"/\n\x0e\x45numOnlyProto2\"\x1d\n\x04\x42ool\x12\n\n\x06kFalse\x10\x00\x12\t\n\x05kTrue\x10\x01*F\n\x11\x46oreignEnumProto2\x12\x0f\n\x0b\x46OREIGN_FOO\x10\x00\x12\x0f\n\x0b\x46OREIGN_BAR\x10\x01\x12\x0f\n\x0b\x46OREIGN_BAZ\x10\x02:J\n\x0f\x65xtension_int32\x12\x31.protobuf_test_messages.proto2.TestAllTypesProto2\x18x \x01(\x05\x42/\n(com.google.protobuf_test_messages.proto2H\x01\xf8\x01\x01') - -_FOREIGNENUMPROTO2 = DESCRIPTOR.enum_types_by_name['ForeignEnumProto2'] -ForeignEnumProto2 = enum_type_wrapper.EnumTypeWrapper(_FOREIGNENUMPROTO2) -FOREIGN_FOO = 0 -FOREIGN_BAR = 1 -FOREIGN_BAZ = 2 - -EXTENSION_INT32_FIELD_NUMBER = 120 -extension_int32 = DESCRIPTOR.extensions_by_name['extension_int32'] - -_TESTALLTYPESPROTO2 = DESCRIPTOR.message_types_by_name['TestAllTypesProto2'] -_TESTALLTYPESPROTO2_NESTEDMESSAGE = _TESTALLTYPESPROTO2.nested_types_by_name['NestedMessage'] -_TESTALLTYPESPROTO2_MAPINT32INT32ENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapInt32Int32Entry'] -_TESTALLTYPESPROTO2_MAPINT64INT64ENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapInt64Int64Entry'] -_TESTALLTYPESPROTO2_MAPUINT32UINT32ENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapUint32Uint32Entry'] -_TESTALLTYPESPROTO2_MAPUINT64UINT64ENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapUint64Uint64Entry'] -_TESTALLTYPESPROTO2_MAPSINT32SINT32ENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapSint32Sint32Entry'] -_TESTALLTYPESPROTO2_MAPSINT64SINT64ENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapSint64Sint64Entry'] -_TESTALLTYPESPROTO2_MAPFIXED32FIXED32ENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapFixed32Fixed32Entry'] -_TESTALLTYPESPROTO2_MAPFIXED64FIXED64ENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapFixed64Fixed64Entry'] -_TESTALLTYPESPROTO2_MAPSFIXED32SFIXED32ENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapSfixed32Sfixed32Entry'] -_TESTALLTYPESPROTO2_MAPSFIXED64SFIXED64ENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapSfixed64Sfixed64Entry'] -_TESTALLTYPESPROTO2_MAPINT32FLOATENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapInt32FloatEntry'] -_TESTALLTYPESPROTO2_MAPINT32DOUBLEENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapInt32DoubleEntry'] -_TESTALLTYPESPROTO2_MAPBOOLBOOLENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapBoolBoolEntry'] -_TESTALLTYPESPROTO2_MAPSTRINGSTRINGENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapStringStringEntry'] -_TESTALLTYPESPROTO2_MAPSTRINGBYTESENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapStringBytesEntry'] -_TESTALLTYPESPROTO2_MAPSTRINGNESTEDMESSAGEENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapStringNestedMessageEntry'] -_TESTALLTYPESPROTO2_MAPSTRINGFOREIGNMESSAGEENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapStringForeignMessageEntry'] -_TESTALLTYPESPROTO2_MAPSTRINGNESTEDENUMENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapStringNestedEnumEntry'] -_TESTALLTYPESPROTO2_MAPSTRINGFOREIGNENUMENTRY = _TESTALLTYPESPROTO2.nested_types_by_name['MapStringForeignEnumEntry'] -_TESTALLTYPESPROTO2_DATA = _TESTALLTYPESPROTO2.nested_types_by_name['Data'] -_TESTALLTYPESPROTO2_MESSAGESETCORRECT = _TESTALLTYPESPROTO2.nested_types_by_name['MessageSetCorrect'] -_TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION1 = _TESTALLTYPESPROTO2.nested_types_by_name['MessageSetCorrectExtension1'] -_TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION2 = _TESTALLTYPESPROTO2.nested_types_by_name['MessageSetCorrectExtension2'] -_FOREIGNMESSAGEPROTO2 = DESCRIPTOR.message_types_by_name['ForeignMessageProto2'] -_UNKNOWNTOTESTALLTYPES = DESCRIPTOR.message_types_by_name['UnknownToTestAllTypes'] -_UNKNOWNTOTESTALLTYPES_OPTIONALGROUP = _UNKNOWNTOTESTALLTYPES.nested_types_by_name['OptionalGroup'] -_NULLHYPOTHESISPROTO2 = DESCRIPTOR.message_types_by_name['NullHypothesisProto2'] -_ENUMONLYPROTO2 = DESCRIPTOR.message_types_by_name['EnumOnlyProto2'] -_TESTALLTYPESPROTO2_NESTEDENUM = _TESTALLTYPESPROTO2.enum_types_by_name['NestedEnum'] -_ENUMONLYPROTO2_BOOL = _ENUMONLYPROTO2.enum_types_by_name['Bool'] -TestAllTypesProto2 = _reflection.GeneratedProtocolMessageType('TestAllTypesProto2', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_NESTEDMESSAGE, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage) - }) - , - - 'MapInt32Int32Entry' : _reflection.GeneratedProtocolMessageType('MapInt32Int32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPINT32INT32ENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapInt32Int32Entry) - }) - , - - 'MapInt64Int64Entry' : _reflection.GeneratedProtocolMessageType('MapInt64Int64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPINT64INT64ENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapInt64Int64Entry) - }) - , - - 'MapUint32Uint32Entry' : _reflection.GeneratedProtocolMessageType('MapUint32Uint32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPUINT32UINT32ENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapUint32Uint32Entry) - }) - , - - 'MapUint64Uint64Entry' : _reflection.GeneratedProtocolMessageType('MapUint64Uint64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPUINT64UINT64ENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapUint64Uint64Entry) - }) - , - - 'MapSint32Sint32Entry' : _reflection.GeneratedProtocolMessageType('MapSint32Sint32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPSINT32SINT32ENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapSint32Sint32Entry) - }) - , - - 'MapSint64Sint64Entry' : _reflection.GeneratedProtocolMessageType('MapSint64Sint64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPSINT64SINT64ENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapSint64Sint64Entry) - }) - , - - 'MapFixed32Fixed32Entry' : _reflection.GeneratedProtocolMessageType('MapFixed32Fixed32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPFIXED32FIXED32ENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapFixed32Fixed32Entry) - }) - , - - 'MapFixed64Fixed64Entry' : _reflection.GeneratedProtocolMessageType('MapFixed64Fixed64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPFIXED64FIXED64ENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapFixed64Fixed64Entry) - }) - , - - 'MapSfixed32Sfixed32Entry' : _reflection.GeneratedProtocolMessageType('MapSfixed32Sfixed32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPSFIXED32SFIXED32ENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapSfixed32Sfixed32Entry) - }) - , - - 'MapSfixed64Sfixed64Entry' : _reflection.GeneratedProtocolMessageType('MapSfixed64Sfixed64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPSFIXED64SFIXED64ENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapSfixed64Sfixed64Entry) - }) - , - - 'MapInt32FloatEntry' : _reflection.GeneratedProtocolMessageType('MapInt32FloatEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPINT32FLOATENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapInt32FloatEntry) - }) - , - - 'MapInt32DoubleEntry' : _reflection.GeneratedProtocolMessageType('MapInt32DoubleEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPINT32DOUBLEENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapInt32DoubleEntry) - }) - , - - 'MapBoolBoolEntry' : _reflection.GeneratedProtocolMessageType('MapBoolBoolEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPBOOLBOOLENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapBoolBoolEntry) - }) - , - - 'MapStringStringEntry' : _reflection.GeneratedProtocolMessageType('MapStringStringEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPSTRINGSTRINGENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapStringStringEntry) - }) - , - - 'MapStringBytesEntry' : _reflection.GeneratedProtocolMessageType('MapStringBytesEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPSTRINGBYTESENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapStringBytesEntry) - }) - , - - 'MapStringNestedMessageEntry' : _reflection.GeneratedProtocolMessageType('MapStringNestedMessageEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPSTRINGNESTEDMESSAGEENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapStringNestedMessageEntry) - }) - , - - 'MapStringForeignMessageEntry' : _reflection.GeneratedProtocolMessageType('MapStringForeignMessageEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPSTRINGFOREIGNMESSAGEENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapStringForeignMessageEntry) - }) - , - - 'MapStringNestedEnumEntry' : _reflection.GeneratedProtocolMessageType('MapStringNestedEnumEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPSTRINGNESTEDENUMENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapStringNestedEnumEntry) - }) - , - - 'MapStringForeignEnumEntry' : _reflection.GeneratedProtocolMessageType('MapStringForeignEnumEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MAPSTRINGFOREIGNENUMENTRY, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MapStringForeignEnumEntry) - }) - , - - 'Data' : _reflection.GeneratedProtocolMessageType('Data', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_DATA, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.Data) - }) - , - - 'MessageSetCorrect' : _reflection.GeneratedProtocolMessageType('MessageSetCorrect', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MESSAGESETCORRECT, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrect) - }) - , - - 'MessageSetCorrectExtension1' : _reflection.GeneratedProtocolMessageType('MessageSetCorrectExtension1', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION1, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1) - }) - , - - 'MessageSetCorrectExtension2' : _reflection.GeneratedProtocolMessageType('MessageSetCorrectExtension2', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION2, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2) - }) - , - 'DESCRIPTOR' : _TESTALLTYPESPROTO2, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.TestAllTypesProto2) - }) -_sym_db.RegisterMessage(TestAllTypesProto2) -_sym_db.RegisterMessage(TestAllTypesProto2.NestedMessage) -_sym_db.RegisterMessage(TestAllTypesProto2.MapInt32Int32Entry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapInt64Int64Entry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapUint32Uint32Entry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapUint64Uint64Entry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapSint32Sint32Entry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapSint64Sint64Entry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapFixed32Fixed32Entry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapFixed64Fixed64Entry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapSfixed32Sfixed32Entry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapSfixed64Sfixed64Entry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapInt32FloatEntry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapInt32DoubleEntry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapBoolBoolEntry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapStringStringEntry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapStringBytesEntry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapStringNestedMessageEntry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapStringForeignMessageEntry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapStringNestedEnumEntry) -_sym_db.RegisterMessage(TestAllTypesProto2.MapStringForeignEnumEntry) -_sym_db.RegisterMessage(TestAllTypesProto2.Data) -_sym_db.RegisterMessage(TestAllTypesProto2.MessageSetCorrect) -_sym_db.RegisterMessage(TestAllTypesProto2.MessageSetCorrectExtension1) -_sym_db.RegisterMessage(TestAllTypesProto2.MessageSetCorrectExtension2) - -ForeignMessageProto2 = _reflection.GeneratedProtocolMessageType('ForeignMessageProto2', (_message.Message,), { - 'DESCRIPTOR' : _FOREIGNMESSAGEPROTO2, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.ForeignMessageProto2) - }) -_sym_db.RegisterMessage(ForeignMessageProto2) - -UnknownToTestAllTypes = _reflection.GeneratedProtocolMessageType('UnknownToTestAllTypes', (_message.Message,), { - - 'OptionalGroup' : _reflection.GeneratedProtocolMessageType('OptionalGroup', (_message.Message,), { - 'DESCRIPTOR' : _UNKNOWNTOTESTALLTYPES_OPTIONALGROUP, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup) - }) - , - 'DESCRIPTOR' : _UNKNOWNTOTESTALLTYPES, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.UnknownToTestAllTypes) - }) -_sym_db.RegisterMessage(UnknownToTestAllTypes) -_sym_db.RegisterMessage(UnknownToTestAllTypes.OptionalGroup) - -NullHypothesisProto2 = _reflection.GeneratedProtocolMessageType('NullHypothesisProto2', (_message.Message,), { - 'DESCRIPTOR' : _NULLHYPOTHESISPROTO2, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.NullHypothesisProto2) - }) -_sym_db.RegisterMessage(NullHypothesisProto2) - -EnumOnlyProto2 = _reflection.GeneratedProtocolMessageType('EnumOnlyProto2', (_message.Message,), { - 'DESCRIPTOR' : _ENUMONLYPROTO2, - '__module__' : 'google.protobuf.test_messages_proto2_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto2.EnumOnlyProto2) - }) -_sym_db.RegisterMessage(EnumOnlyProto2) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*google/protobuf/test_messages_proto2.proto\x12\x1dprotobuf_test_messages.proto2\"\xc4>\n\x12TestAllTypesProto2\x12\x16\n\x0eoptional_int32\x18\x01 \x01(\x05\x12\x16\n\x0eoptional_int64\x18\x02 \x01(\x03\x12\x17\n\x0foptional_uint32\x18\x03 \x01(\r\x12\x17\n\x0foptional_uint64\x18\x04 \x01(\x04\x12\x17\n\x0foptional_sint32\x18\x05 \x01(\x11\x12\x17\n\x0foptional_sint64\x18\x06 \x01(\x12\x12\x18\n\x10optional_fixed32\x18\x07 \x01(\x07\x12\x18\n\x10optional_fixed64\x18\x08 \x01(\x06\x12\x19\n\x11optional_sfixed32\x18\t \x01(\x0f\x12\x19\n\x11optional_sfixed64\x18\n \x01(\x10\x12\x16\n\x0eoptional_float\x18\x0b \x01(\x02\x12\x17\n\x0foptional_double\x18\x0c \x01(\x01\x12\x15\n\roptional_bool\x18\r \x01(\x08\x12\x17\n\x0foptional_string\x18\x0e \x01(\t\x12\x16\n\x0eoptional_bytes\x18\x0f \x01(\x0c\x12`\n\x17optional_nested_message\x18\x12 \x01(\x0b\x32?.protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage\x12U\n\x18optional_foreign_message\x18\x13 \x01(\x0b\x32\x33.protobuf_test_messages.proto2.ForeignMessageProto2\x12Z\n\x14optional_nested_enum\x18\x15 \x01(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum\x12O\n\x15optional_foreign_enum\x18\x16 \x01(\x0e\x32\x30.protobuf_test_messages.proto2.ForeignEnumProto2\x12!\n\x15optional_string_piece\x18\x18 \x01(\tB\x02\x08\x02\x12\x19\n\roptional_cord\x18\x19 \x01(\tB\x02\x08\x01\x12L\n\x11recursive_message\x18\x1b \x01(\x0b\x32\x31.protobuf_test_messages.proto2.TestAllTypesProto2\x12\x16\n\x0erepeated_int32\x18\x1f \x03(\x05\x12\x16\n\x0erepeated_int64\x18 \x03(\x03\x12\x17\n\x0frepeated_uint32\x18! \x03(\r\x12\x17\n\x0frepeated_uint64\x18\" \x03(\x04\x12\x17\n\x0frepeated_sint32\x18# \x03(\x11\x12\x17\n\x0frepeated_sint64\x18$ \x03(\x12\x12\x18\n\x10repeated_fixed32\x18% \x03(\x07\x12\x18\n\x10repeated_fixed64\x18& \x03(\x06\x12\x19\n\x11repeated_sfixed32\x18\' \x03(\x0f\x12\x19\n\x11repeated_sfixed64\x18( \x03(\x10\x12\x16\n\x0erepeated_float\x18) \x03(\x02\x12\x17\n\x0frepeated_double\x18* \x03(\x01\x12\x15\n\rrepeated_bool\x18+ \x03(\x08\x12\x17\n\x0frepeated_string\x18, \x03(\t\x12\x16\n\x0erepeated_bytes\x18- \x03(\x0c\x12`\n\x17repeated_nested_message\x18\x30 \x03(\x0b\x32?.protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage\x12U\n\x18repeated_foreign_message\x18\x31 \x03(\x0b\x32\x33.protobuf_test_messages.proto2.ForeignMessageProto2\x12Z\n\x14repeated_nested_enum\x18\x33 \x03(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum\x12O\n\x15repeated_foreign_enum\x18\x34 \x03(\x0e\x32\x30.protobuf_test_messages.proto2.ForeignEnumProto2\x12!\n\x15repeated_string_piece\x18\x36 \x03(\tB\x02\x08\x02\x12\x19\n\rrepeated_cord\x18\x37 \x03(\tB\x02\x08\x01\x12\x18\n\x0cpacked_int32\x18K \x03(\x05\x42\x02\x10\x01\x12\x18\n\x0cpacked_int64\x18L \x03(\x03\x42\x02\x10\x01\x12\x19\n\rpacked_uint32\x18M \x03(\rB\x02\x10\x01\x12\x19\n\rpacked_uint64\x18N \x03(\x04\x42\x02\x10\x01\x12\x19\n\rpacked_sint32\x18O \x03(\x11\x42\x02\x10\x01\x12\x19\n\rpacked_sint64\x18P \x03(\x12\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed32\x18Q \x03(\x07\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed64\x18R \x03(\x06\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed32\x18S \x03(\x0f\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed64\x18T \x03(\x10\x42\x02\x10\x01\x12\x18\n\x0cpacked_float\x18U \x03(\x02\x42\x02\x10\x01\x12\x19\n\rpacked_double\x18V \x03(\x01\x42\x02\x10\x01\x12\x17\n\x0bpacked_bool\x18W \x03(\x08\x42\x02\x10\x01\x12\\\n\x12packed_nested_enum\x18X \x03(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnumB\x02\x10\x01\x12\x1a\n\x0eunpacked_int32\x18Y \x03(\x05\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_int64\x18Z \x03(\x03\x42\x02\x10\x00\x12\x1b\n\x0funpacked_uint32\x18[ \x03(\rB\x02\x10\x00\x12\x1b\n\x0funpacked_uint64\x18\\ \x03(\x04\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint32\x18] \x03(\x11\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint64\x18^ \x03(\x12\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed32\x18_ \x03(\x07\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed64\x18` \x03(\x06\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed32\x18\x61 \x03(\x0f\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed64\x18\x62 \x03(\x10\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_float\x18\x63 \x03(\x02\x42\x02\x10\x00\x12\x1b\n\x0funpacked_double\x18\x64 \x03(\x01\x42\x02\x10\x00\x12\x19\n\runpacked_bool\x18\x65 \x03(\x08\x42\x02\x10\x00\x12^\n\x14unpacked_nested_enum\x18\x66 \x03(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnumB\x02\x10\x00\x12]\n\x0fmap_int32_int32\x18\x38 \x03(\x0b\x32\x44.protobuf_test_messages.proto2.TestAllTypesProto2.MapInt32Int32Entry\x12]\n\x0fmap_int64_int64\x18\x39 \x03(\x0b\x32\x44.protobuf_test_messages.proto2.TestAllTypesProto2.MapInt64Int64Entry\x12\x61\n\x11map_uint32_uint32\x18: \x03(\x0b\x32\x46.protobuf_test_messages.proto2.TestAllTypesProto2.MapUint32Uint32Entry\x12\x61\n\x11map_uint64_uint64\x18; \x03(\x0b\x32\x46.protobuf_test_messages.proto2.TestAllTypesProto2.MapUint64Uint64Entry\x12\x61\n\x11map_sint32_sint32\x18< \x03(\x0b\x32\x46.protobuf_test_messages.proto2.TestAllTypesProto2.MapSint32Sint32Entry\x12\x61\n\x11map_sint64_sint64\x18= \x03(\x0b\x32\x46.protobuf_test_messages.proto2.TestAllTypesProto2.MapSint64Sint64Entry\x12\x65\n\x13map_fixed32_fixed32\x18> \x03(\x0b\x32H.protobuf_test_messages.proto2.TestAllTypesProto2.MapFixed32Fixed32Entry\x12\x65\n\x13map_fixed64_fixed64\x18? \x03(\x0b\x32H.protobuf_test_messages.proto2.TestAllTypesProto2.MapFixed64Fixed64Entry\x12i\n\x15map_sfixed32_sfixed32\x18@ \x03(\x0b\x32J.protobuf_test_messages.proto2.TestAllTypesProto2.MapSfixed32Sfixed32Entry\x12i\n\x15map_sfixed64_sfixed64\x18\x41 \x03(\x0b\x32J.protobuf_test_messages.proto2.TestAllTypesProto2.MapSfixed64Sfixed64Entry\x12]\n\x0fmap_int32_float\x18\x42 \x03(\x0b\x32\x44.protobuf_test_messages.proto2.TestAllTypesProto2.MapInt32FloatEntry\x12_\n\x10map_int32_double\x18\x43 \x03(\x0b\x32\x45.protobuf_test_messages.proto2.TestAllTypesProto2.MapInt32DoubleEntry\x12Y\n\rmap_bool_bool\x18\x44 \x03(\x0b\x32\x42.protobuf_test_messages.proto2.TestAllTypesProto2.MapBoolBoolEntry\x12\x61\n\x11map_string_string\x18\x45 \x03(\x0b\x32\x46.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringStringEntry\x12_\n\x10map_string_bytes\x18\x46 \x03(\x0b\x32\x45.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringBytesEntry\x12p\n\x19map_string_nested_message\x18G \x03(\x0b\x32M.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringNestedMessageEntry\x12r\n\x1amap_string_foreign_message\x18H \x03(\x0b\x32N.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringForeignMessageEntry\x12j\n\x16map_string_nested_enum\x18I \x03(\x0b\x32J.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringNestedEnumEntry\x12l\n\x17map_string_foreign_enum\x18J \x03(\x0b\x32K.protobuf_test_messages.proto2.TestAllTypesProto2.MapStringForeignEnumEntry\x12\x16\n\x0coneof_uint32\x18o \x01(\rH\x00\x12_\n\x14oneof_nested_message\x18p \x01(\x0b\x32?.protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessageH\x00\x12\x16\n\x0coneof_string\x18q \x01(\tH\x00\x12\x15\n\x0boneof_bytes\x18r \x01(\x0cH\x00\x12\x14\n\noneof_bool\x18s \x01(\x08H\x00\x12\x16\n\x0coneof_uint64\x18t \x01(\x04H\x00\x12\x15\n\x0boneof_float\x18u \x01(\x02H\x00\x12\x16\n\x0coneof_double\x18v \x01(\x01H\x00\x12R\n\noneof_enum\x18w \x01(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnumH\x00\x12\x45\n\x04\x64\x61ta\x18\xc9\x01 \x01(\n26.protobuf_test_messages.proto2.TestAllTypesProto2.Data\x12\"\n\rdefault_int32\x18\xf1\x01 \x01(\x05:\n-123456789\x12,\n\rdefault_int64\x18\xf2\x01 \x01(\x03:\x14-9123456789123456789\x12#\n\x0e\x64\x65\x66\x61ult_uint32\x18\xf3\x01 \x01(\r:\n2123456789\x12-\n\x0e\x64\x65\x66\x61ult_uint64\x18\xf4\x01 \x01(\x04:\x14\x31\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x31\x32\x33\x34\x35\x36\x37\x38\x39\x12#\n\x0e\x64\x65\x66\x61ult_sint32\x18\xf5\x01 \x01(\x11:\n-123456789\x12-\n\x0e\x64\x65\x66\x61ult_sint64\x18\xf6\x01 \x01(\x12:\x14-9123456789123456789\x12$\n\x0f\x64\x65\x66\x61ult_fixed32\x18\xf7\x01 \x01(\x07:\n2123456789\x12.\n\x0f\x64\x65\x66\x61ult_fixed64\x18\xf8\x01 \x01(\x06:\x14\x31\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x31\x32\x33\x34\x35\x36\x37\x38\x39\x12%\n\x10\x64\x65\x66\x61ult_sfixed32\x18\xf9\x01 \x01(\x0f:\n-123456789\x12/\n\x10\x64\x65\x66\x61ult_sfixed64\x18\xfa\x01 \x01(\x10:\x14-9123456789123456789\x12\x1d\n\rdefault_float\x18\xfb\x01 \x01(\x02:\x05\x39\x65+09\x12\x1e\n\x0e\x64\x65\x66\x61ult_double\x18\xfc\x01 \x01(\x01:\x05\x37\x65+22\x12\x1b\n\x0c\x64\x65\x66\x61ult_bool\x18\xfd\x01 \x01(\x08:\x04true\x12 \n\x0e\x64\x65\x66\x61ult_string\x18\xfe\x01 \x01(\t:\x07Rosebud\x12\x1e\n\rdefault_bytes\x18\xff\x01 \x01(\x0c:\x06joshua\x12\x13\n\nfieldname1\x18\x91\x03 \x01(\x05\x12\x14\n\x0b\x66ield_name2\x18\x92\x03 \x01(\x05\x12\x15\n\x0c_field_name3\x18\x93\x03 \x01(\x05\x12\x16\n\rfield__name4_\x18\x94\x03 \x01(\x05\x12\x14\n\x0b\x66ield0name5\x18\x95\x03 \x01(\x05\x12\x16\n\rfield_0_name6\x18\x96\x03 \x01(\x05\x12\x13\n\nfieldName7\x18\x97\x03 \x01(\x05\x12\x13\n\nFieldName8\x18\x98\x03 \x01(\x05\x12\x14\n\x0b\x66ield_Name9\x18\x99\x03 \x01(\x05\x12\x15\n\x0c\x46ield_Name10\x18\x9a\x03 \x01(\x05\x12\x15\n\x0c\x46IELD_NAME11\x18\x9b\x03 \x01(\x05\x12\x15\n\x0c\x46IELD_name12\x18\x9c\x03 \x01(\x05\x12\x17\n\x0e__field_name13\x18\x9d\x03 \x01(\x05\x12\x17\n\x0e__Field_name14\x18\x9e\x03 \x01(\x05\x12\x16\n\rfield__name15\x18\x9f\x03 \x01(\x05\x12\x16\n\rfield__Name16\x18\xa0\x03 \x01(\x05\x12\x17\n\x0e\x66ield_name17__\x18\xa1\x03 \x01(\x05\x12\x17\n\x0e\x46ield_name18__\x18\xa2\x03 \x01(\x05\x1a\x62\n\rNestedMessage\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\x46\n\x0b\x63orecursive\x18\x02 \x01(\x0b\x32\x31.protobuf_test_messages.proto2.TestAllTypesProto2\x1a\x34\n\x12MapInt32Int32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x34\n\x12MapInt64Int64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x36\n\x14MapUint32Uint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\x1a\x36\n\x14MapUint64Uint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x04:\x02\x38\x01\x1a\x36\n\x14MapSint32Sint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x11\x12\r\n\x05value\x18\x02 \x01(\x11:\x02\x38\x01\x1a\x36\n\x14MapSint64Sint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x12\x12\r\n\x05value\x18\x02 \x01(\x12:\x02\x38\x01\x1a\x38\n\x16MapFixed32Fixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x07\x12\r\n\x05value\x18\x02 \x01(\x07:\x02\x38\x01\x1a\x38\n\x16MapFixed64Fixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x06\x12\r\n\x05value\x18\x02 \x01(\x06:\x02\x38\x01\x1a:\n\x18MapSfixed32Sfixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x0f\x12\r\n\x05value\x18\x02 \x01(\x0f:\x02\x38\x01\x1a:\n\x18MapSfixed64Sfixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x10\x12\r\n\x05value\x18\x02 \x01(\x10:\x02\x38\x01\x1a\x34\n\x12MapInt32FloatEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x1a\x35\n\x13MapInt32DoubleEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x32\n\x10MapBoolBoolEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\x1a\x36\n\x14MapStringStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13MapStringBytesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\x1a~\n\x1bMapStringNestedMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12N\n\x05value\x18\x02 \x01(\x0b\x32?.protobuf_test_messages.proto2.TestAllTypesProto2.NestedMessage:\x02\x38\x01\x1as\n\x1cMapStringForeignMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x42\n\x05value\x18\x02 \x01(\x0b\x32\x33.protobuf_test_messages.proto2.ForeignMessageProto2:\x02\x38\x01\x1ax\n\x18MapStringNestedEnumEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12K\n\x05value\x18\x02 \x01(\x0e\x32<.protobuf_test_messages.proto2.TestAllTypesProto2.NestedEnum:\x02\x38\x01\x1am\n\x19MapStringForeignEnumEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0e\x32\x30.protobuf_test_messages.proto2.ForeignEnumProto2:\x02\x38\x01\x1a\x33\n\x04\x44\x61ta\x12\x14\n\x0bgroup_int32\x18\xca\x01 \x01(\x05\x12\x15\n\x0cgroup_uint32\x18\xcb\x01 \x01(\r\x1a!\n\x11MessageSetCorrect*\x08\x08\x04\x10\xff\xff\xff\xff\x07:\x02\x08\x01\x1a\xe0\x01\n\x1bMessageSetCorrectExtension1\x12\x0b\n\x03str\x18\x19 \x01(\t2\xb3\x01\n\x15message_set_extension\x12\x43.protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrect\x18\xf9\xbb^ \x01(\x0b\x32M.protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1\x1a\xdf\x01\n\x1bMessageSetCorrectExtension2\x12\t\n\x01i\x18\t \x01(\x05\x32\xb4\x01\n\x15message_set_extension\x12\x43.protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrect\x18\x90\xb3\xfc\x01 \x01(\x0b\x32M.protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2\"9\n\nNestedEnum\x12\x07\n\x03\x46OO\x10\x00\x12\x07\n\x03\x42\x41R\x10\x01\x12\x07\n\x03\x42\x41Z\x10\x02\x12\x10\n\x03NEG\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01*\x05\x08x\x10\xc9\x01\x42\r\n\x0boneof_fieldJ\x06\x08\xe8\x07\x10\x90N\"!\n\x14\x46oreignMessageProto2\x12\t\n\x01\x63\x18\x01 \x01(\x05\"\xc1\x02\n\x15UnknownToTestAllTypes\x12\x17\n\x0eoptional_int32\x18\xe9\x07 \x01(\x05\x12\x18\n\x0foptional_string\x18\xea\x07 \x01(\t\x12L\n\x0enested_message\x18\xeb\x07 \x01(\x0b\x32\x33.protobuf_test_messages.proto2.ForeignMessageProto2\x12Z\n\roptionalgroup\x18\xec\x07 \x01(\n2B.protobuf_test_messages.proto2.UnknownToTestAllTypes.OptionalGroup\x12\x16\n\roptional_bool\x18\xee\x07 \x01(\x08\x12\x17\n\x0erepeated_int32\x18\xf3\x07 \x03(\x05\x1a\x1a\n\rOptionalGroup\x12\t\n\x01\x61\x18\x01 \x01(\x05\"\x16\n\x14NullHypothesisProto2\"/\n\x0e\x45numOnlyProto2\"\x1d\n\x04\x42ool\x12\n\n\x06kFalse\x10\x00\x12\t\n\x05kTrue\x10\x01\"\x1f\n\x0fOneStringProto2\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\t*F\n\x11\x46oreignEnumProto2\x12\x0f\n\x0b\x46OREIGN_FOO\x10\x00\x12\x0f\n\x0b\x46OREIGN_BAR\x10\x01\x12\x0f\n\x0b\x46OREIGN_BAZ\x10\x02:J\n\x0f\x65xtension_int32\x12\x31.protobuf_test_messages.proto2.TestAllTypesProto2\x18x \x01(\x05\x42/\n(com.google.protobuf_test_messages.proto2H\x01\xf8\x01\x01') +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.test_messages_proto2_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: TestAllTypesProto2.RegisterExtension(extension_int32) TestAllTypesProto2.MessageSetCorrect.RegisterExtension(_TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION1.extensions_by_name['message_set_extension']) @@ -404,70 +128,72 @@ if _descriptor._USE_C_DESCRIPTORS == False: _TESTALLTYPESPROTO2.fields_by_name['unpacked_bool']._serialized_options = b'\020\000' _TESTALLTYPESPROTO2.fields_by_name['unpacked_nested_enum']._options = None _TESTALLTYPESPROTO2.fields_by_name['unpacked_nested_enum']._serialized_options = b'\020\000' - _FOREIGNENUMPROTO2._serialized_start=8484 - _FOREIGNENUMPROTO2._serialized_end=8554 + _FOREIGNENUMPROTO2._serialized_start=8549 + _FOREIGNENUMPROTO2._serialized_end=8619 _TESTALLTYPESPROTO2._serialized_start=78 - _TESTALLTYPESPROTO2._serialized_end=8050 - _TESTALLTYPESPROTO2_NESTEDMESSAGE._serialized_start=6004 - _TESTALLTYPESPROTO2_NESTEDMESSAGE._serialized_end=6102 - _TESTALLTYPESPROTO2_MAPINT32INT32ENTRY._serialized_start=6104 - _TESTALLTYPESPROTO2_MAPINT32INT32ENTRY._serialized_end=6156 - _TESTALLTYPESPROTO2_MAPINT64INT64ENTRY._serialized_start=6158 - _TESTALLTYPESPROTO2_MAPINT64INT64ENTRY._serialized_end=6210 - _TESTALLTYPESPROTO2_MAPUINT32UINT32ENTRY._serialized_start=6212 - _TESTALLTYPESPROTO2_MAPUINT32UINT32ENTRY._serialized_end=6266 - _TESTALLTYPESPROTO2_MAPUINT64UINT64ENTRY._serialized_start=6268 - _TESTALLTYPESPROTO2_MAPUINT64UINT64ENTRY._serialized_end=6322 - _TESTALLTYPESPROTO2_MAPSINT32SINT32ENTRY._serialized_start=6324 - _TESTALLTYPESPROTO2_MAPSINT32SINT32ENTRY._serialized_end=6378 - _TESTALLTYPESPROTO2_MAPSINT64SINT64ENTRY._serialized_start=6380 - _TESTALLTYPESPROTO2_MAPSINT64SINT64ENTRY._serialized_end=6434 - _TESTALLTYPESPROTO2_MAPFIXED32FIXED32ENTRY._serialized_start=6436 - _TESTALLTYPESPROTO2_MAPFIXED32FIXED32ENTRY._serialized_end=6492 - _TESTALLTYPESPROTO2_MAPFIXED64FIXED64ENTRY._serialized_start=6494 - _TESTALLTYPESPROTO2_MAPFIXED64FIXED64ENTRY._serialized_end=6550 - _TESTALLTYPESPROTO2_MAPSFIXED32SFIXED32ENTRY._serialized_start=6552 - _TESTALLTYPESPROTO2_MAPSFIXED32SFIXED32ENTRY._serialized_end=6610 - _TESTALLTYPESPROTO2_MAPSFIXED64SFIXED64ENTRY._serialized_start=6612 - _TESTALLTYPESPROTO2_MAPSFIXED64SFIXED64ENTRY._serialized_end=6670 - _TESTALLTYPESPROTO2_MAPINT32FLOATENTRY._serialized_start=6672 - _TESTALLTYPESPROTO2_MAPINT32FLOATENTRY._serialized_end=6724 - _TESTALLTYPESPROTO2_MAPINT32DOUBLEENTRY._serialized_start=6726 - _TESTALLTYPESPROTO2_MAPINT32DOUBLEENTRY._serialized_end=6779 - _TESTALLTYPESPROTO2_MAPBOOLBOOLENTRY._serialized_start=6781 - _TESTALLTYPESPROTO2_MAPBOOLBOOLENTRY._serialized_end=6831 - _TESTALLTYPESPROTO2_MAPSTRINGSTRINGENTRY._serialized_start=6833 - _TESTALLTYPESPROTO2_MAPSTRINGSTRINGENTRY._serialized_end=6887 - _TESTALLTYPESPROTO2_MAPSTRINGBYTESENTRY._serialized_start=6889 - _TESTALLTYPESPROTO2_MAPSTRINGBYTESENTRY._serialized_end=6942 - _TESTALLTYPESPROTO2_MAPSTRINGNESTEDMESSAGEENTRY._serialized_start=6944 - _TESTALLTYPESPROTO2_MAPSTRINGNESTEDMESSAGEENTRY._serialized_end=7070 - _TESTALLTYPESPROTO2_MAPSTRINGFOREIGNMESSAGEENTRY._serialized_start=7072 - _TESTALLTYPESPROTO2_MAPSTRINGFOREIGNMESSAGEENTRY._serialized_end=7187 - _TESTALLTYPESPROTO2_MAPSTRINGNESTEDENUMENTRY._serialized_start=7189 - _TESTALLTYPESPROTO2_MAPSTRINGNESTEDENUMENTRY._serialized_end=7309 - _TESTALLTYPESPROTO2_MAPSTRINGFOREIGNENUMENTRY._serialized_start=7311 - _TESTALLTYPESPROTO2_MAPSTRINGFOREIGNENUMENTRY._serialized_end=7420 - _TESTALLTYPESPROTO2_DATA._serialized_start=7422 - _TESTALLTYPESPROTO2_DATA._serialized_end=7473 - _TESTALLTYPESPROTO2_MESSAGESETCORRECT._serialized_start=7475 - _TESTALLTYPESPROTO2_MESSAGESETCORRECT._serialized_end=7508 - _TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION1._serialized_start=7511 - _TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION1._serialized_end=7735 - _TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION2._serialized_start=7738 - _TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION2._serialized_end=7961 - _TESTALLTYPESPROTO2_NESTEDENUM._serialized_start=7963 - _TESTALLTYPESPROTO2_NESTEDENUM._serialized_end=8020 - _FOREIGNMESSAGEPROTO2._serialized_start=8052 - _FOREIGNMESSAGEPROTO2._serialized_end=8085 - _UNKNOWNTOTESTALLTYPES._serialized_start=8088 - _UNKNOWNTOTESTALLTYPES._serialized_end=8409 - _UNKNOWNTOTESTALLTYPES_OPTIONALGROUP._serialized_start=8383 - _UNKNOWNTOTESTALLTYPES_OPTIONALGROUP._serialized_end=8409 - _NULLHYPOTHESISPROTO2._serialized_start=8411 - _NULLHYPOTHESISPROTO2._serialized_end=8433 - _ENUMONLYPROTO2._serialized_start=8435 - _ENUMONLYPROTO2._serialized_end=8482 - _ENUMONLYPROTO2_BOOL._serialized_start=8453 - _ENUMONLYPROTO2_BOOL._serialized_end=8482 + _TESTALLTYPESPROTO2._serialized_end=8082 + _TESTALLTYPESPROTO2_NESTEDMESSAGE._serialized_start=6036 + _TESTALLTYPESPROTO2_NESTEDMESSAGE._serialized_end=6134 + _TESTALLTYPESPROTO2_MAPINT32INT32ENTRY._serialized_start=6136 + _TESTALLTYPESPROTO2_MAPINT32INT32ENTRY._serialized_end=6188 + _TESTALLTYPESPROTO2_MAPINT64INT64ENTRY._serialized_start=6190 + _TESTALLTYPESPROTO2_MAPINT64INT64ENTRY._serialized_end=6242 + _TESTALLTYPESPROTO2_MAPUINT32UINT32ENTRY._serialized_start=6244 + _TESTALLTYPESPROTO2_MAPUINT32UINT32ENTRY._serialized_end=6298 + _TESTALLTYPESPROTO2_MAPUINT64UINT64ENTRY._serialized_start=6300 + _TESTALLTYPESPROTO2_MAPUINT64UINT64ENTRY._serialized_end=6354 + _TESTALLTYPESPROTO2_MAPSINT32SINT32ENTRY._serialized_start=6356 + _TESTALLTYPESPROTO2_MAPSINT32SINT32ENTRY._serialized_end=6410 + _TESTALLTYPESPROTO2_MAPSINT64SINT64ENTRY._serialized_start=6412 + _TESTALLTYPESPROTO2_MAPSINT64SINT64ENTRY._serialized_end=6466 + _TESTALLTYPESPROTO2_MAPFIXED32FIXED32ENTRY._serialized_start=6468 + _TESTALLTYPESPROTO2_MAPFIXED32FIXED32ENTRY._serialized_end=6524 + _TESTALLTYPESPROTO2_MAPFIXED64FIXED64ENTRY._serialized_start=6526 + _TESTALLTYPESPROTO2_MAPFIXED64FIXED64ENTRY._serialized_end=6582 + _TESTALLTYPESPROTO2_MAPSFIXED32SFIXED32ENTRY._serialized_start=6584 + _TESTALLTYPESPROTO2_MAPSFIXED32SFIXED32ENTRY._serialized_end=6642 + _TESTALLTYPESPROTO2_MAPSFIXED64SFIXED64ENTRY._serialized_start=6644 + _TESTALLTYPESPROTO2_MAPSFIXED64SFIXED64ENTRY._serialized_end=6702 + _TESTALLTYPESPROTO2_MAPINT32FLOATENTRY._serialized_start=6704 + _TESTALLTYPESPROTO2_MAPINT32FLOATENTRY._serialized_end=6756 + _TESTALLTYPESPROTO2_MAPINT32DOUBLEENTRY._serialized_start=6758 + _TESTALLTYPESPROTO2_MAPINT32DOUBLEENTRY._serialized_end=6811 + _TESTALLTYPESPROTO2_MAPBOOLBOOLENTRY._serialized_start=6813 + _TESTALLTYPESPROTO2_MAPBOOLBOOLENTRY._serialized_end=6863 + _TESTALLTYPESPROTO2_MAPSTRINGSTRINGENTRY._serialized_start=6865 + _TESTALLTYPESPROTO2_MAPSTRINGSTRINGENTRY._serialized_end=6919 + _TESTALLTYPESPROTO2_MAPSTRINGBYTESENTRY._serialized_start=6921 + _TESTALLTYPESPROTO2_MAPSTRINGBYTESENTRY._serialized_end=6974 + _TESTALLTYPESPROTO2_MAPSTRINGNESTEDMESSAGEENTRY._serialized_start=6976 + _TESTALLTYPESPROTO2_MAPSTRINGNESTEDMESSAGEENTRY._serialized_end=7102 + _TESTALLTYPESPROTO2_MAPSTRINGFOREIGNMESSAGEENTRY._serialized_start=7104 + _TESTALLTYPESPROTO2_MAPSTRINGFOREIGNMESSAGEENTRY._serialized_end=7219 + _TESTALLTYPESPROTO2_MAPSTRINGNESTEDENUMENTRY._serialized_start=7221 + _TESTALLTYPESPROTO2_MAPSTRINGNESTEDENUMENTRY._serialized_end=7341 + _TESTALLTYPESPROTO2_MAPSTRINGFOREIGNENUMENTRY._serialized_start=7343 + _TESTALLTYPESPROTO2_MAPSTRINGFOREIGNENUMENTRY._serialized_end=7452 + _TESTALLTYPESPROTO2_DATA._serialized_start=7454 + _TESTALLTYPESPROTO2_DATA._serialized_end=7505 + _TESTALLTYPESPROTO2_MESSAGESETCORRECT._serialized_start=7507 + _TESTALLTYPESPROTO2_MESSAGESETCORRECT._serialized_end=7540 + _TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION1._serialized_start=7543 + _TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION1._serialized_end=7767 + _TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION2._serialized_start=7770 + _TESTALLTYPESPROTO2_MESSAGESETCORRECTEXTENSION2._serialized_end=7993 + _TESTALLTYPESPROTO2_NESTEDENUM._serialized_start=7995 + _TESTALLTYPESPROTO2_NESTEDENUM._serialized_end=8052 + _FOREIGNMESSAGEPROTO2._serialized_start=8084 + _FOREIGNMESSAGEPROTO2._serialized_end=8117 + _UNKNOWNTOTESTALLTYPES._serialized_start=8120 + _UNKNOWNTOTESTALLTYPES._serialized_end=8441 + _UNKNOWNTOTESTALLTYPES_OPTIONALGROUP._serialized_start=8415 + _UNKNOWNTOTESTALLTYPES_OPTIONALGROUP._serialized_end=8441 + _NULLHYPOTHESISPROTO2._serialized_start=8443 + _NULLHYPOTHESISPROTO2._serialized_end=8465 + _ENUMONLYPROTO2._serialized_start=8467 + _ENUMONLYPROTO2._serialized_end=8514 + _ENUMONLYPROTO2_BOOL._serialized_start=8485 + _ENUMONLYPROTO2_BOOL._serialized_end=8514 + _ONESTRINGPROTO2._serialized_start=8516 + _ONESTRINGPROTO2._serialized_end=8547 # @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/test_messages_proto3_pb2.py b/windows/python/google/protobuf/test_messages_proto3_pb2.py index ef7d7cb40..48675344e 100644 --- a/windows/python/google/protobuf/test_messages_proto3_pb2.py +++ b/windows/python/google/protobuf/test_messages_proto3_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/test_messages_proto3.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -21,230 +19,10 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__ from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*google/protobuf/test_messages_proto3.proto\x12\x1dprotobuf_test_messages.proto3\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xb1\x45\n\x12TestAllTypesProto3\x12\x16\n\x0eoptional_int32\x18\x01 \x01(\x05\x12\x16\n\x0eoptional_int64\x18\x02 \x01(\x03\x12\x17\n\x0foptional_uint32\x18\x03 \x01(\r\x12\x17\n\x0foptional_uint64\x18\x04 \x01(\x04\x12\x17\n\x0foptional_sint32\x18\x05 \x01(\x11\x12\x17\n\x0foptional_sint64\x18\x06 \x01(\x12\x12\x18\n\x10optional_fixed32\x18\x07 \x01(\x07\x12\x18\n\x10optional_fixed64\x18\x08 \x01(\x06\x12\x19\n\x11optional_sfixed32\x18\t \x01(\x0f\x12\x19\n\x11optional_sfixed64\x18\n \x01(\x10\x12\x16\n\x0eoptional_float\x18\x0b \x01(\x02\x12\x17\n\x0foptional_double\x18\x0c \x01(\x01\x12\x15\n\roptional_bool\x18\r \x01(\x08\x12\x17\n\x0foptional_string\x18\x0e \x01(\t\x12\x16\n\x0eoptional_bytes\x18\x0f \x01(\x0c\x12`\n\x17optional_nested_message\x18\x12 \x01(\x0b\x32?.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage\x12O\n\x18optional_foreign_message\x18\x13 \x01(\x0b\x32-.protobuf_test_messages.proto3.ForeignMessage\x12Z\n\x14optional_nested_enum\x18\x15 \x01(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum\x12I\n\x15optional_foreign_enum\x18\x16 \x01(\x0e\x32*.protobuf_test_messages.proto3.ForeignEnum\x12\\\n\x15optional_aliased_enum\x18\x17 \x01(\x0e\x32=.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum\x12!\n\x15optional_string_piece\x18\x18 \x01(\tB\x02\x08\x02\x12\x19\n\roptional_cord\x18\x19 \x01(\tB\x02\x08\x01\x12L\n\x11recursive_message\x18\x1b \x01(\x0b\x32\x31.protobuf_test_messages.proto3.TestAllTypesProto3\x12\x16\n\x0erepeated_int32\x18\x1f \x03(\x05\x12\x16\n\x0erepeated_int64\x18 \x03(\x03\x12\x17\n\x0frepeated_uint32\x18! \x03(\r\x12\x17\n\x0frepeated_uint64\x18\" \x03(\x04\x12\x17\n\x0frepeated_sint32\x18# \x03(\x11\x12\x17\n\x0frepeated_sint64\x18$ \x03(\x12\x12\x18\n\x10repeated_fixed32\x18% \x03(\x07\x12\x18\n\x10repeated_fixed64\x18& \x03(\x06\x12\x19\n\x11repeated_sfixed32\x18\' \x03(\x0f\x12\x19\n\x11repeated_sfixed64\x18( \x03(\x10\x12\x16\n\x0erepeated_float\x18) \x03(\x02\x12\x17\n\x0frepeated_double\x18* \x03(\x01\x12\x15\n\rrepeated_bool\x18+ \x03(\x08\x12\x17\n\x0frepeated_string\x18, \x03(\t\x12\x16\n\x0erepeated_bytes\x18- \x03(\x0c\x12`\n\x17repeated_nested_message\x18\x30 \x03(\x0b\x32?.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage\x12O\n\x18repeated_foreign_message\x18\x31 \x03(\x0b\x32-.protobuf_test_messages.proto3.ForeignMessage\x12Z\n\x14repeated_nested_enum\x18\x33 \x03(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum\x12I\n\x15repeated_foreign_enum\x18\x34 \x03(\x0e\x32*.protobuf_test_messages.proto3.ForeignEnum\x12!\n\x15repeated_string_piece\x18\x36 \x03(\tB\x02\x08\x02\x12\x19\n\rrepeated_cord\x18\x37 \x03(\tB\x02\x08\x01\x12\x18\n\x0cpacked_int32\x18K \x03(\x05\x42\x02\x10\x01\x12\x18\n\x0cpacked_int64\x18L \x03(\x03\x42\x02\x10\x01\x12\x19\n\rpacked_uint32\x18M \x03(\rB\x02\x10\x01\x12\x19\n\rpacked_uint64\x18N \x03(\x04\x42\x02\x10\x01\x12\x19\n\rpacked_sint32\x18O \x03(\x11\x42\x02\x10\x01\x12\x19\n\rpacked_sint64\x18P \x03(\x12\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed32\x18Q \x03(\x07\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed64\x18R \x03(\x06\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed32\x18S \x03(\x0f\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed64\x18T \x03(\x10\x42\x02\x10\x01\x12\x18\n\x0cpacked_float\x18U \x03(\x02\x42\x02\x10\x01\x12\x19\n\rpacked_double\x18V \x03(\x01\x42\x02\x10\x01\x12\x17\n\x0bpacked_bool\x18W \x03(\x08\x42\x02\x10\x01\x12\\\n\x12packed_nested_enum\x18X \x03(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnumB\x02\x10\x01\x12\x1a\n\x0eunpacked_int32\x18Y \x03(\x05\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_int64\x18Z \x03(\x03\x42\x02\x10\x00\x12\x1b\n\x0funpacked_uint32\x18[ \x03(\rB\x02\x10\x00\x12\x1b\n\x0funpacked_uint64\x18\\ \x03(\x04\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint32\x18] \x03(\x11\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint64\x18^ \x03(\x12\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed32\x18_ \x03(\x07\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed64\x18` \x03(\x06\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed32\x18\x61 \x03(\x0f\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed64\x18\x62 \x03(\x10\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_float\x18\x63 \x03(\x02\x42\x02\x10\x00\x12\x1b\n\x0funpacked_double\x18\x64 \x03(\x01\x42\x02\x10\x00\x12\x19\n\runpacked_bool\x18\x65 \x03(\x08\x42\x02\x10\x00\x12^\n\x14unpacked_nested_enum\x18\x66 \x03(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnumB\x02\x10\x00\x12]\n\x0fmap_int32_int32\x18\x38 \x03(\x0b\x32\x44.protobuf_test_messages.proto3.TestAllTypesProto3.MapInt32Int32Entry\x12]\n\x0fmap_int64_int64\x18\x39 \x03(\x0b\x32\x44.protobuf_test_messages.proto3.TestAllTypesProto3.MapInt64Int64Entry\x12\x61\n\x11map_uint32_uint32\x18: \x03(\x0b\x32\x46.protobuf_test_messages.proto3.TestAllTypesProto3.MapUint32Uint32Entry\x12\x61\n\x11map_uint64_uint64\x18; \x03(\x0b\x32\x46.protobuf_test_messages.proto3.TestAllTypesProto3.MapUint64Uint64Entry\x12\x61\n\x11map_sint32_sint32\x18< \x03(\x0b\x32\x46.protobuf_test_messages.proto3.TestAllTypesProto3.MapSint32Sint32Entry\x12\x61\n\x11map_sint64_sint64\x18= \x03(\x0b\x32\x46.protobuf_test_messages.proto3.TestAllTypesProto3.MapSint64Sint64Entry\x12\x65\n\x13map_fixed32_fixed32\x18> \x03(\x0b\x32H.protobuf_test_messages.proto3.TestAllTypesProto3.MapFixed32Fixed32Entry\x12\x65\n\x13map_fixed64_fixed64\x18? \x03(\x0b\x32H.protobuf_test_messages.proto3.TestAllTypesProto3.MapFixed64Fixed64Entry\x12i\n\x15map_sfixed32_sfixed32\x18@ \x03(\x0b\x32J.protobuf_test_messages.proto3.TestAllTypesProto3.MapSfixed32Sfixed32Entry\x12i\n\x15map_sfixed64_sfixed64\x18\x41 \x03(\x0b\x32J.protobuf_test_messages.proto3.TestAllTypesProto3.MapSfixed64Sfixed64Entry\x12]\n\x0fmap_int32_float\x18\x42 \x03(\x0b\x32\x44.protobuf_test_messages.proto3.TestAllTypesProto3.MapInt32FloatEntry\x12_\n\x10map_int32_double\x18\x43 \x03(\x0b\x32\x45.protobuf_test_messages.proto3.TestAllTypesProto3.MapInt32DoubleEntry\x12Y\n\rmap_bool_bool\x18\x44 \x03(\x0b\x32\x42.protobuf_test_messages.proto3.TestAllTypesProto3.MapBoolBoolEntry\x12\x61\n\x11map_string_string\x18\x45 \x03(\x0b\x32\x46.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringStringEntry\x12_\n\x10map_string_bytes\x18\x46 \x03(\x0b\x32\x45.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringBytesEntry\x12p\n\x19map_string_nested_message\x18G \x03(\x0b\x32M.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringNestedMessageEntry\x12r\n\x1amap_string_foreign_message\x18H \x03(\x0b\x32N.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringForeignMessageEntry\x12j\n\x16map_string_nested_enum\x18I \x03(\x0b\x32J.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringNestedEnumEntry\x12l\n\x17map_string_foreign_enum\x18J \x03(\x0b\x32K.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringForeignEnumEntry\x12\x16\n\x0coneof_uint32\x18o \x01(\rH\x00\x12_\n\x14oneof_nested_message\x18p \x01(\x0b\x32?.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessageH\x00\x12\x16\n\x0coneof_string\x18q \x01(\tH\x00\x12\x15\n\x0boneof_bytes\x18r \x01(\x0cH\x00\x12\x14\n\noneof_bool\x18s \x01(\x08H\x00\x12\x16\n\x0coneof_uint64\x18t \x01(\x04H\x00\x12\x15\n\x0boneof_float\x18u \x01(\x02H\x00\x12\x16\n\x0coneof_double\x18v \x01(\x01H\x00\x12R\n\noneof_enum\x18w \x01(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnumH\x00\x12\x36\n\x10oneof_null_value\x18x \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12:\n\x15optional_bool_wrapper\x18\xc9\x01 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12<\n\x16optional_int32_wrapper\x18\xca\x01 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12<\n\x16optional_int64_wrapper\x18\xcb\x01 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12>\n\x17optional_uint32_wrapper\x18\xcc\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12>\n\x17optional_uint64_wrapper\x18\xcd\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt64Value\x12<\n\x16optional_float_wrapper\x18\xce\x01 \x01(\x0b\x32\x1b.google.protobuf.FloatValue\x12>\n\x17optional_double_wrapper\x18\xcf\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12>\n\x17optional_string_wrapper\x18\xd0\x01 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12<\n\x16optional_bytes_wrapper\x18\xd1\x01 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x12:\n\x15repeated_bool_wrapper\x18\xd3\x01 \x03(\x0b\x32\x1a.google.protobuf.BoolValue\x12<\n\x16repeated_int32_wrapper\x18\xd4\x01 \x03(\x0b\x32\x1b.google.protobuf.Int32Value\x12<\n\x16repeated_int64_wrapper\x18\xd5\x01 \x03(\x0b\x32\x1b.google.protobuf.Int64Value\x12>\n\x17repeated_uint32_wrapper\x18\xd6\x01 \x03(\x0b\x32\x1c.google.protobuf.UInt32Value\x12>\n\x17repeated_uint64_wrapper\x18\xd7\x01 \x03(\x0b\x32\x1c.google.protobuf.UInt64Value\x12<\n\x16repeated_float_wrapper\x18\xd8\x01 \x03(\x0b\x32\x1b.google.protobuf.FloatValue\x12>\n\x17repeated_double_wrapper\x18\xd9\x01 \x03(\x0b\x32\x1c.google.protobuf.DoubleValue\x12>\n\x17repeated_string_wrapper\x18\xda\x01 \x03(\x0b\x32\x1c.google.protobuf.StringValue\x12<\n\x16repeated_bytes_wrapper\x18\xdb\x01 \x03(\x0b\x32\x1b.google.protobuf.BytesValue\x12\x35\n\x11optional_duration\x18\xad\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x12optional_timestamp\x18\xae\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x13optional_field_mask\x18\xaf\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x31\n\x0foptional_struct\x18\xb0\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12+\n\x0coptional_any\x18\xb1\x02 \x01(\x0b\x32\x14.google.protobuf.Any\x12/\n\x0eoptional_value\x18\xb2\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x38\n\x13optional_null_value\x18\xb3\x02 \x01(\x0e\x32\x1a.google.protobuf.NullValue\x12\x35\n\x11repeated_duration\x18\xb7\x02 \x03(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x12repeated_timestamp\x18\xb8\x02 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x12repeated_fieldmask\x18\xb9\x02 \x03(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x31\n\x0frepeated_struct\x18\xc4\x02 \x03(\x0b\x32\x17.google.protobuf.Struct\x12+\n\x0crepeated_any\x18\xbb\x02 \x03(\x0b\x32\x14.google.protobuf.Any\x12/\n\x0erepeated_value\x18\xbc\x02 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x38\n\x13repeated_list_value\x18\xbd\x02 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12\x13\n\nfieldname1\x18\x91\x03 \x01(\x05\x12\x14\n\x0b\x66ield_name2\x18\x92\x03 \x01(\x05\x12\x15\n\x0c_field_name3\x18\x93\x03 \x01(\x05\x12\x16\n\rfield__name4_\x18\x94\x03 \x01(\x05\x12\x14\n\x0b\x66ield0name5\x18\x95\x03 \x01(\x05\x12\x16\n\rfield_0_name6\x18\x96\x03 \x01(\x05\x12\x13\n\nfieldName7\x18\x97\x03 \x01(\x05\x12\x13\n\nFieldName8\x18\x98\x03 \x01(\x05\x12\x14\n\x0b\x66ield_Name9\x18\x99\x03 \x01(\x05\x12\x15\n\x0c\x46ield_Name10\x18\x9a\x03 \x01(\x05\x12\x15\n\x0c\x46IELD_NAME11\x18\x9b\x03 \x01(\x05\x12\x15\n\x0c\x46IELD_name12\x18\x9c\x03 \x01(\x05\x12\x17\n\x0e__field_name13\x18\x9d\x03 \x01(\x05\x12\x17\n\x0e__Field_name14\x18\x9e\x03 \x01(\x05\x12\x16\n\rfield__name15\x18\x9f\x03 \x01(\x05\x12\x16\n\rfield__Name16\x18\xa0\x03 \x01(\x05\x12\x17\n\x0e\x66ield_name17__\x18\xa1\x03 \x01(\x05\x12\x17\n\x0e\x46ield_name18__\x18\xa2\x03 \x01(\x05\x1a\x62\n\rNestedMessage\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\x46\n\x0b\x63orecursive\x18\x02 \x01(\x0b\x32\x31.protobuf_test_messages.proto3.TestAllTypesProto3\x1a\x34\n\x12MapInt32Int32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x34\n\x12MapInt64Int64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x36\n\x14MapUint32Uint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\x1a\x36\n\x14MapUint64Uint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x04:\x02\x38\x01\x1a\x36\n\x14MapSint32Sint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x11\x12\r\n\x05value\x18\x02 \x01(\x11:\x02\x38\x01\x1a\x36\n\x14MapSint64Sint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x12\x12\r\n\x05value\x18\x02 \x01(\x12:\x02\x38\x01\x1a\x38\n\x16MapFixed32Fixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x07\x12\r\n\x05value\x18\x02 \x01(\x07:\x02\x38\x01\x1a\x38\n\x16MapFixed64Fixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x06\x12\r\n\x05value\x18\x02 \x01(\x06:\x02\x38\x01\x1a:\n\x18MapSfixed32Sfixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x0f\x12\r\n\x05value\x18\x02 \x01(\x0f:\x02\x38\x01\x1a:\n\x18MapSfixed64Sfixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x10\x12\r\n\x05value\x18\x02 \x01(\x10:\x02\x38\x01\x1a\x34\n\x12MapInt32FloatEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x1a\x35\n\x13MapInt32DoubleEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x32\n\x10MapBoolBoolEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\x1a\x36\n\x14MapStringStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13MapStringBytesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\x1a~\n\x1bMapStringNestedMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12N\n\x05value\x18\x02 \x01(\x0b\x32?.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage:\x02\x38\x01\x1am\n\x1cMapStringForeignMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0b\x32-.protobuf_test_messages.proto3.ForeignMessage:\x02\x38\x01\x1ax\n\x18MapStringNestedEnumEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12K\n\x05value\x18\x02 \x01(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum:\x02\x38\x01\x1ag\n\x19MapStringForeignEnumEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0e\x32*.protobuf_test_messages.proto3.ForeignEnum:\x02\x38\x01\"9\n\nNestedEnum\x12\x07\n\x03\x46OO\x10\x00\x12\x07\n\x03\x42\x41R\x10\x01\x12\x07\n\x03\x42\x41Z\x10\x02\x12\x10\n\x03NEG\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\"Y\n\x0b\x41liasedEnum\x12\r\n\tALIAS_FOO\x10\x00\x12\r\n\tALIAS_BAR\x10\x01\x12\r\n\tALIAS_BAZ\x10\x02\x12\x07\n\x03QUX\x10\x02\x12\x07\n\x03qux\x10\x02\x12\x07\n\x03\x62\x41z\x10\x02\x1a\x02\x10\x01\x42\r\n\x0boneof_fieldJ\x06\x08\xf5\x03\x10\xff\x03\"\x1b\n\x0e\x46oreignMessage\x12\t\n\x01\x63\x18\x01 \x01(\x05\"\x16\n\x14NullHypothesisProto3\"/\n\x0e\x45numOnlyProto3\"\x1d\n\x04\x42ool\x12\n\n\x06kFalse\x10\x00\x12\t\n\x05kTrue\x10\x01*@\n\x0b\x46oreignEnum\x12\x0f\n\x0b\x46OREIGN_FOO\x10\x00\x12\x0f\n\x0b\x46OREIGN_BAR\x10\x01\x12\x0f\n\x0b\x46OREIGN_BAZ\x10\x02\x42\x38\n(com.google.protobuf_test_messages.proto3H\x01\xf8\x01\x01\xa2\x02\x06Proto3b\x06proto3') - -_FOREIGNENUM = DESCRIPTOR.enum_types_by_name['ForeignEnum'] -ForeignEnum = enum_type_wrapper.EnumTypeWrapper(_FOREIGNENUM) -FOREIGN_FOO = 0 -FOREIGN_BAR = 1 -FOREIGN_BAZ = 2 - - -_TESTALLTYPESPROTO3 = DESCRIPTOR.message_types_by_name['TestAllTypesProto3'] -_TESTALLTYPESPROTO3_NESTEDMESSAGE = _TESTALLTYPESPROTO3.nested_types_by_name['NestedMessage'] -_TESTALLTYPESPROTO3_MAPINT32INT32ENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapInt32Int32Entry'] -_TESTALLTYPESPROTO3_MAPINT64INT64ENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapInt64Int64Entry'] -_TESTALLTYPESPROTO3_MAPUINT32UINT32ENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapUint32Uint32Entry'] -_TESTALLTYPESPROTO3_MAPUINT64UINT64ENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapUint64Uint64Entry'] -_TESTALLTYPESPROTO3_MAPSINT32SINT32ENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapSint32Sint32Entry'] -_TESTALLTYPESPROTO3_MAPSINT64SINT64ENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapSint64Sint64Entry'] -_TESTALLTYPESPROTO3_MAPFIXED32FIXED32ENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapFixed32Fixed32Entry'] -_TESTALLTYPESPROTO3_MAPFIXED64FIXED64ENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapFixed64Fixed64Entry'] -_TESTALLTYPESPROTO3_MAPSFIXED32SFIXED32ENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapSfixed32Sfixed32Entry'] -_TESTALLTYPESPROTO3_MAPSFIXED64SFIXED64ENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapSfixed64Sfixed64Entry'] -_TESTALLTYPESPROTO3_MAPINT32FLOATENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapInt32FloatEntry'] -_TESTALLTYPESPROTO3_MAPINT32DOUBLEENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapInt32DoubleEntry'] -_TESTALLTYPESPROTO3_MAPBOOLBOOLENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapBoolBoolEntry'] -_TESTALLTYPESPROTO3_MAPSTRINGSTRINGENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapStringStringEntry'] -_TESTALLTYPESPROTO3_MAPSTRINGBYTESENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapStringBytesEntry'] -_TESTALLTYPESPROTO3_MAPSTRINGNESTEDMESSAGEENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapStringNestedMessageEntry'] -_TESTALLTYPESPROTO3_MAPSTRINGFOREIGNMESSAGEENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapStringForeignMessageEntry'] -_TESTALLTYPESPROTO3_MAPSTRINGNESTEDENUMENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapStringNestedEnumEntry'] -_TESTALLTYPESPROTO3_MAPSTRINGFOREIGNENUMENTRY = _TESTALLTYPESPROTO3.nested_types_by_name['MapStringForeignEnumEntry'] -_FOREIGNMESSAGE = DESCRIPTOR.message_types_by_name['ForeignMessage'] -_NULLHYPOTHESISPROTO3 = DESCRIPTOR.message_types_by_name['NullHypothesisProto3'] -_ENUMONLYPROTO3 = DESCRIPTOR.message_types_by_name['EnumOnlyProto3'] -_TESTALLTYPESPROTO3_NESTEDENUM = _TESTALLTYPESPROTO3.enum_types_by_name['NestedEnum'] -_TESTALLTYPESPROTO3_ALIASEDENUM = _TESTALLTYPESPROTO3.enum_types_by_name['AliasedEnum'] -_ENUMONLYPROTO3_BOOL = _ENUMONLYPROTO3.enum_types_by_name['Bool'] -TestAllTypesProto3 = _reflection.GeneratedProtocolMessageType('TestAllTypesProto3', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_NESTEDMESSAGE, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage) - }) - , - - 'MapInt32Int32Entry' : _reflection.GeneratedProtocolMessageType('MapInt32Int32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPINT32INT32ENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapInt32Int32Entry) - }) - , - - 'MapInt64Int64Entry' : _reflection.GeneratedProtocolMessageType('MapInt64Int64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPINT64INT64ENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapInt64Int64Entry) - }) - , - - 'MapUint32Uint32Entry' : _reflection.GeneratedProtocolMessageType('MapUint32Uint32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPUINT32UINT32ENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapUint32Uint32Entry) - }) - , - - 'MapUint64Uint64Entry' : _reflection.GeneratedProtocolMessageType('MapUint64Uint64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPUINT64UINT64ENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapUint64Uint64Entry) - }) - , - - 'MapSint32Sint32Entry' : _reflection.GeneratedProtocolMessageType('MapSint32Sint32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPSINT32SINT32ENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapSint32Sint32Entry) - }) - , - - 'MapSint64Sint64Entry' : _reflection.GeneratedProtocolMessageType('MapSint64Sint64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPSINT64SINT64ENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapSint64Sint64Entry) - }) - , - - 'MapFixed32Fixed32Entry' : _reflection.GeneratedProtocolMessageType('MapFixed32Fixed32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPFIXED32FIXED32ENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapFixed32Fixed32Entry) - }) - , - - 'MapFixed64Fixed64Entry' : _reflection.GeneratedProtocolMessageType('MapFixed64Fixed64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPFIXED64FIXED64ENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapFixed64Fixed64Entry) - }) - , - - 'MapSfixed32Sfixed32Entry' : _reflection.GeneratedProtocolMessageType('MapSfixed32Sfixed32Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPSFIXED32SFIXED32ENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapSfixed32Sfixed32Entry) - }) - , - - 'MapSfixed64Sfixed64Entry' : _reflection.GeneratedProtocolMessageType('MapSfixed64Sfixed64Entry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPSFIXED64SFIXED64ENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapSfixed64Sfixed64Entry) - }) - , - - 'MapInt32FloatEntry' : _reflection.GeneratedProtocolMessageType('MapInt32FloatEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPINT32FLOATENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapInt32FloatEntry) - }) - , - - 'MapInt32DoubleEntry' : _reflection.GeneratedProtocolMessageType('MapInt32DoubleEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPINT32DOUBLEENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapInt32DoubleEntry) - }) - , - - 'MapBoolBoolEntry' : _reflection.GeneratedProtocolMessageType('MapBoolBoolEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPBOOLBOOLENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapBoolBoolEntry) - }) - , - - 'MapStringStringEntry' : _reflection.GeneratedProtocolMessageType('MapStringStringEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPSTRINGSTRINGENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapStringStringEntry) - }) - , - - 'MapStringBytesEntry' : _reflection.GeneratedProtocolMessageType('MapStringBytesEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPSTRINGBYTESENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapStringBytesEntry) - }) - , - - 'MapStringNestedMessageEntry' : _reflection.GeneratedProtocolMessageType('MapStringNestedMessageEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPSTRINGNESTEDMESSAGEENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapStringNestedMessageEntry) - }) - , - - 'MapStringForeignMessageEntry' : _reflection.GeneratedProtocolMessageType('MapStringForeignMessageEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPSTRINGFOREIGNMESSAGEENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapStringForeignMessageEntry) - }) - , - - 'MapStringNestedEnumEntry' : _reflection.GeneratedProtocolMessageType('MapStringNestedEnumEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPSTRINGNESTEDENUMENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapStringNestedEnumEntry) - }) - , - - 'MapStringForeignEnumEntry' : _reflection.GeneratedProtocolMessageType('MapStringForeignEnumEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPESPROTO3_MAPSTRINGFOREIGNENUMENTRY, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3.MapStringForeignEnumEntry) - }) - , - 'DESCRIPTOR' : _TESTALLTYPESPROTO3, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.TestAllTypesProto3) - }) -_sym_db.RegisterMessage(TestAllTypesProto3) -_sym_db.RegisterMessage(TestAllTypesProto3.NestedMessage) -_sym_db.RegisterMessage(TestAllTypesProto3.MapInt32Int32Entry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapInt64Int64Entry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapUint32Uint32Entry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapUint64Uint64Entry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapSint32Sint32Entry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapSint64Sint64Entry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapFixed32Fixed32Entry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapFixed64Fixed64Entry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapSfixed32Sfixed32Entry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapSfixed64Sfixed64Entry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapInt32FloatEntry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapInt32DoubleEntry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapBoolBoolEntry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapStringStringEntry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapStringBytesEntry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapStringNestedMessageEntry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapStringForeignMessageEntry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapStringNestedEnumEntry) -_sym_db.RegisterMessage(TestAllTypesProto3.MapStringForeignEnumEntry) - -ForeignMessage = _reflection.GeneratedProtocolMessageType('ForeignMessage', (_message.Message,), { - 'DESCRIPTOR' : _FOREIGNMESSAGE, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.ForeignMessage) - }) -_sym_db.RegisterMessage(ForeignMessage) - -NullHypothesisProto3 = _reflection.GeneratedProtocolMessageType('NullHypothesisProto3', (_message.Message,), { - 'DESCRIPTOR' : _NULLHYPOTHESISPROTO3, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.NullHypothesisProto3) - }) -_sym_db.RegisterMessage(NullHypothesisProto3) - -EnumOnlyProto3 = _reflection.GeneratedProtocolMessageType('EnumOnlyProto3', (_message.Message,), { - 'DESCRIPTOR' : _ENUMONLYPROTO3, - '__module__' : 'google.protobuf.test_messages_proto3_pb2' - # @@protoc_insertion_point(class_scope:protobuf_test_messages.proto3.EnumOnlyProto3) - }) -_sym_db.RegisterMessage(EnumOnlyProto3) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*google/protobuf/test_messages_proto3.proto\x12\x1dprotobuf_test_messages.proto3\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xb1\x45\n\x12TestAllTypesProto3\x12\x16\n\x0eoptional_int32\x18\x01 \x01(\x05\x12\x16\n\x0eoptional_int64\x18\x02 \x01(\x03\x12\x17\n\x0foptional_uint32\x18\x03 \x01(\r\x12\x17\n\x0foptional_uint64\x18\x04 \x01(\x04\x12\x17\n\x0foptional_sint32\x18\x05 \x01(\x11\x12\x17\n\x0foptional_sint64\x18\x06 \x01(\x12\x12\x18\n\x10optional_fixed32\x18\x07 \x01(\x07\x12\x18\n\x10optional_fixed64\x18\x08 \x01(\x06\x12\x19\n\x11optional_sfixed32\x18\t \x01(\x0f\x12\x19\n\x11optional_sfixed64\x18\n \x01(\x10\x12\x16\n\x0eoptional_float\x18\x0b \x01(\x02\x12\x17\n\x0foptional_double\x18\x0c \x01(\x01\x12\x15\n\roptional_bool\x18\r \x01(\x08\x12\x17\n\x0foptional_string\x18\x0e \x01(\t\x12\x16\n\x0eoptional_bytes\x18\x0f \x01(\x0c\x12`\n\x17optional_nested_message\x18\x12 \x01(\x0b\x32?.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage\x12O\n\x18optional_foreign_message\x18\x13 \x01(\x0b\x32-.protobuf_test_messages.proto3.ForeignMessage\x12Z\n\x14optional_nested_enum\x18\x15 \x01(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum\x12I\n\x15optional_foreign_enum\x18\x16 \x01(\x0e\x32*.protobuf_test_messages.proto3.ForeignEnum\x12\\\n\x15optional_aliased_enum\x18\x17 \x01(\x0e\x32=.protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum\x12!\n\x15optional_string_piece\x18\x18 \x01(\tB\x02\x08\x02\x12\x19\n\roptional_cord\x18\x19 \x01(\tB\x02\x08\x01\x12L\n\x11recursive_message\x18\x1b \x01(\x0b\x32\x31.protobuf_test_messages.proto3.TestAllTypesProto3\x12\x16\n\x0erepeated_int32\x18\x1f \x03(\x05\x12\x16\n\x0erepeated_int64\x18 \x03(\x03\x12\x17\n\x0frepeated_uint32\x18! \x03(\r\x12\x17\n\x0frepeated_uint64\x18\" \x03(\x04\x12\x17\n\x0frepeated_sint32\x18# \x03(\x11\x12\x17\n\x0frepeated_sint64\x18$ \x03(\x12\x12\x18\n\x10repeated_fixed32\x18% \x03(\x07\x12\x18\n\x10repeated_fixed64\x18& \x03(\x06\x12\x19\n\x11repeated_sfixed32\x18\' \x03(\x0f\x12\x19\n\x11repeated_sfixed64\x18( \x03(\x10\x12\x16\n\x0erepeated_float\x18) \x03(\x02\x12\x17\n\x0frepeated_double\x18* \x03(\x01\x12\x15\n\rrepeated_bool\x18+ \x03(\x08\x12\x17\n\x0frepeated_string\x18, \x03(\t\x12\x16\n\x0erepeated_bytes\x18- \x03(\x0c\x12`\n\x17repeated_nested_message\x18\x30 \x03(\x0b\x32?.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage\x12O\n\x18repeated_foreign_message\x18\x31 \x03(\x0b\x32-.protobuf_test_messages.proto3.ForeignMessage\x12Z\n\x14repeated_nested_enum\x18\x33 \x03(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum\x12I\n\x15repeated_foreign_enum\x18\x34 \x03(\x0e\x32*.protobuf_test_messages.proto3.ForeignEnum\x12!\n\x15repeated_string_piece\x18\x36 \x03(\tB\x02\x08\x02\x12\x19\n\rrepeated_cord\x18\x37 \x03(\tB\x02\x08\x01\x12\x18\n\x0cpacked_int32\x18K \x03(\x05\x42\x02\x10\x01\x12\x18\n\x0cpacked_int64\x18L \x03(\x03\x42\x02\x10\x01\x12\x19\n\rpacked_uint32\x18M \x03(\rB\x02\x10\x01\x12\x19\n\rpacked_uint64\x18N \x03(\x04\x42\x02\x10\x01\x12\x19\n\rpacked_sint32\x18O \x03(\x11\x42\x02\x10\x01\x12\x19\n\rpacked_sint64\x18P \x03(\x12\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed32\x18Q \x03(\x07\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed64\x18R \x03(\x06\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed32\x18S \x03(\x0f\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed64\x18T \x03(\x10\x42\x02\x10\x01\x12\x18\n\x0cpacked_float\x18U \x03(\x02\x42\x02\x10\x01\x12\x19\n\rpacked_double\x18V \x03(\x01\x42\x02\x10\x01\x12\x17\n\x0bpacked_bool\x18W \x03(\x08\x42\x02\x10\x01\x12\\\n\x12packed_nested_enum\x18X \x03(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnumB\x02\x10\x01\x12\x1a\n\x0eunpacked_int32\x18Y \x03(\x05\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_int64\x18Z \x03(\x03\x42\x02\x10\x00\x12\x1b\n\x0funpacked_uint32\x18[ \x03(\rB\x02\x10\x00\x12\x1b\n\x0funpacked_uint64\x18\\ \x03(\x04\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint32\x18] \x03(\x11\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint64\x18^ \x03(\x12\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed32\x18_ \x03(\x07\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed64\x18` \x03(\x06\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed32\x18\x61 \x03(\x0f\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed64\x18\x62 \x03(\x10\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_float\x18\x63 \x03(\x02\x42\x02\x10\x00\x12\x1b\n\x0funpacked_double\x18\x64 \x03(\x01\x42\x02\x10\x00\x12\x19\n\runpacked_bool\x18\x65 \x03(\x08\x42\x02\x10\x00\x12^\n\x14unpacked_nested_enum\x18\x66 \x03(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnumB\x02\x10\x00\x12]\n\x0fmap_int32_int32\x18\x38 \x03(\x0b\x32\x44.protobuf_test_messages.proto3.TestAllTypesProto3.MapInt32Int32Entry\x12]\n\x0fmap_int64_int64\x18\x39 \x03(\x0b\x32\x44.protobuf_test_messages.proto3.TestAllTypesProto3.MapInt64Int64Entry\x12\x61\n\x11map_uint32_uint32\x18: \x03(\x0b\x32\x46.protobuf_test_messages.proto3.TestAllTypesProto3.MapUint32Uint32Entry\x12\x61\n\x11map_uint64_uint64\x18; \x03(\x0b\x32\x46.protobuf_test_messages.proto3.TestAllTypesProto3.MapUint64Uint64Entry\x12\x61\n\x11map_sint32_sint32\x18< \x03(\x0b\x32\x46.protobuf_test_messages.proto3.TestAllTypesProto3.MapSint32Sint32Entry\x12\x61\n\x11map_sint64_sint64\x18= \x03(\x0b\x32\x46.protobuf_test_messages.proto3.TestAllTypesProto3.MapSint64Sint64Entry\x12\x65\n\x13map_fixed32_fixed32\x18> \x03(\x0b\x32H.protobuf_test_messages.proto3.TestAllTypesProto3.MapFixed32Fixed32Entry\x12\x65\n\x13map_fixed64_fixed64\x18? \x03(\x0b\x32H.protobuf_test_messages.proto3.TestAllTypesProto3.MapFixed64Fixed64Entry\x12i\n\x15map_sfixed32_sfixed32\x18@ \x03(\x0b\x32J.protobuf_test_messages.proto3.TestAllTypesProto3.MapSfixed32Sfixed32Entry\x12i\n\x15map_sfixed64_sfixed64\x18\x41 \x03(\x0b\x32J.protobuf_test_messages.proto3.TestAllTypesProto3.MapSfixed64Sfixed64Entry\x12]\n\x0fmap_int32_float\x18\x42 \x03(\x0b\x32\x44.protobuf_test_messages.proto3.TestAllTypesProto3.MapInt32FloatEntry\x12_\n\x10map_int32_double\x18\x43 \x03(\x0b\x32\x45.protobuf_test_messages.proto3.TestAllTypesProto3.MapInt32DoubleEntry\x12Y\n\rmap_bool_bool\x18\x44 \x03(\x0b\x32\x42.protobuf_test_messages.proto3.TestAllTypesProto3.MapBoolBoolEntry\x12\x61\n\x11map_string_string\x18\x45 \x03(\x0b\x32\x46.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringStringEntry\x12_\n\x10map_string_bytes\x18\x46 \x03(\x0b\x32\x45.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringBytesEntry\x12p\n\x19map_string_nested_message\x18G \x03(\x0b\x32M.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringNestedMessageEntry\x12r\n\x1amap_string_foreign_message\x18H \x03(\x0b\x32N.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringForeignMessageEntry\x12j\n\x16map_string_nested_enum\x18I \x03(\x0b\x32J.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringNestedEnumEntry\x12l\n\x17map_string_foreign_enum\x18J \x03(\x0b\x32K.protobuf_test_messages.proto3.TestAllTypesProto3.MapStringForeignEnumEntry\x12\x16\n\x0coneof_uint32\x18o \x01(\rH\x00\x12_\n\x14oneof_nested_message\x18p \x01(\x0b\x32?.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessageH\x00\x12\x16\n\x0coneof_string\x18q \x01(\tH\x00\x12\x15\n\x0boneof_bytes\x18r \x01(\x0cH\x00\x12\x14\n\noneof_bool\x18s \x01(\x08H\x00\x12\x16\n\x0coneof_uint64\x18t \x01(\x04H\x00\x12\x15\n\x0boneof_float\x18u \x01(\x02H\x00\x12\x16\n\x0coneof_double\x18v \x01(\x01H\x00\x12R\n\noneof_enum\x18w \x01(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnumH\x00\x12\x36\n\x10oneof_null_value\x18x \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12:\n\x15optional_bool_wrapper\x18\xc9\x01 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12<\n\x16optional_int32_wrapper\x18\xca\x01 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12<\n\x16optional_int64_wrapper\x18\xcb\x01 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12>\n\x17optional_uint32_wrapper\x18\xcc\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12>\n\x17optional_uint64_wrapper\x18\xcd\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt64Value\x12<\n\x16optional_float_wrapper\x18\xce\x01 \x01(\x0b\x32\x1b.google.protobuf.FloatValue\x12>\n\x17optional_double_wrapper\x18\xcf\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12>\n\x17optional_string_wrapper\x18\xd0\x01 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12<\n\x16optional_bytes_wrapper\x18\xd1\x01 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x12:\n\x15repeated_bool_wrapper\x18\xd3\x01 \x03(\x0b\x32\x1a.google.protobuf.BoolValue\x12<\n\x16repeated_int32_wrapper\x18\xd4\x01 \x03(\x0b\x32\x1b.google.protobuf.Int32Value\x12<\n\x16repeated_int64_wrapper\x18\xd5\x01 \x03(\x0b\x32\x1b.google.protobuf.Int64Value\x12>\n\x17repeated_uint32_wrapper\x18\xd6\x01 \x03(\x0b\x32\x1c.google.protobuf.UInt32Value\x12>\n\x17repeated_uint64_wrapper\x18\xd7\x01 \x03(\x0b\x32\x1c.google.protobuf.UInt64Value\x12<\n\x16repeated_float_wrapper\x18\xd8\x01 \x03(\x0b\x32\x1b.google.protobuf.FloatValue\x12>\n\x17repeated_double_wrapper\x18\xd9\x01 \x03(\x0b\x32\x1c.google.protobuf.DoubleValue\x12>\n\x17repeated_string_wrapper\x18\xda\x01 \x03(\x0b\x32\x1c.google.protobuf.StringValue\x12<\n\x16repeated_bytes_wrapper\x18\xdb\x01 \x03(\x0b\x32\x1b.google.protobuf.BytesValue\x12\x35\n\x11optional_duration\x18\xad\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x12optional_timestamp\x18\xae\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x13optional_field_mask\x18\xaf\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x31\n\x0foptional_struct\x18\xb0\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12+\n\x0coptional_any\x18\xb1\x02 \x01(\x0b\x32\x14.google.protobuf.Any\x12/\n\x0eoptional_value\x18\xb2\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x38\n\x13optional_null_value\x18\xb3\x02 \x01(\x0e\x32\x1a.google.protobuf.NullValue\x12\x35\n\x11repeated_duration\x18\xb7\x02 \x03(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x12repeated_timestamp\x18\xb8\x02 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x12repeated_fieldmask\x18\xb9\x02 \x03(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x31\n\x0frepeated_struct\x18\xc4\x02 \x03(\x0b\x32\x17.google.protobuf.Struct\x12+\n\x0crepeated_any\x18\xbb\x02 \x03(\x0b\x32\x14.google.protobuf.Any\x12/\n\x0erepeated_value\x18\xbc\x02 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x38\n\x13repeated_list_value\x18\xbd\x02 \x03(\x0b\x32\x1a.google.protobuf.ListValue\x12\x13\n\nfieldname1\x18\x91\x03 \x01(\x05\x12\x14\n\x0b\x66ield_name2\x18\x92\x03 \x01(\x05\x12\x15\n\x0c_field_name3\x18\x93\x03 \x01(\x05\x12\x16\n\rfield__name4_\x18\x94\x03 \x01(\x05\x12\x14\n\x0b\x66ield0name5\x18\x95\x03 \x01(\x05\x12\x16\n\rfield_0_name6\x18\x96\x03 \x01(\x05\x12\x13\n\nfieldName7\x18\x97\x03 \x01(\x05\x12\x13\n\nFieldName8\x18\x98\x03 \x01(\x05\x12\x14\n\x0b\x66ield_Name9\x18\x99\x03 \x01(\x05\x12\x15\n\x0c\x46ield_Name10\x18\x9a\x03 \x01(\x05\x12\x15\n\x0c\x46IELD_NAME11\x18\x9b\x03 \x01(\x05\x12\x15\n\x0c\x46IELD_name12\x18\x9c\x03 \x01(\x05\x12\x17\n\x0e__field_name13\x18\x9d\x03 \x01(\x05\x12\x17\n\x0e__Field_name14\x18\x9e\x03 \x01(\x05\x12\x16\n\rfield__name15\x18\x9f\x03 \x01(\x05\x12\x16\n\rfield__Name16\x18\xa0\x03 \x01(\x05\x12\x17\n\x0e\x66ield_name17__\x18\xa1\x03 \x01(\x05\x12\x17\n\x0e\x46ield_name18__\x18\xa2\x03 \x01(\x05\x1a\x62\n\rNestedMessage\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\x46\n\x0b\x63orecursive\x18\x02 \x01(\x0b\x32\x31.protobuf_test_messages.proto3.TestAllTypesProto3\x1a\x34\n\x12MapInt32Int32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x34\n\x12MapInt64Int64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x36\n\x14MapUint32Uint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\x1a\x36\n\x14MapUint64Uint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x04:\x02\x38\x01\x1a\x36\n\x14MapSint32Sint32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x11\x12\r\n\x05value\x18\x02 \x01(\x11:\x02\x38\x01\x1a\x36\n\x14MapSint64Sint64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x12\x12\r\n\x05value\x18\x02 \x01(\x12:\x02\x38\x01\x1a\x38\n\x16MapFixed32Fixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x07\x12\r\n\x05value\x18\x02 \x01(\x07:\x02\x38\x01\x1a\x38\n\x16MapFixed64Fixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x06\x12\r\n\x05value\x18\x02 \x01(\x06:\x02\x38\x01\x1a:\n\x18MapSfixed32Sfixed32Entry\x12\x0b\n\x03key\x18\x01 \x01(\x0f\x12\r\n\x05value\x18\x02 \x01(\x0f:\x02\x38\x01\x1a:\n\x18MapSfixed64Sfixed64Entry\x12\x0b\n\x03key\x18\x01 \x01(\x10\x12\r\n\x05value\x18\x02 \x01(\x10:\x02\x38\x01\x1a\x34\n\x12MapInt32FloatEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x1a\x35\n\x13MapInt32DoubleEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x32\n\x10MapBoolBoolEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\x1a\x36\n\x14MapStringStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13MapStringBytesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\x1a~\n\x1bMapStringNestedMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12N\n\x05value\x18\x02 \x01(\x0b\x32?.protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage:\x02\x38\x01\x1am\n\x1cMapStringForeignMessageEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0b\x32-.protobuf_test_messages.proto3.ForeignMessage:\x02\x38\x01\x1ax\n\x18MapStringNestedEnumEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12K\n\x05value\x18\x02 \x01(\x0e\x32<.protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum:\x02\x38\x01\x1ag\n\x19MapStringForeignEnumEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0e\x32*.protobuf_test_messages.proto3.ForeignEnum:\x02\x38\x01\"9\n\nNestedEnum\x12\x07\n\x03\x46OO\x10\x00\x12\x07\n\x03\x42\x41R\x10\x01\x12\x07\n\x03\x42\x41Z\x10\x02\x12\x10\n\x03NEG\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\"Y\n\x0b\x41liasedEnum\x12\r\n\tALIAS_FOO\x10\x00\x12\r\n\tALIAS_BAR\x10\x01\x12\r\n\tALIAS_BAZ\x10\x02\x12\x07\n\x03MOO\x10\x02\x12\x07\n\x03moo\x10\x02\x12\x07\n\x03\x62\x41z\x10\x02\x1a\x02\x10\x01\x42\r\n\x0boneof_fieldJ\x06\x08\xf5\x03\x10\xff\x03\"\x1b\n\x0e\x46oreignMessage\x12\t\n\x01\x63\x18\x01 \x01(\x05\"\x16\n\x14NullHypothesisProto3\"/\n\x0e\x45numOnlyProto3\"\x1d\n\x04\x42ool\x12\n\n\x06kFalse\x10\x00\x12\t\n\x05kTrue\x10\x01*@\n\x0b\x46oreignEnum\x12\x0f\n\x0b\x46OREIGN_FOO\x10\x00\x12\x0f\n\x0b\x46OREIGN_BAR\x10\x01\x12\x0f\n\x0b\x46OREIGN_BAZ\x10\x02\x42\x38\n(com.google.protobuf_test_messages.proto3H\x01\xf8\x01\x01\xa2\x02\x06Proto3b\x06proto3') +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.test_messages_proto3_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/text_format.py b/windows/python/google/protobuf/text_format.py index 412385c26..a6d8bcf64 100644 --- a/windows/python/google/protobuf/text_format.py +++ b/windows/python/google/protobuf/text_format.py @@ -53,6 +53,7 @@ from google.protobuf.internal import decoder from google.protobuf.internal import type_checkers from google.protobuf import descriptor from google.protobuf import text_encoding +from google.protobuf import unknown_fields # pylint: disable=g-import-not-at-top __all__ = ['MessageToString', 'Parse', 'PrintMessage', 'PrintField', @@ -136,8 +137,6 @@ def MessageToString( Args: message: The protocol buffers message. as_utf8: Return unescaped Unicode for non-ASCII characters. - In Python 3 actual Unicode characters may appear as is in strings. - In Python 2 the return value will be valid UTF-8 rather than only ASCII. as_one_line: Don't introduce newlines between fields. use_short_repeated_primitives: Use short repeated format for primitives. pointy_brackets: If True, use angle brackets instead of curly braces for @@ -223,6 +222,36 @@ def PrintMessage(message, message_formatter=None, print_unknown_fields=False, force_colon=False): + """Convert the message to text format and write it to the out stream. + + Args: + message: The Message object to convert to text format. + out: A file handle to write the message to. + indent: The initial indent level for pretty print. + as_utf8: Return unescaped Unicode for non-ASCII characters. + as_one_line: Don't introduce newlines between fields. + use_short_repeated_primitives: Use short repeated format for primitives. + pointy_brackets: If True, use angle brackets instead of curly braces for + nesting. + use_index_order: If True, print fields of a proto message using the order + defined in source code instead of the field number. By default, use the + field number order. + float_format: If set, use this to specify float field formatting + (per the "Format Specification Mini-Language"); otherwise, shortest + float that has same value in wire will be printed. Also affect double + field if double_format is not set but float_format is set. + double_format: If set, use this to specify double field formatting + (per the "Format Specification Mini-Language"); if it is not set but + float_format is set, use float_format. Otherwise, str() is used. + use_field_number: If True, print field numbers instead of names. + descriptor_pool: A DescriptorPool used to resolve Any types. + message_formatter: A function(message, indent, as_one_line): unicode|None + to custom format selected sub-messages (usually based on message type). + Use to pretty print parts of the protobuf for easier diffing. + print_unknown_fields: If True, unknown fields will be printed. + force_colon: If set, a colon will be added after the field name even if + the field is a proto message. + """ printer = _Printer( out=out, indent=indent, as_utf8=as_utf8, as_one_line=as_one_line, @@ -347,8 +376,6 @@ class _Printer(object): out: To record the text format result. indent: The initial indent level for pretty print. as_utf8: Return unescaped Unicode for non-ASCII characters. - In Python 3 actual Unicode characters may appear as is in strings. - In Python 2 the return value will be valid UTF-8 rather than ASCII. as_one_line: Don't introduce newlines between fields. use_short_repeated_primitives: Use short repeated format for primitives. pointy_brackets: If True, use angle brackets instead of curly braces for @@ -454,12 +481,12 @@ class _Printer(object): self.PrintField(field, value) if self.print_unknown_fields: - self._PrintUnknownFields(message.UnknownFields()) + self._PrintUnknownFields(unknown_fields.UnknownFieldSet(message)) - def _PrintUnknownFields(self, unknown_fields): + def _PrintUnknownFields(self, unknown_field_set): """Print unknown fields.""" out = self.out - for field in unknown_fields: + for field in unknown_field_set: out.write(' ' * self.indent) out.write(str(field.field_number)) if field.wire_type == WIRETYPE_START_GROUP: @@ -859,7 +886,10 @@ class _Parser(object): expanded_any_end_token = '}' expanded_any_sub_message = _BuildMessageFromTypeName(packed_type_name, self.descriptor_pool) - if not expanded_any_sub_message: + # Direct comparison with None is used instead of implicit bool conversion + # to avoid false positives with falsy initial values, e.g. for + # google.protobuf.ListValue. + if expanded_any_sub_message is None: raise ParseError('Type %s not found in descriptor pool' % packed_type_name) while not tokenizer.TryConsume(expanded_any_end_token): @@ -1143,9 +1173,12 @@ def _SkipFieldContents(tokenizer): # start with "{" or "<" which indicates the beginning of a message body. # If there is no ":" or there is a "{" or "<" after ":", this field has # to be a message or the input is ill-formed. - if tokenizer.TryConsume(':') and not tokenizer.LookingAt( - '{') and not tokenizer.LookingAt('<'): - _SkipFieldValue(tokenizer) + if tokenizer.TryConsume( + ':') and not tokenizer.LookingAt('{') and not tokenizer.LookingAt('<'): + if tokenizer.LookingAt('['): + _SkipRepeatedFieldValue(tokenizer) + else: + _SkipFieldValue(tokenizer) else: _SkipFieldMessage(tokenizer) @@ -1214,6 +1247,20 @@ def _SkipFieldValue(tokenizer): raise ParseError('Invalid field value: ' + tokenizer.token) +def _SkipRepeatedFieldValue(tokenizer): + """Skips over a repeated field value. + + Args: + tokenizer: A tokenizer to parse the field value. + """ + tokenizer.Consume('[') + if not tokenizer.LookingAt(']'): + _SkipFieldValue(tokenizer) + while tokenizer.TryConsume(','): + _SkipFieldValue(tokenizer) + tokenizer.Consume(']') + + class Tokenizer(object): """Protocol buffer text representation tokenizer. diff --git a/windows/python/google/protobuf/timestamp_pb2.py b/windows/python/google/protobuf/timestamp_pb2.py index 48e6e123d..558d49694 100644 --- a/windows/python/google/protobuf/timestamp_pb2.py +++ b/windows/python/google/protobuf/timestamp_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/timestamp.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,16 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fgoogle/protobuf/timestamp.proto\x12\x0fgoogle.protobuf\"+\n\tTimestamp\x12\x0f\n\x07seconds\x18\x01 \x01(\x03\x12\r\n\x05nanos\x18\x02 \x01(\x05\x42\x85\x01\n\x13\x63om.google.protobufB\x0eTimestampProtoP\x01Z2google.golang.org/protobuf/types/known/timestamppb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3') - - -_TIMESTAMP = DESCRIPTOR.message_types_by_name['Timestamp'] -Timestamp = _reflection.GeneratedProtocolMessageType('Timestamp', (_message.Message,), { - 'DESCRIPTOR' : _TIMESTAMP, - '__module__' : 'google.protobuf.timestamp_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Timestamp) - }) -_sym_db.RegisterMessage(Timestamp) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.timestamp_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/type_pb2.py b/windows/python/google/protobuf/type_pb2.py index a1a45371e..19903fb6b 100644 --- a/windows/python/google/protobuf/type_pb2.py +++ b/windows/python/google/protobuf/type_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/type.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -19,54 +17,8 @@ from google.protobuf import source_context_pb2 as google_dot_protobuf_dot_source DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1agoogle/protobuf/type.proto\x12\x0fgoogle.protobuf\x1a\x19google/protobuf/any.proto\x1a$google/protobuf/source_context.proto\"\xd7\x01\n\x04Type\x12\x0c\n\x04name\x18\x01 \x01(\t\x12&\n\x06\x66ields\x18\x02 \x03(\x0b\x32\x16.google.protobuf.Field\x12\x0e\n\x06oneofs\x18\x03 \x03(\t\x12(\n\x07options\x18\x04 \x03(\x0b\x32\x17.google.protobuf.Option\x12\x36\n\x0esource_context\x18\x05 \x01(\x0b\x32\x1e.google.protobuf.SourceContext\x12\'\n\x06syntax\x18\x06 \x01(\x0e\x32\x17.google.protobuf.Syntax\"\xd5\x05\n\x05\x46ield\x12)\n\x04kind\x18\x01 \x01(\x0e\x32\x1b.google.protobuf.Field.Kind\x12\x37\n\x0b\x63\x61rdinality\x18\x02 \x01(\x0e\x32\".google.protobuf.Field.Cardinality\x12\x0e\n\x06number\x18\x03 \x01(\x05\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x10\n\x08type_url\x18\x06 \x01(\t\x12\x13\n\x0boneof_index\x18\x07 \x01(\x05\x12\x0e\n\x06packed\x18\x08 \x01(\x08\x12(\n\x07options\x18\t \x03(\x0b\x32\x17.google.protobuf.Option\x12\x11\n\tjson_name\x18\n \x01(\t\x12\x15\n\rdefault_value\x18\x0b \x01(\t\"\xc8\x02\n\x04Kind\x12\x10\n\x0cTYPE_UNKNOWN\x10\x00\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12\"t\n\x0b\x43\x61rdinality\x12\x17\n\x13\x43\x41RDINALITY_UNKNOWN\x10\x00\x12\x18\n\x14\x43\x41RDINALITY_OPTIONAL\x10\x01\x12\x18\n\x14\x43\x41RDINALITY_REQUIRED\x10\x02\x12\x18\n\x14\x43\x41RDINALITY_REPEATED\x10\x03\"\xce\x01\n\x04\x45num\x12\x0c\n\x04name\x18\x01 \x01(\t\x12-\n\tenumvalue\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.EnumValue\x12(\n\x07options\x18\x03 \x03(\x0b\x32\x17.google.protobuf.Option\x12\x36\n\x0esource_context\x18\x04 \x01(\x0b\x32\x1e.google.protobuf.SourceContext\x12\'\n\x06syntax\x18\x05 \x01(\x0e\x32\x17.google.protobuf.Syntax\"S\n\tEnumValue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06number\x18\x02 \x01(\x05\x12(\n\x07options\x18\x03 \x03(\x0b\x32\x17.google.protobuf.Option\";\n\x06Option\x12\x0c\n\x04name\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any*.\n\x06Syntax\x12\x11\n\rSYNTAX_PROTO2\x10\x00\x12\x11\n\rSYNTAX_PROTO3\x10\x01\x42{\n\x13\x63om.google.protobufB\tTypeProtoP\x01Z-google.golang.org/protobuf/types/known/typepb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3') -_SYNTAX = DESCRIPTOR.enum_types_by_name['Syntax'] -Syntax = enum_type_wrapper.EnumTypeWrapper(_SYNTAX) -SYNTAX_PROTO2 = 0 -SYNTAX_PROTO3 = 1 - - -_TYPE = DESCRIPTOR.message_types_by_name['Type'] -_FIELD = DESCRIPTOR.message_types_by_name['Field'] -_ENUM = DESCRIPTOR.message_types_by_name['Enum'] -_ENUMVALUE = DESCRIPTOR.message_types_by_name['EnumValue'] -_OPTION = DESCRIPTOR.message_types_by_name['Option'] -_FIELD_KIND = _FIELD.enum_types_by_name['Kind'] -_FIELD_CARDINALITY = _FIELD.enum_types_by_name['Cardinality'] -Type = _reflection.GeneratedProtocolMessageType('Type', (_message.Message,), { - 'DESCRIPTOR' : _TYPE, - '__module__' : 'google.protobuf.type_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Type) - }) -_sym_db.RegisterMessage(Type) - -Field = _reflection.GeneratedProtocolMessageType('Field', (_message.Message,), { - 'DESCRIPTOR' : _FIELD, - '__module__' : 'google.protobuf.type_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Field) - }) -_sym_db.RegisterMessage(Field) - -Enum = _reflection.GeneratedProtocolMessageType('Enum', (_message.Message,), { - 'DESCRIPTOR' : _ENUM, - '__module__' : 'google.protobuf.type_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Enum) - }) -_sym_db.RegisterMessage(Enum) - -EnumValue = _reflection.GeneratedProtocolMessageType('EnumValue', (_message.Message,), { - 'DESCRIPTOR' : _ENUMVALUE, - '__module__' : 'google.protobuf.type_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.EnumValue) - }) -_sym_db.RegisterMessage(EnumValue) - -Option = _reflection.GeneratedProtocolMessageType('Option', (_message.Message,), { - 'DESCRIPTOR' : _OPTION, - '__module__' : 'google.protobuf.type_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Option) - }) -_sym_db.RegisterMessage(Option) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.type_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/unittest_arena_pb2.py b/windows/python/google/protobuf/unittest_arena_pb2.py index d07c87a42..a7e9831f7 100644 --- a/windows/python/google/protobuf/unittest_arena_pb2.py +++ b/windows/python/google/protobuf/unittest_arena_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_arena.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,24 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$google/protobuf/unittest_arena.proto\x12\x15proto2_arena_unittest\"\x1a\n\rNestedMessage\x12\t\n\x01\x64\x18\x01 \x01(\x05\"U\n\x0c\x41renaMessage\x12\x45\n\x17repeated_nested_message\x18\x01 \x03(\x0b\x32$.proto2_arena_unittest.NestedMessageB\x03\xf8\x01\x01') - - -_NESTEDMESSAGE = DESCRIPTOR.message_types_by_name['NestedMessage'] -_ARENAMESSAGE = DESCRIPTOR.message_types_by_name['ArenaMessage'] -NestedMessage = _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _NESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_arena_pb2' - # @@protoc_insertion_point(class_scope:proto2_arena_unittest.NestedMessage) - }) -_sym_db.RegisterMessage(NestedMessage) - -ArenaMessage = _reflection.GeneratedProtocolMessageType('ArenaMessage', (_message.Message,), { - 'DESCRIPTOR' : _ARENAMESSAGE, - '__module__' : 'google.protobuf.unittest_arena_pb2' - # @@protoc_insertion_point(class_scope:proto2_arena_unittest.ArenaMessage) - }) -_sym_db.RegisterMessage(ArenaMessage) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.unittest_arena_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/unittest_custom_options_pb2.py b/windows/python/google/protobuf/unittest_custom_options_pb2.py index ceed527e1..0b88f9042 100644 --- a/windows/python/google/protobuf/unittest_custom_options_pb2.py +++ b/windows/python/google/protobuf/unittest_custom_options_pb2.py @@ -2,14 +2,10 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_custom_options.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database -from google.protobuf import service as _service -from google.protobuf import service_reflection # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -19,344 +15,10 @@ from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-google/protobuf/unittest_custom_options.proto\x12\x11protobuf_unittest\x1a\x19google/protobuf/any.proto\x1a google/protobuf/descriptor.proto\"\xd0\x02\n\x1cTestMessageWithCustomOptions\x12\x1e\n\x06\x66ield1\x18\x01 \x01(\tB\x0e\x08\x01\xc1\xe0\xc3\x1d-\xe1u\n\x02\x00\x00\x00\x12\x15\n\x0boneof_field\x18\x02 \x01(\x05H\x00\x12^\n\tmap_field\x18\x03 \x03(\x0b\x32=.protobuf_unittest.TestMessageWithCustomOptions.MapFieldEntryB\x0c\xc1\xe0\xc3\x1d\x39\x30\x00\x00\x00\x00\x00\x00\x1a/\n\rMapFieldEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\";\n\x06\x41nEnum\x12\x0f\n\x0b\x41NENUM_VAL1\x10\x01\x12\x16\n\x0b\x41NENUM_VAL2\x10\x02\x1a\x05\xb0\x86\xfa\x05{\x1a\x08\xc5\xf6\xc9\x1d\xeb\xfc\xff\xff:\x10\x08\x00\xe0\xe9\xc2\x1d\xc8\xff\xff\xff\xff\xff\xff\xff\xff\x01\x42\x19\n\x07\x41nOneof\x12\x0e\xf8\xac\xc3\x1d\x9d\xff\xff\xff\xff\xff\xff\xff\xff\x01\"\x18\n\x16\x43ustomOptionFooRequest\"\x19\n\x17\x43ustomOptionFooResponse\"\x1e\n\x1c\x43ustomOptionFooClientMessage\"\x1e\n\x1c\x43ustomOptionFooServerMessage\"m\n\x1a\x44ummyMessageContainingEnum\"O\n\x0cTestEnumType\x12\x1a\n\x16TEST_OPTION_ENUM_TYPE1\x10\x16\x12#\n\x16TEST_OPTION_ENUM_TYPE2\x10\xe9\xff\xff\xff\xff\xff\xff\xff\xff\x01\"!\n\x1f\x44ummyMessageInvalidAsOptionType\"\x8a\x01\n\x1c\x43ustomOptionMinIntegerValues:j\xd0\xde\xb2\x1d\x00\xe8\xc6\xb2\x1d\x80\x80\x80\x80\xf8\xff\xff\xff\xff\x01\xb0\xbc\xb2\x1d\x80\x80\x80\x80\x80\x80\x80\x80\x80\x01\x80\x93\xb2\x1d\x00\xf8\xf5\xb0\x1d\x00\x80\xc4\xb0\x1d\xff\xff\xff\xff\x0f\xf8\x97\xb0\x1d\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x9d\xf5\xaf\x1d\x00\x00\x00\x00\x91\xee\xaf\x1d\x00\x00\x00\x00\x00\x00\x00\x00\xad\x8d\xaf\x1d\x00\x00\x00\x80\x99\xd6\xa8\x1d\x00\x00\x00\x00\x00\x00\x00\x80\"\x91\x01\n\x1c\x43ustomOptionMaxIntegerValues:q\xd0\xde\xb2\x1d\x01\xe8\xc6\xb2\x1d\xff\xff\xff\xff\x07\xb0\xbc\xb2\x1d\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x80\x93\xb2\x1d\xff\xff\xff\xff\x0f\xf8\xf5\xb0\x1d\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x80\xc4\xb0\x1d\xfe\xff\xff\xff\x0f\xf8\x97\xb0\x1d\xfe\xff\xff\xff\xff\xff\xff\xff\xff\x01\x9d\xf5\xaf\x1d\xff\xff\xff\xff\x91\xee\xaf\x1d\xff\xff\xff\xff\xff\xff\xff\xff\xad\x8d\xaf\x1d\xff\xff\xff\x7f\x99\xd6\xa8\x1d\xff\xff\xff\xff\xff\xff\xff\x7f\"n\n\x17\x43ustomOptionOtherValues:S\xe8\xc6\xb2\x1d\x9c\xff\xff\xff\xff\xff\xff\xff\xff\x01\xf5\xdf\xa3\x1d\xe7\x87\x45\x41\xe9\xdc\xa2\x1d\xfbY\x8c\x42\xca\xc0\xf3?\xaa\xdc\xa2\x1d\x0eHello, \"World\"\xb2\xd9\xa2\x1d\x0bHello\x00World\x88\xd9\xa2\x1d\xe9\xff\xff\xff\xff\xff\xff\xff\xff\x01\"4\n\x1cSettingRealsFromPositiveInts:\x14\xf5\xdf\xa3\x1d\x00\x00@A\xe9\xdc\xa2\x1d\x00\x00\x00\x00\x00@c@\"4\n\x1cSettingRealsFromNegativeInts:\x14\xf5\xdf\xa3\x1d\x00\x00@\xc1\xe9\xdc\xa2\x1d\x00\x00\x00\x00\x00@c\xc0\"U\n\x12\x43omplexOptionType1\x12\x0b\n\x03\x66oo\x18\x01 \x01(\x05\x12\x0c\n\x04\x66oo2\x18\x02 \x01(\x05\x12\x0c\n\x04\x66oo3\x18\x03 \x01(\x05\x12\x0c\n\x04\x66oo4\x18\x04 \x03(\x05*\x08\x08\x64\x10\x80\x80\x80\x80\x02\"\x8b\x03\n\x12\x43omplexOptionType2\x12\x32\n\x03\x62\x61r\x18\x01 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType1\x12\x0b\n\x03\x62\x61z\x18\x02 \x01(\x05\x12\x46\n\x04\x66red\x18\x03 \x01(\x0b\x32\x38.protobuf_unittest.ComplexOptionType2.ComplexOptionType4\x12H\n\x06\x62\x61rney\x18\x04 \x03(\x0b\x32\x38.protobuf_unittest.ComplexOptionType2.ComplexOptionType4\x1a\x97\x01\n\x12\x43omplexOptionType4\x12\r\n\x05waldo\x18\x01 \x01(\x05\x32r\n\x0c\x63omplex_opt4\x12\x1f.google.protobuf.MessageOptions\x18\x8a\xf5\xd1\x03 \x01(\x0b\x32\x38.protobuf_unittest.ComplexOptionType2.ComplexOptionType4*\x08\x08\x64\x10\x80\x80\x80\x80\x02\"\x9c\x01\n\x12\x43omplexOptionType3\x12\x0b\n\x03qux\x18\x01 \x01(\x05\x12T\n\x12\x63omplexoptiontype5\x18\x02 \x01(\n28.protobuf_unittest.ComplexOptionType3.ComplexOptionType5\x1a#\n\x12\x43omplexOptionType5\x12\r\n\x05plugh\x18\x03 \x01(\x05\"\x1f\n\x0b\x43omplexOpt6\x12\x10\n\x05xyzzy\x18\xdf\xbf\xcf\x03 \x01(\x05\"\xf1\x01\n\x15VariousComplexOptions:\xd7\x01\xa2\xe2\x95\x1d\x02\x08*\xa2\xe2\x95\x1d\x06\xd8\x85\x9e\x1d\xc4\x02\xa2\xe2\x95\x1d\x08\x92\xf5\x9d\x1d\x03\x08\xec\x06\xa2\xe2\x95\x1d\x02 c\xa2\xe2\x95\x1d\x02 X\xaa\xfd\x90\x1d\x03\x10\xdb\x07\xaa\xfd\x90\x1d\x06\xf8\xe6\x97\x1d\x8e\x05\xaa\xfd\x90\x1d\x05\n\x03\x08\xe7\x05\xaa\xfd\x90\x1d\x08\n\x06\xd8\x85\x9e\x1d\xcf\x0f\xaa\xfd\x90\x1d\n\n\x08\x92\xf5\x9d\x1d\x03\x08\xd8\x0f\xaa\xfd\x90\x1d\x08\xc2\xac\x97\x1d\x03\x08\xe5\x05\xaa\xfd\x90\x1d\x0b\xc2\xac\x97\x1d\x06\xd8\x85\x9e\x1d\xce\x0f\xaa\xfd\x90\x1d\r\xc2\xac\x97\x1d\x08\x92\xf5\x9d\x1d\x03\x08\xc9\x10\xd2\xa8\x8f\x1d\x03\x08\xb3\x0f\xaa\xfd\x90\x1d\x05\x1a\x03\x08\xc1\x02\xaa\xfd\x90\x1d\x04\"\x02\x08\x65\xaa\xfd\x90\x1d\x05\"\x03\x08\xd4\x01\xfa\xde\x90\x1d\x02\x08\t\xfa\xde\x90\x1d\x04\x13\x18\x16\x14\xe3\xdc\xfc\x1c\xf8\xfd\xfb\x1c\x18\xe4\xdc\xfc\x1c\"#\n\x13\x41ggregateMessageSet*\x08\x08\x04\x10\xff\xff\xff\xff\x07:\x02\x08\x01\"\xa0\x01\n\x1a\x41ggregateMessageSetElement\x12\t\n\x01s\x18\x01 \x01(\t2w\n\x15message_set_extension\x12&.protobuf_unittest.AggregateMessageSet\x18\xf6\xeb\xae\x07 \x01(\x0b\x32-.protobuf_unittest.AggregateMessageSetElement\"\xa0\x02\n\tAggregate\x12\t\n\x01i\x18\x01 \x01(\x05\x12\t\n\x01s\x18\x02 \x01(\t\x12)\n\x03sub\x18\x03 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate\x12*\n\x04\x66ile\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.FileOptions\x12\x34\n\x04mset\x18\x05 \x01(\x0b\x32&.protobuf_unittest.AggregateMessageSet\x12!\n\x03\x61ny\x18\x06 \x01(\x0b\x32\x14.google.protobuf.Any2M\n\x06nested\x12\x1c.google.protobuf.FileOptions\x18\xa7\xd1\xb0\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate\"Y\n\x10\x41ggregateMessage\x12)\n\tfieldname\x18\x01 \x01(\x05\x42\x16\xf2\xa1\x87;\x11\x12\x0f\x46ieldAnnotation:\x1a\xc2\xd1\x86;\x15\x08\x65\x12\x11MessageAnnotation\"\xc9\x01\n\x10NestedOptionType\x1a;\n\rNestedMessage\x12\"\n\x0cnested_field\x18\x01 \x01(\x05\x42\x0c\xc1\xe0\xc3\x1d\xea\x03\x00\x00\x00\x00\x00\x00:\x06\xe0\xe9\xc2\x1d\xe9\x07\"5\n\nNestedEnum\x12\x1d\n\x11NESTED_ENUM_VALUE\x10\x01\x1a\x06\xb0\x86\xfa\x05\xec\x07\x1a\x08\xc5\xf6\xc9\x1d\xeb\x03\x00\x00\x32\x41\n\x10nested_extension\x12\x1c.google.protobuf.FileOptions\x18\xfd\xf8\xe2\x03 \x01(\x05\x42\x06\xc8\x8b\xca\x1d\xed\x07\"d\n\rOldOptionType\x12\x38\n\x05value\x18\x01 \x02(\x0e\x32).protobuf_unittest.OldOptionType.TestEnum\"\x19\n\x08TestEnum\x12\r\n\tOLD_VALUE\x10\x00\"s\n\rNewOptionType\x12\x38\n\x05value\x18\x01 \x02(\x0e\x32).protobuf_unittest.NewOptionType.TestEnum\"(\n\x08TestEnum\x12\r\n\tOLD_VALUE\x10\x00\x12\r\n\tNEW_VALUE\x10\x01\"-\n!TestMessageWithRequiredEnumOption:\x08\xfa\xe8\xfc\x94\x03\x02\x08\x00*6\n\nMethodOpt1\x12\x13\n\x0fMETHODOPT1_VAL1\x10\x01\x12\x13\n\x0fMETHODOPT1_VAL2\x10\x02*M\n\rAggregateEnum\x12%\n\x05VALUE\x10\x01\x1a\x1a\xca\xfc\x89;\x15\x12\x13\x45numValueAnnotation\x1a\x15\x92\x95\x88;\x10\x12\x0e\x45numAnnotation2\x8e\x01\n\x1cTestServiceWithCustomOptions\x12\x63\n\x03\x46oo\x12).protobuf_unittest.CustomOptionFooRequest\x1a*.protobuf_unittest.CustomOptionFooResponse\"\x05\xe0\xfa\x8c\x1e\x02\x1a\t\x90\xb2\x8b\x1e\xd3\xdb\x80\xcbI2\x99\x01\n\x10\x41ggregateService\x12k\n\x06Method\x12#.protobuf_unittest.AggregateMessage\x1a#.protobuf_unittest.AggregateMessage\"\x17\xca\xc8\x96;\x12\x12\x10MethodAnnotation\x1a\x18\xca\xfb\x8e;\x13\x12\x11ServiceAnnotation:2\n\tfile_opt1\x12\x1c.google.protobuf.FileOptions\x18\x8e\x9d\xd8\x03 \x01(\x04:8\n\x0cmessage_opt1\x12\x1f.google.protobuf.MessageOptions\x18\x9c\xad\xd8\x03 \x01(\x05:4\n\nfield_opt1\x12\x1d.google.protobuf.FieldOptions\x18\x88\xbc\xd8\x03 \x01(\x06:8\n\nfield_opt2\x12\x1d.google.protobuf.FieldOptions\x18\xb9\xa1\xd9\x03 \x01(\x05:\x02\x34\x32:4\n\noneof_opt1\x12\x1d.google.protobuf.OneofOptions\x18\xcf\xb5\xd8\x03 \x01(\x05:2\n\tenum_opt1\x12\x1c.google.protobuf.EnumOptions\x18\xe8\x9e\xd9\x03 \x01(\x0f:<\n\x0f\x65num_value_opt1\x12!.google.protobuf.EnumValueOptions\x18\xe6\xa0_ \x01(\x05:8\n\x0cservice_opt1\x12\x1f.google.protobuf.ServiceOptions\x18\xa2\xb6\xe1\x03 \x01(\x12:U\n\x0bmethod_opt1\x12\x1e.google.protobuf.MethodOptions\x18\xac\xcf\xe1\x03 \x01(\x0e\x32\x1d.protobuf_unittest.MethodOpt1:4\n\x08\x62ool_opt\x12\x1f.google.protobuf.MessageOptions\x18\xea\xab\xd6\x03 \x01(\x08:5\n\tint32_opt\x12\x1f.google.protobuf.MessageOptions\x18\xed\xa8\xd6\x03 \x01(\x05:5\n\tint64_opt\x12\x1f.google.protobuf.MessageOptions\x18\xc6\xa7\xd6\x03 \x01(\x03:6\n\nuint32_opt\x12\x1f.google.protobuf.MessageOptions\x18\xb0\xa2\xd6\x03 \x01(\r:6\n\nuint64_opt\x12\x1f.google.protobuf.MessageOptions\x18\xdf\x8e\xd6\x03 \x01(\x04:6\n\nsint32_opt\x12\x1f.google.protobuf.MessageOptions\x18\xc0\x88\xd6\x03 \x01(\x11:6\n\nsint64_opt\x12\x1f.google.protobuf.MessageOptions\x18\xff\x82\xd6\x03 \x01(\x12:7\n\x0b\x66ixed32_opt\x12\x1f.google.protobuf.MessageOptions\x18\xd3\xfe\xd5\x03 \x01(\x07:7\n\x0b\x66ixed64_opt\x12\x1f.google.protobuf.MessageOptions\x18\xe2\xfd\xd5\x03 \x01(\x06:8\n\x0csfixed32_opt\x12\x1f.google.protobuf.MessageOptions\x18\xd5\xf1\xd5\x03 \x01(\x0f:8\n\x0csfixed64_opt\x12\x1f.google.protobuf.MessageOptions\x18\xe3\x8a\xd5\x03 \x01(\x10:5\n\tfloat_opt\x12\x1f.google.protobuf.MessageOptions\x18\xfe\xbb\xd4\x03 \x01(\x02:6\n\ndouble_opt\x12\x1f.google.protobuf.MessageOptions\x18\xcd\xab\xd4\x03 \x01(\x01:6\n\nstring_opt\x12\x1f.google.protobuf.MessageOptions\x18\xc5\xab\xd4\x03 \x01(\t:5\n\tbytes_opt\x12\x1f.google.protobuf.MessageOptions\x18\x96\xab\xd4\x03 \x01(\x0c:p\n\x08\x65num_opt\x12\x1f.google.protobuf.MessageOptions\x18\x91\xab\xd4\x03 \x01(\x0e\x32:.protobuf_unittest.DummyMessageContainingEnum.TestEnumType:p\n\x10message_type_opt\x12\x1f.google.protobuf.MessageOptions\x18\xaf\xf2\xd3\x03 \x01(\x0b\x32\x32.protobuf_unittest.DummyMessageInvalidAsOptionType:6\n\x04quux\x12%.protobuf_unittest.ComplexOptionType1\x18\xdb\xe0\xd3\x03 \x01(\x05:^\n\x05\x63orge\x12%.protobuf_unittest.ComplexOptionType1\x18\xd2\xde\xd3\x03 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType3:8\n\x06grault\x12%.protobuf_unittest.ComplexOptionType2\x18\xef\xfc\xd2\x03 \x01(\x05:_\n\x06garply\x12%.protobuf_unittest.ComplexOptionType2\x18\xc8\xf5\xd2\x03 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType1:_\n\x0c\x63omplex_opt1\x12\x1f.google.protobuf.MessageOptions\x18\xa4\xdc\xd2\x03 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType1:_\n\x0c\x63omplex_opt2\x12\x1f.google.protobuf.MessageOptions\x18\xd5\x8f\xd2\x03 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType2:_\n\x0c\x63omplex_opt3\x12\x1f.google.protobuf.MessageOptions\x18\xef\x8b\xd2\x03 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType3:W\n\x0b\x63omplexopt6\x12\x1f.google.protobuf.MessageOptions\x18\xcc\xcb\xcf\x03 \x01(\n2\x1e.protobuf_unittest.ComplexOpt6:N\n\x07\x66ileopt\x12\x1c.google.protobuf.FileOptions\x18\xcf\xdd\xb0\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:P\n\x06msgopt\x12\x1f.google.protobuf.MessageOptions\x18\x98\xea\xb0\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:P\n\x08\x66ieldopt\x12\x1d.google.protobuf.FieldOptions\x18\x9e\xf4\xb0\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:N\n\x07\x65numopt\x12\x1c.google.protobuf.EnumOptions\x18\xd2\x82\xb1\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:V\n\nenumvalopt\x12!.google.protobuf.EnumValueOptions\x18\xc9\x9f\xb1\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:T\n\nserviceopt\x12\x1f.google.protobuf.ServiceOptions\x18\xb9\xef\xb1\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:R\n\tmethodopt\x12\x1e.google.protobuf.MethodOptions\x18\x89\xe9\xb2\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:_\n\x11required_enum_opt\x12\x1f.google.protobuf.MessageOptions\x18\x8f\xcd\xcf\x32 \x01(\x0b\x32 .protobuf_unittest.OldOptionTypeB\xe9\x01\x80\x01\x01\x88\x01\x01\x90\x01\x01\xf0\xe8\xc1\x1d\xea\xad\xc0\xe5$\xfa\xec\x85;\xd1\x01\x08\x64\x12\x0e\x46ileAnnotation\x1a\x16\x12\x14NestedFileAnnotation\"\x1e\xfa\xec\x85;\x19\x12\x17\x46ileExtensionAnnotation*$\x0b\x10\xf6\xeb\xae\x07\x1a\x1b\n\x19\x45mbeddedMessageSetElement\x0c\x32_\n@type.googleapis.com/protobuf_unittest.AggregateMessageSetElement\x12\x1b\n\x19\x45mbeddedMessageSetElement') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-google/protobuf/unittest_custom_options.proto\x12\x11protobuf_unittest\x1a\x19google/protobuf/any.proto\x1a google/protobuf/descriptor.proto\"\xd0\x02\n\x1cTestMessageWithCustomOptions\x12\x1e\n\x06\x66ield1\x18\x01 \x01(\tB\x0e\x08\x01\xc1\xe0\xc3\x1d-\xe1u\n\x02\x00\x00\x00\x12\x15\n\x0boneof_field\x18\x02 \x01(\x05H\x00\x12^\n\tmap_field\x18\x03 \x03(\x0b\x32=.protobuf_unittest.TestMessageWithCustomOptions.MapFieldEntryB\x0c\xc1\xe0\xc3\x1d\x39\x30\x00\x00\x00\x00\x00\x00\x1a/\n\rMapFieldEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\";\n\x06\x41nEnum\x12\x0f\n\x0b\x41NENUM_VAL1\x10\x01\x12\x16\n\x0b\x41NENUM_VAL2\x10\x02\x1a\x05\xb0\x86\xfa\x05{\x1a\x08\xc5\xf6\xc9\x1d\xeb\xfc\xff\xff:\x10\x08\x00\xe0\xe9\xc2\x1d\xc8\xff\xff\xff\xff\xff\xff\xff\xff\x01\x42\x19\n\x07\x41nOneof\x12\x0e\xf8\xac\xc3\x1d\x9d\xff\xff\xff\xff\xff\xff\xff\xff\x01\"\x18\n\x16\x43ustomOptionFooRequest\"\x19\n\x17\x43ustomOptionFooResponse\"\x1e\n\x1c\x43ustomOptionFooClientMessage\"\x1e\n\x1c\x43ustomOptionFooServerMessage\"m\n\x1a\x44ummyMessageContainingEnum\"O\n\x0cTestEnumType\x12\x1a\n\x16TEST_OPTION_ENUM_TYPE1\x10\x16\x12#\n\x16TEST_OPTION_ENUM_TYPE2\x10\xe9\xff\xff\xff\xff\xff\xff\xff\xff\x01\"!\n\x1f\x44ummyMessageInvalidAsOptionType\"\x8a\x01\n\x1c\x43ustomOptionMinIntegerValues:j\xd0\xde\xb2\x1d\x00\xe8\xc6\xb2\x1d\x80\x80\x80\x80\xf8\xff\xff\xff\xff\x01\xb0\xbc\xb2\x1d\x80\x80\x80\x80\x80\x80\x80\x80\x80\x01\x80\x93\xb2\x1d\x00\xf8\xf5\xb0\x1d\x00\x80\xc4\xb0\x1d\xff\xff\xff\xff\x0f\xf8\x97\xb0\x1d\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x9d\xf5\xaf\x1d\x00\x00\x00\x00\x91\xee\xaf\x1d\x00\x00\x00\x00\x00\x00\x00\x00\xad\x8d\xaf\x1d\x00\x00\x00\x80\x99\xd6\xa8\x1d\x00\x00\x00\x00\x00\x00\x00\x80\"\x91\x01\n\x1c\x43ustomOptionMaxIntegerValues:q\xd0\xde\xb2\x1d\x01\xe8\xc6\xb2\x1d\xff\xff\xff\xff\x07\xb0\xbc\xb2\x1d\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x80\x93\xb2\x1d\xff\xff\xff\xff\x0f\xf8\xf5\xb0\x1d\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x80\xc4\xb0\x1d\xfe\xff\xff\xff\x0f\xf8\x97\xb0\x1d\xfe\xff\xff\xff\xff\xff\xff\xff\xff\x01\x9d\xf5\xaf\x1d\xff\xff\xff\xff\x91\xee\xaf\x1d\xff\xff\xff\xff\xff\xff\xff\xff\xad\x8d\xaf\x1d\xff\xff\xff\x7f\x99\xd6\xa8\x1d\xff\xff\xff\xff\xff\xff\xff\x7f\"n\n\x17\x43ustomOptionOtherValues:S\xe8\xc6\xb2\x1d\x9c\xff\xff\xff\xff\xff\xff\xff\xff\x01\xf5\xdf\xa3\x1d\xe7\x87\x45\x41\xe9\xdc\xa2\x1d\xfbY\x8c\x42\xca\xc0\xf3?\xaa\xdc\xa2\x1d\x0eHello, \"World\"\xb2\xd9\xa2\x1d\x0bHello\x00World\x88\xd9\xa2\x1d\xe9\xff\xff\xff\xff\xff\xff\xff\xff\x01\"4\n\x1cSettingRealsFromPositiveInts:\x14\xf5\xdf\xa3\x1d\x00\x00@A\xe9\xdc\xa2\x1d\x00\x00\x00\x00\x00@c@\"4\n\x1cSettingRealsFromNegativeInts:\x14\xf5\xdf\xa3\x1d\x00\x00@\xc1\xe9\xdc\xa2\x1d\x00\x00\x00\x00\x00@c\xc0\"U\n\x12\x43omplexOptionType1\x12\x0b\n\x03\x66oo\x18\x01 \x01(\x05\x12\x0c\n\x04\x66oo2\x18\x02 \x01(\x05\x12\x0c\n\x04\x66oo3\x18\x03 \x01(\x05\x12\x0c\n\x04\x66oo4\x18\x04 \x03(\x05*\x08\x08\x64\x10\x80\x80\x80\x80\x02\"\x8b\x03\n\x12\x43omplexOptionType2\x12\x32\n\x03\x62\x61r\x18\x01 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType1\x12\x0b\n\x03\x62\x61z\x18\x02 \x01(\x05\x12\x46\n\x04\x66red\x18\x03 \x01(\x0b\x32\x38.protobuf_unittest.ComplexOptionType2.ComplexOptionType4\x12H\n\x06\x62\x61rney\x18\x04 \x03(\x0b\x32\x38.protobuf_unittest.ComplexOptionType2.ComplexOptionType4\x1a\x97\x01\n\x12\x43omplexOptionType4\x12\r\n\x05waldo\x18\x01 \x01(\x05\x32r\n\x0c\x63omplex_opt4\x12\x1f.google.protobuf.MessageOptions\x18\x8a\xf5\xd1\x03 \x01(\x0b\x32\x38.protobuf_unittest.ComplexOptionType2.ComplexOptionType4*\x08\x08\x64\x10\x80\x80\x80\x80\x02\"\x9c\x01\n\x12\x43omplexOptionType3\x12\x0b\n\x03moo\x18\x01 \x01(\x05\x12T\n\x12\x63omplexoptiontype5\x18\x02 \x01(\n28.protobuf_unittest.ComplexOptionType3.ComplexOptionType5\x1a#\n\x12\x43omplexOptionType5\x12\r\n\x05plugh\x18\x03 \x01(\x05\"\x1f\n\x0b\x43omplexOpt6\x12\x10\n\x05xyzzy\x18\xdf\xbf\xcf\x03 \x01(\x05\"\xf1\x01\n\x15VariousComplexOptions:\xd7\x01\xa2\xe2\x95\x1d\x02\x08*\xa2\xe2\x95\x1d\x06\xd8\x85\x9e\x1d\xc4\x02\xa2\xe2\x95\x1d\x08\x92\xf5\x9d\x1d\x03\x08\xec\x06\xa2\xe2\x95\x1d\x02 c\xa2\xe2\x95\x1d\x02 X\xaa\xfd\x90\x1d\x03\x10\xdb\x07\xaa\xfd\x90\x1d\x06\xf8\xe6\x97\x1d\x8e\x05\xaa\xfd\x90\x1d\x05\n\x03\x08\xe7\x05\xaa\xfd\x90\x1d\x08\n\x06\xd8\x85\x9e\x1d\xcf\x0f\xaa\xfd\x90\x1d\n\n\x08\x92\xf5\x9d\x1d\x03\x08\xd8\x0f\xaa\xfd\x90\x1d\x08\xc2\xac\x97\x1d\x03\x08\xe5\x05\xaa\xfd\x90\x1d\x0b\xc2\xac\x97\x1d\x06\xd8\x85\x9e\x1d\xce\x0f\xaa\xfd\x90\x1d\r\xc2\xac\x97\x1d\x08\x92\xf5\x9d\x1d\x03\x08\xc9\x10\xd2\xa8\x8f\x1d\x03\x08\xb3\x0f\xaa\xfd\x90\x1d\x05\x1a\x03\x08\xc1\x02\xaa\xfd\x90\x1d\x04\"\x02\x08\x65\xaa\xfd\x90\x1d\x05\"\x03\x08\xd4\x01\xfa\xde\x90\x1d\x02\x08\t\xfa\xde\x90\x1d\x04\x13\x18\x16\x14\xe3\xdc\xfc\x1c\xf8\xfd\xfb\x1c\x18\xe4\xdc\xfc\x1c\"#\n\x13\x41ggregateMessageSet*\x08\x08\x04\x10\xff\xff\xff\xff\x07:\x02\x08\x01\"\xa0\x01\n\x1a\x41ggregateMessageSetElement\x12\t\n\x01s\x18\x01 \x01(\t2w\n\x15message_set_extension\x12&.protobuf_unittest.AggregateMessageSet\x18\xf6\xeb\xae\x07 \x01(\x0b\x32-.protobuf_unittest.AggregateMessageSetElement\"\xa0\x02\n\tAggregate\x12\t\n\x01i\x18\x01 \x01(\x05\x12\t\n\x01s\x18\x02 \x01(\t\x12)\n\x03sub\x18\x03 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate\x12*\n\x04\x66ile\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.FileOptions\x12\x34\n\x04mset\x18\x05 \x01(\x0b\x32&.protobuf_unittest.AggregateMessageSet\x12!\n\x03\x61ny\x18\x06 \x01(\x0b\x32\x14.google.protobuf.Any2M\n\x06nested\x12\x1c.google.protobuf.FileOptions\x18\xa7\xd1\xb0\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate\"Y\n\x10\x41ggregateMessage\x12)\n\tfieldname\x18\x01 \x01(\x05\x42\x16\xf2\xa1\x87;\x11\x12\x0f\x46ieldAnnotation:\x1a\xc2\xd1\x86;\x15\x08\x65\x12\x11MessageAnnotation\"\xc9\x01\n\x10NestedOptionType\x1a;\n\rNestedMessage\x12\"\n\x0cnested_field\x18\x01 \x01(\x05\x42\x0c\xc1\xe0\xc3\x1d\xea\x03\x00\x00\x00\x00\x00\x00:\x06\xe0\xe9\xc2\x1d\xe9\x07\"5\n\nNestedEnum\x12\x1d\n\x11NESTED_ENUM_VALUE\x10\x01\x1a\x06\xb0\x86\xfa\x05\xec\x07\x1a\x08\xc5\xf6\xc9\x1d\xeb\x03\x00\x00\x32\x41\n\x10nested_extension\x12\x1c.google.protobuf.FileOptions\x18\xfd\xf8\xe2\x03 \x01(\x05\x42\x06\xc8\x8b\xca\x1d\xed\x07\"d\n\rOldOptionType\x12\x38\n\x05value\x18\x01 \x02(\x0e\x32).protobuf_unittest.OldOptionType.TestEnum\"\x19\n\x08TestEnum\x12\r\n\tOLD_VALUE\x10\x00\"s\n\rNewOptionType\x12\x38\n\x05value\x18\x01 \x02(\x0e\x32).protobuf_unittest.NewOptionType.TestEnum\"(\n\x08TestEnum\x12\r\n\tOLD_VALUE\x10\x00\x12\r\n\tNEW_VALUE\x10\x01\"-\n!TestMessageWithRequiredEnumOption:\x08\xfa\xe8\xfc\x94\x03\x02\x08\x00*6\n\nMethodOpt1\x12\x13\n\x0fMETHODOPT1_VAL1\x10\x01\x12\x13\n\x0fMETHODOPT1_VAL2\x10\x02*M\n\rAggregateEnum\x12%\n\x05VALUE\x10\x01\x1a\x1a\xca\xfc\x89;\x15\x12\x13\x45numValueAnnotation\x1a\x15\x92\x95\x88;\x10\x12\x0e\x45numAnnotation2\x8e\x01\n\x1cTestServiceWithCustomOptions\x12\x63\n\x03\x46oo\x12).protobuf_unittest.CustomOptionFooRequest\x1a*.protobuf_unittest.CustomOptionFooResponse\"\x05\xe0\xfa\x8c\x1e\x02\x1a\t\x90\xb2\x8b\x1e\xd3\xdb\x80\xcbI2\x99\x01\n\x10\x41ggregateService\x12k\n\x06Method\x12#.protobuf_unittest.AggregateMessage\x1a#.protobuf_unittest.AggregateMessage\"\x17\xca\xc8\x96;\x12\x12\x10MethodAnnotation\x1a\x18\xca\xfb\x8e;\x13\x12\x11ServiceAnnotation:2\n\tfile_opt1\x12\x1c.google.protobuf.FileOptions\x18\x8e\x9d\xd8\x03 \x01(\x04:8\n\x0cmessage_opt1\x12\x1f.google.protobuf.MessageOptions\x18\x9c\xad\xd8\x03 \x01(\x05:4\n\nfield_opt1\x12\x1d.google.protobuf.FieldOptions\x18\x88\xbc\xd8\x03 \x01(\x06:8\n\nfield_opt2\x12\x1d.google.protobuf.FieldOptions\x18\xb9\xa1\xd9\x03 \x01(\x05:\x02\x34\x32:4\n\noneof_opt1\x12\x1d.google.protobuf.OneofOptions\x18\xcf\xb5\xd8\x03 \x01(\x05:2\n\tenum_opt1\x12\x1c.google.protobuf.EnumOptions\x18\xe8\x9e\xd9\x03 \x01(\x0f:<\n\x0f\x65num_value_opt1\x12!.google.protobuf.EnumValueOptions\x18\xe6\xa0_ \x01(\x05:8\n\x0cservice_opt1\x12\x1f.google.protobuf.ServiceOptions\x18\xa2\xb6\xe1\x03 \x01(\x12:U\n\x0bmethod_opt1\x12\x1e.google.protobuf.MethodOptions\x18\xac\xcf\xe1\x03 \x01(\x0e\x32\x1d.protobuf_unittest.MethodOpt1:4\n\x08\x62ool_opt\x12\x1f.google.protobuf.MessageOptions\x18\xea\xab\xd6\x03 \x01(\x08:5\n\tint32_opt\x12\x1f.google.protobuf.MessageOptions\x18\xed\xa8\xd6\x03 \x01(\x05:5\n\tint64_opt\x12\x1f.google.protobuf.MessageOptions\x18\xc6\xa7\xd6\x03 \x01(\x03:6\n\nuint32_opt\x12\x1f.google.protobuf.MessageOptions\x18\xb0\xa2\xd6\x03 \x01(\r:6\n\nuint64_opt\x12\x1f.google.protobuf.MessageOptions\x18\xdf\x8e\xd6\x03 \x01(\x04:6\n\nsint32_opt\x12\x1f.google.protobuf.MessageOptions\x18\xc0\x88\xd6\x03 \x01(\x11:6\n\nsint64_opt\x12\x1f.google.protobuf.MessageOptions\x18\xff\x82\xd6\x03 \x01(\x12:7\n\x0b\x66ixed32_opt\x12\x1f.google.protobuf.MessageOptions\x18\xd3\xfe\xd5\x03 \x01(\x07:7\n\x0b\x66ixed64_opt\x12\x1f.google.protobuf.MessageOptions\x18\xe2\xfd\xd5\x03 \x01(\x06:8\n\x0csfixed32_opt\x12\x1f.google.protobuf.MessageOptions\x18\xd5\xf1\xd5\x03 \x01(\x0f:8\n\x0csfixed64_opt\x12\x1f.google.protobuf.MessageOptions\x18\xe3\x8a\xd5\x03 \x01(\x10:5\n\tfloat_opt\x12\x1f.google.protobuf.MessageOptions\x18\xfe\xbb\xd4\x03 \x01(\x02:6\n\ndouble_opt\x12\x1f.google.protobuf.MessageOptions\x18\xcd\xab\xd4\x03 \x01(\x01:6\n\nstring_opt\x12\x1f.google.protobuf.MessageOptions\x18\xc5\xab\xd4\x03 \x01(\t:5\n\tbytes_opt\x12\x1f.google.protobuf.MessageOptions\x18\x96\xab\xd4\x03 \x01(\x0c:p\n\x08\x65num_opt\x12\x1f.google.protobuf.MessageOptions\x18\x91\xab\xd4\x03 \x01(\x0e\x32:.protobuf_unittest.DummyMessageContainingEnum.TestEnumType:p\n\x10message_type_opt\x12\x1f.google.protobuf.MessageOptions\x18\xaf\xf2\xd3\x03 \x01(\x0b\x32\x32.protobuf_unittest.DummyMessageInvalidAsOptionType:6\n\x04mooo\x12%.protobuf_unittest.ComplexOptionType1\x18\xdb\xe0\xd3\x03 \x01(\x05:^\n\x05\x63orge\x12%.protobuf_unittest.ComplexOptionType1\x18\xd2\xde\xd3\x03 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType3:8\n\x06grault\x12%.protobuf_unittest.ComplexOptionType2\x18\xef\xfc\xd2\x03 \x01(\x05:_\n\x06garply\x12%.protobuf_unittest.ComplexOptionType2\x18\xc8\xf5\xd2\x03 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType1:_\n\x0c\x63omplex_opt1\x12\x1f.google.protobuf.MessageOptions\x18\xa4\xdc\xd2\x03 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType1:_\n\x0c\x63omplex_opt2\x12\x1f.google.protobuf.MessageOptions\x18\xd5\x8f\xd2\x03 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType2:_\n\x0c\x63omplex_opt3\x12\x1f.google.protobuf.MessageOptions\x18\xef\x8b\xd2\x03 \x01(\x0b\x32%.protobuf_unittest.ComplexOptionType3:W\n\x0b\x63omplexopt6\x12\x1f.google.protobuf.MessageOptions\x18\xcc\xcb\xcf\x03 \x01(\n2\x1e.protobuf_unittest.ComplexOpt6:N\n\x07\x66ileopt\x12\x1c.google.protobuf.FileOptions\x18\xcf\xdd\xb0\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:P\n\x06msgopt\x12\x1f.google.protobuf.MessageOptions\x18\x98\xea\xb0\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:P\n\x08\x66ieldopt\x12\x1d.google.protobuf.FieldOptions\x18\x9e\xf4\xb0\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:N\n\x07\x65numopt\x12\x1c.google.protobuf.EnumOptions\x18\xd2\x82\xb1\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:V\n\nenumvalopt\x12!.google.protobuf.EnumValueOptions\x18\xc9\x9f\xb1\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:T\n\nserviceopt\x12\x1f.google.protobuf.ServiceOptions\x18\xb9\xef\xb1\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:R\n\tmethodopt\x12\x1e.google.protobuf.MethodOptions\x18\x89\xe9\xb2\x07 \x01(\x0b\x32\x1c.protobuf_unittest.Aggregate:_\n\x11required_enum_opt\x12\x1f.google.protobuf.MessageOptions\x18\x8f\xcd\xcf\x32 \x01(\x0b\x32 .protobuf_unittest.OldOptionTypeB\xe9\x01\x80\x01\x01\x88\x01\x01\x90\x01\x01\xf0\xe8\xc1\x1d\xea\xad\xc0\xe5$\xfa\xec\x85;\xd1\x01\x08\x64\x12\x0e\x46ileAnnotation\x1a\x16\x12\x14NestedFileAnnotation\"\x1e\xfa\xec\x85;\x19\x12\x17\x46ileExtensionAnnotation*$\x0b\x10\xf6\xeb\xae\x07\x1a\x1b\n\x19\x45mbeddedMessageSetElement\x0c\x32_\n@type.googleapis.com/protobuf_unittest.AggregateMessageSetElement\x12\x1b\n\x19\x45mbeddedMessageSetElement') -_METHODOPT1 = DESCRIPTOR.enum_types_by_name['MethodOpt1'] -MethodOpt1 = enum_type_wrapper.EnumTypeWrapper(_METHODOPT1) -_AGGREGATEENUM = DESCRIPTOR.enum_types_by_name['AggregateEnum'] -AggregateEnum = enum_type_wrapper.EnumTypeWrapper(_AGGREGATEENUM) -METHODOPT1_VAL1 = 1 -METHODOPT1_VAL2 = 2 -VALUE = 1 - -FILE_OPT1_FIELD_NUMBER = 7736974 -file_opt1 = DESCRIPTOR.extensions_by_name['file_opt1'] -MESSAGE_OPT1_FIELD_NUMBER = 7739036 -message_opt1 = DESCRIPTOR.extensions_by_name['message_opt1'] -FIELD_OPT1_FIELD_NUMBER = 7740936 -field_opt1 = DESCRIPTOR.extensions_by_name['field_opt1'] -FIELD_OPT2_FIELD_NUMBER = 7753913 -field_opt2 = DESCRIPTOR.extensions_by_name['field_opt2'] -ONEOF_OPT1_FIELD_NUMBER = 7740111 -oneof_opt1 = DESCRIPTOR.extensions_by_name['oneof_opt1'] -ENUM_OPT1_FIELD_NUMBER = 7753576 -enum_opt1 = DESCRIPTOR.extensions_by_name['enum_opt1'] -ENUM_VALUE_OPT1_FIELD_NUMBER = 1560678 -enum_value_opt1 = DESCRIPTOR.extensions_by_name['enum_value_opt1'] -SERVICE_OPT1_FIELD_NUMBER = 7887650 -service_opt1 = DESCRIPTOR.extensions_by_name['service_opt1'] -METHOD_OPT1_FIELD_NUMBER = 7890860 -method_opt1 = DESCRIPTOR.extensions_by_name['method_opt1'] -BOOL_OPT_FIELD_NUMBER = 7706090 -bool_opt = DESCRIPTOR.extensions_by_name['bool_opt'] -INT32_OPT_FIELD_NUMBER = 7705709 -int32_opt = DESCRIPTOR.extensions_by_name['int32_opt'] -INT64_OPT_FIELD_NUMBER = 7705542 -int64_opt = DESCRIPTOR.extensions_by_name['int64_opt'] -UINT32_OPT_FIELD_NUMBER = 7704880 -uint32_opt = DESCRIPTOR.extensions_by_name['uint32_opt'] -UINT64_OPT_FIELD_NUMBER = 7702367 -uint64_opt = DESCRIPTOR.extensions_by_name['uint64_opt'] -SINT32_OPT_FIELD_NUMBER = 7701568 -sint32_opt = DESCRIPTOR.extensions_by_name['sint32_opt'] -SINT64_OPT_FIELD_NUMBER = 7700863 -sint64_opt = DESCRIPTOR.extensions_by_name['sint64_opt'] -FIXED32_OPT_FIELD_NUMBER = 7700307 -fixed32_opt = DESCRIPTOR.extensions_by_name['fixed32_opt'] -FIXED64_OPT_FIELD_NUMBER = 7700194 -fixed64_opt = DESCRIPTOR.extensions_by_name['fixed64_opt'] -SFIXED32_OPT_FIELD_NUMBER = 7698645 -sfixed32_opt = DESCRIPTOR.extensions_by_name['sfixed32_opt'] -SFIXED64_OPT_FIELD_NUMBER = 7685475 -sfixed64_opt = DESCRIPTOR.extensions_by_name['sfixed64_opt'] -FLOAT_OPT_FIELD_NUMBER = 7675390 -float_opt = DESCRIPTOR.extensions_by_name['float_opt'] -DOUBLE_OPT_FIELD_NUMBER = 7673293 -double_opt = DESCRIPTOR.extensions_by_name['double_opt'] -STRING_OPT_FIELD_NUMBER = 7673285 -string_opt = DESCRIPTOR.extensions_by_name['string_opt'] -BYTES_OPT_FIELD_NUMBER = 7673238 -bytes_opt = DESCRIPTOR.extensions_by_name['bytes_opt'] -ENUM_OPT_FIELD_NUMBER = 7673233 -enum_opt = DESCRIPTOR.extensions_by_name['enum_opt'] -MESSAGE_TYPE_OPT_FIELD_NUMBER = 7665967 -message_type_opt = DESCRIPTOR.extensions_by_name['message_type_opt'] -QUUX_FIELD_NUMBER = 7663707 -quux = DESCRIPTOR.extensions_by_name['quux'] -CORGE_FIELD_NUMBER = 7663442 -corge = DESCRIPTOR.extensions_by_name['corge'] -GRAULT_FIELD_NUMBER = 7650927 -grault = DESCRIPTOR.extensions_by_name['grault'] -GARPLY_FIELD_NUMBER = 7649992 -garply = DESCRIPTOR.extensions_by_name['garply'] -COMPLEX_OPT1_FIELD_NUMBER = 7646756 -complex_opt1 = DESCRIPTOR.extensions_by_name['complex_opt1'] -COMPLEX_OPT2_FIELD_NUMBER = 7636949 -complex_opt2 = DESCRIPTOR.extensions_by_name['complex_opt2'] -COMPLEX_OPT3_FIELD_NUMBER = 7636463 -complex_opt3 = DESCRIPTOR.extensions_by_name['complex_opt3'] -COMPLEXOPT6_FIELD_NUMBER = 7595468 -complexopt6 = DESCRIPTOR.extensions_by_name['complexopt6'] -FILEOPT_FIELD_NUMBER = 15478479 -fileopt = DESCRIPTOR.extensions_by_name['fileopt'] -MSGOPT_FIELD_NUMBER = 15480088 -msgopt = DESCRIPTOR.extensions_by_name['msgopt'] -FIELDOPT_FIELD_NUMBER = 15481374 -fieldopt = DESCRIPTOR.extensions_by_name['fieldopt'] -ENUMOPT_FIELD_NUMBER = 15483218 -enumopt = DESCRIPTOR.extensions_by_name['enumopt'] -ENUMVALOPT_FIELD_NUMBER = 15486921 -enumvalopt = DESCRIPTOR.extensions_by_name['enumvalopt'] -SERVICEOPT_FIELD_NUMBER = 15497145 -serviceopt = DESCRIPTOR.extensions_by_name['serviceopt'] -METHODOPT_FIELD_NUMBER = 15512713 -methodopt = DESCRIPTOR.extensions_by_name['methodopt'] -REQUIRED_ENUM_OPT_FIELD_NUMBER = 106161807 -required_enum_opt = DESCRIPTOR.extensions_by_name['required_enum_opt'] - -_TESTMESSAGEWITHCUSTOMOPTIONS = DESCRIPTOR.message_types_by_name['TestMessageWithCustomOptions'] -_TESTMESSAGEWITHCUSTOMOPTIONS_MAPFIELDENTRY = _TESTMESSAGEWITHCUSTOMOPTIONS.nested_types_by_name['MapFieldEntry'] -_CUSTOMOPTIONFOOREQUEST = DESCRIPTOR.message_types_by_name['CustomOptionFooRequest'] -_CUSTOMOPTIONFOORESPONSE = DESCRIPTOR.message_types_by_name['CustomOptionFooResponse'] -_CUSTOMOPTIONFOOCLIENTMESSAGE = DESCRIPTOR.message_types_by_name['CustomOptionFooClientMessage'] -_CUSTOMOPTIONFOOSERVERMESSAGE = DESCRIPTOR.message_types_by_name['CustomOptionFooServerMessage'] -_DUMMYMESSAGECONTAININGENUM = DESCRIPTOR.message_types_by_name['DummyMessageContainingEnum'] -_DUMMYMESSAGEINVALIDASOPTIONTYPE = DESCRIPTOR.message_types_by_name['DummyMessageInvalidAsOptionType'] -_CUSTOMOPTIONMININTEGERVALUES = DESCRIPTOR.message_types_by_name['CustomOptionMinIntegerValues'] -_CUSTOMOPTIONMAXINTEGERVALUES = DESCRIPTOR.message_types_by_name['CustomOptionMaxIntegerValues'] -_CUSTOMOPTIONOTHERVALUES = DESCRIPTOR.message_types_by_name['CustomOptionOtherValues'] -_SETTINGREALSFROMPOSITIVEINTS = DESCRIPTOR.message_types_by_name['SettingRealsFromPositiveInts'] -_SETTINGREALSFROMNEGATIVEINTS = DESCRIPTOR.message_types_by_name['SettingRealsFromNegativeInts'] -_COMPLEXOPTIONTYPE1 = DESCRIPTOR.message_types_by_name['ComplexOptionType1'] -_COMPLEXOPTIONTYPE2 = DESCRIPTOR.message_types_by_name['ComplexOptionType2'] -_COMPLEXOPTIONTYPE2_COMPLEXOPTIONTYPE4 = _COMPLEXOPTIONTYPE2.nested_types_by_name['ComplexOptionType4'] -_COMPLEXOPTIONTYPE3 = DESCRIPTOR.message_types_by_name['ComplexOptionType3'] -_COMPLEXOPTIONTYPE3_COMPLEXOPTIONTYPE5 = _COMPLEXOPTIONTYPE3.nested_types_by_name['ComplexOptionType5'] -_COMPLEXOPT6 = DESCRIPTOR.message_types_by_name['ComplexOpt6'] -_VARIOUSCOMPLEXOPTIONS = DESCRIPTOR.message_types_by_name['VariousComplexOptions'] -_AGGREGATEMESSAGESET = DESCRIPTOR.message_types_by_name['AggregateMessageSet'] -_AGGREGATEMESSAGESETELEMENT = DESCRIPTOR.message_types_by_name['AggregateMessageSetElement'] -_AGGREGATE = DESCRIPTOR.message_types_by_name['Aggregate'] -_AGGREGATEMESSAGE = DESCRIPTOR.message_types_by_name['AggregateMessage'] -_NESTEDOPTIONTYPE = DESCRIPTOR.message_types_by_name['NestedOptionType'] -_NESTEDOPTIONTYPE_NESTEDMESSAGE = _NESTEDOPTIONTYPE.nested_types_by_name['NestedMessage'] -_OLDOPTIONTYPE = DESCRIPTOR.message_types_by_name['OldOptionType'] -_NEWOPTIONTYPE = DESCRIPTOR.message_types_by_name['NewOptionType'] -_TESTMESSAGEWITHREQUIREDENUMOPTION = DESCRIPTOR.message_types_by_name['TestMessageWithRequiredEnumOption'] -_TESTMESSAGEWITHCUSTOMOPTIONS_ANENUM = _TESTMESSAGEWITHCUSTOMOPTIONS.enum_types_by_name['AnEnum'] -_DUMMYMESSAGECONTAININGENUM_TESTENUMTYPE = _DUMMYMESSAGECONTAININGENUM.enum_types_by_name['TestEnumType'] -_NESTEDOPTIONTYPE_NESTEDENUM = _NESTEDOPTIONTYPE.enum_types_by_name['NestedEnum'] -_OLDOPTIONTYPE_TESTENUM = _OLDOPTIONTYPE.enum_types_by_name['TestEnum'] -_NEWOPTIONTYPE_TESTENUM = _NEWOPTIONTYPE.enum_types_by_name['TestEnum'] -TestMessageWithCustomOptions = _reflection.GeneratedProtocolMessageType('TestMessageWithCustomOptions', (_message.Message,), { - - 'MapFieldEntry' : _reflection.GeneratedProtocolMessageType('MapFieldEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGEWITHCUSTOMOPTIONS_MAPFIELDENTRY, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageWithCustomOptions.MapFieldEntry) - }) - , - 'DESCRIPTOR' : _TESTMESSAGEWITHCUSTOMOPTIONS, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageWithCustomOptions) - }) -_sym_db.RegisterMessage(TestMessageWithCustomOptions) -_sym_db.RegisterMessage(TestMessageWithCustomOptions.MapFieldEntry) - -CustomOptionFooRequest = _reflection.GeneratedProtocolMessageType('CustomOptionFooRequest', (_message.Message,), { - 'DESCRIPTOR' : _CUSTOMOPTIONFOOREQUEST, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.CustomOptionFooRequest) - }) -_sym_db.RegisterMessage(CustomOptionFooRequest) - -CustomOptionFooResponse = _reflection.GeneratedProtocolMessageType('CustomOptionFooResponse', (_message.Message,), { - 'DESCRIPTOR' : _CUSTOMOPTIONFOORESPONSE, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.CustomOptionFooResponse) - }) -_sym_db.RegisterMessage(CustomOptionFooResponse) - -CustomOptionFooClientMessage = _reflection.GeneratedProtocolMessageType('CustomOptionFooClientMessage', (_message.Message,), { - 'DESCRIPTOR' : _CUSTOMOPTIONFOOCLIENTMESSAGE, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.CustomOptionFooClientMessage) - }) -_sym_db.RegisterMessage(CustomOptionFooClientMessage) - -CustomOptionFooServerMessage = _reflection.GeneratedProtocolMessageType('CustomOptionFooServerMessage', (_message.Message,), { - 'DESCRIPTOR' : _CUSTOMOPTIONFOOSERVERMESSAGE, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.CustomOptionFooServerMessage) - }) -_sym_db.RegisterMessage(CustomOptionFooServerMessage) - -DummyMessageContainingEnum = _reflection.GeneratedProtocolMessageType('DummyMessageContainingEnum', (_message.Message,), { - 'DESCRIPTOR' : _DUMMYMESSAGECONTAININGENUM, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.DummyMessageContainingEnum) - }) -_sym_db.RegisterMessage(DummyMessageContainingEnum) - -DummyMessageInvalidAsOptionType = _reflection.GeneratedProtocolMessageType('DummyMessageInvalidAsOptionType', (_message.Message,), { - 'DESCRIPTOR' : _DUMMYMESSAGEINVALIDASOPTIONTYPE, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.DummyMessageInvalidAsOptionType) - }) -_sym_db.RegisterMessage(DummyMessageInvalidAsOptionType) - -CustomOptionMinIntegerValues = _reflection.GeneratedProtocolMessageType('CustomOptionMinIntegerValues', (_message.Message,), { - 'DESCRIPTOR' : _CUSTOMOPTIONMININTEGERVALUES, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.CustomOptionMinIntegerValues) - }) -_sym_db.RegisterMessage(CustomOptionMinIntegerValues) - -CustomOptionMaxIntegerValues = _reflection.GeneratedProtocolMessageType('CustomOptionMaxIntegerValues', (_message.Message,), { - 'DESCRIPTOR' : _CUSTOMOPTIONMAXINTEGERVALUES, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.CustomOptionMaxIntegerValues) - }) -_sym_db.RegisterMessage(CustomOptionMaxIntegerValues) - -CustomOptionOtherValues = _reflection.GeneratedProtocolMessageType('CustomOptionOtherValues', (_message.Message,), { - 'DESCRIPTOR' : _CUSTOMOPTIONOTHERVALUES, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.CustomOptionOtherValues) - }) -_sym_db.RegisterMessage(CustomOptionOtherValues) - -SettingRealsFromPositiveInts = _reflection.GeneratedProtocolMessageType('SettingRealsFromPositiveInts', (_message.Message,), { - 'DESCRIPTOR' : _SETTINGREALSFROMPOSITIVEINTS, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.SettingRealsFromPositiveInts) - }) -_sym_db.RegisterMessage(SettingRealsFromPositiveInts) - -SettingRealsFromNegativeInts = _reflection.GeneratedProtocolMessageType('SettingRealsFromNegativeInts', (_message.Message,), { - 'DESCRIPTOR' : _SETTINGREALSFROMNEGATIVEINTS, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.SettingRealsFromNegativeInts) - }) -_sym_db.RegisterMessage(SettingRealsFromNegativeInts) - -ComplexOptionType1 = _reflection.GeneratedProtocolMessageType('ComplexOptionType1', (_message.Message,), { - 'DESCRIPTOR' : _COMPLEXOPTIONTYPE1, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.ComplexOptionType1) - }) -_sym_db.RegisterMessage(ComplexOptionType1) - -ComplexOptionType2 = _reflection.GeneratedProtocolMessageType('ComplexOptionType2', (_message.Message,), { - - 'ComplexOptionType4' : _reflection.GeneratedProtocolMessageType('ComplexOptionType4', (_message.Message,), { - 'DESCRIPTOR' : _COMPLEXOPTIONTYPE2_COMPLEXOPTIONTYPE4, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.ComplexOptionType2.ComplexOptionType4) - }) - , - 'DESCRIPTOR' : _COMPLEXOPTIONTYPE2, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.ComplexOptionType2) - }) -_sym_db.RegisterMessage(ComplexOptionType2) -_sym_db.RegisterMessage(ComplexOptionType2.ComplexOptionType4) - -ComplexOptionType3 = _reflection.GeneratedProtocolMessageType('ComplexOptionType3', (_message.Message,), { - - 'ComplexOptionType5' : _reflection.GeneratedProtocolMessageType('ComplexOptionType5', (_message.Message,), { - 'DESCRIPTOR' : _COMPLEXOPTIONTYPE3_COMPLEXOPTIONTYPE5, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.ComplexOptionType3.ComplexOptionType5) - }) - , - 'DESCRIPTOR' : _COMPLEXOPTIONTYPE3, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.ComplexOptionType3) - }) -_sym_db.RegisterMessage(ComplexOptionType3) -_sym_db.RegisterMessage(ComplexOptionType3.ComplexOptionType5) - -ComplexOpt6 = _reflection.GeneratedProtocolMessageType('ComplexOpt6', (_message.Message,), { - 'DESCRIPTOR' : _COMPLEXOPT6, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.ComplexOpt6) - }) -_sym_db.RegisterMessage(ComplexOpt6) - -VariousComplexOptions = _reflection.GeneratedProtocolMessageType('VariousComplexOptions', (_message.Message,), { - 'DESCRIPTOR' : _VARIOUSCOMPLEXOPTIONS, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.VariousComplexOptions) - }) -_sym_db.RegisterMessage(VariousComplexOptions) - -AggregateMessageSet = _reflection.GeneratedProtocolMessageType('AggregateMessageSet', (_message.Message,), { - 'DESCRIPTOR' : _AGGREGATEMESSAGESET, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.AggregateMessageSet) - }) -_sym_db.RegisterMessage(AggregateMessageSet) - -AggregateMessageSetElement = _reflection.GeneratedProtocolMessageType('AggregateMessageSetElement', (_message.Message,), { - 'DESCRIPTOR' : _AGGREGATEMESSAGESETELEMENT, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.AggregateMessageSetElement) - }) -_sym_db.RegisterMessage(AggregateMessageSetElement) - -Aggregate = _reflection.GeneratedProtocolMessageType('Aggregate', (_message.Message,), { - 'DESCRIPTOR' : _AGGREGATE, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.Aggregate) - }) -_sym_db.RegisterMessage(Aggregate) - -AggregateMessage = _reflection.GeneratedProtocolMessageType('AggregateMessage', (_message.Message,), { - 'DESCRIPTOR' : _AGGREGATEMESSAGE, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.AggregateMessage) - }) -_sym_db.RegisterMessage(AggregateMessage) - -NestedOptionType = _reflection.GeneratedProtocolMessageType('NestedOptionType', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _NESTEDOPTIONTYPE_NESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.NestedOptionType.NestedMessage) - }) - , - 'DESCRIPTOR' : _NESTEDOPTIONTYPE, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.NestedOptionType) - }) -_sym_db.RegisterMessage(NestedOptionType) -_sym_db.RegisterMessage(NestedOptionType.NestedMessage) - -OldOptionType = _reflection.GeneratedProtocolMessageType('OldOptionType', (_message.Message,), { - 'DESCRIPTOR' : _OLDOPTIONTYPE, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.OldOptionType) - }) -_sym_db.RegisterMessage(OldOptionType) - -NewOptionType = _reflection.GeneratedProtocolMessageType('NewOptionType', (_message.Message,), { - 'DESCRIPTOR' : _NEWOPTIONTYPE, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.NewOptionType) - }) -_sym_db.RegisterMessage(NewOptionType) - -TestMessageWithRequiredEnumOption = _reflection.GeneratedProtocolMessageType('TestMessageWithRequiredEnumOption', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGEWITHREQUIREDENUMOPTION, - '__module__' : 'google.protobuf.unittest_custom_options_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageWithRequiredEnumOption) - }) -_sym_db.RegisterMessage(TestMessageWithRequiredEnumOption) - -_TESTSERVICEWITHCUSTOMOPTIONS = DESCRIPTOR.services_by_name['TestServiceWithCustomOptions'] -_AGGREGATESERVICE = DESCRIPTOR.services_by_name['AggregateService'] +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.unittest_custom_options_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(file_opt1) google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(message_opt1) @@ -384,7 +46,7 @@ if _descriptor._USE_C_DESCRIPTORS == False: google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(bytes_opt) google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(enum_opt) google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(message_type_opt) - ComplexOptionType1.RegisterExtension(quux) + ComplexOptionType1.RegisterExtension(mooo) ComplexOptionType1.RegisterExtension(corge) ComplexOptionType2.RegisterExtension(grault) ComplexOptionType2.RegisterExtension(garply) @@ -539,26 +201,5 @@ if _descriptor._USE_C_DESCRIPTORS == False: _TESTSERVICEWITHCUSTOMOPTIONS._serialized_end=3491 _AGGREGATESERVICE._serialized_start=3494 _AGGREGATESERVICE._serialized_end=3647 -TestServiceWithCustomOptions = service_reflection.GeneratedServiceType('TestServiceWithCustomOptions', (_service.Service,), dict( - DESCRIPTOR = _TESTSERVICEWITHCUSTOMOPTIONS, - __module__ = 'google.protobuf.unittest_custom_options_pb2' - )) - -TestServiceWithCustomOptions_Stub = service_reflection.GeneratedServiceStubType('TestServiceWithCustomOptions_Stub', (TestServiceWithCustomOptions,), dict( - DESCRIPTOR = _TESTSERVICEWITHCUSTOMOPTIONS, - __module__ = 'google.protobuf.unittest_custom_options_pb2' - )) - - -AggregateService = service_reflection.GeneratedServiceType('AggregateService', (_service.Service,), dict( - DESCRIPTOR = _AGGREGATESERVICE, - __module__ = 'google.protobuf.unittest_custom_options_pb2' - )) - -AggregateService_Stub = service_reflection.GeneratedServiceStubType('AggregateService_Stub', (AggregateService,), dict( - DESCRIPTOR = _AGGREGATESERVICE, - __module__ = 'google.protobuf.unittest_custom_options_pb2' - )) - - +_builder.BuildServices(DESCRIPTOR, 'google.protobuf.unittest_custom_options_pb2', globals()) # @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/unittest_import_pb2.py b/windows/python/google/protobuf/unittest_import_pb2.py index b3dc764eb..00c20536b 100644 --- a/windows/python/google/protobuf/unittest_import_pb2.py +++ b/windows/python/google/protobuf/unittest_import_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_import.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -19,26 +17,8 @@ from google.protobuf.unittest_import_public_pb2 import * DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%google/protobuf/unittest_import.proto\x12\x18protobuf_unittest_import\x1a,google/protobuf/unittest_import_public.proto\"\x1a\n\rImportMessage\x12\t\n\x01\x64\x18\x01 \x01(\x05*<\n\nImportEnum\x12\x0e\n\nIMPORT_FOO\x10\x07\x12\x0e\n\nIMPORT_BAR\x10\x08\x12\x0e\n\nIMPORT_BAZ\x10\t*1\n\x10ImportEnumForMap\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x07\n\x03\x46OO\x10\x01\x12\x07\n\x03\x42\x41R\x10\x02\x42\x1f\n\x18\x63om.google.protobuf.testH\x01\xf8\x01\x01P\x00') -_IMPORTENUM = DESCRIPTOR.enum_types_by_name['ImportEnum'] -ImportEnum = enum_type_wrapper.EnumTypeWrapper(_IMPORTENUM) -_IMPORTENUMFORMAP = DESCRIPTOR.enum_types_by_name['ImportEnumForMap'] -ImportEnumForMap = enum_type_wrapper.EnumTypeWrapper(_IMPORTENUMFORMAP) -IMPORT_FOO = 7 -IMPORT_BAR = 8 -IMPORT_BAZ = 9 -UNKNOWN = 0 -FOO = 1 -BAR = 2 - - -_IMPORTMESSAGE = DESCRIPTOR.message_types_by_name['ImportMessage'] -ImportMessage = _reflection.GeneratedProtocolMessageType('ImportMessage', (_message.Message,), { - 'DESCRIPTOR' : _IMPORTMESSAGE, - '__module__' : 'google.protobuf.unittest_import_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest_import.ImportMessage) - }) -_sym_db.RegisterMessage(ImportMessage) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.unittest_import_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/unittest_import_public_pb2.py b/windows/python/google/protobuf/unittest_import_public_pb2.py index a1889133b..e209b682a 100644 --- a/windows/python/google/protobuf/unittest_import_public_pb2.py +++ b/windows/python/google/protobuf/unittest_import_public_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_import_public.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,16 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,google/protobuf/unittest_import_public.proto\x12\x18protobuf_unittest_import\" \n\x13PublicImportMessage\x12\t\n\x01\x65\x18\x01 \x01(\x05\x42\x1a\n\x18\x63om.google.protobuf.test') - - -_PUBLICIMPORTMESSAGE = DESCRIPTOR.message_types_by_name['PublicImportMessage'] -PublicImportMessage = _reflection.GeneratedProtocolMessageType('PublicImportMessage', (_message.Message,), { - 'DESCRIPTOR' : _PUBLICIMPORTMESSAGE, - '__module__' : 'google.protobuf.unittest_import_public_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest_import.PublicImportMessage) - }) -_sym_db.RegisterMessage(PublicImportMessage) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.unittest_import_public_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/unittest_mset_pb2.py b/windows/python/google/protobuf/unittest_mset_pb2.py index 3a08dfe38..2639a452b 100644 --- a/windows/python/google/protobuf/unittest_mset_pb2.py +++ b/windows/python/google/protobuf/unittest_mset_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_mset.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -15,54 +14,14 @@ _sym_db = _symbol_database.Default() from google.protobuf import unittest_mset_wire_format_pb2 as google_dot_protobuf_dot_unittest__mset__wire__format__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#google/protobuf/unittest_mset.proto\x12\x11protobuf_unittest\x1a/google/protobuf/unittest_mset_wire_format.proto\"Z\n\x17TestMessageSetContainer\x12?\n\x0bmessage_set\x18\x01 \x01(\x0b\x32*.proto2_wireformat_unittest.TestMessageSet\"\xf9\x01\n\x18TestMessageSetExtension1\x12\t\n\x01i\x18\x0f \x01(\x05\x12=\n\trecursive\x18\x10 \x01(\x0b\x32*.proto2_wireformat_unittest.TestMessageSet\x12\x19\n\rtest_aliasing\x18\x11 \x01(\tB\x02\x08\x02\x32x\n\x15message_set_extension\x12*.proto2_wireformat_unittest.TestMessageSet\x18\xb0\xa6^ \x01(\x0b\x32+.protobuf_unittest.TestMessageSetExtension1\"\xa1\x01\n\x18TestMessageSetExtension2\x12\x0b\n\x03str\x18\x19 \x01(\t2x\n\x15message_set_extension\x12*.proto2_wireformat_unittest.TestMessageSet\x18\xf9\xbb^ \x01(\x0b\x32+.protobuf_unittest.TestMessageSetExtension2\"n\n\rRawMessageSet\x12\x33\n\x04item\x18\x01 \x03(\n2%.protobuf_unittest.RawMessageSet.Item\x1a(\n\x04Item\x12\x0f\n\x07type_id\x18\x02 \x02(\x05\x12\x0f\n\x07message\x18\x03 \x02(\x0c\x42\x05H\x01\xf8\x01\x01') - - - -_TESTMESSAGESETCONTAINER = DESCRIPTOR.message_types_by_name['TestMessageSetContainer'] -_TESTMESSAGESETEXTENSION1 = DESCRIPTOR.message_types_by_name['TestMessageSetExtension1'] -_TESTMESSAGESETEXTENSION2 = DESCRIPTOR.message_types_by_name['TestMessageSetExtension2'] -_RAWMESSAGESET = DESCRIPTOR.message_types_by_name['RawMessageSet'] -_RAWMESSAGESET_ITEM = _RAWMESSAGESET.nested_types_by_name['Item'] -TestMessageSetContainer = _reflection.GeneratedProtocolMessageType('TestMessageSetContainer', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGESETCONTAINER, - '__module__' : 'google.protobuf.unittest_mset_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageSetContainer) - }) -_sym_db.RegisterMessage(TestMessageSetContainer) - -TestMessageSetExtension1 = _reflection.GeneratedProtocolMessageType('TestMessageSetExtension1', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGESETEXTENSION1, - '__module__' : 'google.protobuf.unittest_mset_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageSetExtension1) - }) -_sym_db.RegisterMessage(TestMessageSetExtension1) - -TestMessageSetExtension2 = _reflection.GeneratedProtocolMessageType('TestMessageSetExtension2', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGESETEXTENSION2, - '__module__' : 'google.protobuf.unittest_mset_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageSetExtension2) - }) -_sym_db.RegisterMessage(TestMessageSetExtension2) - -RawMessageSet = _reflection.GeneratedProtocolMessageType('RawMessageSet', (_message.Message,), { - - 'Item' : _reflection.GeneratedProtocolMessageType('Item', (_message.Message,), { - 'DESCRIPTOR' : _RAWMESSAGESET_ITEM, - '__module__' : 'google.protobuf.unittest_mset_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.RawMessageSet.Item) - }) - , - 'DESCRIPTOR' : _RAWMESSAGESET, - '__module__' : 'google.protobuf.unittest_mset_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.RawMessageSet) - }) -_sym_db.RegisterMessage(RawMessageSet) -_sym_db.RegisterMessage(RawMessageSet.Item) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#google/protobuf/unittest_mset.proto\x12\x11protobuf_unittest\x1a/google/protobuf/unittest_mset_wire_format.proto\"Z\n\x17TestMessageSetContainer\x12?\n\x0bmessage_set\x18\x01 \x01(\x0b\x32*.proto2_wireformat_unittest.TestMessageSet\"\x9f\x01\n\x1dNestedTestMessageSetContainer\x12=\n\tcontainer\x18\x01 \x01(\x0b\x32*.protobuf_unittest.TestMessageSetContainer\x12?\n\x05\x63hild\x18\x02 \x01(\x0b\x32\x30.protobuf_unittest.NestedTestMessageSetContainer\"\xf9\x01\n\x18TestMessageSetExtension1\x12\t\n\x01i\x18\x0f \x01(\x05\x12=\n\trecursive\x18\x10 \x01(\x0b\x32*.proto2_wireformat_unittest.TestMessageSet\x12\x19\n\rtest_aliasing\x18\x11 \x01(\tB\x02\x08\x02\x32x\n\x15message_set_extension\x12*.proto2_wireformat_unittest.TestMessageSet\x18\xb0\xa6^ \x01(\x0b\x32+.protobuf_unittest.TestMessageSetExtension1\"\xa1\x01\n\x18TestMessageSetExtension2\x12\x0b\n\x03str\x18\x19 \x01(\t2x\n\x15message_set_extension\x12*.proto2_wireformat_unittest.TestMessageSet\x18\xf9\xbb^ \x01(\x0b\x32+.protobuf_unittest.TestMessageSetExtension2\"K\n\rNestedTestInt\x12\t\n\x01\x61\x18\x01 \x01(\x07\x12/\n\x05\x63hild\x18\x02 \x01(\x0b\x32 .protobuf_unittest.NestedTestInt\"\xc4\x01\n\x18TestMessageSetExtension3\x12-\n\x03msg\x18# \x01(\x0b\x32 .protobuf_unittest.NestedTestInt2y\n\x15message_set_extension\x12*.proto2_wireformat_unittest.TestMessageSet\x18\xa9\xc3\x8e] \x01(\x0b\x32+.protobuf_unittest.TestMessageSetExtension3\"n\n\rRawMessageSet\x12\x33\n\x04item\x18\x01 \x03(\n2%.protobuf_unittest.RawMessageSet.Item\x1a(\n\x04Item\x12\x0f\n\x07type_id\x18\x02 \x02(\x05\x12\x0f\n\x07message\x18\x03 \x02(\x0c\x42\x05H\x01\xf8\x01\x01') +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.unittest_mset_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: google_dot_protobuf_dot_unittest__mset__wire__format__pb2.TestMessageSet.RegisterExtension(_TESTMESSAGESETEXTENSION1.extensions_by_name['message_set_extension']) google_dot_protobuf_dot_unittest__mset__wire__format__pb2.TestMessageSet.RegisterExtension(_TESTMESSAGESETEXTENSION2.extensions_by_name['message_set_extension']) + google_dot_protobuf_dot_unittest__mset__wire__format__pb2.TestMessageSet.RegisterExtension(_TESTMESSAGESETEXTENSION3.extensions_by_name['message_set_extension']) DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'H\001\370\001\001' @@ -70,12 +29,18 @@ if _descriptor._USE_C_DESCRIPTORS == False: _TESTMESSAGESETEXTENSION1.fields_by_name['test_aliasing']._serialized_options = b'\010\002' _TESTMESSAGESETCONTAINER._serialized_start=107 _TESTMESSAGESETCONTAINER._serialized_end=197 - _TESTMESSAGESETEXTENSION1._serialized_start=200 - _TESTMESSAGESETEXTENSION1._serialized_end=449 - _TESTMESSAGESETEXTENSION2._serialized_start=452 - _TESTMESSAGESETEXTENSION2._serialized_end=613 - _RAWMESSAGESET._serialized_start=615 - _RAWMESSAGESET._serialized_end=725 - _RAWMESSAGESET_ITEM._serialized_start=685 - _RAWMESSAGESET_ITEM._serialized_end=725 + _NESTEDTESTMESSAGESETCONTAINER._serialized_start=200 + _NESTEDTESTMESSAGESETCONTAINER._serialized_end=359 + _TESTMESSAGESETEXTENSION1._serialized_start=362 + _TESTMESSAGESETEXTENSION1._serialized_end=611 + _TESTMESSAGESETEXTENSION2._serialized_start=614 + _TESTMESSAGESETEXTENSION2._serialized_end=775 + _NESTEDTESTINT._serialized_start=777 + _NESTEDTESTINT._serialized_end=852 + _TESTMESSAGESETEXTENSION3._serialized_start=855 + _TESTMESSAGESETEXTENSION3._serialized_end=1051 + _RAWMESSAGESET._serialized_start=1053 + _RAWMESSAGESET._serialized_end=1163 + _RAWMESSAGESET_ITEM._serialized_start=1123 + _RAWMESSAGESET_ITEM._serialized_end=1163 # @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/unittest_mset_wire_format_pb2.py b/windows/python/google/protobuf/unittest_mset_wire_format_pb2.py index 08f9cde82..a228b3d24 100644 --- a/windows/python/google/protobuf/unittest_mset_wire_format_pb2.py +++ b/windows/python/google/protobuf/unittest_mset_wire_format_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_mset_wire_format.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,24 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/google/protobuf/unittest_mset_wire_format.proto\x12\x1aproto2_wireformat_unittest\"\x1e\n\x0eTestMessageSet*\x08\x08\x04\x10\xff\xff\xff\xff\x07:\x02\x08\x01\"d\n!TestMessageSetWireFormatContainer\x12?\n\x0bmessage_set\x18\x01 \x01(\x0b\x32*.proto2_wireformat_unittest.TestMessageSetB)H\x01\xf8\x01\x01\xaa\x02!Google.ProtocolBuffers.TestProtos') - - -_TESTMESSAGESET = DESCRIPTOR.message_types_by_name['TestMessageSet'] -_TESTMESSAGESETWIREFORMATCONTAINER = DESCRIPTOR.message_types_by_name['TestMessageSetWireFormatContainer'] -TestMessageSet = _reflection.GeneratedProtocolMessageType('TestMessageSet', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGESET, - '__module__' : 'google.protobuf.unittest_mset_wire_format_pb2' - # @@protoc_insertion_point(class_scope:proto2_wireformat_unittest.TestMessageSet) - }) -_sym_db.RegisterMessage(TestMessageSet) - -TestMessageSetWireFormatContainer = _reflection.GeneratedProtocolMessageType('TestMessageSetWireFormatContainer', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGESETWIREFORMATCONTAINER, - '__module__' : 'google.protobuf.unittest_mset_wire_format_pb2' - # @@protoc_insertion_point(class_scope:proto2_wireformat_unittest.TestMessageSetWireFormatContainer) - }) -_sym_db.RegisterMessage(TestMessageSetWireFormatContainer) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.unittest_mset_wire_format_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/unittest_no_generic_services_pb2.py b/windows/python/google/protobuf/unittest_no_generic_services_pb2.py index 9747aea9d..b084d4070 100644 --- a/windows/python/google/protobuf/unittest_no_generic_services_pb2.py +++ b/windows/python/google/protobuf/unittest_no_generic_services_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_no_generic_services.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,22 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2google/protobuf/unittest_no_generic_services.proto\x12*protobuf_unittest.no_generic_services_test\"#\n\x0bTestMessage\x12\t\n\x01\x61\x18\x01 \x01(\x05*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02*\x13\n\x08TestEnum\x12\x07\n\x03\x46OO\x10\x01\x32\x86\x01\n\x0bTestService\x12w\n\x03\x46oo\x12\x37.protobuf_unittest.no_generic_services_test.TestMessage\x1a\x37.protobuf_unittest.no_generic_services_test.TestMessage:P\n\x0etest_extension\x12\x37.protobuf_unittest.no_generic_services_test.TestMessage\x18\xe8\x07 \x01(\x05') -_TESTENUM = DESCRIPTOR.enum_types_by_name['TestEnum'] -TestEnum = enum_type_wrapper.EnumTypeWrapper(_TESTENUM) -FOO = 1 - -TEST_EXTENSION_FIELD_NUMBER = 1000 -test_extension = DESCRIPTOR.extensions_by_name['test_extension'] - -_TESTMESSAGE = DESCRIPTOR.message_types_by_name['TestMessage'] -TestMessage = _reflection.GeneratedProtocolMessageType('TestMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGE, - '__module__' : 'google.protobuf.unittest_no_generic_services_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.no_generic_services_test.TestMessage) - }) -_sym_db.RegisterMessage(TestMessage) - -_TESTSERVICE = DESCRIPTOR.services_by_name['TestService'] +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.unittest_no_generic_services_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: TestMessage.RegisterExtension(test_extension) diff --git a/windows/python/google/protobuf/unittest_pb2.py b/windows/python/google/protobuf/unittest_pb2.py index 65800de4a..2cc051a6b 100644 --- a/windows/python/google/protobuf/unittest_pb2.py +++ b/windows/python/google/protobuf/unittest_pb2.py @@ -2,14 +2,10 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database -from google.protobuf import service as _service -from google.protobuf import service_reflection # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -22,1149 +18,10 @@ except AttributeError: google_dot_protobuf_dot_unittest__import__public__pb2 = google_dot_protobuf_dot_unittest__import__pb2.google.protobuf.unittest_import_public_pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1egoogle/protobuf/unittest.proto\x12\x11protobuf_unittest\x1a%google/protobuf/unittest_import.proto\"\xed\x18\n\x0cTestAllTypes\x12\x16\n\x0eoptional_int32\x18\x01 \x01(\x05\x12\x16\n\x0eoptional_int64\x18\x02 \x01(\x03\x12\x17\n\x0foptional_uint32\x18\x03 \x01(\r\x12\x17\n\x0foptional_uint64\x18\x04 \x01(\x04\x12\x17\n\x0foptional_sint32\x18\x05 \x01(\x11\x12\x17\n\x0foptional_sint64\x18\x06 \x01(\x12\x12\x18\n\x10optional_fixed32\x18\x07 \x01(\x07\x12\x18\n\x10optional_fixed64\x18\x08 \x01(\x06\x12\x19\n\x11optional_sfixed32\x18\t \x01(\x0f\x12\x19\n\x11optional_sfixed64\x18\n \x01(\x10\x12\x16\n\x0eoptional_float\x18\x0b \x01(\x02\x12\x17\n\x0foptional_double\x18\x0c \x01(\x01\x12\x15\n\roptional_bool\x18\r \x01(\x08\x12\x17\n\x0foptional_string\x18\x0e \x01(\t\x12\x16\n\x0eoptional_bytes\x18\x0f \x01(\x0c\x12\x44\n\roptionalgroup\x18\x10 \x01(\n2-.protobuf_unittest.TestAllTypes.OptionalGroup\x12N\n\x17optional_nested_message\x18\x12 \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage\x12\x43\n\x18optional_foreign_message\x18\x13 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage\x12H\n\x17optional_import_message\x18\x14 \x01(\x0b\x32\'.protobuf_unittest_import.ImportMessage\x12H\n\x14optional_nested_enum\x18\x15 \x01(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum\x12=\n\x15optional_foreign_enum\x18\x16 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12\x42\n\x14optional_import_enum\x18\x17 \x01(\x0e\x32$.protobuf_unittest_import.ImportEnum\x12!\n\x15optional_string_piece\x18\x18 \x01(\tB\x02\x08\x02\x12\x19\n\roptional_cord\x18\x19 \x01(\tB\x02\x08\x01\x12U\n\x1eoptional_public_import_message\x18\x1a \x01(\x0b\x32-.protobuf_unittest_import.PublicImportMessage\x12P\n\x15optional_lazy_message\x18\x1b \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageB\x02(\x01\x12\x16\n\x0erepeated_int32\x18\x1f \x03(\x05\x12\x16\n\x0erepeated_int64\x18 \x03(\x03\x12\x17\n\x0frepeated_uint32\x18! \x03(\r\x12\x17\n\x0frepeated_uint64\x18\" \x03(\x04\x12\x17\n\x0frepeated_sint32\x18# \x03(\x11\x12\x17\n\x0frepeated_sint64\x18$ \x03(\x12\x12\x18\n\x10repeated_fixed32\x18% \x03(\x07\x12\x18\n\x10repeated_fixed64\x18& \x03(\x06\x12\x19\n\x11repeated_sfixed32\x18\' \x03(\x0f\x12\x19\n\x11repeated_sfixed64\x18( \x03(\x10\x12\x16\n\x0erepeated_float\x18) \x03(\x02\x12\x17\n\x0frepeated_double\x18* \x03(\x01\x12\x15\n\rrepeated_bool\x18+ \x03(\x08\x12\x17\n\x0frepeated_string\x18, \x03(\t\x12\x16\n\x0erepeated_bytes\x18- \x03(\x0c\x12\x44\n\rrepeatedgroup\x18. \x03(\n2-.protobuf_unittest.TestAllTypes.RepeatedGroup\x12N\n\x17repeated_nested_message\x18\x30 \x03(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage\x12\x43\n\x18repeated_foreign_message\x18\x31 \x03(\x0b\x32!.protobuf_unittest.ForeignMessage\x12H\n\x17repeated_import_message\x18\x32 \x03(\x0b\x32\'.protobuf_unittest_import.ImportMessage\x12H\n\x14repeated_nested_enum\x18\x33 \x03(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum\x12=\n\x15repeated_foreign_enum\x18\x34 \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12\x42\n\x14repeated_import_enum\x18\x35 \x03(\x0e\x32$.protobuf_unittest_import.ImportEnum\x12!\n\x15repeated_string_piece\x18\x36 \x03(\tB\x02\x08\x02\x12\x19\n\rrepeated_cord\x18\x37 \x03(\tB\x02\x08\x01\x12P\n\x15repeated_lazy_message\x18\x39 \x03(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageB\x02(\x01\x12\x19\n\rdefault_int32\x18= \x01(\x05:\x02\x34\x31\x12\x19\n\rdefault_int64\x18> \x01(\x03:\x02\x34\x32\x12\x1a\n\x0e\x64\x65\x66\x61ult_uint32\x18? \x01(\r:\x02\x34\x33\x12\x1a\n\x0e\x64\x65\x66\x61ult_uint64\x18@ \x01(\x04:\x02\x34\x34\x12\x1b\n\x0e\x64\x65\x66\x61ult_sint32\x18\x41 \x01(\x11:\x03-45\x12\x1a\n\x0e\x64\x65\x66\x61ult_sint64\x18\x42 \x01(\x12:\x02\x34\x36\x12\x1b\n\x0f\x64\x65\x66\x61ult_fixed32\x18\x43 \x01(\x07:\x02\x34\x37\x12\x1b\n\x0f\x64\x65\x66\x61ult_fixed64\x18\x44 \x01(\x06:\x02\x34\x38\x12\x1c\n\x10\x64\x65\x66\x61ult_sfixed32\x18\x45 \x01(\x0f:\x02\x34\x39\x12\x1d\n\x10\x64\x65\x66\x61ult_sfixed64\x18\x46 \x01(\x10:\x03-50\x12\x1b\n\rdefault_float\x18G \x01(\x02:\x04\x35\x31.5\x12\x1d\n\x0e\x64\x65\x66\x61ult_double\x18H \x01(\x01:\x05\x35\x32\x30\x30\x30\x12\x1a\n\x0c\x64\x65\x66\x61ult_bool\x18I \x01(\x08:\x04true\x12\x1d\n\x0e\x64\x65\x66\x61ult_string\x18J \x01(\t:\x05hello\x12\x1c\n\rdefault_bytes\x18K \x01(\x0c:\x05world\x12L\n\x13\x64\x65\x66\x61ult_nested_enum\x18Q \x01(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum:\x03\x42\x41R\x12I\n\x14\x64\x65\x66\x61ult_foreign_enum\x18R \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum:\x0b\x46OREIGN_BAR\x12M\n\x13\x64\x65\x66\x61ult_import_enum\x18S \x01(\x0e\x32$.protobuf_unittest_import.ImportEnum:\nIMPORT_BAR\x12%\n\x14\x64\x65\x66\x61ult_string_piece\x18T \x01(\t:\x03\x61\x62\x63\x42\x02\x08\x02\x12\x1d\n\x0c\x64\x65\x66\x61ult_cord\x18U \x01(\t:\x03\x31\x32\x33\x42\x02\x08\x01\x12\x16\n\x0coneof_uint32\x18o \x01(\rH\x00\x12M\n\x14oneof_nested_message\x18p \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageH\x00\x12\x16\n\x0coneof_string\x18q \x01(\tH\x00\x12\x15\n\x0boneof_bytes\x18r \x01(\x0cH\x00\x1a\x1b\n\rNestedMessage\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05\x1a\x1a\n\rOptionalGroup\x12\t\n\x01\x61\x18\x11 \x01(\x05\x1a\x1a\n\rRepeatedGroup\x12\t\n\x01\x61\x18/ \x01(\x05\"9\n\nNestedEnum\x12\x07\n\x03\x46OO\x10\x01\x12\x07\n\x03\x42\x41R\x10\x02\x12\x07\n\x03\x42\x41Z\x10\x03\x12\x10\n\x03NEG\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x42\r\n\x0boneof_field\"\xbb\x01\n\x12NestedTestAllTypes\x12\x34\n\x05\x63hild\x18\x01 \x01(\x0b\x32%.protobuf_unittest.NestedTestAllTypes\x12\x30\n\x07payload\x18\x02 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12=\n\x0erepeated_child\x18\x03 \x03(\x0b\x32%.protobuf_unittest.NestedTestAllTypes\"m\n\x14TestDeprecatedFields\x12\x1c\n\x10\x64\x65precated_int32\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\'\n\x19\x64\x65precated_int32_in_oneof\x18\x02 \x01(\x05\x42\x02\x18\x01H\x00\x42\x0e\n\x0coneof_fields\"\x1b\n\x15TestDeprecatedMessage:\x02\x18\x01\"&\n\x0e\x46oreignMessage\x12\t\n\x01\x63\x18\x01 \x01(\x05\x12\t\n\x01\x64\x18\x02 \x01(\x05\"0\n\x12TestReservedFieldsJ\x04\x08\x02\x10\x03J\x04\x08\x0f\x10\x10J\x04\x08\t\x10\x0cR\x03\x62\x61rR\x03\x62\x61z\"\x1d\n\x11TestAllExtensions*\x08\x08\x01\x10\x80\x80\x80\x80\x02\"$\n\x17OptionalGroup_extension\x12\t\n\x01\x61\x18\x11 \x01(\x05\"$\n\x17RepeatedGroup_extension\x12\t\n\x01\x61\x18/ \x01(\x05\"\xa9\x01\n\tTestGroup\x12\x41\n\roptionalgroup\x18\x10 \x01(\n2*.protobuf_unittest.TestGroup.OptionalGroup\x12=\n\x15optional_foreign_enum\x18\x16 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x1a\x1a\n\rOptionalGroup\x12\t\n\x01\x61\x18\x11 \x01(\x05\"\x1e\n\x12TestGroupExtension*\x08\x08\x01\x10\x80\x80\x80\x80\x02\"\xb7\x03\n\x13TestNestedExtension\x1a$\n\x17OptionalGroup_extension\x12\t\n\x01\x61\x18\x11 \x01(\x05\x32\x39\n\x04test\x12$.protobuf_unittest.TestAllExtensions\x18\xea\x07 \x01(\t:\x04test2F\n\x17nested_string_extension\x12$.protobuf_unittest.TestAllExtensions\x18\xeb\x07 \x01(\t2\x86\x01\n\x17optionalgroup_extension\x12%.protobuf_unittest.TestGroupExtension\x18\x10 \x01(\n2>.protobuf_unittest.TestNestedExtension.OptionalGroup_extension2n\n\x1foptional_foreign_enum_extension\x12%.protobuf_unittest.TestGroupExtension\x18\x16 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\"l\n\x12TestChildExtension\x12\t\n\x01\x61\x18\x01 \x01(\t\x12\t\n\x01\x62\x18\x02 \x01(\t\x12@\n\x12optional_extension\x18\x03 \x01(\x0b\x32$.protobuf_unittest.TestAllExtensions\"\xd5\x05\n\x0cTestRequired\x12\t\n\x01\x61\x18\x01 \x02(\x05\x12\x0e\n\x06\x64ummy2\x18\x02 \x01(\x05\x12\t\n\x01\x62\x18\x03 \x02(\x05\x12\x0e\n\x06\x64ummy4\x18\x04 \x01(\x05\x12\x0e\n\x06\x64ummy5\x18\x05 \x01(\x05\x12\x0e\n\x06\x64ummy6\x18\x06 \x01(\x05\x12\x0e\n\x06\x64ummy7\x18\x07 \x01(\x05\x12\x0e\n\x06\x64ummy8\x18\x08 \x01(\x05\x12\x0e\n\x06\x64ummy9\x18\t \x01(\x05\x12\x0f\n\x07\x64ummy10\x18\n \x01(\x05\x12\x0f\n\x07\x64ummy11\x18\x0b \x01(\x05\x12\x0f\n\x07\x64ummy12\x18\x0c \x01(\x05\x12\x0f\n\x07\x64ummy13\x18\r \x01(\x05\x12\x0f\n\x07\x64ummy14\x18\x0e \x01(\x05\x12\x0f\n\x07\x64ummy15\x18\x0f \x01(\x05\x12\x0f\n\x07\x64ummy16\x18\x10 \x01(\x05\x12\x0f\n\x07\x64ummy17\x18\x11 \x01(\x05\x12\x0f\n\x07\x64ummy18\x18\x12 \x01(\x05\x12\x0f\n\x07\x64ummy19\x18\x13 \x01(\x05\x12\x0f\n\x07\x64ummy20\x18\x14 \x01(\x05\x12\x0f\n\x07\x64ummy21\x18\x15 \x01(\x05\x12\x0f\n\x07\x64ummy22\x18\x16 \x01(\x05\x12\x0f\n\x07\x64ummy23\x18\x17 \x01(\x05\x12\x0f\n\x07\x64ummy24\x18\x18 \x01(\x05\x12\x0f\n\x07\x64ummy25\x18\x19 \x01(\x05\x12\x0f\n\x07\x64ummy26\x18\x1a \x01(\x05\x12\x0f\n\x07\x64ummy27\x18\x1b \x01(\x05\x12\x0f\n\x07\x64ummy28\x18\x1c \x01(\x05\x12\x0f\n\x07\x64ummy29\x18\x1d \x01(\x05\x12\x0f\n\x07\x64ummy30\x18\x1e \x01(\x05\x12\x0f\n\x07\x64ummy31\x18\x1f \x01(\x05\x12\x0f\n\x07\x64ummy32\x18 \x01(\x05\x12\t\n\x01\x63\x18! \x02(\x05\x32V\n\x06single\x12$.protobuf_unittest.TestAllExtensions\x18\xe8\x07 \x01(\x0b\x32\x1f.protobuf_unittest.TestRequired2U\n\x05multi\x12$.protobuf_unittest.TestAllExtensions\x18\xe9\x07 \x03(\x0b\x32\x1f.protobuf_unittest.TestRequired\"\x9a\x01\n\x13TestRequiredForeign\x12\x39\n\x10optional_message\x18\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestRequired\x12\x39\n\x10repeated_message\x18\x02 \x03(\x0b\x32\x1f.protobuf_unittest.TestRequired\x12\r\n\x05\x64ummy\x18\x03 \x01(\x05\"\xc6\x01\n\x13TestRequiredMessage\x12\x39\n\x10optional_message\x18\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestRequired\x12\x39\n\x10repeated_message\x18\x02 \x03(\x0b\x32\x1f.protobuf_unittest.TestRequired\x12\x39\n\x10required_message\x18\x03 \x02(\x0b\x32\x1f.protobuf_unittest.TestRequired\"Z\n\x11TestForeignNested\x12\x45\n\x0e\x66oreign_nested\x18\x01 \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage\"\x12\n\x10TestEmptyMessage\"*\n\x1eTestEmptyMessageWithExtensions*\x08\x08\x01\x10\x80\x80\x80\x80\x02\"Y\n\x17TestPickleNestedMessage\x1a>\n\rNestedMessage\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05\x1a!\n\x13NestedNestedMessage\x12\n\n\x02\x63\x63\x18\x01 \x01(\x05\"7\n\x1bTestMultipleExtensionRanges*\x04\x08*\x10+*\x06\x08\xaf \x10\x94!*\n\x08\x80\x80\x04\x10\x80\x80\x80\x80\x02\"4\n\x18TestReallyLargeTagNumber\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\r\n\x02\x62\x62\x18\xff\xff\xff\x7f \x01(\x05\"U\n\x14TestRecursiveMessage\x12\x32\n\x01\x61\x18\x01 \x01(\x0b\x32\'.protobuf_unittest.TestRecursiveMessage\x12\t\n\x01i\x18\x02 \x01(\x05\"\xe1\x02\n\x14TestMutualRecursionA\x12\x33\n\x02\x62\x62\x18\x01 \x01(\x0b\x32\'.protobuf_unittest.TestMutualRecursionB\x12\x42\n\x08subgroup\x18\x02 \x01(\n20.protobuf_unittest.TestMutualRecursionA.SubGroup\x1a@\n\nSubMessage\x12\x32\n\x01\x62\x18\x01 \x01(\x0b\x32\'.protobuf_unittest.TestMutualRecursionB\x1a\x8d\x01\n\x08SubGroup\x12G\n\x0bsub_message\x18\x03 \x01(\x0b\x32\x32.protobuf_unittest.TestMutualRecursionA.SubMessage\x12\x38\n\x0fnot_in_this_scc\x18\x04 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"b\n\x14TestMutualRecursionB\x12\x32\n\x01\x61\x18\x01 \x01(\x0b\x32\'.protobuf_unittest.TestMutualRecursionA\x12\x16\n\x0eoptional_int32\x18\x02 \x01(\x05\"\xca\x01\n\x11TestIsInitialized\x12\x44\n\x0bsub_message\x18\x01 \x01(\x0b\x32/.protobuf_unittest.TestIsInitialized.SubMessage\x1ao\n\nSubMessage\x12J\n\x08subgroup\x18\x01 \x01(\n28.protobuf_unittest.TestIsInitialized.SubMessage.SubGroup\x1a\x15\n\x08SubGroup\x12\t\n\x01i\x18\x02 \x02(\x05\"\xb3\x01\n\x12TestDupFieldNumber\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\x36\n\x03\x66oo\x18\x02 \x01(\n2).protobuf_unittest.TestDupFieldNumber.Foo\x12\x36\n\x03\x62\x61r\x18\x03 \x01(\n2).protobuf_unittest.TestDupFieldNumber.Bar\x1a\x10\n\x03\x46oo\x12\t\n\x01\x61\x18\x01 \x01(\x05\x1a\x10\n\x03\x42\x61r\x12\t\n\x01\x61\x18\x01 \x01(\x05\"L\n\x10TestEagerMessage\x12\x38\n\x0bsub_message\x18\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypesB\x02(\x00\"K\n\x0fTestLazyMessage\x12\x38\n\x0bsub_message\x18\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypesB\x02(\x01\"\x80\x02\n\x18TestNestedMessageHasBits\x12Z\n\x17optional_nested_message\x18\x01 \x01(\x0b\x32\x39.protobuf_unittest.TestNestedMessageHasBits.NestedMessage\x1a\x87\x01\n\rNestedMessage\x12$\n\x1cnestedmessage_repeated_int32\x18\x01 \x03(\x05\x12P\n%nestedmessage_repeated_foreignmessage\x18\x02 \x03(\x0b\x32!.protobuf_unittest.ForeignMessage\"\xe5\x03\n\x17TestCamelCaseFieldNames\x12\x16\n\x0ePrimitiveField\x18\x01 \x01(\x05\x12\x13\n\x0bStringField\x18\x02 \x01(\t\x12\x31\n\tEnumField\x18\x03 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12\x37\n\x0cMessageField\x18\x04 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage\x12\x1c\n\x10StringPieceField\x18\x05 \x01(\tB\x02\x08\x02\x12\x15\n\tCordField\x18\x06 \x01(\tB\x02\x08\x01\x12\x1e\n\x16RepeatedPrimitiveField\x18\x07 \x03(\x05\x12\x1b\n\x13RepeatedStringField\x18\x08 \x03(\t\x12\x39\n\x11RepeatedEnumField\x18\t \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12?\n\x14RepeatedMessageField\x18\n \x03(\x0b\x32!.protobuf_unittest.ForeignMessage\x12$\n\x18RepeatedStringPieceField\x18\x0b \x03(\tB\x02\x08\x02\x12\x1d\n\x11RepeatedCordField\x18\x0c \x03(\tB\x02\x08\x01\"\xd5\x01\n\x12TestFieldOrderings\x12\x11\n\tmy_string\x18\x0b \x01(\t\x12\x0e\n\x06my_int\x18\x01 \x01(\x03\x12\x10\n\x08my_float\x18\x65 \x01(\x02\x12U\n\x17optional_nested_message\x18\xc8\x01 \x01(\x0b\x32\x33.protobuf_unittest.TestFieldOrderings.NestedMessage\x1a\'\n\rNestedMessage\x12\n\n\x02oo\x18\x02 \x01(\x03\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05*\x04\x08\x02\x10\x0b*\x04\x08\x0c\x10\x65\"\x9c\x01\n\x17TestExtensionOrderings1\x12\x11\n\tmy_string\x18\x01 \x01(\t2n\n\x13test_ext_orderings1\x12%.protobuf_unittest.TestFieldOrderings\x18\r \x01(\x0b\x32*.protobuf_unittest.TestExtensionOrderings1\"\xd4\x02\n\x17TestExtensionOrderings2\x12\x11\n\tmy_string\x18\x01 \x01(\t\x1a\xb5\x01\n\x17TestExtensionOrderings3\x12\x11\n\tmy_string\x18\x01 \x01(\t2\x86\x01\n\x13test_ext_orderings3\x12%.protobuf_unittest.TestFieldOrderings\x18\x0e \x01(\x0b\x32\x42.protobuf_unittest.TestExtensionOrderings2.TestExtensionOrderings32n\n\x13test_ext_orderings2\x12%.protobuf_unittest.TestFieldOrderings\x18\x0c \x01(\x0b\x32*.protobuf_unittest.TestExtensionOrderings2\"\xb6\x07\n\x18TestExtremeDefaultValues\x12?\n\rescaped_bytes\x18\x01 \x01(\x0c:(\\000\\001\\007\\010\\014\\n\\r\\t\\013\\\\\\\'\\\"\\376\x12 \n\x0clarge_uint32\x18\x02 \x01(\r:\n4294967295\x12*\n\x0clarge_uint64\x18\x03 \x01(\x04:\x14\x31\x38\x34\x34\x36\x37\x34\x34\x30\x37\x33\x37\x30\x39\x35\x35\x31\x36\x31\x35\x12 \n\x0bsmall_int32\x18\x04 \x01(\x05:\x0b-2147483647\x12)\n\x0bsmall_int64\x18\x05 \x01(\x03:\x14-9223372036854775807\x12\'\n\x12really_small_int32\x18\x15 \x01(\x05:\x0b-2147483648\x12\x30\n\x12really_small_int64\x18\x16 \x01(\x03:\x14-9223372036854775808\x12\x18\n\x0butf8_string\x18\x06 \x01(\t:\x03\xe1\x88\xb4\x12\x15\n\nzero_float\x18\x07 \x01(\x02:\x01\x30\x12\x14\n\tone_float\x18\x08 \x01(\x02:\x01\x31\x12\x18\n\x0bsmall_float\x18\t \x01(\x02:\x03\x31.5\x12\x1e\n\x12negative_one_float\x18\n \x01(\x02:\x02-1\x12\x1c\n\x0enegative_float\x18\x0b \x01(\x02:\x04-1.5\x12\x1a\n\x0blarge_float\x18\x0c \x01(\x02:\x05\x32\x65+08\x12$\n\x14small_negative_float\x18\r \x01(\x02:\x06-8e-28\x12\x17\n\ninf_double\x18\x0e \x01(\x01:\x03inf\x12\x1c\n\x0eneg_inf_double\x18\x0f \x01(\x01:\x04-inf\x12\x17\n\nnan_double\x18\x10 \x01(\x01:\x03nan\x12\x16\n\tinf_float\x18\x11 \x01(\x02:\x03inf\x12\x1b\n\rneg_inf_float\x18\x12 \x01(\x02:\x04-inf\x12\x16\n\tnan_float\x18\x13 \x01(\x02:\x03nan\x12+\n\x0c\x63pp_trigraph\x18\x14 \x01(\t:\x15? ? ?? ?? ??? ??/ ??-\x12 \n\x10string_with_zero\x18\x17 \x01(\t:\x06hel\x00lo\x12\"\n\x0f\x62ytes_with_zero\x18\x18 \x01(\x0c:\twor\\000ld\x12(\n\x16string_piece_with_zero\x18\x19 \x01(\t:\x04\x61\x62\x00\x63\x42\x02\x08\x02\x12 \n\x0e\x63ord_with_zero\x18\x1a \x01(\t:\x04\x31\x32\x00\x33\x42\x02\x08\x01\x12&\n\x12replacement_string\x18\x1b \x01(\t:\n${unknown}\"K\n\x11SparseEnumMessage\x12\x36\n\x0bsparse_enum\x18\x01 \x01(\x0e\x32!.protobuf_unittest.TestSparseEnum\"\x19\n\tOneString\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\t\"\x1a\n\nMoreString\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\t\"\x18\n\x08OneBytes\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"\x19\n\tMoreBytes\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x0c\"\x1c\n\x0cInt32Message\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x05\"\x1d\n\rUint32Message\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\r\"\x1c\n\x0cInt64Message\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x03\"\x1d\n\rUint64Message\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x04\"\x1b\n\x0b\x42oolMessage\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x08\"\xd0\x01\n\tTestOneof\x12\x11\n\x07\x66oo_int\x18\x01 \x01(\x05H\x00\x12\x14\n\nfoo_string\x18\x02 \x01(\tH\x00\x12\x36\n\x0b\x66oo_message\x18\x03 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypesH\x00\x12\x39\n\x08\x66oogroup\x18\x04 \x01(\n2%.protobuf_unittest.TestOneof.FooGroupH\x00\x1a \n\x08\x46ooGroup\x12\t\n\x01\x61\x18\x05 \x01(\x05\x12\t\n\x01\x62\x18\x06 \x01(\tB\x05\n\x03\x66oo\"\xe7\x01\n\x1cTestOneofBackwardsCompatible\x12\x0f\n\x07\x66oo_int\x18\x01 \x01(\x05\x12\x12\n\nfoo_string\x18\x02 \x01(\t\x12\x34\n\x0b\x66oo_message\x18\x03 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12J\n\x08\x66oogroup\x18\x04 \x01(\n28.protobuf_unittest.TestOneofBackwardsCompatible.FooGroup\x1a \n\x08\x46ooGroup\x12\t\n\x01\x61\x18\x05 \x01(\x05\x12\t\n\x01\x62\x18\x06 \x01(\t\"\xd5\x07\n\nTestOneof2\x12\x11\n\x07\x66oo_int\x18\x01 \x01(\x05H\x00\x12\x14\n\nfoo_string\x18\x02 \x01(\tH\x00\x12\x16\n\x08\x66oo_cord\x18\x03 \x01(\tB\x02\x08\x01H\x00\x12\x1e\n\x10\x66oo_string_piece\x18\x04 \x01(\tB\x02\x08\x02H\x00\x12\x13\n\tfoo_bytes\x18\x05 \x01(\x0cH\x00\x12<\n\x08\x66oo_enum\x18\x06 \x01(\x0e\x32(.protobuf_unittest.TestOneof2.NestedEnumH\x00\x12\x42\n\x0b\x66oo_message\x18\x07 \x01(\x0b\x32+.protobuf_unittest.TestOneof2.NestedMessageH\x00\x12:\n\x08\x66oogroup\x18\x08 \x01(\n2&.protobuf_unittest.TestOneof2.FooGroupH\x00\x12K\n\x10\x66oo_lazy_message\x18\x0b \x01(\x0b\x32+.protobuf_unittest.TestOneof2.NestedMessageB\x02(\x01H\x00\x12\x14\n\x07\x62\x61r_int\x18\x0c \x01(\x05:\x01\x35H\x01\x12\x1c\n\nbar_string\x18\r \x01(\t:\x06STRINGH\x01\x12\x1c\n\x08\x62\x61r_cord\x18\x0e \x01(\t:\x04\x43ORDB\x02\x08\x01H\x01\x12&\n\x10\x62\x61r_string_piece\x18\x0f \x01(\t:\x06SPIECEB\x02\x08\x02H\x01\x12\x1a\n\tbar_bytes\x18\x10 \x01(\x0c:\x05\x42YTESH\x01\x12\x41\n\x08\x62\x61r_enum\x18\x11 \x01(\x0e\x32(.protobuf_unittest.TestOneof2.NestedEnum:\x03\x42\x41RH\x01\x12)\n\x1d\x62\x61r_string_with_empty_default\x18\x14 \x01(\t:\x00H\x01\x12+\n\x1b\x62\x61r_cord_with_empty_default\x18\x15 \x01(\t:\x00\x42\x02\x08\x01H\x01\x12\x33\n#bar_string_piece_with_empty_default\x18\x16 \x01(\t:\x00\x42\x02\x08\x02H\x01\x12(\n\x1c\x62\x61r_bytes_with_empty_default\x18\x17 \x01(\x0c:\x00H\x01\x12\x0f\n\x07\x62\x61z_int\x18\x12 \x01(\x05\x12\x17\n\nbaz_string\x18\x13 \x01(\t:\x03\x42\x41Z\x1a \n\x08\x46ooGroup\x12\t\n\x01\x61\x18\t \x01(\x05\x12\t\n\x01\x62\x18\n \x01(\t\x1a\x33\n\rNestedMessage\x12\x0f\n\x07qux_int\x18\x01 \x01(\x03\x12\x11\n\tcorge_int\x18\x02 \x03(\x05\"\'\n\nNestedEnum\x12\x07\n\x03\x46OO\x10\x01\x12\x07\n\x03\x42\x41R\x10\x02\x12\x07\n\x03\x42\x41Z\x10\x03\x42\x05\n\x03\x66ooB\x05\n\x03\x62\x61r\"\xb8\x01\n\x11TestRequiredOneof\x12\x11\n\x07\x66oo_int\x18\x01 \x01(\x05H\x00\x12\x14\n\nfoo_string\x18\x02 \x01(\tH\x00\x12I\n\x0b\x66oo_message\x18\x03 \x01(\x0b\x32\x32.protobuf_unittest.TestRequiredOneof.NestedMessageH\x00\x1a(\n\rNestedMessage\x12\x17\n\x0frequired_double\x18\x01 \x02(\x01\x42\x05\n\x03\x66oo\"\xaa\x03\n\x0fTestPackedTypes\x12\x18\n\x0cpacked_int32\x18Z \x03(\x05\x42\x02\x10\x01\x12\x18\n\x0cpacked_int64\x18[ \x03(\x03\x42\x02\x10\x01\x12\x19\n\rpacked_uint32\x18\\ \x03(\rB\x02\x10\x01\x12\x19\n\rpacked_uint64\x18] \x03(\x04\x42\x02\x10\x01\x12\x19\n\rpacked_sint32\x18^ \x03(\x11\x42\x02\x10\x01\x12\x19\n\rpacked_sint64\x18_ \x03(\x12\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed32\x18` \x03(\x07\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed64\x18\x61 \x03(\x06\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed32\x18\x62 \x03(\x0f\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed64\x18\x63 \x03(\x10\x42\x02\x10\x01\x12\x18\n\x0cpacked_float\x18\x64 \x03(\x02\x42\x02\x10\x01\x12\x19\n\rpacked_double\x18\x65 \x03(\x01\x42\x02\x10\x01\x12\x17\n\x0bpacked_bool\x18\x66 \x03(\x08\x42\x02\x10\x01\x12\x37\n\x0bpacked_enum\x18g \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnumB\x02\x10\x01\"\xc8\x03\n\x11TestUnpackedTypes\x12\x1a\n\x0eunpacked_int32\x18Z \x03(\x05\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_int64\x18[ \x03(\x03\x42\x02\x10\x00\x12\x1b\n\x0funpacked_uint32\x18\\ \x03(\rB\x02\x10\x00\x12\x1b\n\x0funpacked_uint64\x18] \x03(\x04\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint32\x18^ \x03(\x11\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint64\x18_ \x03(\x12\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed32\x18` \x03(\x07\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed64\x18\x61 \x03(\x06\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed32\x18\x62 \x03(\x0f\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed64\x18\x63 \x03(\x10\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_float\x18\x64 \x03(\x02\x42\x02\x10\x00\x12\x1b\n\x0funpacked_double\x18\x65 \x03(\x01\x42\x02\x10\x00\x12\x19\n\runpacked_bool\x18\x66 \x03(\x08\x42\x02\x10\x00\x12\x39\n\runpacked_enum\x18g \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnumB\x02\x10\x00\" \n\x14TestPackedExtensions*\x08\x08\x01\x10\x80\x80\x80\x80\x02\"\"\n\x16TestUnpackedExtensions*\x08\x08\x01\x10\x80\x80\x80\x80\x02\"\x99\x04\n\x15TestDynamicExtensions\x12\x19\n\x10scalar_extension\x18\xd0\x0f \x01(\x07\x12\x37\n\x0e\x65num_extension\x18\xd1\x0f \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12Y\n\x16\x64ynamic_enum_extension\x18\xd2\x0f \x01(\x0e\x32\x38.protobuf_unittest.TestDynamicExtensions.DynamicEnumType\x12=\n\x11message_extension\x18\xd3\x0f \x01(\x0b\x32!.protobuf_unittest.ForeignMessage\x12_\n\x19\x64ynamic_message_extension\x18\xd4\x0f \x01(\x0b\x32;.protobuf_unittest.TestDynamicExtensions.DynamicMessageType\x12\x1b\n\x12repeated_extension\x18\xd5\x0f \x03(\t\x12\x1d\n\x10packed_extension\x18\xd6\x0f \x03(\x11\x42\x02\x10\x01\x1a,\n\x12\x44ynamicMessageType\x12\x16\n\rdynamic_field\x18\xb4\x10 \x01(\x05\"G\n\x0f\x44ynamicEnumType\x12\x10\n\x0b\x44YNAMIC_FOO\x10\x98\x11\x12\x10\n\x0b\x44YNAMIC_BAR\x10\x99\x11\x12\x10\n\x0b\x44YNAMIC_BAZ\x10\x9a\x11\"\xc0\x01\n#TestRepeatedScalarDifferentTagSizes\x12\x18\n\x10repeated_fixed32\x18\x0c \x03(\x07\x12\x16\n\x0erepeated_int32\x18\r \x03(\x05\x12\x19\n\x10repeated_fixed64\x18\xfe\x0f \x03(\x06\x12\x17\n\x0erepeated_int64\x18\xff\x0f \x03(\x03\x12\x18\n\x0erepeated_float\x18\xfe\xff\x0f \x03(\x02\x12\x19\n\x0frepeated_uint64\x18\xff\xff\x0f \x03(\x04\"\xf7\t\n\x10TestParsingMerge\x12;\n\x12required_all_types\x18\x01 \x02(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12optional_all_types\x18\x02 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12repeated_all_types\x18\x03 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12H\n\roptionalgroup\x18\n \x01(\n21.protobuf_unittest.TestParsingMerge.OptionalGroup\x12H\n\rrepeatedgroup\x18\x14 \x03(\n21.protobuf_unittest.TestParsingMerge.RepeatedGroup\x1a\xaa\x04\n\x17RepeatedFieldsGenerator\x12/\n\x06\x66ield1\x18\x01 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12/\n\x06\x66ield2\x18\x02 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12/\n\x06\x66ield3\x18\x03 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12R\n\x06group1\x18\n \x03(\n2B.protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group1\x12R\n\x06group2\x18\x14 \x03(\n2B.protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group2\x12.\n\x04\x65xt1\x18\xe8\x07 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12.\n\x04\x65xt2\x18\xe9\x07 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x1a\x39\n\x06Group1\x12/\n\x06\x66ield1\x18\x0b \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x1a\x39\n\x06Group2\x12/\n\x06\x66ield1\x18\x15 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x1aR\n\rOptionalGroup\x12\x41\n\x18optional_group_all_types\x18\x0b \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x1aR\n\rRepeatedGroup\x12\x41\n\x18repeated_group_all_types\x18\x15 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x32[\n\x0coptional_ext\x12#.protobuf_unittest.TestParsingMerge\x18\xe8\x07 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes2[\n\x0crepeated_ext\x12#.protobuf_unittest.TestParsingMerge\x18\xe9\x07 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"D\n\x1bTestCommentInjectionMessage\x12%\n\x01\x61\x18\x01 \x01(\t:\x1a*/ <- Neither should this.\"\x0c\n\nFooRequest\"\r\n\x0b\x46ooResponse\"\x12\n\x10\x46ooClientMessage\"\x12\n\x10\x46ooServerMessage\"\x0c\n\nBarRequest\"\r\n\x0b\x42\x61rResponse\"\xa6\x01\n\x0cTestJsonName\x12\x13\n\x0b\x66ield_name1\x18\x01 \x01(\x05\x12\x12\n\nfieldName2\x18\x02 \x01(\x05\x12\x12\n\nFieldName3\x18\x03 \x01(\x05\x12\x14\n\x0c_field_name4\x18\x04 \x01(\x05\x12\x13\n\x0b\x46IELD_NAME5\x18\x05 \x01(\x05\x12\x1a\n\x0b\x66ield_name6\x18\x06 \x01(\x05R\x05@type\x12\x12\n\nfieldname7\x18\x07 \x01(\x05\"\xfd\x05\n\x14TestHugeFieldNumbers\x12\x1a\n\x0eoptional_int32\x18\xf0\xf8\xff\xff\x01 \x01(\x05\x12\x14\n\x08\x66ixed_32\x18\xf1\xf8\xff\xff\x01 \x01(\x05\x12\x1e\n\x0erepeated_int32\x18\xf2\xf8\xff\xff\x01 \x03(\x05\x42\x02\x10\x00\x12\x1c\n\x0cpacked_int32\x18\xf3\xf8\xff\xff\x01 \x03(\x05\x42\x02\x10\x01\x12\x39\n\roptional_enum\x18\xf4\xf8\xff\xff\x01 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12\x1b\n\x0foptional_string\x18\xf5\xf8\xff\xff\x01 \x01(\t\x12\x1a\n\x0eoptional_bytes\x18\xf6\xf8\xff\xff\x01 \x01(\x0c\x12?\n\x10optional_message\x18\xf7\xf8\xff\xff\x01 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage\x12P\n\roptionalgroup\x18\xf8\xf8\xff\xff\x01 \x01(\n25.protobuf_unittest.TestHugeFieldNumbers.OptionalGroup\x12[\n\x11string_string_map\x18\xfa\xf8\xff\xff\x01 \x03(\x0b\x32<.protobuf_unittest.TestHugeFieldNumbers.StringStringMapEntry\x12\x1a\n\x0coneof_uint32\x18\xfb\xf8\xff\xff\x01 \x01(\rH\x00\x12\x43\n\x14oneof_test_all_types\x18\xfc\xf8\xff\xff\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypesH\x00\x12\x1a\n\x0coneof_string\x18\xfd\xf8\xff\xff\x01 \x01(\tH\x00\x12\x19\n\x0boneof_bytes\x18\xfe\xf8\xff\xff\x01 \x01(\x0cH\x00\x1a$\n\rOptionalGroup\x12\x13\n\x07group_a\x18\xf9\xf8\xff\xff\x01 \x01(\x05\x1a\x36\n\x14StringStringMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01*\x0c\x08\xe0\xaa\xff\xff\x01\x10\xf0\xf8\xff\xff\x01\x42\r\n\x0boneof_field\"\xb1\x01\n\x18TestExtensionInsideTable\x12\x0e\n\x06\x66ield1\x18\x01 \x01(\x05\x12\x0e\n\x06\x66ield2\x18\x02 \x01(\x05\x12\x0e\n\x06\x66ield3\x18\x03 \x01(\x05\x12\x0e\n\x06\x66ield4\x18\x04 \x01(\x05\x12\x0e\n\x06\x66ield6\x18\x06 \x01(\x05\x12\x0e\n\x06\x66ield7\x18\x07 \x01(\x05\x12\x0e\n\x06\x66ield8\x18\x08 \x01(\x05\x12\x0e\n\x06\x66ield9\x18\t \x01(\x05\x12\x0f\n\x07\x66ield10\x18\n \x01(\x05*\x04\x08\x05\x10\x06\"\xd1\x03\n\x1bTestExtensionRangeSerialize\x12\x0f\n\x07\x66oo_one\x18\x01 \x01(\x05\x12\x0f\n\x07\x66oo_two\x18\x06 \x01(\x05\x12\x11\n\tfoo_three\x18\x07 \x01(\x05\x12\x10\n\x08\x66oo_four\x18\r \x01(\x05*\x04\x08\x02\x10\x03*\x04\x08\x03\x10\x05*\x04\x08\t\x10\x0b*\x04\x08\x0f\x10\x10*\x04\x08\x11\x10\x12*\x04\x08\x13\x10\x14\x32?\n\x07\x62\x61r_one\x12..protobuf_unittest.TestExtensionRangeSerialize\x18\x02 \x01(\x05\x32?\n\x07\x62\x61r_two\x12..protobuf_unittest.TestExtensionRangeSerialize\x18\x04 \x01(\x05\x32\x41\n\tbar_three\x12..protobuf_unittest.TestExtensionRangeSerialize\x18\n \x01(\x05\x32@\n\x08\x62\x61r_four\x12..protobuf_unittest.TestExtensionRangeSerialize\x18\x0f \x01(\x05\x32@\n\x08\x62\x61r_five\x12..protobuf_unittest.TestExtensionRangeSerialize\x18\x13 \x01(\x05*@\n\x0b\x46oreignEnum\x12\x0f\n\x0b\x46OREIGN_FOO\x10\x04\x12\x0f\n\x0b\x46OREIGN_BAR\x10\x05\x12\x0f\n\x0b\x46OREIGN_BAZ\x10\x06*K\n\x14TestEnumWithDupValue\x12\x08\n\x04\x46OO1\x10\x01\x12\x08\n\x04\x42\x41R1\x10\x02\x12\x07\n\x03\x42\x41Z\x10\x03\x12\x08\n\x04\x46OO2\x10\x01\x12\x08\n\x04\x42\x41R2\x10\x02\x1a\x02\x10\x01*\x89\x01\n\x0eTestSparseEnum\x12\x0c\n\x08SPARSE_A\x10{\x12\x0e\n\x08SPARSE_B\x10\xa6\xe7\x03\x12\x0f\n\x08SPARSE_C\x10\xb2\xb1\x80\x06\x12\x15\n\x08SPARSE_D\x10\xf1\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\x15\n\x08SPARSE_E\x10\xb4\xde\xfc\xff\xff\xff\xff\xff\xff\x01\x12\x0c\n\x08SPARSE_F\x10\x00\x12\x0c\n\x08SPARSE_G\x10\x02*\x8b\x0f\n\rVeryLargeEnum\x12\x16\n\x12\x45NUM_LABEL_DEFAULT\x10\x00\x12\x10\n\x0c\x45NUM_LABEL_1\x10\x01\x12\x10\n\x0c\x45NUM_LABEL_2\x10\x02\x12\x10\n\x0c\x45NUM_LABEL_3\x10\x03\x12\x10\n\x0c\x45NUM_LABEL_4\x10\x04\x12\x10\n\x0c\x45NUM_LABEL_5\x10\x05\x12\x10\n\x0c\x45NUM_LABEL_6\x10\x06\x12\x10\n\x0c\x45NUM_LABEL_7\x10\x07\x12\x10\n\x0c\x45NUM_LABEL_8\x10\x08\x12\x10\n\x0c\x45NUM_LABEL_9\x10\t\x12\x11\n\rENUM_LABEL_10\x10\n\x12\x11\n\rENUM_LABEL_11\x10\x0b\x12\x11\n\rENUM_LABEL_12\x10\x0c\x12\x11\n\rENUM_LABEL_13\x10\r\x12\x11\n\rENUM_LABEL_14\x10\x0e\x12\x11\n\rENUM_LABEL_15\x10\x0f\x12\x11\n\rENUM_LABEL_16\x10\x10\x12\x11\n\rENUM_LABEL_17\x10\x11\x12\x11\n\rENUM_LABEL_18\x10\x12\x12\x11\n\rENUM_LABEL_19\x10\x13\x12\x11\n\rENUM_LABEL_20\x10\x14\x12\x11\n\rENUM_LABEL_21\x10\x15\x12\x11\n\rENUM_LABEL_22\x10\x16\x12\x11\n\rENUM_LABEL_23\x10\x17\x12\x11\n\rENUM_LABEL_24\x10\x18\x12\x11\n\rENUM_LABEL_25\x10\x19\x12\x11\n\rENUM_LABEL_26\x10\x1a\x12\x11\n\rENUM_LABEL_27\x10\x1b\x12\x11\n\rENUM_LABEL_28\x10\x1c\x12\x11\n\rENUM_LABEL_29\x10\x1d\x12\x11\n\rENUM_LABEL_30\x10\x1e\x12\x11\n\rENUM_LABEL_31\x10\x1f\x12\x11\n\rENUM_LABEL_32\x10 \x12\x11\n\rENUM_LABEL_33\x10!\x12\x11\n\rENUM_LABEL_34\x10\"\x12\x11\n\rENUM_LABEL_35\x10#\x12\x11\n\rENUM_LABEL_36\x10$\x12\x11\n\rENUM_LABEL_37\x10%\x12\x11\n\rENUM_LABEL_38\x10&\x12\x11\n\rENUM_LABEL_39\x10\'\x12\x11\n\rENUM_LABEL_40\x10(\x12\x11\n\rENUM_LABEL_41\x10)\x12\x11\n\rENUM_LABEL_42\x10*\x12\x11\n\rENUM_LABEL_43\x10+\x12\x11\n\rENUM_LABEL_44\x10,\x12\x11\n\rENUM_LABEL_45\x10-\x12\x11\n\rENUM_LABEL_46\x10.\x12\x11\n\rENUM_LABEL_47\x10/\x12\x11\n\rENUM_LABEL_48\x10\x30\x12\x11\n\rENUM_LABEL_49\x10\x31\x12\x11\n\rENUM_LABEL_50\x10\x32\x12\x11\n\rENUM_LABEL_51\x10\x33\x12\x11\n\rENUM_LABEL_52\x10\x34\x12\x11\n\rENUM_LABEL_53\x10\x35\x12\x11\n\rENUM_LABEL_54\x10\x36\x12\x11\n\rENUM_LABEL_55\x10\x37\x12\x11\n\rENUM_LABEL_56\x10\x38\x12\x11\n\rENUM_LABEL_57\x10\x39\x12\x11\n\rENUM_LABEL_58\x10:\x12\x11\n\rENUM_LABEL_59\x10;\x12\x11\n\rENUM_LABEL_60\x10<\x12\x11\n\rENUM_LABEL_61\x10=\x12\x11\n\rENUM_LABEL_62\x10>\x12\x11\n\rENUM_LABEL_63\x10?\x12\x11\n\rENUM_LABEL_64\x10@\x12\x11\n\rENUM_LABEL_65\x10\x41\x12\x11\n\rENUM_LABEL_66\x10\x42\x12\x11\n\rENUM_LABEL_67\x10\x43\x12\x11\n\rENUM_LABEL_68\x10\x44\x12\x11\n\rENUM_LABEL_69\x10\x45\x12\x11\n\rENUM_LABEL_70\x10\x46\x12\x11\n\rENUM_LABEL_71\x10G\x12\x11\n\rENUM_LABEL_72\x10H\x12\x11\n\rENUM_LABEL_73\x10I\x12\x11\n\rENUM_LABEL_74\x10J\x12\x11\n\rENUM_LABEL_75\x10K\x12\x11\n\rENUM_LABEL_76\x10L\x12\x11\n\rENUM_LABEL_77\x10M\x12\x11\n\rENUM_LABEL_78\x10N\x12\x11\n\rENUM_LABEL_79\x10O\x12\x11\n\rENUM_LABEL_80\x10P\x12\x11\n\rENUM_LABEL_81\x10Q\x12\x11\n\rENUM_LABEL_82\x10R\x12\x11\n\rENUM_LABEL_83\x10S\x12\x11\n\rENUM_LABEL_84\x10T\x12\x11\n\rENUM_LABEL_85\x10U\x12\x11\n\rENUM_LABEL_86\x10V\x12\x11\n\rENUM_LABEL_87\x10W\x12\x11\n\rENUM_LABEL_88\x10X\x12\x11\n\rENUM_LABEL_89\x10Y\x12\x11\n\rENUM_LABEL_90\x10Z\x12\x11\n\rENUM_LABEL_91\x10[\x12\x11\n\rENUM_LABEL_92\x10\\\x12\x11\n\rENUM_LABEL_93\x10]\x12\x11\n\rENUM_LABEL_94\x10^\x12\x11\n\rENUM_LABEL_95\x10_\x12\x11\n\rENUM_LABEL_96\x10`\x12\x11\n\rENUM_LABEL_97\x10\x61\x12\x11\n\rENUM_LABEL_98\x10\x62\x12\x11\n\rENUM_LABEL_99\x10\x63\x12\x12\n\x0e\x45NUM_LABEL_100\x10\x64\x32\x99\x01\n\x0bTestService\x12\x44\n\x03\x46oo\x12\x1d.protobuf_unittest.FooRequest\x1a\x1e.protobuf_unittest.FooResponse\x12\x44\n\x03\x42\x61r\x12\x1d.protobuf_unittest.BarRequest\x1a\x1e.protobuf_unittest.BarResponse:F\n\x18optional_int32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x01 \x01(\x05:F\n\x18optional_int64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x02 \x01(\x03:G\n\x19optional_uint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x03 \x01(\r:G\n\x19optional_uint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x04 \x01(\x04:G\n\x19optional_sint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x05 \x01(\x11:G\n\x19optional_sint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x06 \x01(\x12:H\n\x1aoptional_fixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x07 \x01(\x07:H\n\x1aoptional_fixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x08 \x01(\x06:I\n\x1boptional_sfixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\t \x01(\x0f:I\n\x1boptional_sfixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\n \x01(\x10:F\n\x18optional_float_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x0b \x01(\x02:G\n\x19optional_double_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x0c \x01(\x01:E\n\x17optional_bool_extension\x12$.protobuf_unittest.TestAllExtensions\x18\r \x01(\x08:G\n\x19optional_string_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x0e \x01(\t:F\n\x18optional_bytes_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x0f \x01(\x0c:q\n\x17optionalgroup_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x10 \x01(\n2*.protobuf_unittest.OptionalGroup_extension:~\n!optional_nested_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x12 \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage:s\n\"optional_foreign_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x13 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage:x\n!optional_import_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x14 \x01(\x0b\x32\'.protobuf_unittest_import.ImportMessage:x\n\x1eoptional_nested_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x15 \x01(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum:m\n\x1foptional_foreign_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x16 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum:r\n\x1eoptional_import_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x17 \x01(\x0e\x32$.protobuf_unittest_import.ImportEnum:Q\n\x1foptional_string_piece_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x18 \x01(\tB\x02\x08\x02:I\n\x17optional_cord_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x19 \x01(\tB\x02\x08\x01:\x85\x01\n(optional_public_import_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x1a \x01(\x0b\x32-.protobuf_unittest_import.PublicImportMessage:\x80\x01\n\x1foptional_lazy_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x1b \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageB\x02(\x01:F\n\x18repeated_int32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x1f \x03(\x05:F\n\x18repeated_int64_extension\x12$.protobuf_unittest.TestAllExtensions\x18 \x03(\x03:G\n\x19repeated_uint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18! \x03(\r:G\n\x19repeated_uint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\" \x03(\x04:G\n\x19repeated_sint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18# \x03(\x11:G\n\x19repeated_sint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18$ \x03(\x12:H\n\x1arepeated_fixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18% \x03(\x07:H\n\x1arepeated_fixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18& \x03(\x06:I\n\x1brepeated_sfixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\' \x03(\x0f:I\n\x1brepeated_sfixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18( \x03(\x10:F\n\x18repeated_float_extension\x12$.protobuf_unittest.TestAllExtensions\x18) \x03(\x02:G\n\x19repeated_double_extension\x12$.protobuf_unittest.TestAllExtensions\x18* \x03(\x01:E\n\x17repeated_bool_extension\x12$.protobuf_unittest.TestAllExtensions\x18+ \x03(\x08:G\n\x19repeated_string_extension\x12$.protobuf_unittest.TestAllExtensions\x18, \x03(\t:F\n\x18repeated_bytes_extension\x12$.protobuf_unittest.TestAllExtensions\x18- \x03(\x0c:q\n\x17repeatedgroup_extension\x12$.protobuf_unittest.TestAllExtensions\x18. \x03(\n2*.protobuf_unittest.RepeatedGroup_extension:~\n!repeated_nested_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x30 \x03(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage:s\n\"repeated_foreign_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x31 \x03(\x0b\x32!.protobuf_unittest.ForeignMessage:x\n!repeated_import_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x32 \x03(\x0b\x32\'.protobuf_unittest_import.ImportMessage:x\n\x1erepeated_nested_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x33 \x03(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum:m\n\x1frepeated_foreign_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x34 \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnum:r\n\x1erepeated_import_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x35 \x03(\x0e\x32$.protobuf_unittest_import.ImportEnum:Q\n\x1frepeated_string_piece_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x36 \x03(\tB\x02\x08\x02:I\n\x17repeated_cord_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x37 \x03(\tB\x02\x08\x01:\x80\x01\n\x1frepeated_lazy_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x39 \x03(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageB\x02(\x01:I\n\x17\x64\x65\x66\x61ult_int32_extension\x12$.protobuf_unittest.TestAllExtensions\x18= \x01(\x05:\x02\x34\x31:I\n\x17\x64\x65\x66\x61ult_int64_extension\x12$.protobuf_unittest.TestAllExtensions\x18> \x01(\x03:\x02\x34\x32:J\n\x18\x64\x65\x66\x61ult_uint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18? \x01(\r:\x02\x34\x33:J\n\x18\x64\x65\x66\x61ult_uint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18@ \x01(\x04:\x02\x34\x34:K\n\x18\x64\x65\x66\x61ult_sint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x41 \x01(\x11:\x03-45:J\n\x18\x64\x65\x66\x61ult_sint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x42 \x01(\x12:\x02\x34\x36:K\n\x19\x64\x65\x66\x61ult_fixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x43 \x01(\x07:\x02\x34\x37:K\n\x19\x64\x65\x66\x61ult_fixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x44 \x01(\x06:\x02\x34\x38:L\n\x1a\x64\x65\x66\x61ult_sfixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x45 \x01(\x0f:\x02\x34\x39:M\n\x1a\x64\x65\x66\x61ult_sfixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x46 \x01(\x10:\x03-50:K\n\x17\x64\x65\x66\x61ult_float_extension\x12$.protobuf_unittest.TestAllExtensions\x18G \x01(\x02:\x04\x35\x31.5:M\n\x18\x64\x65\x66\x61ult_double_extension\x12$.protobuf_unittest.TestAllExtensions\x18H \x01(\x01:\x05\x35\x32\x30\x30\x30:J\n\x16\x64\x65\x66\x61ult_bool_extension\x12$.protobuf_unittest.TestAllExtensions\x18I \x01(\x08:\x04true:M\n\x18\x64\x65\x66\x61ult_string_extension\x12$.protobuf_unittest.TestAllExtensions\x18J \x01(\t:\x05hello:L\n\x17\x64\x65\x66\x61ult_bytes_extension\x12$.protobuf_unittest.TestAllExtensions\x18K \x01(\x0c:\x05world:|\n\x1d\x64\x65\x66\x61ult_nested_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18Q \x01(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum:\x03\x42\x41R:y\n\x1e\x64\x65\x66\x61ult_foreign_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18R \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum:\x0b\x46OREIGN_BAR:}\n\x1d\x64\x65\x66\x61ult_import_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18S \x01(\x0e\x32$.protobuf_unittest_import.ImportEnum:\nIMPORT_BAR:U\n\x1e\x64\x65\x66\x61ult_string_piece_extension\x12$.protobuf_unittest.TestAllExtensions\x18T \x01(\t:\x03\x61\x62\x63\x42\x02\x08\x02:M\n\x16\x64\x65\x66\x61ult_cord_extension\x12$.protobuf_unittest.TestAllExtensions\x18U \x01(\t:\x03\x31\x32\x33\x42\x02\x08\x01:D\n\x16oneof_uint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18o \x01(\r:{\n\x1eoneof_nested_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18p \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage:D\n\x16oneof_string_extension\x12$.protobuf_unittest.TestAllExtensions\x18q \x01(\t:C\n\x15oneof_bytes_extension\x12$.protobuf_unittest.TestAllExtensions\x18r \x01(\x0c:B\n\x13my_extension_string\x12%.protobuf_unittest.TestFieldOrderings\x18\x32 \x01(\t:?\n\x10my_extension_int\x12%.protobuf_unittest.TestFieldOrderings\x18\x05 \x01(\x05:K\n\x16packed_int32_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18Z \x03(\x05\x42\x02\x10\x01:K\n\x16packed_int64_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18[ \x03(\x03\x42\x02\x10\x01:L\n\x17packed_uint32_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\\ \x03(\rB\x02\x10\x01:L\n\x17packed_uint64_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18] \x03(\x04\x42\x02\x10\x01:L\n\x17packed_sint32_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18^ \x03(\x11\x42\x02\x10\x01:L\n\x17packed_sint64_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18_ \x03(\x12\x42\x02\x10\x01:M\n\x18packed_fixed32_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18` \x03(\x07\x42\x02\x10\x01:M\n\x18packed_fixed64_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x61 \x03(\x06\x42\x02\x10\x01:N\n\x19packed_sfixed32_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x62 \x03(\x0f\x42\x02\x10\x01:N\n\x19packed_sfixed64_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x63 \x03(\x10\x42\x02\x10\x01:K\n\x16packed_float_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x64 \x03(\x02\x42\x02\x10\x01:L\n\x17packed_double_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x65 \x03(\x01\x42\x02\x10\x01:J\n\x15packed_bool_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x66 \x03(\x08\x42\x02\x10\x01:j\n\x15packed_enum_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18g \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnumB\x02\x10\x01:O\n\x18unpacked_int32_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18Z \x03(\x05\x42\x02\x10\x00:O\n\x18unpacked_int64_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18[ \x03(\x03\x42\x02\x10\x00:P\n\x19unpacked_uint32_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\\ \x03(\rB\x02\x10\x00:P\n\x19unpacked_uint64_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18] \x03(\x04\x42\x02\x10\x00:P\n\x19unpacked_sint32_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18^ \x03(\x11\x42\x02\x10\x00:P\n\x19unpacked_sint64_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18_ \x03(\x12\x42\x02\x10\x00:Q\n\x1aunpacked_fixed32_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18` \x03(\x07\x42\x02\x10\x00:Q\n\x1aunpacked_fixed64_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x61 \x03(\x06\x42\x02\x10\x00:R\n\x1bunpacked_sfixed32_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x62 \x03(\x0f\x42\x02\x10\x00:R\n\x1bunpacked_sfixed64_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x63 \x03(\x10\x42\x02\x10\x00:O\n\x18unpacked_float_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x64 \x03(\x02\x42\x02\x10\x00:P\n\x19unpacked_double_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x65 \x03(\x01\x42\x02\x10\x00:N\n\x17unpacked_bool_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x66 \x03(\x08\x42\x02\x10\x00:n\n\x17unpacked_enum_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18g \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnumB\x02\x10\x00:d\n\x0etest_all_types\x12\'.protobuf_unittest.TestHugeFieldNumbers\x18\xe0\xaa\xff\xff\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes:Z\n%test_extension_inside_table_extension\x12+.protobuf_unittest.TestExtensionInsideTable\x18\x05 \x01(\x05\x42\x1d\x42\rUnittestProtoH\x01\x80\x01\x01\x88\x01\x01\x90\x01\x01\xf8\x01\x01') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1egoogle/protobuf/unittest.proto\x12\x11protobuf_unittest\x1a%google/protobuf/unittest_import.proto\"\xca\x19\n\x0cTestAllTypes\x12\x16\n\x0eoptional_int32\x18\x01 \x01(\x05\x12\x16\n\x0eoptional_int64\x18\x02 \x01(\x03\x12\x17\n\x0foptional_uint32\x18\x03 \x01(\r\x12\x17\n\x0foptional_uint64\x18\x04 \x01(\x04\x12\x17\n\x0foptional_sint32\x18\x05 \x01(\x11\x12\x17\n\x0foptional_sint64\x18\x06 \x01(\x12\x12\x18\n\x10optional_fixed32\x18\x07 \x01(\x07\x12\x18\n\x10optional_fixed64\x18\x08 \x01(\x06\x12\x19\n\x11optional_sfixed32\x18\t \x01(\x0f\x12\x19\n\x11optional_sfixed64\x18\n \x01(\x10\x12\x16\n\x0eoptional_float\x18\x0b \x01(\x02\x12\x17\n\x0foptional_double\x18\x0c \x01(\x01\x12\x15\n\roptional_bool\x18\r \x01(\x08\x12\x17\n\x0foptional_string\x18\x0e \x01(\t\x12\x16\n\x0eoptional_bytes\x18\x0f \x01(\x0c\x12\x44\n\roptionalgroup\x18\x10 \x01(\n2-.protobuf_unittest.TestAllTypes.OptionalGroup\x12N\n\x17optional_nested_message\x18\x12 \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage\x12\x43\n\x18optional_foreign_message\x18\x13 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage\x12H\n\x17optional_import_message\x18\x14 \x01(\x0b\x32\'.protobuf_unittest_import.ImportMessage\x12H\n\x14optional_nested_enum\x18\x15 \x01(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum\x12=\n\x15optional_foreign_enum\x18\x16 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12\x42\n\x14optional_import_enum\x18\x17 \x01(\x0e\x32$.protobuf_unittest_import.ImportEnum\x12!\n\x15optional_string_piece\x18\x18 \x01(\tB\x02\x08\x02\x12\x19\n\roptional_cord\x18\x19 \x01(\tB\x02\x08\x01\x12U\n\x1eoptional_public_import_message\x18\x1a \x01(\x0b\x32-.protobuf_unittest_import.PublicImportMessage\x12P\n\x15optional_lazy_message\x18\x1b \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageB\x02(\x01\x12[\n optional_unverified_lazy_message\x18\x1c \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageB\x02x\x01\x12\x16\n\x0erepeated_int32\x18\x1f \x03(\x05\x12\x16\n\x0erepeated_int64\x18 \x03(\x03\x12\x17\n\x0frepeated_uint32\x18! \x03(\r\x12\x17\n\x0frepeated_uint64\x18\" \x03(\x04\x12\x17\n\x0frepeated_sint32\x18# \x03(\x11\x12\x17\n\x0frepeated_sint64\x18$ \x03(\x12\x12\x18\n\x10repeated_fixed32\x18% \x03(\x07\x12\x18\n\x10repeated_fixed64\x18& \x03(\x06\x12\x19\n\x11repeated_sfixed32\x18\' \x03(\x0f\x12\x19\n\x11repeated_sfixed64\x18( \x03(\x10\x12\x16\n\x0erepeated_float\x18) \x03(\x02\x12\x17\n\x0frepeated_double\x18* \x03(\x01\x12\x15\n\rrepeated_bool\x18+ \x03(\x08\x12\x17\n\x0frepeated_string\x18, \x03(\t\x12\x16\n\x0erepeated_bytes\x18- \x03(\x0c\x12\x44\n\rrepeatedgroup\x18. \x03(\n2-.protobuf_unittest.TestAllTypes.RepeatedGroup\x12N\n\x17repeated_nested_message\x18\x30 \x03(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage\x12\x43\n\x18repeated_foreign_message\x18\x31 \x03(\x0b\x32!.protobuf_unittest.ForeignMessage\x12H\n\x17repeated_import_message\x18\x32 \x03(\x0b\x32\'.protobuf_unittest_import.ImportMessage\x12H\n\x14repeated_nested_enum\x18\x33 \x03(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum\x12=\n\x15repeated_foreign_enum\x18\x34 \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12\x42\n\x14repeated_import_enum\x18\x35 \x03(\x0e\x32$.protobuf_unittest_import.ImportEnum\x12!\n\x15repeated_string_piece\x18\x36 \x03(\tB\x02\x08\x02\x12\x19\n\rrepeated_cord\x18\x37 \x03(\tB\x02\x08\x01\x12P\n\x15repeated_lazy_message\x18\x39 \x03(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageB\x02(\x01\x12\x19\n\rdefault_int32\x18= \x01(\x05:\x02\x34\x31\x12\x19\n\rdefault_int64\x18> \x01(\x03:\x02\x34\x32\x12\x1a\n\x0e\x64\x65\x66\x61ult_uint32\x18? \x01(\r:\x02\x34\x33\x12\x1a\n\x0e\x64\x65\x66\x61ult_uint64\x18@ \x01(\x04:\x02\x34\x34\x12\x1b\n\x0e\x64\x65\x66\x61ult_sint32\x18\x41 \x01(\x11:\x03-45\x12\x1a\n\x0e\x64\x65\x66\x61ult_sint64\x18\x42 \x01(\x12:\x02\x34\x36\x12\x1b\n\x0f\x64\x65\x66\x61ult_fixed32\x18\x43 \x01(\x07:\x02\x34\x37\x12\x1b\n\x0f\x64\x65\x66\x61ult_fixed64\x18\x44 \x01(\x06:\x02\x34\x38\x12\x1c\n\x10\x64\x65\x66\x61ult_sfixed32\x18\x45 \x01(\x0f:\x02\x34\x39\x12\x1d\n\x10\x64\x65\x66\x61ult_sfixed64\x18\x46 \x01(\x10:\x03-50\x12\x1b\n\rdefault_float\x18G \x01(\x02:\x04\x35\x31.5\x12\x1d\n\x0e\x64\x65\x66\x61ult_double\x18H \x01(\x01:\x05\x35\x32\x30\x30\x30\x12\x1a\n\x0c\x64\x65\x66\x61ult_bool\x18I \x01(\x08:\x04true\x12\x1d\n\x0e\x64\x65\x66\x61ult_string\x18J \x01(\t:\x05hello\x12\x1c\n\rdefault_bytes\x18K \x01(\x0c:\x05world\x12L\n\x13\x64\x65\x66\x61ult_nested_enum\x18Q \x01(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum:\x03\x42\x41R\x12I\n\x14\x64\x65\x66\x61ult_foreign_enum\x18R \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum:\x0b\x46OREIGN_BAR\x12M\n\x13\x64\x65\x66\x61ult_import_enum\x18S \x01(\x0e\x32$.protobuf_unittest_import.ImportEnum:\nIMPORT_BAR\x12%\n\x14\x64\x65\x66\x61ult_string_piece\x18T \x01(\t:\x03\x61\x62\x63\x42\x02\x08\x02\x12\x1d\n\x0c\x64\x65\x66\x61ult_cord\x18U \x01(\t:\x03\x31\x32\x33\x42\x02\x08\x01\x12\x16\n\x0coneof_uint32\x18o \x01(\rH\x00\x12M\n\x14oneof_nested_message\x18p \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageH\x00\x12\x16\n\x0coneof_string\x18q \x01(\tH\x00\x12\x15\n\x0boneof_bytes\x18r \x01(\x0cH\x00\x1a\x1b\n\rNestedMessage\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05\x1a\x1a\n\rOptionalGroup\x12\t\n\x01\x61\x18\x11 \x01(\x05\x1a\x1a\n\rRepeatedGroup\x12\t\n\x01\x61\x18/ \x01(\x05\"9\n\nNestedEnum\x12\x07\n\x03\x46OO\x10\x01\x12\x07\n\x03\x42\x41R\x10\x02\x12\x07\n\x03\x42\x41Z\x10\x03\x12\x10\n\x03NEG\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x42\r\n\x0boneof_field\"\xb4\x02\n\x12NestedTestAllTypes\x12\x34\n\x05\x63hild\x18\x01 \x01(\x0b\x32%.protobuf_unittest.NestedTestAllTypes\x12\x30\n\x07payload\x18\x02 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12=\n\x0erepeated_child\x18\x03 \x03(\x0b\x32%.protobuf_unittest.NestedTestAllTypes\x12=\n\nlazy_child\x18\x04 \x01(\x0b\x32%.protobuf_unittest.NestedTestAllTypesB\x02(\x01\x12\x38\n\x0b\x65\x61ger_child\x18\x05 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypesB\x02(\x00\"m\n\x14TestDeprecatedFields\x12\x1c\n\x10\x64\x65precated_int32\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\'\n\x19\x64\x65precated_int32_in_oneof\x18\x02 \x01(\x05\x42\x02\x18\x01H\x00\x42\x0e\n\x0coneof_fields\"\x1b\n\x15TestDeprecatedMessage:\x02\x18\x01\"&\n\x0e\x46oreignMessage\x12\t\n\x01\x63\x18\x01 \x01(\x05\x12\t\n\x01\x64\x18\x02 \x01(\x05\"0\n\x12TestReservedFieldsJ\x04\x08\x02\x10\x03J\x04\x08\x0f\x10\x10J\x04\x08\t\x10\x0cR\x03\x62\x61rR\x03\x62\x61z\"\x1d\n\x11TestAllExtensions*\x08\x08\x01\x10\x80\x80\x80\x80\x02\"$\n\x17OptionalGroup_extension\x12\t\n\x01\x61\x18\x11 \x01(\x05\"$\n\x17RepeatedGroup_extension\x12\t\n\x01\x61\x18/ \x01(\x05\"\xa9\x01\n\tTestGroup\x12\x41\n\roptionalgroup\x18\x10 \x01(\n2*.protobuf_unittest.TestGroup.OptionalGroup\x12=\n\x15optional_foreign_enum\x18\x16 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x1a\x1a\n\rOptionalGroup\x12\t\n\x01\x61\x18\x11 \x01(\x05\"\x1e\n\x12TestGroupExtension*\x08\x08\x01\x10\x80\x80\x80\x80\x02\"\xb7\x03\n\x13TestNestedExtension\x1a$\n\x17OptionalGroup_extension\x12\t\n\x01\x61\x18\x11 \x01(\x05\x32\x39\n\x04test\x12$.protobuf_unittest.TestAllExtensions\x18\xea\x07 \x01(\t:\x04test2F\n\x17nested_string_extension\x12$.protobuf_unittest.TestAllExtensions\x18\xeb\x07 \x01(\t2\x86\x01\n\x17optionalgroup_extension\x12%.protobuf_unittest.TestGroupExtension\x18\x10 \x01(\n2>.protobuf_unittest.TestNestedExtension.OptionalGroup_extension2n\n\x1foptional_foreign_enum_extension\x12%.protobuf_unittest.TestGroupExtension\x18\x16 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\"l\n\x12TestChildExtension\x12\t\n\x01\x61\x18\x01 \x01(\t\x12\t\n\x01\x62\x18\x02 \x01(\t\x12@\n\x12optional_extension\x18\x03 \x01(\x0b\x32$.protobuf_unittest.TestAllExtensions\"\xd6\x02\n\x16TestChildExtensionData\x12\t\n\x01\x61\x18\x01 \x01(\t\x12\t\n\x01\x62\x18\x02 \x01(\t\x12\x61\n\x12optional_extension\x18\x03 \x01(\x0b\x32\x45.protobuf_unittest.TestChildExtensionData.NestedTestAllExtensionsData\x1a\xc2\x01\n\x1bNestedTestAllExtensionsData\x12r\n\x07\x64ynamic\x18\x80\xc4\xae\xc3\x01 \x01(\x0b\x32].protobuf_unittest.TestChildExtensionData.NestedTestAllExtensionsData.NestedDynamicExtensions\x1a/\n\x17NestedDynamicExtensions\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\t\n\x01\x62\x18\x02 \x01(\x05\"[\n\x18TestNestedChildExtension\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\x34\n\x05\x63hild\x18\x02 \x01(\x0b\x32%.protobuf_unittest.TestChildExtension\"c\n\x1cTestNestedChildExtensionData\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\x38\n\x05\x63hild\x18\x02 \x01(\x0b\x32).protobuf_unittest.TestChildExtensionData\"\x92\x06\n\x0cTestRequired\x12\t\n\x01\x61\x18\x01 \x02(\x05\x12\x0e\n\x06\x64ummy2\x18\x02 \x01(\x05\x12\t\n\x01\x62\x18\x03 \x02(\x05\x12\x0e\n\x06\x64ummy4\x18\x04 \x01(\x05\x12\x0e\n\x06\x64ummy5\x18\x05 \x01(\x05\x12\x0e\n\x06\x64ummy6\x18\x06 \x01(\x05\x12\x0e\n\x06\x64ummy7\x18\x07 \x01(\x05\x12\x0e\n\x06\x64ummy8\x18\x08 \x01(\x05\x12\x0e\n\x06\x64ummy9\x18\t \x01(\x05\x12\x0f\n\x07\x64ummy10\x18\n \x01(\x05\x12\x0f\n\x07\x64ummy11\x18\x0b \x01(\x05\x12\x0f\n\x07\x64ummy12\x18\x0c \x01(\x05\x12\x0f\n\x07\x64ummy13\x18\r \x01(\x05\x12\x0f\n\x07\x64ummy14\x18\x0e \x01(\x05\x12\x0f\n\x07\x64ummy15\x18\x0f \x01(\x05\x12\x0f\n\x07\x64ummy16\x18\x10 \x01(\x05\x12\x0f\n\x07\x64ummy17\x18\x11 \x01(\x05\x12\x0f\n\x07\x64ummy18\x18\x12 \x01(\x05\x12\x0f\n\x07\x64ummy19\x18\x13 \x01(\x05\x12\x0f\n\x07\x64ummy20\x18\x14 \x01(\x05\x12\x0f\n\x07\x64ummy21\x18\x15 \x01(\x05\x12\x0f\n\x07\x64ummy22\x18\x16 \x01(\x05\x12\x0f\n\x07\x64ummy23\x18\x17 \x01(\x05\x12\x0f\n\x07\x64ummy24\x18\x18 \x01(\x05\x12\x0f\n\x07\x64ummy25\x18\x19 \x01(\x05\x12\x0f\n\x07\x64ummy26\x18\x1a \x01(\x05\x12\x0f\n\x07\x64ummy27\x18\x1b \x01(\x05\x12\x0f\n\x07\x64ummy28\x18\x1c \x01(\x05\x12\x0f\n\x07\x64ummy29\x18\x1d \x01(\x05\x12\x0f\n\x07\x64ummy30\x18\x1e \x01(\x05\x12\x0f\n\x07\x64ummy31\x18\x1f \x01(\x05\x12\x0f\n\x07\x64ummy32\x18 \x01(\x05\x12\t\n\x01\x63\x18! \x02(\x05\x12;\n\x10optional_foreign\x18\" \x01(\x0b\x32!.protobuf_unittest.ForeignMessage2V\n\x06single\x12$.protobuf_unittest.TestAllExtensions\x18\xe8\x07 \x01(\x0b\x32\x1f.protobuf_unittest.TestRequired2U\n\x05multi\x12$.protobuf_unittest.TestAllExtensions\x18\xe9\x07 \x03(\x0b\x32\x1f.protobuf_unittest.TestRequired\"\x9a\x01\n\x13TestRequiredForeign\x12\x39\n\x10optional_message\x18\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestRequired\x12\x39\n\x10repeated_message\x18\x02 \x03(\x0b\x32\x1f.protobuf_unittest.TestRequired\x12\r\n\x05\x64ummy\x18\x03 \x01(\x05\"\xc6\x01\n\x13TestRequiredMessage\x12\x39\n\x10optional_message\x18\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestRequired\x12\x39\n\x10repeated_message\x18\x02 \x03(\x0b\x32\x1f.protobuf_unittest.TestRequired\x12\x39\n\x10required_message\x18\x03 \x02(\x0b\x32\x1f.protobuf_unittest.TestRequired\"\xa0\x01\n\x19TestNestedRequiredForeign\x12;\n\x05\x63hild\x18\x01 \x01(\x0b\x32,.protobuf_unittest.TestNestedRequiredForeign\x12\x37\n\x07payload\x18\x02 \x01(\x0b\x32&.protobuf_unittest.TestRequiredForeign\x12\r\n\x05\x64ummy\x18\x03 \x01(\x05\"Z\n\x11TestForeignNested\x12\x45\n\x0e\x66oreign_nested\x18\x01 \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage\"\x12\n\x10TestEmptyMessage\"*\n\x1eTestEmptyMessageWithExtensions*\x08\x08\x01\x10\x80\x80\x80\x80\x02\"Y\n\x17TestPickleNestedMessage\x1a>\n\rNestedMessage\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05\x1a!\n\x13NestedNestedMessage\x12\n\n\x02\x63\x63\x18\x01 \x01(\x05\"7\n\x1bTestMultipleExtensionRanges*\x04\x08*\x10+*\x06\x08\xaf \x10\x94!*\n\x08\x80\x80\x04\x10\x80\x80\x80\x80\x02\"4\n\x18TestReallyLargeTagNumber\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\r\n\x02\x62\x62\x18\xff\xff\xff\x7f \x01(\x05\"U\n\x14TestRecursiveMessage\x12\x32\n\x01\x61\x18\x01 \x01(\x0b\x32\'.protobuf_unittest.TestRecursiveMessage\x12\t\n\x01i\x18\x02 \x01(\x05\"\xe1\x02\n\x14TestMutualRecursionA\x12\x33\n\x02\x62\x62\x18\x01 \x01(\x0b\x32\'.protobuf_unittest.TestMutualRecursionB\x12\x42\n\x08subgroup\x18\x02 \x01(\n20.protobuf_unittest.TestMutualRecursionA.SubGroup\x1a@\n\nSubMessage\x12\x32\n\x01\x62\x18\x01 \x01(\x0b\x32\'.protobuf_unittest.TestMutualRecursionB\x1a\x8d\x01\n\x08SubGroup\x12G\n\x0bsub_message\x18\x03 \x01(\x0b\x32\x32.protobuf_unittest.TestMutualRecursionA.SubMessage\x12\x38\n\x0fnot_in_this_scc\x18\x04 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"b\n\x14TestMutualRecursionB\x12\x32\n\x01\x61\x18\x01 \x01(\x0b\x32\'.protobuf_unittest.TestMutualRecursionA\x12\x16\n\x0eoptional_int32\x18\x02 \x01(\x05\"\xca\x01\n\x11TestIsInitialized\x12\x44\n\x0bsub_message\x18\x01 \x01(\x0b\x32/.protobuf_unittest.TestIsInitialized.SubMessage\x1ao\n\nSubMessage\x12J\n\x08subgroup\x18\x01 \x01(\n28.protobuf_unittest.TestIsInitialized.SubMessage.SubGroup\x1a\x15\n\x08SubGroup\x12\t\n\x01i\x18\x02 \x02(\x05\"\xb3\x01\n\x12TestDupFieldNumber\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\x36\n\x03\x66oo\x18\x02 \x01(\n2).protobuf_unittest.TestDupFieldNumber.Foo\x12\x36\n\x03\x62\x61r\x18\x03 \x01(\n2).protobuf_unittest.TestDupFieldNumber.Bar\x1a\x10\n\x03\x46oo\x12\t\n\x01\x61\x18\x01 \x01(\x05\x1a\x10\n\x03\x42\x61r\x12\t\n\x01\x61\x18\x01 \x01(\x05\"L\n\x10TestEagerMessage\x12\x38\n\x0bsub_message\x18\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypesB\x02(\x00\"K\n\x0fTestLazyMessage\x12\x38\n\x0bsub_message\x18\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypesB\x02(\x01\"\x8f\x02\n\x12TestEagerMaybeLazy\x12\x34\n\x0bmessage_foo\x18\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12\x34\n\x0bmessage_bar\x18\x02 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12H\n\x0bmessage_baz\x18\x03 \x01(\x0b\x32\x33.protobuf_unittest.TestEagerMaybeLazy.NestedMessage\x1a\x43\n\rNestedMessage\x12\x32\n\x06packed\x18\x01 \x01(\x0b\x32\".protobuf_unittest.TestPackedTypes\"\x80\x02\n\x18TestNestedMessageHasBits\x12Z\n\x17optional_nested_message\x18\x01 \x01(\x0b\x32\x39.protobuf_unittest.TestNestedMessageHasBits.NestedMessage\x1a\x87\x01\n\rNestedMessage\x12$\n\x1cnestedmessage_repeated_int32\x18\x01 \x03(\x05\x12P\n%nestedmessage_repeated_foreignmessage\x18\x02 \x03(\x0b\x32!.protobuf_unittest.ForeignMessage\"\xe5\x03\n\x17TestCamelCaseFieldNames\x12\x16\n\x0ePrimitiveField\x18\x01 \x01(\x05\x12\x13\n\x0bStringField\x18\x02 \x01(\t\x12\x31\n\tEnumField\x18\x03 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12\x37\n\x0cMessageField\x18\x04 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage\x12\x1c\n\x10StringPieceField\x18\x05 \x01(\tB\x02\x08\x02\x12\x15\n\tCordField\x18\x06 \x01(\tB\x02\x08\x01\x12\x1e\n\x16RepeatedPrimitiveField\x18\x07 \x03(\x05\x12\x1b\n\x13RepeatedStringField\x18\x08 \x03(\t\x12\x39\n\x11RepeatedEnumField\x18\t \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12?\n\x14RepeatedMessageField\x18\n \x03(\x0b\x32!.protobuf_unittest.ForeignMessage\x12$\n\x18RepeatedStringPieceField\x18\x0b \x03(\tB\x02\x08\x02\x12\x1d\n\x11RepeatedCordField\x18\x0c \x03(\tB\x02\x08\x01\"\xd5\x01\n\x12TestFieldOrderings\x12\x11\n\tmy_string\x18\x0b \x01(\t\x12\x0e\n\x06my_int\x18\x01 \x01(\x03\x12\x10\n\x08my_float\x18\x65 \x01(\x02\x12U\n\x17optional_nested_message\x18\xc8\x01 \x01(\x0b\x32\x33.protobuf_unittest.TestFieldOrderings.NestedMessage\x1a\'\n\rNestedMessage\x12\n\n\x02oo\x18\x02 \x01(\x03\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05*\x04\x08\x02\x10\x0b*\x04\x08\x0c\x10\x65\"\x9c\x01\n\x17TestExtensionOrderings1\x12\x11\n\tmy_string\x18\x01 \x01(\t2n\n\x13test_ext_orderings1\x12%.protobuf_unittest.TestFieldOrderings\x18\r \x01(\x0b\x32*.protobuf_unittest.TestExtensionOrderings1\"\xd4\x02\n\x17TestExtensionOrderings2\x12\x11\n\tmy_string\x18\x01 \x01(\t\x1a\xb5\x01\n\x17TestExtensionOrderings3\x12\x11\n\tmy_string\x18\x01 \x01(\t2\x86\x01\n\x13test_ext_orderings3\x12%.protobuf_unittest.TestFieldOrderings\x18\x0e \x01(\x0b\x32\x42.protobuf_unittest.TestExtensionOrderings2.TestExtensionOrderings32n\n\x13test_ext_orderings2\x12%.protobuf_unittest.TestFieldOrderings\x18\x0c \x01(\x0b\x32*.protobuf_unittest.TestExtensionOrderings2\"\xb6\x07\n\x18TestExtremeDefaultValues\x12?\n\rescaped_bytes\x18\x01 \x01(\x0c:(\\000\\001\\007\\010\\014\\n\\r\\t\\013\\\\\\\'\\\"\\376\x12 \n\x0clarge_uint32\x18\x02 \x01(\r:\n4294967295\x12*\n\x0clarge_uint64\x18\x03 \x01(\x04:\x14\x31\x38\x34\x34\x36\x37\x34\x34\x30\x37\x33\x37\x30\x39\x35\x35\x31\x36\x31\x35\x12 \n\x0bsmall_int32\x18\x04 \x01(\x05:\x0b-2147483647\x12)\n\x0bsmall_int64\x18\x05 \x01(\x03:\x14-9223372036854775807\x12\'\n\x12really_small_int32\x18\x15 \x01(\x05:\x0b-2147483648\x12\x30\n\x12really_small_int64\x18\x16 \x01(\x03:\x14-9223372036854775808\x12\x18\n\x0butf8_string\x18\x06 \x01(\t:\x03\xe1\x88\xb4\x12\x15\n\nzero_float\x18\x07 \x01(\x02:\x01\x30\x12\x14\n\tone_float\x18\x08 \x01(\x02:\x01\x31\x12\x18\n\x0bsmall_float\x18\t \x01(\x02:\x03\x31.5\x12\x1e\n\x12negative_one_float\x18\n \x01(\x02:\x02-1\x12\x1c\n\x0enegative_float\x18\x0b \x01(\x02:\x04-1.5\x12\x1a\n\x0blarge_float\x18\x0c \x01(\x02:\x05\x32\x65+08\x12$\n\x14small_negative_float\x18\r \x01(\x02:\x06-8e-28\x12\x17\n\ninf_double\x18\x0e \x01(\x01:\x03inf\x12\x1c\n\x0eneg_inf_double\x18\x0f \x01(\x01:\x04-inf\x12\x17\n\nnan_double\x18\x10 \x01(\x01:\x03nan\x12\x16\n\tinf_float\x18\x11 \x01(\x02:\x03inf\x12\x1b\n\rneg_inf_float\x18\x12 \x01(\x02:\x04-inf\x12\x16\n\tnan_float\x18\x13 \x01(\x02:\x03nan\x12+\n\x0c\x63pp_trigraph\x18\x14 \x01(\t:\x15? ? ?? ?? ??? ??/ ??-\x12 \n\x10string_with_zero\x18\x17 \x01(\t:\x06hel\x00lo\x12\"\n\x0f\x62ytes_with_zero\x18\x18 \x01(\x0c:\twor\\000ld\x12(\n\x16string_piece_with_zero\x18\x19 \x01(\t:\x04\x61\x62\x00\x63\x42\x02\x08\x02\x12 \n\x0e\x63ord_with_zero\x18\x1a \x01(\t:\x04\x31\x32\x00\x33\x42\x02\x08\x01\x12&\n\x12replacement_string\x18\x1b \x01(\t:\n${unknown}\"K\n\x11SparseEnumMessage\x12\x36\n\x0bsparse_enum\x18\x01 \x01(\x0e\x32!.protobuf_unittest.TestSparseEnum\"\x19\n\tOneString\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\t\"\x1a\n\nMoreString\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\t\"\x18\n\x08OneBytes\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"\x19\n\tMoreBytes\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x0c\"\xeb\x03\n\x12ManyOptionalString\x12\x0c\n\x04str1\x18\x01 \x01(\t\x12\x0c\n\x04str2\x18\x02 \x01(\t\x12\x0c\n\x04str3\x18\x03 \x01(\t\x12\x0c\n\x04str4\x18\x04 \x01(\t\x12\x0c\n\x04str5\x18\x05 \x01(\t\x12\x0c\n\x04str6\x18\x06 \x01(\t\x12\x0c\n\x04str7\x18\x07 \x01(\t\x12\x0c\n\x04str8\x18\x08 \x01(\t\x12\x0c\n\x04str9\x18\t \x01(\t\x12\r\n\x05str10\x18\n \x01(\t\x12\r\n\x05str11\x18\x0b \x01(\t\x12\r\n\x05str12\x18\x0c \x01(\t\x12\r\n\x05str13\x18\r \x01(\t\x12\r\n\x05str14\x18\x0e \x01(\t\x12\r\n\x05str15\x18\x0f \x01(\t\x12\r\n\x05str16\x18\x10 \x01(\t\x12\r\n\x05str17\x18\x11 \x01(\t\x12\r\n\x05str18\x18\x12 \x01(\t\x12\r\n\x05str19\x18\x13 \x01(\t\x12\r\n\x05str20\x18\x14 \x01(\t\x12\r\n\x05str21\x18\x15 \x01(\t\x12\r\n\x05str22\x18\x16 \x01(\t\x12\r\n\x05str23\x18\x17 \x01(\t\x12\r\n\x05str24\x18\x18 \x01(\t\x12\r\n\x05str25\x18\x19 \x01(\t\x12\r\n\x05str26\x18\x1a \x01(\t\x12\r\n\x05str27\x18\x1b \x01(\t\x12\r\n\x05str28\x18\x1c \x01(\t\x12\r\n\x05str29\x18\x1d \x01(\t\x12\r\n\x05str30\x18\x1e \x01(\t\x12\r\n\x05str31\x18\x1f \x01(\t\x12\r\n\x05str32\x18 \x01(\t\"\x1c\n\x0cInt32Message\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x05\"\x1d\n\rUint32Message\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\r\"\x1c\n\x0cInt64Message\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x03\"\x1d\n\rUint64Message\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x04\"\x1b\n\x0b\x42oolMessage\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x08\"\xd0\x01\n\tTestOneof\x12\x11\n\x07\x66oo_int\x18\x01 \x01(\x05H\x00\x12\x14\n\nfoo_string\x18\x02 \x01(\tH\x00\x12\x36\n\x0b\x66oo_message\x18\x03 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypesH\x00\x12\x39\n\x08\x66oogroup\x18\x04 \x01(\n2%.protobuf_unittest.TestOneof.FooGroupH\x00\x1a \n\x08\x46ooGroup\x12\t\n\x01\x61\x18\x05 \x01(\x05\x12\t\n\x01\x62\x18\x06 \x01(\tB\x05\n\x03\x66oo\"\xe7\x01\n\x1cTestOneofBackwardsCompatible\x12\x0f\n\x07\x66oo_int\x18\x01 \x01(\x05\x12\x12\n\nfoo_string\x18\x02 \x01(\t\x12\x34\n\x0b\x66oo_message\x18\x03 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12J\n\x08\x66oogroup\x18\x04 \x01(\n28.protobuf_unittest.TestOneofBackwardsCompatible.FooGroup\x1a \n\x08\x46ooGroup\x12\t\n\x01\x61\x18\x05 \x01(\x05\x12\t\n\x01\x62\x18\x06 \x01(\t\"\xd5\x07\n\nTestOneof2\x12\x11\n\x07\x66oo_int\x18\x01 \x01(\x05H\x00\x12\x14\n\nfoo_string\x18\x02 \x01(\tH\x00\x12\x16\n\x08\x66oo_cord\x18\x03 \x01(\tB\x02\x08\x01H\x00\x12\x1e\n\x10\x66oo_string_piece\x18\x04 \x01(\tB\x02\x08\x02H\x00\x12\x13\n\tfoo_bytes\x18\x05 \x01(\x0cH\x00\x12<\n\x08\x66oo_enum\x18\x06 \x01(\x0e\x32(.protobuf_unittest.TestOneof2.NestedEnumH\x00\x12\x42\n\x0b\x66oo_message\x18\x07 \x01(\x0b\x32+.protobuf_unittest.TestOneof2.NestedMessageH\x00\x12:\n\x08\x66oogroup\x18\x08 \x01(\n2&.protobuf_unittest.TestOneof2.FooGroupH\x00\x12K\n\x10\x66oo_lazy_message\x18\x0b \x01(\x0b\x32+.protobuf_unittest.TestOneof2.NestedMessageB\x02(\x01H\x00\x12\x14\n\x07\x62\x61r_int\x18\x0c \x01(\x05:\x01\x35H\x01\x12\x1c\n\nbar_string\x18\r \x01(\t:\x06STRINGH\x01\x12\x1c\n\x08\x62\x61r_cord\x18\x0e \x01(\t:\x04\x43ORDB\x02\x08\x01H\x01\x12&\n\x10\x62\x61r_string_piece\x18\x0f \x01(\t:\x06SPIECEB\x02\x08\x02H\x01\x12\x1a\n\tbar_bytes\x18\x10 \x01(\x0c:\x05\x42YTESH\x01\x12\x41\n\x08\x62\x61r_enum\x18\x11 \x01(\x0e\x32(.protobuf_unittest.TestOneof2.NestedEnum:\x03\x42\x41RH\x01\x12)\n\x1d\x62\x61r_string_with_empty_default\x18\x14 \x01(\t:\x00H\x01\x12+\n\x1b\x62\x61r_cord_with_empty_default\x18\x15 \x01(\t:\x00\x42\x02\x08\x01H\x01\x12\x33\n#bar_string_piece_with_empty_default\x18\x16 \x01(\t:\x00\x42\x02\x08\x02H\x01\x12(\n\x1c\x62\x61r_bytes_with_empty_default\x18\x17 \x01(\x0c:\x00H\x01\x12\x0f\n\x07\x62\x61z_int\x18\x12 \x01(\x05\x12\x17\n\nbaz_string\x18\x13 \x01(\t:\x03\x42\x41Z\x1a \n\x08\x46ooGroup\x12\t\n\x01\x61\x18\t \x01(\x05\x12\t\n\x01\x62\x18\n \x01(\t\x1a\x33\n\rNestedMessage\x12\x0f\n\x07moo_int\x18\x01 \x01(\x03\x12\x11\n\tcorge_int\x18\x02 \x03(\x05\"\'\n\nNestedEnum\x12\x07\n\x03\x46OO\x10\x01\x12\x07\n\x03\x42\x41R\x10\x02\x12\x07\n\x03\x42\x41Z\x10\x03\x42\x05\n\x03\x66ooB\x05\n\x03\x62\x61r\"\xb8\x01\n\x11TestRequiredOneof\x12\x11\n\x07\x66oo_int\x18\x01 \x01(\x05H\x00\x12\x14\n\nfoo_string\x18\x02 \x01(\tH\x00\x12I\n\x0b\x66oo_message\x18\x03 \x01(\x0b\x32\x32.protobuf_unittest.TestRequiredOneof.NestedMessageH\x00\x1a(\n\rNestedMessage\x12\x17\n\x0frequired_double\x18\x01 \x02(\x01\x42\x05\n\x03\x66oo\"\xaa\x03\n\x0fTestPackedTypes\x12\x18\n\x0cpacked_int32\x18Z \x03(\x05\x42\x02\x10\x01\x12\x18\n\x0cpacked_int64\x18[ \x03(\x03\x42\x02\x10\x01\x12\x19\n\rpacked_uint32\x18\\ \x03(\rB\x02\x10\x01\x12\x19\n\rpacked_uint64\x18] \x03(\x04\x42\x02\x10\x01\x12\x19\n\rpacked_sint32\x18^ \x03(\x11\x42\x02\x10\x01\x12\x19\n\rpacked_sint64\x18_ \x03(\x12\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed32\x18` \x03(\x07\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed64\x18\x61 \x03(\x06\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed32\x18\x62 \x03(\x0f\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed64\x18\x63 \x03(\x10\x42\x02\x10\x01\x12\x18\n\x0cpacked_float\x18\x64 \x03(\x02\x42\x02\x10\x01\x12\x19\n\rpacked_double\x18\x65 \x03(\x01\x42\x02\x10\x01\x12\x17\n\x0bpacked_bool\x18\x66 \x03(\x08\x42\x02\x10\x01\x12\x37\n\x0bpacked_enum\x18g \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnumB\x02\x10\x01\"\xc8\x03\n\x11TestUnpackedTypes\x12\x1a\n\x0eunpacked_int32\x18Z \x03(\x05\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_int64\x18[ \x03(\x03\x42\x02\x10\x00\x12\x1b\n\x0funpacked_uint32\x18\\ \x03(\rB\x02\x10\x00\x12\x1b\n\x0funpacked_uint64\x18] \x03(\x04\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint32\x18^ \x03(\x11\x42\x02\x10\x00\x12\x1b\n\x0funpacked_sint64\x18_ \x03(\x12\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed32\x18` \x03(\x07\x42\x02\x10\x00\x12\x1c\n\x10unpacked_fixed64\x18\x61 \x03(\x06\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed32\x18\x62 \x03(\x0f\x42\x02\x10\x00\x12\x1d\n\x11unpacked_sfixed64\x18\x63 \x03(\x10\x42\x02\x10\x00\x12\x1a\n\x0eunpacked_float\x18\x64 \x03(\x02\x42\x02\x10\x00\x12\x1b\n\x0funpacked_double\x18\x65 \x03(\x01\x42\x02\x10\x00\x12\x19\n\runpacked_bool\x18\x66 \x03(\x08\x42\x02\x10\x00\x12\x39\n\runpacked_enum\x18g \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnumB\x02\x10\x00\" \n\x14TestPackedExtensions*\x08\x08\x01\x10\x80\x80\x80\x80\x02\"\"\n\x16TestUnpackedExtensions*\x08\x08\x01\x10\x80\x80\x80\x80\x02\"\x99\x04\n\x15TestDynamicExtensions\x12\x19\n\x10scalar_extension\x18\xd0\x0f \x01(\x07\x12\x37\n\x0e\x65num_extension\x18\xd1\x0f \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12Y\n\x16\x64ynamic_enum_extension\x18\xd2\x0f \x01(\x0e\x32\x38.protobuf_unittest.TestDynamicExtensions.DynamicEnumType\x12=\n\x11message_extension\x18\xd3\x0f \x01(\x0b\x32!.protobuf_unittest.ForeignMessage\x12_\n\x19\x64ynamic_message_extension\x18\xd4\x0f \x01(\x0b\x32;.protobuf_unittest.TestDynamicExtensions.DynamicMessageType\x12\x1b\n\x12repeated_extension\x18\xd5\x0f \x03(\t\x12\x1d\n\x10packed_extension\x18\xd6\x0f \x03(\x11\x42\x02\x10\x01\x1a,\n\x12\x44ynamicMessageType\x12\x16\n\rdynamic_field\x18\xb4\x10 \x01(\x05\"G\n\x0f\x44ynamicEnumType\x12\x10\n\x0b\x44YNAMIC_FOO\x10\x98\x11\x12\x10\n\x0b\x44YNAMIC_BAR\x10\x99\x11\x12\x10\n\x0b\x44YNAMIC_BAZ\x10\x9a\x11\"\xc0\x01\n#TestRepeatedScalarDifferentTagSizes\x12\x18\n\x10repeated_fixed32\x18\x0c \x03(\x07\x12\x16\n\x0erepeated_int32\x18\r \x03(\x05\x12\x19\n\x10repeated_fixed64\x18\xfe\x0f \x03(\x06\x12\x17\n\x0erepeated_int64\x18\xff\x0f \x03(\x03\x12\x18\n\x0erepeated_float\x18\xfe\xff\x0f \x03(\x02\x12\x19\n\x0frepeated_uint64\x18\xff\xff\x0f \x03(\x04\"\xf7\t\n\x10TestParsingMerge\x12;\n\x12required_all_types\x18\x01 \x02(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12optional_all_types\x18\x02 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12repeated_all_types\x18\x03 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12H\n\roptionalgroup\x18\n \x01(\n21.protobuf_unittest.TestParsingMerge.OptionalGroup\x12H\n\rrepeatedgroup\x18\x14 \x03(\n21.protobuf_unittest.TestParsingMerge.RepeatedGroup\x1a\xaa\x04\n\x17RepeatedFieldsGenerator\x12/\n\x06\x66ield1\x18\x01 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12/\n\x06\x66ield2\x18\x02 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12/\n\x06\x66ield3\x18\x03 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12R\n\x06group1\x18\n \x03(\n2B.protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group1\x12R\n\x06group2\x18\x14 \x03(\n2B.protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group2\x12.\n\x04\x65xt1\x18\xe8\x07 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12.\n\x04\x65xt2\x18\xe9\x07 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x1a\x39\n\x06Group1\x12/\n\x06\x66ield1\x18\x0b \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x1a\x39\n\x06Group2\x12/\n\x06\x66ield1\x18\x15 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x1aR\n\rOptionalGroup\x12\x41\n\x18optional_group_all_types\x18\x0b \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x1aR\n\rRepeatedGroup\x12\x41\n\x18repeated_group_all_types\x18\x15 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x32[\n\x0coptional_ext\x12#.protobuf_unittest.TestParsingMerge\x18\xe8\x07 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes2[\n\x0crepeated_ext\x12#.protobuf_unittest.TestParsingMerge\x18\xe9\x07 \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"R\n\x12TestMergeException\x12<\n\x0e\x61ll_extensions\x18\x01 \x01(\x0b\x32$.protobuf_unittest.TestAllExtensions\"D\n\x1bTestCommentInjectionMessage\x12%\n\x01\x61\x18\x01 \x01(\t:\x1a*/ <- Neither should this.\"Y\n\x0fTestMessageSize\x12\n\n\x02m1\x18\x01 \x01(\x08\x12\n\n\x02m2\x18\x02 \x01(\x03\x12\n\n\x02m3\x18\x03 \x01(\x08\x12\n\n\x02m4\x18\x04 \x01(\t\x12\n\n\x02m5\x18\x05 \x01(\x05\x12\n\n\x02m6\x18\x06 \x01(\x03\"\x0c\n\nFooRequest\"\r\n\x0b\x46ooResponse\"\x12\n\x10\x46ooClientMessage\"\x12\n\x10\x46ooServerMessage\"\x0c\n\nBarRequest\"\r\n\x0b\x42\x61rResponse\"\xa6\x01\n\x0cTestJsonName\x12\x13\n\x0b\x66ield_name1\x18\x01 \x01(\x05\x12\x12\n\nfieldName2\x18\x02 \x01(\x05\x12\x12\n\nFieldName3\x18\x03 \x01(\x05\x12\x14\n\x0c_field_name4\x18\x04 \x01(\x05\x12\x13\n\x0b\x46IELD_NAME5\x18\x05 \x01(\x05\x12\x1a\n\x0b\x66ield_name6\x18\x06 \x01(\x05R\x05@type\x12\x12\n\nfieldname7\x18\x07 \x01(\x05\"\xfd\x05\n\x14TestHugeFieldNumbers\x12\x1a\n\x0eoptional_int32\x18\xf0\xf8\xff\xff\x01 \x01(\x05\x12\x14\n\x08\x66ixed_32\x18\xf1\xf8\xff\xff\x01 \x01(\x05\x12\x1e\n\x0erepeated_int32\x18\xf2\xf8\xff\xff\x01 \x03(\x05\x42\x02\x10\x00\x12\x1c\n\x0cpacked_int32\x18\xf3\xf8\xff\xff\x01 \x03(\x05\x42\x02\x10\x01\x12\x39\n\roptional_enum\x18\xf4\xf8\xff\xff\x01 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum\x12\x1b\n\x0foptional_string\x18\xf5\xf8\xff\xff\x01 \x01(\t\x12\x1a\n\x0eoptional_bytes\x18\xf6\xf8\xff\xff\x01 \x01(\x0c\x12?\n\x10optional_message\x18\xf7\xf8\xff\xff\x01 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage\x12P\n\roptionalgroup\x18\xf8\xf8\xff\xff\x01 \x01(\n25.protobuf_unittest.TestHugeFieldNumbers.OptionalGroup\x12[\n\x11string_string_map\x18\xfa\xf8\xff\xff\x01 \x03(\x0b\x32<.protobuf_unittest.TestHugeFieldNumbers.StringStringMapEntry\x12\x1a\n\x0coneof_uint32\x18\xfb\xf8\xff\xff\x01 \x01(\rH\x00\x12\x43\n\x14oneof_test_all_types\x18\xfc\xf8\xff\xff\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypesH\x00\x12\x1a\n\x0coneof_string\x18\xfd\xf8\xff\xff\x01 \x01(\tH\x00\x12\x19\n\x0boneof_bytes\x18\xfe\xf8\xff\xff\x01 \x01(\x0cH\x00\x1a$\n\rOptionalGroup\x12\x13\n\x07group_a\x18\xf9\xf8\xff\xff\x01 \x01(\x05\x1a\x36\n\x14StringStringMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01*\x0c\x08\xe0\xaa\xff\xff\x01\x10\xf0\xf8\xff\xff\x01\x42\r\n\x0boneof_field\"\xb1\x01\n\x18TestExtensionInsideTable\x12\x0e\n\x06\x66ield1\x18\x01 \x01(\x05\x12\x0e\n\x06\x66ield2\x18\x02 \x01(\x05\x12\x0e\n\x06\x66ield3\x18\x03 \x01(\x05\x12\x0e\n\x06\x66ield4\x18\x04 \x01(\x05\x12\x0e\n\x06\x66ield6\x18\x06 \x01(\x05\x12\x0e\n\x06\x66ield7\x18\x07 \x01(\x05\x12\x0e\n\x06\x66ield8\x18\x08 \x01(\x05\x12\x0e\n\x06\x66ield9\x18\t \x01(\x05\x12\x0f\n\x07\x66ield10\x18\n \x01(\x05*\x04\x08\x05\x10\x06\"\x96\x04\n\x1dTestNestedGroupExtensionOuter\x12\x61\n\x13layer1optionalgroup\x18\x01 \x01(\n2D.protobuf_unittest.TestNestedGroupExtensionOuter.Layer1OptionalGroup\x1a\x91\x03\n\x13Layer1OptionalGroup\x12u\n\x13layer2repeatedgroup\x18\x02 \x03(\n2X.protobuf_unittest.TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup\x12\x93\x01\n\"layer2anotheroptionalrepeatedgroup\x18\x04 \x03(\n2g.protobuf_unittest.TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2AnotherOptionalRepeatedGroup\x1a\x32\n\x13Layer2RepeatedGroup\x12\x15\n\ranother_field\x18\x06 \x01(\t*\x04\x08\x03\x10\x04\x1a\x39\n\"Layer2AnotherOptionalRepeatedGroup\x12\x13\n\x0b\x62ut_why_tho\x18\x05 \x01(\t\"<\n&TestNestedGroupExtensionInnerExtension\x12\x12\n\ninner_name\x18\x01 \x01(\t\"\xd1\x03\n\x1bTestExtensionRangeSerialize\x12\x0f\n\x07\x66oo_one\x18\x01 \x01(\x05\x12\x0f\n\x07\x66oo_two\x18\x06 \x01(\x05\x12\x11\n\tfoo_three\x18\x07 \x01(\x05\x12\x10\n\x08\x66oo_four\x18\r \x01(\x05*\x04\x08\x02\x10\x03*\x04\x08\x03\x10\x05*\x04\x08\t\x10\x0b*\x04\x08\x0f\x10\x10*\x04\x08\x11\x10\x12*\x04\x08\x13\x10\x14\x32?\n\x07\x62\x61r_one\x12..protobuf_unittest.TestExtensionRangeSerialize\x18\x02 \x01(\x05\x32?\n\x07\x62\x61r_two\x12..protobuf_unittest.TestExtensionRangeSerialize\x18\x04 \x01(\x05\x32\x41\n\tbar_three\x12..protobuf_unittest.TestExtensionRangeSerialize\x18\n \x01(\x05\x32@\n\x08\x62\x61r_four\x12..protobuf_unittest.TestExtensionRangeSerialize\x18\x0f \x01(\x05\x32@\n\x08\x62\x61r_five\x12..protobuf_unittest.TestExtensionRangeSerialize\x18\x13 \x01(\x05\"\x81\x01\n\x15TestVerifyInt32Simple\x12\x18\n\x10optional_int32_1\x18\x01 \x01(\x05\x12\x18\n\x10optional_int32_2\x18\x02 \x01(\x05\x12\x19\n\x11optional_int32_63\x18? \x01(\x05\x12\x19\n\x11optional_int32_64\x18@ \x01(\x05\"\xf5\x01\n\x0fTestVerifyInt32\x12\x18\n\x10optional_int32_1\x18\x01 \x01(\x05\x12\x18\n\x10optional_int32_2\x18\x02 \x01(\x05\x12\x19\n\x11optional_int32_63\x18? \x01(\x05\x12\x19\n\x11optional_int32_64\x18@ \x01(\x05\x12;\n\x12optional_all_types\x18\t \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12repeated_all_types\x18\n \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"\xca\x02\n\x15TestVerifyMostlyInt32\x12\x19\n\x11optional_int64_30\x18\x1e \x01(\x03\x12\x18\n\x10optional_int32_1\x18\x01 \x01(\x05\x12\x18\n\x10optional_int32_2\x18\x02 \x01(\x05\x12\x18\n\x10optional_int32_3\x18\x03 \x01(\x05\x12\x18\n\x10optional_int32_4\x18\x04 \x01(\x05\x12\x19\n\x11optional_int32_63\x18? \x01(\x05\x12\x19\n\x11optional_int32_64\x18@ \x01(\x05\x12;\n\x12optional_all_types\x18\t \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12repeated_all_types\x18\n \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"\xf5\x02\n#TestVerifyMostlyInt32BigFieldNumber\x12\x19\n\x11optional_int64_30\x18\x1e \x01(\x03\x12\x1b\n\x12optional_int32_300\x18\xac\x02 \x01(\x05\x12\x18\n\x10optional_int32_1\x18\x01 \x01(\x05\x12\x18\n\x10optional_int32_2\x18\x02 \x01(\x05\x12\x18\n\x10optional_int32_3\x18\x03 \x01(\x05\x12\x18\n\x10optional_int32_4\x18\x04 \x01(\x05\x12\x19\n\x11optional_int32_63\x18? \x01(\x05\x12\x19\n\x11optional_int32_64\x18@ \x01(\x05\x12;\n\x12optional_all_types\x18\t \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12repeated_all_types\x18\n \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"\x86\x01\n\x16TestVerifyUint32Simple\x12\x19\n\x11optional_uint32_1\x18\x01 \x01(\r\x12\x19\n\x11optional_uint32_2\x18\x02 \x01(\r\x12\x1a\n\x12optional_uint32_63\x18? \x01(\r\x12\x1a\n\x12optional_uint32_64\x18@ \x01(\r\"\xfa\x01\n\x10TestVerifyUint32\x12\x19\n\x11optional_uint32_1\x18\x01 \x01(\r\x12\x19\n\x11optional_uint32_2\x18\x02 \x01(\r\x12\x1a\n\x12optional_uint32_63\x18? \x01(\r\x12\x1a\n\x12optional_uint32_64\x18@ \x01(\r\x12;\n\x12optional_all_types\x18\t \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12repeated_all_types\x18\n \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"\xfa\x01\n\x13TestVerifyOneUint32\x12\x19\n\x11optional_uint32_1\x18\x01 \x01(\r\x12\x18\n\x10optional_int32_2\x18\x02 \x01(\x05\x12\x19\n\x11optional_int32_63\x18? \x01(\x05\x12\x19\n\x11optional_int32_64\x18@ \x01(\x05\x12;\n\x12optional_all_types\x18\t \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12repeated_all_types\x18\n \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"\xa1\x02\n TestVerifyOneInt32BigFieldNumber\x12\x19\n\x11optional_int32_65\x18\x41 \x01(\x05\x12\x18\n\x10optional_int64_1\x18\x01 \x01(\x03\x12\x18\n\x10optional_int64_2\x18\x02 \x01(\x03\x12\x19\n\x11optional_int64_63\x18? \x01(\x03\x12\x19\n\x11optional_int64_64\x18@ \x01(\x03\x12;\n\x12optional_all_types\x18\t \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12repeated_all_types\x18\n \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"\xbc\x02\n\x1dTestVerifyInt32BigFieldNumber\x12\x1c\n\x13optional_int32_1000\x18\xe8\x07 \x01(\x05\x12\x19\n\x11optional_int32_65\x18\x41 \x01(\x05\x12\x18\n\x10optional_int32_1\x18\x01 \x01(\x05\x12\x18\n\x10optional_int32_2\x18\x02 \x01(\x05\x12\x19\n\x11optional_int32_63\x18? \x01(\x05\x12\x19\n\x11optional_int32_64\x18@ \x01(\x05\x12;\n\x12optional_all_types\x18\t \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12repeated_all_types\x18\n \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"\xc3\x02\n\x1eTestVerifyUint32BigFieldNumber\x12\x1d\n\x14optional_uint32_1000\x18\xe8\x07 \x01(\r\x12\x1a\n\x12optional_uint32_65\x18\x41 \x01(\r\x12\x19\n\x11optional_uint32_1\x18\x01 \x01(\r\x12\x19\n\x11optional_uint32_2\x18\x02 \x01(\r\x12\x1a\n\x12optional_uint32_63\x18? \x01(\r\x12\x1a\n\x12optional_uint32_64\x18@ \x01(\r\x12;\n\x12optional_all_types\x18\t \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\x12;\n\x12repeated_all_types\x18\n \x03(\x0b\x32\x1f.protobuf_unittest.TestAllTypes\"\x88\x04\n\x1eTestVerifyBigFieldNumberUint32\x12Q\n\x0foptional_nested\x18\x01 \x01(\x0b\x32\x38.protobuf_unittest.TestVerifyBigFieldNumberUint32.Nested\x1a\x92\x03\n\x06Nested\x12\x1d\n\x14optional_uint32_5000\x18\x88\' \x01(\r\x12\x1d\n\x14optional_uint32_1000\x18\xe8\x07 \x01(\r\x12\x1a\n\x12optional_uint32_66\x18\x42 \x01(\r\x12\x1a\n\x12optional_uint32_65\x18\x41 \x01(\r\x12\x19\n\x11optional_uint32_1\x18\x01 \x01(\r\x12\x19\n\x11optional_uint32_2\x18\x02 \x01(\r\x12\x1a\n\x12optional_uint32_63\x18? \x01(\r\x12\x1a\n\x12optional_uint32_64\x18@ \x01(\r\x12Q\n\x0foptional_nested\x18\t \x01(\x0b\x32\x38.protobuf_unittest.TestVerifyBigFieldNumberUint32.Nested\x12Q\n\x0frepeated_nested\x18\n \x03(\x0b\x32\x38.protobuf_unittest.TestVerifyBigFieldNumberUint32.Nested*@\n\x0b\x46oreignEnum\x12\x0f\n\x0b\x46OREIGN_FOO\x10\x04\x12\x0f\n\x0b\x46OREIGN_BAR\x10\x05\x12\x0f\n\x0b\x46OREIGN_BAZ\x10\x06*K\n\x14TestEnumWithDupValue\x12\x08\n\x04\x46OO1\x10\x01\x12\x08\n\x04\x42\x41R1\x10\x02\x12\x07\n\x03\x42\x41Z\x10\x03\x12\x08\n\x04\x46OO2\x10\x01\x12\x08\n\x04\x42\x41R2\x10\x02\x1a\x02\x10\x01*\x89\x01\n\x0eTestSparseEnum\x12\x0c\n\x08SPARSE_A\x10{\x12\x0e\n\x08SPARSE_B\x10\xa6\xe7\x03\x12\x0f\n\x08SPARSE_C\x10\xb2\xb1\x80\x06\x12\x15\n\x08SPARSE_D\x10\xf1\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\x15\n\x08SPARSE_E\x10\xb4\xde\xfc\xff\xff\xff\xff\xff\xff\x01\x12\x0c\n\x08SPARSE_F\x10\x00\x12\x0c\n\x08SPARSE_G\x10\x02*\x8b\x0f\n\rVeryLargeEnum\x12\x16\n\x12\x45NUM_LABEL_DEFAULT\x10\x00\x12\x10\n\x0c\x45NUM_LABEL_1\x10\x01\x12\x10\n\x0c\x45NUM_LABEL_2\x10\x02\x12\x10\n\x0c\x45NUM_LABEL_3\x10\x03\x12\x10\n\x0c\x45NUM_LABEL_4\x10\x04\x12\x10\n\x0c\x45NUM_LABEL_5\x10\x05\x12\x10\n\x0c\x45NUM_LABEL_6\x10\x06\x12\x10\n\x0c\x45NUM_LABEL_7\x10\x07\x12\x10\n\x0c\x45NUM_LABEL_8\x10\x08\x12\x10\n\x0c\x45NUM_LABEL_9\x10\t\x12\x11\n\rENUM_LABEL_10\x10\n\x12\x11\n\rENUM_LABEL_11\x10\x0b\x12\x11\n\rENUM_LABEL_12\x10\x0c\x12\x11\n\rENUM_LABEL_13\x10\r\x12\x11\n\rENUM_LABEL_14\x10\x0e\x12\x11\n\rENUM_LABEL_15\x10\x0f\x12\x11\n\rENUM_LABEL_16\x10\x10\x12\x11\n\rENUM_LABEL_17\x10\x11\x12\x11\n\rENUM_LABEL_18\x10\x12\x12\x11\n\rENUM_LABEL_19\x10\x13\x12\x11\n\rENUM_LABEL_20\x10\x14\x12\x11\n\rENUM_LABEL_21\x10\x15\x12\x11\n\rENUM_LABEL_22\x10\x16\x12\x11\n\rENUM_LABEL_23\x10\x17\x12\x11\n\rENUM_LABEL_24\x10\x18\x12\x11\n\rENUM_LABEL_25\x10\x19\x12\x11\n\rENUM_LABEL_26\x10\x1a\x12\x11\n\rENUM_LABEL_27\x10\x1b\x12\x11\n\rENUM_LABEL_28\x10\x1c\x12\x11\n\rENUM_LABEL_29\x10\x1d\x12\x11\n\rENUM_LABEL_30\x10\x1e\x12\x11\n\rENUM_LABEL_31\x10\x1f\x12\x11\n\rENUM_LABEL_32\x10 \x12\x11\n\rENUM_LABEL_33\x10!\x12\x11\n\rENUM_LABEL_34\x10\"\x12\x11\n\rENUM_LABEL_35\x10#\x12\x11\n\rENUM_LABEL_36\x10$\x12\x11\n\rENUM_LABEL_37\x10%\x12\x11\n\rENUM_LABEL_38\x10&\x12\x11\n\rENUM_LABEL_39\x10\'\x12\x11\n\rENUM_LABEL_40\x10(\x12\x11\n\rENUM_LABEL_41\x10)\x12\x11\n\rENUM_LABEL_42\x10*\x12\x11\n\rENUM_LABEL_43\x10+\x12\x11\n\rENUM_LABEL_44\x10,\x12\x11\n\rENUM_LABEL_45\x10-\x12\x11\n\rENUM_LABEL_46\x10.\x12\x11\n\rENUM_LABEL_47\x10/\x12\x11\n\rENUM_LABEL_48\x10\x30\x12\x11\n\rENUM_LABEL_49\x10\x31\x12\x11\n\rENUM_LABEL_50\x10\x32\x12\x11\n\rENUM_LABEL_51\x10\x33\x12\x11\n\rENUM_LABEL_52\x10\x34\x12\x11\n\rENUM_LABEL_53\x10\x35\x12\x11\n\rENUM_LABEL_54\x10\x36\x12\x11\n\rENUM_LABEL_55\x10\x37\x12\x11\n\rENUM_LABEL_56\x10\x38\x12\x11\n\rENUM_LABEL_57\x10\x39\x12\x11\n\rENUM_LABEL_58\x10:\x12\x11\n\rENUM_LABEL_59\x10;\x12\x11\n\rENUM_LABEL_60\x10<\x12\x11\n\rENUM_LABEL_61\x10=\x12\x11\n\rENUM_LABEL_62\x10>\x12\x11\n\rENUM_LABEL_63\x10?\x12\x11\n\rENUM_LABEL_64\x10@\x12\x11\n\rENUM_LABEL_65\x10\x41\x12\x11\n\rENUM_LABEL_66\x10\x42\x12\x11\n\rENUM_LABEL_67\x10\x43\x12\x11\n\rENUM_LABEL_68\x10\x44\x12\x11\n\rENUM_LABEL_69\x10\x45\x12\x11\n\rENUM_LABEL_70\x10\x46\x12\x11\n\rENUM_LABEL_71\x10G\x12\x11\n\rENUM_LABEL_72\x10H\x12\x11\n\rENUM_LABEL_73\x10I\x12\x11\n\rENUM_LABEL_74\x10J\x12\x11\n\rENUM_LABEL_75\x10K\x12\x11\n\rENUM_LABEL_76\x10L\x12\x11\n\rENUM_LABEL_77\x10M\x12\x11\n\rENUM_LABEL_78\x10N\x12\x11\n\rENUM_LABEL_79\x10O\x12\x11\n\rENUM_LABEL_80\x10P\x12\x11\n\rENUM_LABEL_81\x10Q\x12\x11\n\rENUM_LABEL_82\x10R\x12\x11\n\rENUM_LABEL_83\x10S\x12\x11\n\rENUM_LABEL_84\x10T\x12\x11\n\rENUM_LABEL_85\x10U\x12\x11\n\rENUM_LABEL_86\x10V\x12\x11\n\rENUM_LABEL_87\x10W\x12\x11\n\rENUM_LABEL_88\x10X\x12\x11\n\rENUM_LABEL_89\x10Y\x12\x11\n\rENUM_LABEL_90\x10Z\x12\x11\n\rENUM_LABEL_91\x10[\x12\x11\n\rENUM_LABEL_92\x10\\\x12\x11\n\rENUM_LABEL_93\x10]\x12\x11\n\rENUM_LABEL_94\x10^\x12\x11\n\rENUM_LABEL_95\x10_\x12\x11\n\rENUM_LABEL_96\x10`\x12\x11\n\rENUM_LABEL_97\x10\x61\x12\x11\n\rENUM_LABEL_98\x10\x62\x12\x11\n\rENUM_LABEL_99\x10\x63\x12\x12\n\x0e\x45NUM_LABEL_100\x10\x64\x32\x99\x01\n\x0bTestService\x12\x44\n\x03\x46oo\x12\x1d.protobuf_unittest.FooRequest\x1a\x1e.protobuf_unittest.FooResponse\x12\x44\n\x03\x42\x61r\x12\x1d.protobuf_unittest.BarRequest\x1a\x1e.protobuf_unittest.BarResponse:F\n\x18optional_int32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x01 \x01(\x05:F\n\x18optional_int64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x02 \x01(\x03:G\n\x19optional_uint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x03 \x01(\r:G\n\x19optional_uint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x04 \x01(\x04:G\n\x19optional_sint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x05 \x01(\x11:G\n\x19optional_sint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x06 \x01(\x12:H\n\x1aoptional_fixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x07 \x01(\x07:H\n\x1aoptional_fixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x08 \x01(\x06:I\n\x1boptional_sfixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\t \x01(\x0f:I\n\x1boptional_sfixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\n \x01(\x10:F\n\x18optional_float_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x0b \x01(\x02:G\n\x19optional_double_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x0c \x01(\x01:E\n\x17optional_bool_extension\x12$.protobuf_unittest.TestAllExtensions\x18\r \x01(\x08:G\n\x19optional_string_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x0e \x01(\t:F\n\x18optional_bytes_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x0f \x01(\x0c:q\n\x17optionalgroup_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x10 \x01(\n2*.protobuf_unittest.OptionalGroup_extension:~\n!optional_nested_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x12 \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage:s\n\"optional_foreign_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x13 \x01(\x0b\x32!.protobuf_unittest.ForeignMessage:x\n!optional_import_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x14 \x01(\x0b\x32\'.protobuf_unittest_import.ImportMessage:x\n\x1eoptional_nested_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x15 \x01(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum:m\n\x1foptional_foreign_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x16 \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum:r\n\x1eoptional_import_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x17 \x01(\x0e\x32$.protobuf_unittest_import.ImportEnum:Q\n\x1foptional_string_piece_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x18 \x01(\tB\x02\x08\x02:I\n\x17optional_cord_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x19 \x01(\tB\x02\x08\x01:\x85\x01\n(optional_public_import_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x1a \x01(\x0b\x32-.protobuf_unittest_import.PublicImportMessage:\x80\x01\n\x1foptional_lazy_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x1b \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageB\x02(\x01:\x8b\x01\n*optional_unverified_lazy_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x1c \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageB\x02x\x01:F\n\x18repeated_int32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x1f \x03(\x05:F\n\x18repeated_int64_extension\x12$.protobuf_unittest.TestAllExtensions\x18 \x03(\x03:G\n\x19repeated_uint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18! \x03(\r:G\n\x19repeated_uint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\" \x03(\x04:G\n\x19repeated_sint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18# \x03(\x11:G\n\x19repeated_sint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18$ \x03(\x12:H\n\x1arepeated_fixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18% \x03(\x07:H\n\x1arepeated_fixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18& \x03(\x06:I\n\x1brepeated_sfixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\' \x03(\x0f:I\n\x1brepeated_sfixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18( \x03(\x10:F\n\x18repeated_float_extension\x12$.protobuf_unittest.TestAllExtensions\x18) \x03(\x02:G\n\x19repeated_double_extension\x12$.protobuf_unittest.TestAllExtensions\x18* \x03(\x01:E\n\x17repeated_bool_extension\x12$.protobuf_unittest.TestAllExtensions\x18+ \x03(\x08:G\n\x19repeated_string_extension\x12$.protobuf_unittest.TestAllExtensions\x18, \x03(\t:F\n\x18repeated_bytes_extension\x12$.protobuf_unittest.TestAllExtensions\x18- \x03(\x0c:q\n\x17repeatedgroup_extension\x12$.protobuf_unittest.TestAllExtensions\x18. \x03(\n2*.protobuf_unittest.RepeatedGroup_extension:~\n!repeated_nested_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x30 \x03(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage:s\n\"repeated_foreign_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x31 \x03(\x0b\x32!.protobuf_unittest.ForeignMessage:x\n!repeated_import_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x32 \x03(\x0b\x32\'.protobuf_unittest_import.ImportMessage:x\n\x1erepeated_nested_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x33 \x03(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum:m\n\x1frepeated_foreign_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x34 \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnum:r\n\x1erepeated_import_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x35 \x03(\x0e\x32$.protobuf_unittest_import.ImportEnum:Q\n\x1frepeated_string_piece_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x36 \x03(\tB\x02\x08\x02:I\n\x17repeated_cord_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x37 \x03(\tB\x02\x08\x01:\x80\x01\n\x1frepeated_lazy_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x39 \x03(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessageB\x02(\x01:I\n\x17\x64\x65\x66\x61ult_int32_extension\x12$.protobuf_unittest.TestAllExtensions\x18= \x01(\x05:\x02\x34\x31:I\n\x17\x64\x65\x66\x61ult_int64_extension\x12$.protobuf_unittest.TestAllExtensions\x18> \x01(\x03:\x02\x34\x32:J\n\x18\x64\x65\x66\x61ult_uint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18? \x01(\r:\x02\x34\x33:J\n\x18\x64\x65\x66\x61ult_uint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18@ \x01(\x04:\x02\x34\x34:K\n\x18\x64\x65\x66\x61ult_sint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x41 \x01(\x11:\x03-45:J\n\x18\x64\x65\x66\x61ult_sint64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x42 \x01(\x12:\x02\x34\x36:K\n\x19\x64\x65\x66\x61ult_fixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x43 \x01(\x07:\x02\x34\x37:K\n\x19\x64\x65\x66\x61ult_fixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x44 \x01(\x06:\x02\x34\x38:L\n\x1a\x64\x65\x66\x61ult_sfixed32_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x45 \x01(\x0f:\x02\x34\x39:M\n\x1a\x64\x65\x66\x61ult_sfixed64_extension\x12$.protobuf_unittest.TestAllExtensions\x18\x46 \x01(\x10:\x03-50:K\n\x17\x64\x65\x66\x61ult_float_extension\x12$.protobuf_unittest.TestAllExtensions\x18G \x01(\x02:\x04\x35\x31.5:M\n\x18\x64\x65\x66\x61ult_double_extension\x12$.protobuf_unittest.TestAllExtensions\x18H \x01(\x01:\x05\x35\x32\x30\x30\x30:J\n\x16\x64\x65\x66\x61ult_bool_extension\x12$.protobuf_unittest.TestAllExtensions\x18I \x01(\x08:\x04true:M\n\x18\x64\x65\x66\x61ult_string_extension\x12$.protobuf_unittest.TestAllExtensions\x18J \x01(\t:\x05hello:L\n\x17\x64\x65\x66\x61ult_bytes_extension\x12$.protobuf_unittest.TestAllExtensions\x18K \x01(\x0c:\x05world:|\n\x1d\x64\x65\x66\x61ult_nested_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18Q \x01(\x0e\x32*.protobuf_unittest.TestAllTypes.NestedEnum:\x03\x42\x41R:y\n\x1e\x64\x65\x66\x61ult_foreign_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18R \x01(\x0e\x32\x1e.protobuf_unittest.ForeignEnum:\x0b\x46OREIGN_BAR:}\n\x1d\x64\x65\x66\x61ult_import_enum_extension\x12$.protobuf_unittest.TestAllExtensions\x18S \x01(\x0e\x32$.protobuf_unittest_import.ImportEnum:\nIMPORT_BAR:U\n\x1e\x64\x65\x66\x61ult_string_piece_extension\x12$.protobuf_unittest.TestAllExtensions\x18T \x01(\t:\x03\x61\x62\x63\x42\x02\x08\x02:M\n\x16\x64\x65\x66\x61ult_cord_extension\x12$.protobuf_unittest.TestAllExtensions\x18U \x01(\t:\x03\x31\x32\x33\x42\x02\x08\x01:D\n\x16oneof_uint32_extension\x12$.protobuf_unittest.TestAllExtensions\x18o \x01(\r:{\n\x1eoneof_nested_message_extension\x12$.protobuf_unittest.TestAllExtensions\x18p \x01(\x0b\x32-.protobuf_unittest.TestAllTypes.NestedMessage:D\n\x16oneof_string_extension\x12$.protobuf_unittest.TestAllExtensions\x18q \x01(\t:C\n\x15oneof_bytes_extension\x12$.protobuf_unittest.TestAllExtensions\x18r \x01(\x0c:B\n\x13my_extension_string\x12%.protobuf_unittest.TestFieldOrderings\x18\x32 \x01(\t:?\n\x10my_extension_int\x12%.protobuf_unittest.TestFieldOrderings\x18\x05 \x01(\x05:K\n\x16packed_int32_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18Z \x03(\x05\x42\x02\x10\x01:K\n\x16packed_int64_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18[ \x03(\x03\x42\x02\x10\x01:L\n\x17packed_uint32_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\\ \x03(\rB\x02\x10\x01:L\n\x17packed_uint64_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18] \x03(\x04\x42\x02\x10\x01:L\n\x17packed_sint32_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18^ \x03(\x11\x42\x02\x10\x01:L\n\x17packed_sint64_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18_ \x03(\x12\x42\x02\x10\x01:M\n\x18packed_fixed32_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18` \x03(\x07\x42\x02\x10\x01:M\n\x18packed_fixed64_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x61 \x03(\x06\x42\x02\x10\x01:N\n\x19packed_sfixed32_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x62 \x03(\x0f\x42\x02\x10\x01:N\n\x19packed_sfixed64_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x63 \x03(\x10\x42\x02\x10\x01:K\n\x16packed_float_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x64 \x03(\x02\x42\x02\x10\x01:L\n\x17packed_double_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x65 \x03(\x01\x42\x02\x10\x01:J\n\x15packed_bool_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18\x66 \x03(\x08\x42\x02\x10\x01:j\n\x15packed_enum_extension\x12\'.protobuf_unittest.TestPackedExtensions\x18g \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnumB\x02\x10\x01:O\n\x18unpacked_int32_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18Z \x03(\x05\x42\x02\x10\x00:O\n\x18unpacked_int64_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18[ \x03(\x03\x42\x02\x10\x00:P\n\x19unpacked_uint32_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\\ \x03(\rB\x02\x10\x00:P\n\x19unpacked_uint64_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18] \x03(\x04\x42\x02\x10\x00:P\n\x19unpacked_sint32_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18^ \x03(\x11\x42\x02\x10\x00:P\n\x19unpacked_sint64_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18_ \x03(\x12\x42\x02\x10\x00:Q\n\x1aunpacked_fixed32_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18` \x03(\x07\x42\x02\x10\x00:Q\n\x1aunpacked_fixed64_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x61 \x03(\x06\x42\x02\x10\x00:R\n\x1bunpacked_sfixed32_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x62 \x03(\x0f\x42\x02\x10\x00:R\n\x1bunpacked_sfixed64_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x63 \x03(\x10\x42\x02\x10\x00:O\n\x18unpacked_float_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x64 \x03(\x02\x42\x02\x10\x00:P\n\x19unpacked_double_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x65 \x03(\x01\x42\x02\x10\x00:N\n\x17unpacked_bool_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18\x66 \x03(\x08\x42\x02\x10\x00:n\n\x17unpacked_enum_extension\x12).protobuf_unittest.TestUnpackedExtensions\x18g \x03(\x0e\x32\x1e.protobuf_unittest.ForeignEnumB\x02\x10\x00:d\n\x0etest_all_types\x12\'.protobuf_unittest.TestHugeFieldNumbers\x18\xe0\xaa\xff\xff\x01 \x01(\x0b\x32\x1f.protobuf_unittest.TestAllTypes:Z\n%test_extension_inside_table_extension\x12+.protobuf_unittest.TestExtensionInsideTable\x18\x05 \x01(\x05:\xa2\x01\n\x05inner\x12X.protobuf_unittest.TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup\x18\x03 \x01(\x0b\x32\x39.protobuf_unittest.TestNestedGroupExtensionInnerExtensionB\x1d\x42\rUnittestProtoH\x01\x80\x01\x01\x88\x01\x01\x90\x01\x01\xf8\x01\x01') -_FOREIGNENUM = DESCRIPTOR.enum_types_by_name['ForeignEnum'] -ForeignEnum = enum_type_wrapper.EnumTypeWrapper(_FOREIGNENUM) -_TESTENUMWITHDUPVALUE = DESCRIPTOR.enum_types_by_name['TestEnumWithDupValue'] -TestEnumWithDupValue = enum_type_wrapper.EnumTypeWrapper(_TESTENUMWITHDUPVALUE) -_TESTSPARSEENUM = DESCRIPTOR.enum_types_by_name['TestSparseEnum'] -TestSparseEnum = enum_type_wrapper.EnumTypeWrapper(_TESTSPARSEENUM) -_VERYLARGEENUM = DESCRIPTOR.enum_types_by_name['VeryLargeEnum'] -VeryLargeEnum = enum_type_wrapper.EnumTypeWrapper(_VERYLARGEENUM) -FOREIGN_FOO = 4 -FOREIGN_BAR = 5 -FOREIGN_BAZ = 6 -FOO1 = 1 -BAR1 = 2 -BAZ = 3 -FOO2 = 1 -BAR2 = 2 -SPARSE_A = 123 -SPARSE_B = 62374 -SPARSE_C = 12589234 -SPARSE_D = -15 -SPARSE_E = -53452 -SPARSE_F = 0 -SPARSE_G = 2 -ENUM_LABEL_DEFAULT = 0 -ENUM_LABEL_1 = 1 -ENUM_LABEL_2 = 2 -ENUM_LABEL_3 = 3 -ENUM_LABEL_4 = 4 -ENUM_LABEL_5 = 5 -ENUM_LABEL_6 = 6 -ENUM_LABEL_7 = 7 -ENUM_LABEL_8 = 8 -ENUM_LABEL_9 = 9 -ENUM_LABEL_10 = 10 -ENUM_LABEL_11 = 11 -ENUM_LABEL_12 = 12 -ENUM_LABEL_13 = 13 -ENUM_LABEL_14 = 14 -ENUM_LABEL_15 = 15 -ENUM_LABEL_16 = 16 -ENUM_LABEL_17 = 17 -ENUM_LABEL_18 = 18 -ENUM_LABEL_19 = 19 -ENUM_LABEL_20 = 20 -ENUM_LABEL_21 = 21 -ENUM_LABEL_22 = 22 -ENUM_LABEL_23 = 23 -ENUM_LABEL_24 = 24 -ENUM_LABEL_25 = 25 -ENUM_LABEL_26 = 26 -ENUM_LABEL_27 = 27 -ENUM_LABEL_28 = 28 -ENUM_LABEL_29 = 29 -ENUM_LABEL_30 = 30 -ENUM_LABEL_31 = 31 -ENUM_LABEL_32 = 32 -ENUM_LABEL_33 = 33 -ENUM_LABEL_34 = 34 -ENUM_LABEL_35 = 35 -ENUM_LABEL_36 = 36 -ENUM_LABEL_37 = 37 -ENUM_LABEL_38 = 38 -ENUM_LABEL_39 = 39 -ENUM_LABEL_40 = 40 -ENUM_LABEL_41 = 41 -ENUM_LABEL_42 = 42 -ENUM_LABEL_43 = 43 -ENUM_LABEL_44 = 44 -ENUM_LABEL_45 = 45 -ENUM_LABEL_46 = 46 -ENUM_LABEL_47 = 47 -ENUM_LABEL_48 = 48 -ENUM_LABEL_49 = 49 -ENUM_LABEL_50 = 50 -ENUM_LABEL_51 = 51 -ENUM_LABEL_52 = 52 -ENUM_LABEL_53 = 53 -ENUM_LABEL_54 = 54 -ENUM_LABEL_55 = 55 -ENUM_LABEL_56 = 56 -ENUM_LABEL_57 = 57 -ENUM_LABEL_58 = 58 -ENUM_LABEL_59 = 59 -ENUM_LABEL_60 = 60 -ENUM_LABEL_61 = 61 -ENUM_LABEL_62 = 62 -ENUM_LABEL_63 = 63 -ENUM_LABEL_64 = 64 -ENUM_LABEL_65 = 65 -ENUM_LABEL_66 = 66 -ENUM_LABEL_67 = 67 -ENUM_LABEL_68 = 68 -ENUM_LABEL_69 = 69 -ENUM_LABEL_70 = 70 -ENUM_LABEL_71 = 71 -ENUM_LABEL_72 = 72 -ENUM_LABEL_73 = 73 -ENUM_LABEL_74 = 74 -ENUM_LABEL_75 = 75 -ENUM_LABEL_76 = 76 -ENUM_LABEL_77 = 77 -ENUM_LABEL_78 = 78 -ENUM_LABEL_79 = 79 -ENUM_LABEL_80 = 80 -ENUM_LABEL_81 = 81 -ENUM_LABEL_82 = 82 -ENUM_LABEL_83 = 83 -ENUM_LABEL_84 = 84 -ENUM_LABEL_85 = 85 -ENUM_LABEL_86 = 86 -ENUM_LABEL_87 = 87 -ENUM_LABEL_88 = 88 -ENUM_LABEL_89 = 89 -ENUM_LABEL_90 = 90 -ENUM_LABEL_91 = 91 -ENUM_LABEL_92 = 92 -ENUM_LABEL_93 = 93 -ENUM_LABEL_94 = 94 -ENUM_LABEL_95 = 95 -ENUM_LABEL_96 = 96 -ENUM_LABEL_97 = 97 -ENUM_LABEL_98 = 98 -ENUM_LABEL_99 = 99 -ENUM_LABEL_100 = 100 - -OPTIONAL_INT32_EXTENSION_FIELD_NUMBER = 1 -optional_int32_extension = DESCRIPTOR.extensions_by_name['optional_int32_extension'] -OPTIONAL_INT64_EXTENSION_FIELD_NUMBER = 2 -optional_int64_extension = DESCRIPTOR.extensions_by_name['optional_int64_extension'] -OPTIONAL_UINT32_EXTENSION_FIELD_NUMBER = 3 -optional_uint32_extension = DESCRIPTOR.extensions_by_name['optional_uint32_extension'] -OPTIONAL_UINT64_EXTENSION_FIELD_NUMBER = 4 -optional_uint64_extension = DESCRIPTOR.extensions_by_name['optional_uint64_extension'] -OPTIONAL_SINT32_EXTENSION_FIELD_NUMBER = 5 -optional_sint32_extension = DESCRIPTOR.extensions_by_name['optional_sint32_extension'] -OPTIONAL_SINT64_EXTENSION_FIELD_NUMBER = 6 -optional_sint64_extension = DESCRIPTOR.extensions_by_name['optional_sint64_extension'] -OPTIONAL_FIXED32_EXTENSION_FIELD_NUMBER = 7 -optional_fixed32_extension = DESCRIPTOR.extensions_by_name['optional_fixed32_extension'] -OPTIONAL_FIXED64_EXTENSION_FIELD_NUMBER = 8 -optional_fixed64_extension = DESCRIPTOR.extensions_by_name['optional_fixed64_extension'] -OPTIONAL_SFIXED32_EXTENSION_FIELD_NUMBER = 9 -optional_sfixed32_extension = DESCRIPTOR.extensions_by_name['optional_sfixed32_extension'] -OPTIONAL_SFIXED64_EXTENSION_FIELD_NUMBER = 10 -optional_sfixed64_extension = DESCRIPTOR.extensions_by_name['optional_sfixed64_extension'] -OPTIONAL_FLOAT_EXTENSION_FIELD_NUMBER = 11 -optional_float_extension = DESCRIPTOR.extensions_by_name['optional_float_extension'] -OPTIONAL_DOUBLE_EXTENSION_FIELD_NUMBER = 12 -optional_double_extension = DESCRIPTOR.extensions_by_name['optional_double_extension'] -OPTIONAL_BOOL_EXTENSION_FIELD_NUMBER = 13 -optional_bool_extension = DESCRIPTOR.extensions_by_name['optional_bool_extension'] -OPTIONAL_STRING_EXTENSION_FIELD_NUMBER = 14 -optional_string_extension = DESCRIPTOR.extensions_by_name['optional_string_extension'] -OPTIONAL_BYTES_EXTENSION_FIELD_NUMBER = 15 -optional_bytes_extension = DESCRIPTOR.extensions_by_name['optional_bytes_extension'] -OPTIONALGROUP_EXTENSION_FIELD_NUMBER = 16 -optionalgroup_extension = DESCRIPTOR.extensions_by_name['optionalgroup_extension'] -OPTIONAL_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER = 18 -optional_nested_message_extension = DESCRIPTOR.extensions_by_name['optional_nested_message_extension'] -OPTIONAL_FOREIGN_MESSAGE_EXTENSION_FIELD_NUMBER = 19 -optional_foreign_message_extension = DESCRIPTOR.extensions_by_name['optional_foreign_message_extension'] -OPTIONAL_IMPORT_MESSAGE_EXTENSION_FIELD_NUMBER = 20 -optional_import_message_extension = DESCRIPTOR.extensions_by_name['optional_import_message_extension'] -OPTIONAL_NESTED_ENUM_EXTENSION_FIELD_NUMBER = 21 -optional_nested_enum_extension = DESCRIPTOR.extensions_by_name['optional_nested_enum_extension'] -OPTIONAL_FOREIGN_ENUM_EXTENSION_FIELD_NUMBER = 22 -optional_foreign_enum_extension = DESCRIPTOR.extensions_by_name['optional_foreign_enum_extension'] -OPTIONAL_IMPORT_ENUM_EXTENSION_FIELD_NUMBER = 23 -optional_import_enum_extension = DESCRIPTOR.extensions_by_name['optional_import_enum_extension'] -OPTIONAL_STRING_PIECE_EXTENSION_FIELD_NUMBER = 24 -optional_string_piece_extension = DESCRIPTOR.extensions_by_name['optional_string_piece_extension'] -OPTIONAL_CORD_EXTENSION_FIELD_NUMBER = 25 -optional_cord_extension = DESCRIPTOR.extensions_by_name['optional_cord_extension'] -OPTIONAL_PUBLIC_IMPORT_MESSAGE_EXTENSION_FIELD_NUMBER = 26 -optional_public_import_message_extension = DESCRIPTOR.extensions_by_name['optional_public_import_message_extension'] -OPTIONAL_LAZY_MESSAGE_EXTENSION_FIELD_NUMBER = 27 -optional_lazy_message_extension = DESCRIPTOR.extensions_by_name['optional_lazy_message_extension'] -REPEATED_INT32_EXTENSION_FIELD_NUMBER = 31 -repeated_int32_extension = DESCRIPTOR.extensions_by_name['repeated_int32_extension'] -REPEATED_INT64_EXTENSION_FIELD_NUMBER = 32 -repeated_int64_extension = DESCRIPTOR.extensions_by_name['repeated_int64_extension'] -REPEATED_UINT32_EXTENSION_FIELD_NUMBER = 33 -repeated_uint32_extension = DESCRIPTOR.extensions_by_name['repeated_uint32_extension'] -REPEATED_UINT64_EXTENSION_FIELD_NUMBER = 34 -repeated_uint64_extension = DESCRIPTOR.extensions_by_name['repeated_uint64_extension'] -REPEATED_SINT32_EXTENSION_FIELD_NUMBER = 35 -repeated_sint32_extension = DESCRIPTOR.extensions_by_name['repeated_sint32_extension'] -REPEATED_SINT64_EXTENSION_FIELD_NUMBER = 36 -repeated_sint64_extension = DESCRIPTOR.extensions_by_name['repeated_sint64_extension'] -REPEATED_FIXED32_EXTENSION_FIELD_NUMBER = 37 -repeated_fixed32_extension = DESCRIPTOR.extensions_by_name['repeated_fixed32_extension'] -REPEATED_FIXED64_EXTENSION_FIELD_NUMBER = 38 -repeated_fixed64_extension = DESCRIPTOR.extensions_by_name['repeated_fixed64_extension'] -REPEATED_SFIXED32_EXTENSION_FIELD_NUMBER = 39 -repeated_sfixed32_extension = DESCRIPTOR.extensions_by_name['repeated_sfixed32_extension'] -REPEATED_SFIXED64_EXTENSION_FIELD_NUMBER = 40 -repeated_sfixed64_extension = DESCRIPTOR.extensions_by_name['repeated_sfixed64_extension'] -REPEATED_FLOAT_EXTENSION_FIELD_NUMBER = 41 -repeated_float_extension = DESCRIPTOR.extensions_by_name['repeated_float_extension'] -REPEATED_DOUBLE_EXTENSION_FIELD_NUMBER = 42 -repeated_double_extension = DESCRIPTOR.extensions_by_name['repeated_double_extension'] -REPEATED_BOOL_EXTENSION_FIELD_NUMBER = 43 -repeated_bool_extension = DESCRIPTOR.extensions_by_name['repeated_bool_extension'] -REPEATED_STRING_EXTENSION_FIELD_NUMBER = 44 -repeated_string_extension = DESCRIPTOR.extensions_by_name['repeated_string_extension'] -REPEATED_BYTES_EXTENSION_FIELD_NUMBER = 45 -repeated_bytes_extension = DESCRIPTOR.extensions_by_name['repeated_bytes_extension'] -REPEATEDGROUP_EXTENSION_FIELD_NUMBER = 46 -repeatedgroup_extension = DESCRIPTOR.extensions_by_name['repeatedgroup_extension'] -REPEATED_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER = 48 -repeated_nested_message_extension = DESCRIPTOR.extensions_by_name['repeated_nested_message_extension'] -REPEATED_FOREIGN_MESSAGE_EXTENSION_FIELD_NUMBER = 49 -repeated_foreign_message_extension = DESCRIPTOR.extensions_by_name['repeated_foreign_message_extension'] -REPEATED_IMPORT_MESSAGE_EXTENSION_FIELD_NUMBER = 50 -repeated_import_message_extension = DESCRIPTOR.extensions_by_name['repeated_import_message_extension'] -REPEATED_NESTED_ENUM_EXTENSION_FIELD_NUMBER = 51 -repeated_nested_enum_extension = DESCRIPTOR.extensions_by_name['repeated_nested_enum_extension'] -REPEATED_FOREIGN_ENUM_EXTENSION_FIELD_NUMBER = 52 -repeated_foreign_enum_extension = DESCRIPTOR.extensions_by_name['repeated_foreign_enum_extension'] -REPEATED_IMPORT_ENUM_EXTENSION_FIELD_NUMBER = 53 -repeated_import_enum_extension = DESCRIPTOR.extensions_by_name['repeated_import_enum_extension'] -REPEATED_STRING_PIECE_EXTENSION_FIELD_NUMBER = 54 -repeated_string_piece_extension = DESCRIPTOR.extensions_by_name['repeated_string_piece_extension'] -REPEATED_CORD_EXTENSION_FIELD_NUMBER = 55 -repeated_cord_extension = DESCRIPTOR.extensions_by_name['repeated_cord_extension'] -REPEATED_LAZY_MESSAGE_EXTENSION_FIELD_NUMBER = 57 -repeated_lazy_message_extension = DESCRIPTOR.extensions_by_name['repeated_lazy_message_extension'] -DEFAULT_INT32_EXTENSION_FIELD_NUMBER = 61 -default_int32_extension = DESCRIPTOR.extensions_by_name['default_int32_extension'] -DEFAULT_INT64_EXTENSION_FIELD_NUMBER = 62 -default_int64_extension = DESCRIPTOR.extensions_by_name['default_int64_extension'] -DEFAULT_UINT32_EXTENSION_FIELD_NUMBER = 63 -default_uint32_extension = DESCRIPTOR.extensions_by_name['default_uint32_extension'] -DEFAULT_UINT64_EXTENSION_FIELD_NUMBER = 64 -default_uint64_extension = DESCRIPTOR.extensions_by_name['default_uint64_extension'] -DEFAULT_SINT32_EXTENSION_FIELD_NUMBER = 65 -default_sint32_extension = DESCRIPTOR.extensions_by_name['default_sint32_extension'] -DEFAULT_SINT64_EXTENSION_FIELD_NUMBER = 66 -default_sint64_extension = DESCRIPTOR.extensions_by_name['default_sint64_extension'] -DEFAULT_FIXED32_EXTENSION_FIELD_NUMBER = 67 -default_fixed32_extension = DESCRIPTOR.extensions_by_name['default_fixed32_extension'] -DEFAULT_FIXED64_EXTENSION_FIELD_NUMBER = 68 -default_fixed64_extension = DESCRIPTOR.extensions_by_name['default_fixed64_extension'] -DEFAULT_SFIXED32_EXTENSION_FIELD_NUMBER = 69 -default_sfixed32_extension = DESCRIPTOR.extensions_by_name['default_sfixed32_extension'] -DEFAULT_SFIXED64_EXTENSION_FIELD_NUMBER = 70 -default_sfixed64_extension = DESCRIPTOR.extensions_by_name['default_sfixed64_extension'] -DEFAULT_FLOAT_EXTENSION_FIELD_NUMBER = 71 -default_float_extension = DESCRIPTOR.extensions_by_name['default_float_extension'] -DEFAULT_DOUBLE_EXTENSION_FIELD_NUMBER = 72 -default_double_extension = DESCRIPTOR.extensions_by_name['default_double_extension'] -DEFAULT_BOOL_EXTENSION_FIELD_NUMBER = 73 -default_bool_extension = DESCRIPTOR.extensions_by_name['default_bool_extension'] -DEFAULT_STRING_EXTENSION_FIELD_NUMBER = 74 -default_string_extension = DESCRIPTOR.extensions_by_name['default_string_extension'] -DEFAULT_BYTES_EXTENSION_FIELD_NUMBER = 75 -default_bytes_extension = DESCRIPTOR.extensions_by_name['default_bytes_extension'] -DEFAULT_NESTED_ENUM_EXTENSION_FIELD_NUMBER = 81 -default_nested_enum_extension = DESCRIPTOR.extensions_by_name['default_nested_enum_extension'] -DEFAULT_FOREIGN_ENUM_EXTENSION_FIELD_NUMBER = 82 -default_foreign_enum_extension = DESCRIPTOR.extensions_by_name['default_foreign_enum_extension'] -DEFAULT_IMPORT_ENUM_EXTENSION_FIELD_NUMBER = 83 -default_import_enum_extension = DESCRIPTOR.extensions_by_name['default_import_enum_extension'] -DEFAULT_STRING_PIECE_EXTENSION_FIELD_NUMBER = 84 -default_string_piece_extension = DESCRIPTOR.extensions_by_name['default_string_piece_extension'] -DEFAULT_CORD_EXTENSION_FIELD_NUMBER = 85 -default_cord_extension = DESCRIPTOR.extensions_by_name['default_cord_extension'] -ONEOF_UINT32_EXTENSION_FIELD_NUMBER = 111 -oneof_uint32_extension = DESCRIPTOR.extensions_by_name['oneof_uint32_extension'] -ONEOF_NESTED_MESSAGE_EXTENSION_FIELD_NUMBER = 112 -oneof_nested_message_extension = DESCRIPTOR.extensions_by_name['oneof_nested_message_extension'] -ONEOF_STRING_EXTENSION_FIELD_NUMBER = 113 -oneof_string_extension = DESCRIPTOR.extensions_by_name['oneof_string_extension'] -ONEOF_BYTES_EXTENSION_FIELD_NUMBER = 114 -oneof_bytes_extension = DESCRIPTOR.extensions_by_name['oneof_bytes_extension'] -MY_EXTENSION_STRING_FIELD_NUMBER = 50 -my_extension_string = DESCRIPTOR.extensions_by_name['my_extension_string'] -MY_EXTENSION_INT_FIELD_NUMBER = 5 -my_extension_int = DESCRIPTOR.extensions_by_name['my_extension_int'] -PACKED_INT32_EXTENSION_FIELD_NUMBER = 90 -packed_int32_extension = DESCRIPTOR.extensions_by_name['packed_int32_extension'] -PACKED_INT64_EXTENSION_FIELD_NUMBER = 91 -packed_int64_extension = DESCRIPTOR.extensions_by_name['packed_int64_extension'] -PACKED_UINT32_EXTENSION_FIELD_NUMBER = 92 -packed_uint32_extension = DESCRIPTOR.extensions_by_name['packed_uint32_extension'] -PACKED_UINT64_EXTENSION_FIELD_NUMBER = 93 -packed_uint64_extension = DESCRIPTOR.extensions_by_name['packed_uint64_extension'] -PACKED_SINT32_EXTENSION_FIELD_NUMBER = 94 -packed_sint32_extension = DESCRIPTOR.extensions_by_name['packed_sint32_extension'] -PACKED_SINT64_EXTENSION_FIELD_NUMBER = 95 -packed_sint64_extension = DESCRIPTOR.extensions_by_name['packed_sint64_extension'] -PACKED_FIXED32_EXTENSION_FIELD_NUMBER = 96 -packed_fixed32_extension = DESCRIPTOR.extensions_by_name['packed_fixed32_extension'] -PACKED_FIXED64_EXTENSION_FIELD_NUMBER = 97 -packed_fixed64_extension = DESCRIPTOR.extensions_by_name['packed_fixed64_extension'] -PACKED_SFIXED32_EXTENSION_FIELD_NUMBER = 98 -packed_sfixed32_extension = DESCRIPTOR.extensions_by_name['packed_sfixed32_extension'] -PACKED_SFIXED64_EXTENSION_FIELD_NUMBER = 99 -packed_sfixed64_extension = DESCRIPTOR.extensions_by_name['packed_sfixed64_extension'] -PACKED_FLOAT_EXTENSION_FIELD_NUMBER = 100 -packed_float_extension = DESCRIPTOR.extensions_by_name['packed_float_extension'] -PACKED_DOUBLE_EXTENSION_FIELD_NUMBER = 101 -packed_double_extension = DESCRIPTOR.extensions_by_name['packed_double_extension'] -PACKED_BOOL_EXTENSION_FIELD_NUMBER = 102 -packed_bool_extension = DESCRIPTOR.extensions_by_name['packed_bool_extension'] -PACKED_ENUM_EXTENSION_FIELD_NUMBER = 103 -packed_enum_extension = DESCRIPTOR.extensions_by_name['packed_enum_extension'] -UNPACKED_INT32_EXTENSION_FIELD_NUMBER = 90 -unpacked_int32_extension = DESCRIPTOR.extensions_by_name['unpacked_int32_extension'] -UNPACKED_INT64_EXTENSION_FIELD_NUMBER = 91 -unpacked_int64_extension = DESCRIPTOR.extensions_by_name['unpacked_int64_extension'] -UNPACKED_UINT32_EXTENSION_FIELD_NUMBER = 92 -unpacked_uint32_extension = DESCRIPTOR.extensions_by_name['unpacked_uint32_extension'] -UNPACKED_UINT64_EXTENSION_FIELD_NUMBER = 93 -unpacked_uint64_extension = DESCRIPTOR.extensions_by_name['unpacked_uint64_extension'] -UNPACKED_SINT32_EXTENSION_FIELD_NUMBER = 94 -unpacked_sint32_extension = DESCRIPTOR.extensions_by_name['unpacked_sint32_extension'] -UNPACKED_SINT64_EXTENSION_FIELD_NUMBER = 95 -unpacked_sint64_extension = DESCRIPTOR.extensions_by_name['unpacked_sint64_extension'] -UNPACKED_FIXED32_EXTENSION_FIELD_NUMBER = 96 -unpacked_fixed32_extension = DESCRIPTOR.extensions_by_name['unpacked_fixed32_extension'] -UNPACKED_FIXED64_EXTENSION_FIELD_NUMBER = 97 -unpacked_fixed64_extension = DESCRIPTOR.extensions_by_name['unpacked_fixed64_extension'] -UNPACKED_SFIXED32_EXTENSION_FIELD_NUMBER = 98 -unpacked_sfixed32_extension = DESCRIPTOR.extensions_by_name['unpacked_sfixed32_extension'] -UNPACKED_SFIXED64_EXTENSION_FIELD_NUMBER = 99 -unpacked_sfixed64_extension = DESCRIPTOR.extensions_by_name['unpacked_sfixed64_extension'] -UNPACKED_FLOAT_EXTENSION_FIELD_NUMBER = 100 -unpacked_float_extension = DESCRIPTOR.extensions_by_name['unpacked_float_extension'] -UNPACKED_DOUBLE_EXTENSION_FIELD_NUMBER = 101 -unpacked_double_extension = DESCRIPTOR.extensions_by_name['unpacked_double_extension'] -UNPACKED_BOOL_EXTENSION_FIELD_NUMBER = 102 -unpacked_bool_extension = DESCRIPTOR.extensions_by_name['unpacked_bool_extension'] -UNPACKED_ENUM_EXTENSION_FIELD_NUMBER = 103 -unpacked_enum_extension = DESCRIPTOR.extensions_by_name['unpacked_enum_extension'] -TEST_ALL_TYPES_FIELD_NUMBER = 536860000 -test_all_types = DESCRIPTOR.extensions_by_name['test_all_types'] -TEST_EXTENSION_INSIDE_TABLE_EXTENSION_FIELD_NUMBER = 5 -test_extension_inside_table_extension = DESCRIPTOR.extensions_by_name['test_extension_inside_table_extension'] - -_TESTALLTYPES = DESCRIPTOR.message_types_by_name['TestAllTypes'] -_TESTALLTYPES_NESTEDMESSAGE = _TESTALLTYPES.nested_types_by_name['NestedMessage'] -_TESTALLTYPES_OPTIONALGROUP = _TESTALLTYPES.nested_types_by_name['OptionalGroup'] -_TESTALLTYPES_REPEATEDGROUP = _TESTALLTYPES.nested_types_by_name['RepeatedGroup'] -_NESTEDTESTALLTYPES = DESCRIPTOR.message_types_by_name['NestedTestAllTypes'] -_TESTDEPRECATEDFIELDS = DESCRIPTOR.message_types_by_name['TestDeprecatedFields'] -_TESTDEPRECATEDMESSAGE = DESCRIPTOR.message_types_by_name['TestDeprecatedMessage'] -_FOREIGNMESSAGE = DESCRIPTOR.message_types_by_name['ForeignMessage'] -_TESTRESERVEDFIELDS = DESCRIPTOR.message_types_by_name['TestReservedFields'] -_TESTALLEXTENSIONS = DESCRIPTOR.message_types_by_name['TestAllExtensions'] -_OPTIONALGROUP_EXTENSION = DESCRIPTOR.message_types_by_name['OptionalGroup_extension'] -_REPEATEDGROUP_EXTENSION = DESCRIPTOR.message_types_by_name['RepeatedGroup_extension'] -_TESTGROUP = DESCRIPTOR.message_types_by_name['TestGroup'] -_TESTGROUP_OPTIONALGROUP = _TESTGROUP.nested_types_by_name['OptionalGroup'] -_TESTGROUPEXTENSION = DESCRIPTOR.message_types_by_name['TestGroupExtension'] -_TESTNESTEDEXTENSION = DESCRIPTOR.message_types_by_name['TestNestedExtension'] -_TESTNESTEDEXTENSION_OPTIONALGROUP_EXTENSION = _TESTNESTEDEXTENSION.nested_types_by_name['OptionalGroup_extension'] -_TESTCHILDEXTENSION = DESCRIPTOR.message_types_by_name['TestChildExtension'] -_TESTREQUIRED = DESCRIPTOR.message_types_by_name['TestRequired'] -_TESTREQUIREDFOREIGN = DESCRIPTOR.message_types_by_name['TestRequiredForeign'] -_TESTREQUIREDMESSAGE = DESCRIPTOR.message_types_by_name['TestRequiredMessage'] -_TESTFOREIGNNESTED = DESCRIPTOR.message_types_by_name['TestForeignNested'] -_TESTEMPTYMESSAGE = DESCRIPTOR.message_types_by_name['TestEmptyMessage'] -_TESTEMPTYMESSAGEWITHEXTENSIONS = DESCRIPTOR.message_types_by_name['TestEmptyMessageWithExtensions'] -_TESTPICKLENESTEDMESSAGE = DESCRIPTOR.message_types_by_name['TestPickleNestedMessage'] -_TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE = _TESTPICKLENESTEDMESSAGE.nested_types_by_name['NestedMessage'] -_TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE = _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE.nested_types_by_name['NestedNestedMessage'] -_TESTMULTIPLEEXTENSIONRANGES = DESCRIPTOR.message_types_by_name['TestMultipleExtensionRanges'] -_TESTREALLYLARGETAGNUMBER = DESCRIPTOR.message_types_by_name['TestReallyLargeTagNumber'] -_TESTRECURSIVEMESSAGE = DESCRIPTOR.message_types_by_name['TestRecursiveMessage'] -_TESTMUTUALRECURSIONA = DESCRIPTOR.message_types_by_name['TestMutualRecursionA'] -_TESTMUTUALRECURSIONA_SUBMESSAGE = _TESTMUTUALRECURSIONA.nested_types_by_name['SubMessage'] -_TESTMUTUALRECURSIONA_SUBGROUP = _TESTMUTUALRECURSIONA.nested_types_by_name['SubGroup'] -_TESTMUTUALRECURSIONB = DESCRIPTOR.message_types_by_name['TestMutualRecursionB'] -_TESTISINITIALIZED = DESCRIPTOR.message_types_by_name['TestIsInitialized'] -_TESTISINITIALIZED_SUBMESSAGE = _TESTISINITIALIZED.nested_types_by_name['SubMessage'] -_TESTISINITIALIZED_SUBMESSAGE_SUBGROUP = _TESTISINITIALIZED_SUBMESSAGE.nested_types_by_name['SubGroup'] -_TESTDUPFIELDNUMBER = DESCRIPTOR.message_types_by_name['TestDupFieldNumber'] -_TESTDUPFIELDNUMBER_FOO = _TESTDUPFIELDNUMBER.nested_types_by_name['Foo'] -_TESTDUPFIELDNUMBER_BAR = _TESTDUPFIELDNUMBER.nested_types_by_name['Bar'] -_TESTEAGERMESSAGE = DESCRIPTOR.message_types_by_name['TestEagerMessage'] -_TESTLAZYMESSAGE = DESCRIPTOR.message_types_by_name['TestLazyMessage'] -_TESTNESTEDMESSAGEHASBITS = DESCRIPTOR.message_types_by_name['TestNestedMessageHasBits'] -_TESTNESTEDMESSAGEHASBITS_NESTEDMESSAGE = _TESTNESTEDMESSAGEHASBITS.nested_types_by_name['NestedMessage'] -_TESTCAMELCASEFIELDNAMES = DESCRIPTOR.message_types_by_name['TestCamelCaseFieldNames'] -_TESTFIELDORDERINGS = DESCRIPTOR.message_types_by_name['TestFieldOrderings'] -_TESTFIELDORDERINGS_NESTEDMESSAGE = _TESTFIELDORDERINGS.nested_types_by_name['NestedMessage'] -_TESTEXTENSIONORDERINGS1 = DESCRIPTOR.message_types_by_name['TestExtensionOrderings1'] -_TESTEXTENSIONORDERINGS2 = DESCRIPTOR.message_types_by_name['TestExtensionOrderings2'] -_TESTEXTENSIONORDERINGS2_TESTEXTENSIONORDERINGS3 = _TESTEXTENSIONORDERINGS2.nested_types_by_name['TestExtensionOrderings3'] -_TESTEXTREMEDEFAULTVALUES = DESCRIPTOR.message_types_by_name['TestExtremeDefaultValues'] -_SPARSEENUMMESSAGE = DESCRIPTOR.message_types_by_name['SparseEnumMessage'] -_ONESTRING = DESCRIPTOR.message_types_by_name['OneString'] -_MORESTRING = DESCRIPTOR.message_types_by_name['MoreString'] -_ONEBYTES = DESCRIPTOR.message_types_by_name['OneBytes'] -_MOREBYTES = DESCRIPTOR.message_types_by_name['MoreBytes'] -_INT32MESSAGE = DESCRIPTOR.message_types_by_name['Int32Message'] -_UINT32MESSAGE = DESCRIPTOR.message_types_by_name['Uint32Message'] -_INT64MESSAGE = DESCRIPTOR.message_types_by_name['Int64Message'] -_UINT64MESSAGE = DESCRIPTOR.message_types_by_name['Uint64Message'] -_BOOLMESSAGE = DESCRIPTOR.message_types_by_name['BoolMessage'] -_TESTONEOF = DESCRIPTOR.message_types_by_name['TestOneof'] -_TESTONEOF_FOOGROUP = _TESTONEOF.nested_types_by_name['FooGroup'] -_TESTONEOFBACKWARDSCOMPATIBLE = DESCRIPTOR.message_types_by_name['TestOneofBackwardsCompatible'] -_TESTONEOFBACKWARDSCOMPATIBLE_FOOGROUP = _TESTONEOFBACKWARDSCOMPATIBLE.nested_types_by_name['FooGroup'] -_TESTONEOF2 = DESCRIPTOR.message_types_by_name['TestOneof2'] -_TESTONEOF2_FOOGROUP = _TESTONEOF2.nested_types_by_name['FooGroup'] -_TESTONEOF2_NESTEDMESSAGE = _TESTONEOF2.nested_types_by_name['NestedMessage'] -_TESTREQUIREDONEOF = DESCRIPTOR.message_types_by_name['TestRequiredOneof'] -_TESTREQUIREDONEOF_NESTEDMESSAGE = _TESTREQUIREDONEOF.nested_types_by_name['NestedMessage'] -_TESTPACKEDTYPES = DESCRIPTOR.message_types_by_name['TestPackedTypes'] -_TESTUNPACKEDTYPES = DESCRIPTOR.message_types_by_name['TestUnpackedTypes'] -_TESTPACKEDEXTENSIONS = DESCRIPTOR.message_types_by_name['TestPackedExtensions'] -_TESTUNPACKEDEXTENSIONS = DESCRIPTOR.message_types_by_name['TestUnpackedExtensions'] -_TESTDYNAMICEXTENSIONS = DESCRIPTOR.message_types_by_name['TestDynamicExtensions'] -_TESTDYNAMICEXTENSIONS_DYNAMICMESSAGETYPE = _TESTDYNAMICEXTENSIONS.nested_types_by_name['DynamicMessageType'] -_TESTREPEATEDSCALARDIFFERENTTAGSIZES = DESCRIPTOR.message_types_by_name['TestRepeatedScalarDifferentTagSizes'] -_TESTPARSINGMERGE = DESCRIPTOR.message_types_by_name['TestParsingMerge'] -_TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR = _TESTPARSINGMERGE.nested_types_by_name['RepeatedFieldsGenerator'] -_TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP1 = _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR.nested_types_by_name['Group1'] -_TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP2 = _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR.nested_types_by_name['Group2'] -_TESTPARSINGMERGE_OPTIONALGROUP = _TESTPARSINGMERGE.nested_types_by_name['OptionalGroup'] -_TESTPARSINGMERGE_REPEATEDGROUP = _TESTPARSINGMERGE.nested_types_by_name['RepeatedGroup'] -_TESTCOMMENTINJECTIONMESSAGE = DESCRIPTOR.message_types_by_name['TestCommentInjectionMessage'] -_FOOREQUEST = DESCRIPTOR.message_types_by_name['FooRequest'] -_FOORESPONSE = DESCRIPTOR.message_types_by_name['FooResponse'] -_FOOCLIENTMESSAGE = DESCRIPTOR.message_types_by_name['FooClientMessage'] -_FOOSERVERMESSAGE = DESCRIPTOR.message_types_by_name['FooServerMessage'] -_BARREQUEST = DESCRIPTOR.message_types_by_name['BarRequest'] -_BARRESPONSE = DESCRIPTOR.message_types_by_name['BarResponse'] -_TESTJSONNAME = DESCRIPTOR.message_types_by_name['TestJsonName'] -_TESTHUGEFIELDNUMBERS = DESCRIPTOR.message_types_by_name['TestHugeFieldNumbers'] -_TESTHUGEFIELDNUMBERS_OPTIONALGROUP = _TESTHUGEFIELDNUMBERS.nested_types_by_name['OptionalGroup'] -_TESTHUGEFIELDNUMBERS_STRINGSTRINGMAPENTRY = _TESTHUGEFIELDNUMBERS.nested_types_by_name['StringStringMapEntry'] -_TESTEXTENSIONINSIDETABLE = DESCRIPTOR.message_types_by_name['TestExtensionInsideTable'] -_TESTEXTENSIONRANGESERIALIZE = DESCRIPTOR.message_types_by_name['TestExtensionRangeSerialize'] -_TESTALLTYPES_NESTEDENUM = _TESTALLTYPES.enum_types_by_name['NestedEnum'] -_TESTONEOF2_NESTEDENUM = _TESTONEOF2.enum_types_by_name['NestedEnum'] -_TESTDYNAMICEXTENSIONS_DYNAMICENUMTYPE = _TESTDYNAMICEXTENSIONS.enum_types_by_name['DynamicEnumType'] -TestAllTypes = _reflection.GeneratedProtocolMessageType('TestAllTypes', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPES_NESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestAllTypes.NestedMessage) - }) - , - - 'OptionalGroup' : _reflection.GeneratedProtocolMessageType('OptionalGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPES_OPTIONALGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestAllTypes.OptionalGroup) - }) - , - - 'RepeatedGroup' : _reflection.GeneratedProtocolMessageType('RepeatedGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPES_REPEATEDGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestAllTypes.RepeatedGroup) - }) - , - 'DESCRIPTOR' : _TESTALLTYPES, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestAllTypes) - }) -_sym_db.RegisterMessage(TestAllTypes) -_sym_db.RegisterMessage(TestAllTypes.NestedMessage) -_sym_db.RegisterMessage(TestAllTypes.OptionalGroup) -_sym_db.RegisterMessage(TestAllTypes.RepeatedGroup) - -NestedTestAllTypes = _reflection.GeneratedProtocolMessageType('NestedTestAllTypes', (_message.Message,), { - 'DESCRIPTOR' : _NESTEDTESTALLTYPES, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.NestedTestAllTypes) - }) -_sym_db.RegisterMessage(NestedTestAllTypes) - -TestDeprecatedFields = _reflection.GeneratedProtocolMessageType('TestDeprecatedFields', (_message.Message,), { - 'DESCRIPTOR' : _TESTDEPRECATEDFIELDS, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestDeprecatedFields) - }) -_sym_db.RegisterMessage(TestDeprecatedFields) - -TestDeprecatedMessage = _reflection.GeneratedProtocolMessageType('TestDeprecatedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTDEPRECATEDMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestDeprecatedMessage) - }) -_sym_db.RegisterMessage(TestDeprecatedMessage) - -ForeignMessage = _reflection.GeneratedProtocolMessageType('ForeignMessage', (_message.Message,), { - 'DESCRIPTOR' : _FOREIGNMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.ForeignMessage) - }) -_sym_db.RegisterMessage(ForeignMessage) - -TestReservedFields = _reflection.GeneratedProtocolMessageType('TestReservedFields', (_message.Message,), { - 'DESCRIPTOR' : _TESTRESERVEDFIELDS, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestReservedFields) - }) -_sym_db.RegisterMessage(TestReservedFields) - -TestAllExtensions = _reflection.GeneratedProtocolMessageType('TestAllExtensions', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLEXTENSIONS, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestAllExtensions) - }) -_sym_db.RegisterMessage(TestAllExtensions) - -OptionalGroup_extension = _reflection.GeneratedProtocolMessageType('OptionalGroup_extension', (_message.Message,), { - 'DESCRIPTOR' : _OPTIONALGROUP_EXTENSION, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.OptionalGroup_extension) - }) -_sym_db.RegisterMessage(OptionalGroup_extension) - -RepeatedGroup_extension = _reflection.GeneratedProtocolMessageType('RepeatedGroup_extension', (_message.Message,), { - 'DESCRIPTOR' : _REPEATEDGROUP_EXTENSION, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.RepeatedGroup_extension) - }) -_sym_db.RegisterMessage(RepeatedGroup_extension) - -TestGroup = _reflection.GeneratedProtocolMessageType('TestGroup', (_message.Message,), { - - 'OptionalGroup' : _reflection.GeneratedProtocolMessageType('OptionalGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTGROUP_OPTIONALGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestGroup.OptionalGroup) - }) - , - 'DESCRIPTOR' : _TESTGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestGroup) - }) -_sym_db.RegisterMessage(TestGroup) -_sym_db.RegisterMessage(TestGroup.OptionalGroup) - -TestGroupExtension = _reflection.GeneratedProtocolMessageType('TestGroupExtension', (_message.Message,), { - 'DESCRIPTOR' : _TESTGROUPEXTENSION, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestGroupExtension) - }) -_sym_db.RegisterMessage(TestGroupExtension) - -TestNestedExtension = _reflection.GeneratedProtocolMessageType('TestNestedExtension', (_message.Message,), { - - 'OptionalGroup_extension' : _reflection.GeneratedProtocolMessageType('OptionalGroup_extension', (_message.Message,), { - 'DESCRIPTOR' : _TESTNESTEDEXTENSION_OPTIONALGROUP_EXTENSION, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestNestedExtension.OptionalGroup_extension) - }) - , - 'DESCRIPTOR' : _TESTNESTEDEXTENSION, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestNestedExtension) - }) -_sym_db.RegisterMessage(TestNestedExtension) -_sym_db.RegisterMessage(TestNestedExtension.OptionalGroup_extension) - -TestChildExtension = _reflection.GeneratedProtocolMessageType('TestChildExtension', (_message.Message,), { - 'DESCRIPTOR' : _TESTCHILDEXTENSION, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestChildExtension) - }) -_sym_db.RegisterMessage(TestChildExtension) - -TestRequired = _reflection.GeneratedProtocolMessageType('TestRequired', (_message.Message,), { - 'DESCRIPTOR' : _TESTREQUIRED, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequired) - }) -_sym_db.RegisterMessage(TestRequired) - -TestRequiredForeign = _reflection.GeneratedProtocolMessageType('TestRequiredForeign', (_message.Message,), { - 'DESCRIPTOR' : _TESTREQUIREDFOREIGN, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequiredForeign) - }) -_sym_db.RegisterMessage(TestRequiredForeign) - -TestRequiredMessage = _reflection.GeneratedProtocolMessageType('TestRequiredMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTREQUIREDMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequiredMessage) - }) -_sym_db.RegisterMessage(TestRequiredMessage) - -TestForeignNested = _reflection.GeneratedProtocolMessageType('TestForeignNested', (_message.Message,), { - 'DESCRIPTOR' : _TESTFOREIGNNESTED, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestForeignNested) - }) -_sym_db.RegisterMessage(TestForeignNested) - -TestEmptyMessage = _reflection.GeneratedProtocolMessageType('TestEmptyMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTEMPTYMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestEmptyMessage) - }) -_sym_db.RegisterMessage(TestEmptyMessage) - -TestEmptyMessageWithExtensions = _reflection.GeneratedProtocolMessageType('TestEmptyMessageWithExtensions', (_message.Message,), { - 'DESCRIPTOR' : _TESTEMPTYMESSAGEWITHEXTENSIONS, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestEmptyMessageWithExtensions) - }) -_sym_db.RegisterMessage(TestEmptyMessageWithExtensions) - -TestPickleNestedMessage = _reflection.GeneratedProtocolMessageType('TestPickleNestedMessage', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - - 'NestedNestedMessage' : _reflection.GeneratedProtocolMessageType('NestedNestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestPickleNestedMessage.NestedMessage.NestedNestedMessage) - }) - , - 'DESCRIPTOR' : _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestPickleNestedMessage.NestedMessage) - }) - , - 'DESCRIPTOR' : _TESTPICKLENESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestPickleNestedMessage) - }) -_sym_db.RegisterMessage(TestPickleNestedMessage) -_sym_db.RegisterMessage(TestPickleNestedMessage.NestedMessage) -_sym_db.RegisterMessage(TestPickleNestedMessage.NestedMessage.NestedNestedMessage) - -TestMultipleExtensionRanges = _reflection.GeneratedProtocolMessageType('TestMultipleExtensionRanges', (_message.Message,), { - 'DESCRIPTOR' : _TESTMULTIPLEEXTENSIONRANGES, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMultipleExtensionRanges) - }) -_sym_db.RegisterMessage(TestMultipleExtensionRanges) - -TestReallyLargeTagNumber = _reflection.GeneratedProtocolMessageType('TestReallyLargeTagNumber', (_message.Message,), { - 'DESCRIPTOR' : _TESTREALLYLARGETAGNUMBER, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestReallyLargeTagNumber) - }) -_sym_db.RegisterMessage(TestReallyLargeTagNumber) - -TestRecursiveMessage = _reflection.GeneratedProtocolMessageType('TestRecursiveMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTRECURSIVEMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRecursiveMessage) - }) -_sym_db.RegisterMessage(TestRecursiveMessage) - -TestMutualRecursionA = _reflection.GeneratedProtocolMessageType('TestMutualRecursionA', (_message.Message,), { - - 'SubMessage' : _reflection.GeneratedProtocolMessageType('SubMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTMUTUALRECURSIONA_SUBMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMutualRecursionA.SubMessage) - }) - , - - 'SubGroup' : _reflection.GeneratedProtocolMessageType('SubGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTMUTUALRECURSIONA_SUBGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMutualRecursionA.SubGroup) - }) - , - 'DESCRIPTOR' : _TESTMUTUALRECURSIONA, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMutualRecursionA) - }) -_sym_db.RegisterMessage(TestMutualRecursionA) -_sym_db.RegisterMessage(TestMutualRecursionA.SubMessage) -_sym_db.RegisterMessage(TestMutualRecursionA.SubGroup) - -TestMutualRecursionB = _reflection.GeneratedProtocolMessageType('TestMutualRecursionB', (_message.Message,), { - 'DESCRIPTOR' : _TESTMUTUALRECURSIONB, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMutualRecursionB) - }) -_sym_db.RegisterMessage(TestMutualRecursionB) - -TestIsInitialized = _reflection.GeneratedProtocolMessageType('TestIsInitialized', (_message.Message,), { - - 'SubMessage' : _reflection.GeneratedProtocolMessageType('SubMessage', (_message.Message,), { - - 'SubGroup' : _reflection.GeneratedProtocolMessageType('SubGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTISINITIALIZED_SUBMESSAGE_SUBGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestIsInitialized.SubMessage.SubGroup) - }) - , - 'DESCRIPTOR' : _TESTISINITIALIZED_SUBMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestIsInitialized.SubMessage) - }) - , - 'DESCRIPTOR' : _TESTISINITIALIZED, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestIsInitialized) - }) -_sym_db.RegisterMessage(TestIsInitialized) -_sym_db.RegisterMessage(TestIsInitialized.SubMessage) -_sym_db.RegisterMessage(TestIsInitialized.SubMessage.SubGroup) - -TestDupFieldNumber = _reflection.GeneratedProtocolMessageType('TestDupFieldNumber', (_message.Message,), { - - 'Foo' : _reflection.GeneratedProtocolMessageType('Foo', (_message.Message,), { - 'DESCRIPTOR' : _TESTDUPFIELDNUMBER_FOO, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestDupFieldNumber.Foo) - }) - , - - 'Bar' : _reflection.GeneratedProtocolMessageType('Bar', (_message.Message,), { - 'DESCRIPTOR' : _TESTDUPFIELDNUMBER_BAR, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestDupFieldNumber.Bar) - }) - , - 'DESCRIPTOR' : _TESTDUPFIELDNUMBER, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestDupFieldNumber) - }) -_sym_db.RegisterMessage(TestDupFieldNumber) -_sym_db.RegisterMessage(TestDupFieldNumber.Foo) -_sym_db.RegisterMessage(TestDupFieldNumber.Bar) - -TestEagerMessage = _reflection.GeneratedProtocolMessageType('TestEagerMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTEAGERMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestEagerMessage) - }) -_sym_db.RegisterMessage(TestEagerMessage) - -TestLazyMessage = _reflection.GeneratedProtocolMessageType('TestLazyMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTLAZYMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestLazyMessage) - }) -_sym_db.RegisterMessage(TestLazyMessage) - -TestNestedMessageHasBits = _reflection.GeneratedProtocolMessageType('TestNestedMessageHasBits', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTNESTEDMESSAGEHASBITS_NESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestNestedMessageHasBits.NestedMessage) - }) - , - 'DESCRIPTOR' : _TESTNESTEDMESSAGEHASBITS, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestNestedMessageHasBits) - }) -_sym_db.RegisterMessage(TestNestedMessageHasBits) -_sym_db.RegisterMessage(TestNestedMessageHasBits.NestedMessage) - -TestCamelCaseFieldNames = _reflection.GeneratedProtocolMessageType('TestCamelCaseFieldNames', (_message.Message,), { - 'DESCRIPTOR' : _TESTCAMELCASEFIELDNAMES, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestCamelCaseFieldNames) - }) -_sym_db.RegisterMessage(TestCamelCaseFieldNames) - -TestFieldOrderings = _reflection.GeneratedProtocolMessageType('TestFieldOrderings', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTFIELDORDERINGS_NESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestFieldOrderings.NestedMessage) - }) - , - 'DESCRIPTOR' : _TESTFIELDORDERINGS, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestFieldOrderings) - }) -_sym_db.RegisterMessage(TestFieldOrderings) -_sym_db.RegisterMessage(TestFieldOrderings.NestedMessage) - -TestExtensionOrderings1 = _reflection.GeneratedProtocolMessageType('TestExtensionOrderings1', (_message.Message,), { - 'DESCRIPTOR' : _TESTEXTENSIONORDERINGS1, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestExtensionOrderings1) - }) -_sym_db.RegisterMessage(TestExtensionOrderings1) - -TestExtensionOrderings2 = _reflection.GeneratedProtocolMessageType('TestExtensionOrderings2', (_message.Message,), { - - 'TestExtensionOrderings3' : _reflection.GeneratedProtocolMessageType('TestExtensionOrderings3', (_message.Message,), { - 'DESCRIPTOR' : _TESTEXTENSIONORDERINGS2_TESTEXTENSIONORDERINGS3, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestExtensionOrderings2.TestExtensionOrderings3) - }) - , - 'DESCRIPTOR' : _TESTEXTENSIONORDERINGS2, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestExtensionOrderings2) - }) -_sym_db.RegisterMessage(TestExtensionOrderings2) -_sym_db.RegisterMessage(TestExtensionOrderings2.TestExtensionOrderings3) - -TestExtremeDefaultValues = _reflection.GeneratedProtocolMessageType('TestExtremeDefaultValues', (_message.Message,), { - 'DESCRIPTOR' : _TESTEXTREMEDEFAULTVALUES, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestExtremeDefaultValues) - }) -_sym_db.RegisterMessage(TestExtremeDefaultValues) - -SparseEnumMessage = _reflection.GeneratedProtocolMessageType('SparseEnumMessage', (_message.Message,), { - 'DESCRIPTOR' : _SPARSEENUMMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.SparseEnumMessage) - }) -_sym_db.RegisterMessage(SparseEnumMessage) - -OneString = _reflection.GeneratedProtocolMessageType('OneString', (_message.Message,), { - 'DESCRIPTOR' : _ONESTRING, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.OneString) - }) -_sym_db.RegisterMessage(OneString) - -MoreString = _reflection.GeneratedProtocolMessageType('MoreString', (_message.Message,), { - 'DESCRIPTOR' : _MORESTRING, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.MoreString) - }) -_sym_db.RegisterMessage(MoreString) - -OneBytes = _reflection.GeneratedProtocolMessageType('OneBytes', (_message.Message,), { - 'DESCRIPTOR' : _ONEBYTES, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.OneBytes) - }) -_sym_db.RegisterMessage(OneBytes) - -MoreBytes = _reflection.GeneratedProtocolMessageType('MoreBytes', (_message.Message,), { - 'DESCRIPTOR' : _MOREBYTES, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.MoreBytes) - }) -_sym_db.RegisterMessage(MoreBytes) - -Int32Message = _reflection.GeneratedProtocolMessageType('Int32Message', (_message.Message,), { - 'DESCRIPTOR' : _INT32MESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.Int32Message) - }) -_sym_db.RegisterMessage(Int32Message) - -Uint32Message = _reflection.GeneratedProtocolMessageType('Uint32Message', (_message.Message,), { - 'DESCRIPTOR' : _UINT32MESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.Uint32Message) - }) -_sym_db.RegisterMessage(Uint32Message) - -Int64Message = _reflection.GeneratedProtocolMessageType('Int64Message', (_message.Message,), { - 'DESCRIPTOR' : _INT64MESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.Int64Message) - }) -_sym_db.RegisterMessage(Int64Message) - -Uint64Message = _reflection.GeneratedProtocolMessageType('Uint64Message', (_message.Message,), { - 'DESCRIPTOR' : _UINT64MESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.Uint64Message) - }) -_sym_db.RegisterMessage(Uint64Message) - -BoolMessage = _reflection.GeneratedProtocolMessageType('BoolMessage', (_message.Message,), { - 'DESCRIPTOR' : _BOOLMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.BoolMessage) - }) -_sym_db.RegisterMessage(BoolMessage) - -TestOneof = _reflection.GeneratedProtocolMessageType('TestOneof', (_message.Message,), { - - 'FooGroup' : _reflection.GeneratedProtocolMessageType('FooGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTONEOF_FOOGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneof.FooGroup) - }) - , - 'DESCRIPTOR' : _TESTONEOF, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneof) - }) -_sym_db.RegisterMessage(TestOneof) -_sym_db.RegisterMessage(TestOneof.FooGroup) - -TestOneofBackwardsCompatible = _reflection.GeneratedProtocolMessageType('TestOneofBackwardsCompatible', (_message.Message,), { - - 'FooGroup' : _reflection.GeneratedProtocolMessageType('FooGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTONEOFBACKWARDSCOMPATIBLE_FOOGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneofBackwardsCompatible.FooGroup) - }) - , - 'DESCRIPTOR' : _TESTONEOFBACKWARDSCOMPATIBLE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneofBackwardsCompatible) - }) -_sym_db.RegisterMessage(TestOneofBackwardsCompatible) -_sym_db.RegisterMessage(TestOneofBackwardsCompatible.FooGroup) - -TestOneof2 = _reflection.GeneratedProtocolMessageType('TestOneof2', (_message.Message,), { - - 'FooGroup' : _reflection.GeneratedProtocolMessageType('FooGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTONEOF2_FOOGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneof2.FooGroup) - }) - , - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTONEOF2_NESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneof2.NestedMessage) - }) - , - 'DESCRIPTOR' : _TESTONEOF2, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestOneof2) - }) -_sym_db.RegisterMessage(TestOneof2) -_sym_db.RegisterMessage(TestOneof2.FooGroup) -_sym_db.RegisterMessage(TestOneof2.NestedMessage) - -TestRequiredOneof = _reflection.GeneratedProtocolMessageType('TestRequiredOneof', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTREQUIREDONEOF_NESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequiredOneof.NestedMessage) - }) - , - 'DESCRIPTOR' : _TESTREQUIREDONEOF, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRequiredOneof) - }) -_sym_db.RegisterMessage(TestRequiredOneof) -_sym_db.RegisterMessage(TestRequiredOneof.NestedMessage) - -TestPackedTypes = _reflection.GeneratedProtocolMessageType('TestPackedTypes', (_message.Message,), { - 'DESCRIPTOR' : _TESTPACKEDTYPES, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestPackedTypes) - }) -_sym_db.RegisterMessage(TestPackedTypes) - -TestUnpackedTypes = _reflection.GeneratedProtocolMessageType('TestUnpackedTypes', (_message.Message,), { - 'DESCRIPTOR' : _TESTUNPACKEDTYPES, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestUnpackedTypes) - }) -_sym_db.RegisterMessage(TestUnpackedTypes) - -TestPackedExtensions = _reflection.GeneratedProtocolMessageType('TestPackedExtensions', (_message.Message,), { - 'DESCRIPTOR' : _TESTPACKEDEXTENSIONS, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestPackedExtensions) - }) -_sym_db.RegisterMessage(TestPackedExtensions) - -TestUnpackedExtensions = _reflection.GeneratedProtocolMessageType('TestUnpackedExtensions', (_message.Message,), { - 'DESCRIPTOR' : _TESTUNPACKEDEXTENSIONS, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestUnpackedExtensions) - }) -_sym_db.RegisterMessage(TestUnpackedExtensions) - -TestDynamicExtensions = _reflection.GeneratedProtocolMessageType('TestDynamicExtensions', (_message.Message,), { - - 'DynamicMessageType' : _reflection.GeneratedProtocolMessageType('DynamicMessageType', (_message.Message,), { - 'DESCRIPTOR' : _TESTDYNAMICEXTENSIONS_DYNAMICMESSAGETYPE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestDynamicExtensions.DynamicMessageType) - }) - , - 'DESCRIPTOR' : _TESTDYNAMICEXTENSIONS, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestDynamicExtensions) - }) -_sym_db.RegisterMessage(TestDynamicExtensions) -_sym_db.RegisterMessage(TestDynamicExtensions.DynamicMessageType) - -TestRepeatedScalarDifferentTagSizes = _reflection.GeneratedProtocolMessageType('TestRepeatedScalarDifferentTagSizes', (_message.Message,), { - 'DESCRIPTOR' : _TESTREPEATEDSCALARDIFFERENTTAGSIZES, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRepeatedScalarDifferentTagSizes) - }) -_sym_db.RegisterMessage(TestRepeatedScalarDifferentTagSizes) - -TestParsingMerge = _reflection.GeneratedProtocolMessageType('TestParsingMerge', (_message.Message,), { - - 'RepeatedFieldsGenerator' : _reflection.GeneratedProtocolMessageType('RepeatedFieldsGenerator', (_message.Message,), { - - 'Group1' : _reflection.GeneratedProtocolMessageType('Group1', (_message.Message,), { - 'DESCRIPTOR' : _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP1, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group1) - }) - , - - 'Group2' : _reflection.GeneratedProtocolMessageType('Group2', (_message.Message,), { - 'DESCRIPTOR' : _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP2, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator.Group2) - }) - , - 'DESCRIPTOR' : _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge.RepeatedFieldsGenerator) - }) - , - - 'OptionalGroup' : _reflection.GeneratedProtocolMessageType('OptionalGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTPARSINGMERGE_OPTIONALGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge.OptionalGroup) - }) - , - - 'RepeatedGroup' : _reflection.GeneratedProtocolMessageType('RepeatedGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTPARSINGMERGE_REPEATEDGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge.RepeatedGroup) - }) - , - 'DESCRIPTOR' : _TESTPARSINGMERGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestParsingMerge) - }) -_sym_db.RegisterMessage(TestParsingMerge) -_sym_db.RegisterMessage(TestParsingMerge.RepeatedFieldsGenerator) -_sym_db.RegisterMessage(TestParsingMerge.RepeatedFieldsGenerator.Group1) -_sym_db.RegisterMessage(TestParsingMerge.RepeatedFieldsGenerator.Group2) -_sym_db.RegisterMessage(TestParsingMerge.OptionalGroup) -_sym_db.RegisterMessage(TestParsingMerge.RepeatedGroup) - -TestCommentInjectionMessage = _reflection.GeneratedProtocolMessageType('TestCommentInjectionMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTCOMMENTINJECTIONMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestCommentInjectionMessage) - }) -_sym_db.RegisterMessage(TestCommentInjectionMessage) - -FooRequest = _reflection.GeneratedProtocolMessageType('FooRequest', (_message.Message,), { - 'DESCRIPTOR' : _FOOREQUEST, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.FooRequest) - }) -_sym_db.RegisterMessage(FooRequest) - -FooResponse = _reflection.GeneratedProtocolMessageType('FooResponse', (_message.Message,), { - 'DESCRIPTOR' : _FOORESPONSE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.FooResponse) - }) -_sym_db.RegisterMessage(FooResponse) - -FooClientMessage = _reflection.GeneratedProtocolMessageType('FooClientMessage', (_message.Message,), { - 'DESCRIPTOR' : _FOOCLIENTMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.FooClientMessage) - }) -_sym_db.RegisterMessage(FooClientMessage) - -FooServerMessage = _reflection.GeneratedProtocolMessageType('FooServerMessage', (_message.Message,), { - 'DESCRIPTOR' : _FOOSERVERMESSAGE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.FooServerMessage) - }) -_sym_db.RegisterMessage(FooServerMessage) - -BarRequest = _reflection.GeneratedProtocolMessageType('BarRequest', (_message.Message,), { - 'DESCRIPTOR' : _BARREQUEST, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.BarRequest) - }) -_sym_db.RegisterMessage(BarRequest) - -BarResponse = _reflection.GeneratedProtocolMessageType('BarResponse', (_message.Message,), { - 'DESCRIPTOR' : _BARRESPONSE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.BarResponse) - }) -_sym_db.RegisterMessage(BarResponse) - -TestJsonName = _reflection.GeneratedProtocolMessageType('TestJsonName', (_message.Message,), { - 'DESCRIPTOR' : _TESTJSONNAME, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestJsonName) - }) -_sym_db.RegisterMessage(TestJsonName) - -TestHugeFieldNumbers = _reflection.GeneratedProtocolMessageType('TestHugeFieldNumbers', (_message.Message,), { - - 'OptionalGroup' : _reflection.GeneratedProtocolMessageType('OptionalGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTHUGEFIELDNUMBERS_OPTIONALGROUP, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestHugeFieldNumbers.OptionalGroup) - }) - , - - 'StringStringMapEntry' : _reflection.GeneratedProtocolMessageType('StringStringMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTHUGEFIELDNUMBERS_STRINGSTRINGMAPENTRY, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestHugeFieldNumbers.StringStringMapEntry) - }) - , - 'DESCRIPTOR' : _TESTHUGEFIELDNUMBERS, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestHugeFieldNumbers) - }) -_sym_db.RegisterMessage(TestHugeFieldNumbers) -_sym_db.RegisterMessage(TestHugeFieldNumbers.OptionalGroup) -_sym_db.RegisterMessage(TestHugeFieldNumbers.StringStringMapEntry) - -TestExtensionInsideTable = _reflection.GeneratedProtocolMessageType('TestExtensionInsideTable', (_message.Message,), { - 'DESCRIPTOR' : _TESTEXTENSIONINSIDETABLE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestExtensionInsideTable) - }) -_sym_db.RegisterMessage(TestExtensionInsideTable) - -TestExtensionRangeSerialize = _reflection.GeneratedProtocolMessageType('TestExtensionRangeSerialize', (_message.Message,), { - 'DESCRIPTOR' : _TESTEXTENSIONRANGESERIALIZE, - '__module__' : 'google.protobuf.unittest_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestExtensionRangeSerialize) - }) -_sym_db.RegisterMessage(TestExtensionRangeSerialize) - -_TESTSERVICE = DESCRIPTOR.services_by_name['TestService'] +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.unittest_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: TestAllExtensions.RegisterExtension(optional_int32_extension) TestAllExtensions.RegisterExtension(optional_int64_extension) @@ -1192,6 +49,7 @@ if _descriptor._USE_C_DESCRIPTORS == False: TestAllExtensions.RegisterExtension(optional_cord_extension) TestAllExtensions.RegisterExtension(optional_public_import_message_extension) TestAllExtensions.RegisterExtension(optional_lazy_message_extension) + TestAllExtensions.RegisterExtension(optional_unverified_lazy_message_extension) TestAllExtensions.RegisterExtension(repeated_int32_extension) TestAllExtensions.RegisterExtension(repeated_int64_extension) TestAllExtensions.RegisterExtension(repeated_uint32_extension) @@ -1273,6 +131,7 @@ if _descriptor._USE_C_DESCRIPTORS == False: TestUnpackedExtensions.RegisterExtension(unpacked_enum_extension) TestHugeFieldNumbers.RegisterExtension(test_all_types) TestExtensionInsideTable.RegisterExtension(test_extension_inside_table_extension) + TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup.RegisterExtension(inner) TestAllExtensions.RegisterExtension(_TESTNESTEDEXTENSION.extensions_by_name['test']) TestAllExtensions.RegisterExtension(_TESTNESTEDEXTENSION.extensions_by_name['nested_string_extension']) TestGroupExtension.RegisterExtension(_TESTNESTEDEXTENSION.extensions_by_name['optionalgroup_extension']) @@ -1300,6 +159,8 @@ if _descriptor._USE_C_DESCRIPTORS == False: optional_cord_extension._serialized_options = b'\010\001' optional_lazy_message_extension._options = None optional_lazy_message_extension._serialized_options = b'(\001' + optional_unverified_lazy_message_extension._options = None + optional_unverified_lazy_message_extension._serialized_options = b'x\001' repeated_string_piece_extension._options = None repeated_string_piece_extension._serialized_options = b'\010\002' repeated_cord_extension._options = None @@ -1372,6 +233,8 @@ if _descriptor._USE_C_DESCRIPTORS == False: _TESTALLTYPES.fields_by_name['optional_cord']._serialized_options = b'\010\001' _TESTALLTYPES.fields_by_name['optional_lazy_message']._options = None _TESTALLTYPES.fields_by_name['optional_lazy_message']._serialized_options = b'(\001' + _TESTALLTYPES.fields_by_name['optional_unverified_lazy_message']._options = None + _TESTALLTYPES.fields_by_name['optional_unverified_lazy_message']._serialized_options = b'x\001' _TESTALLTYPES.fields_by_name['repeated_string_piece']._options = None _TESTALLTYPES.fields_by_name['repeated_string_piece']._serialized_options = b'\010\002' _TESTALLTYPES.fields_by_name['repeated_cord']._options = None @@ -1382,6 +245,10 @@ if _descriptor._USE_C_DESCRIPTORS == False: _TESTALLTYPES.fields_by_name['default_string_piece']._serialized_options = b'\010\002' _TESTALLTYPES.fields_by_name['default_cord']._options = None _TESTALLTYPES.fields_by_name['default_cord']._serialized_options = b'\010\001' + _NESTEDTESTALLTYPES.fields_by_name['lazy_child']._options = None + _NESTEDTESTALLTYPES.fields_by_name['lazy_child']._serialized_options = b'(\001' + _NESTEDTESTALLTYPES.fields_by_name['eager_child']._options = None + _NESTEDTESTALLTYPES.fields_by_name['eager_child']._serialized_options = b'(\000' _TESTDEPRECATEDFIELDS.fields_by_name['deprecated_int32']._options = None _TESTDEPRECATEDFIELDS.fields_by_name['deprecated_int32']._serialized_options = b'\030\001' _TESTDEPRECATEDFIELDS.fields_by_name['deprecated_int32_in_oneof']._options = None @@ -1482,223 +349,269 @@ if _descriptor._USE_C_DESCRIPTORS == False: _TESTHUGEFIELDNUMBERS.fields_by_name['repeated_int32']._serialized_options = b'\020\000' _TESTHUGEFIELDNUMBERS.fields_by_name['packed_int32']._options = None _TESTHUGEFIELDNUMBERS.fields_by_name['packed_int32']._serialized_options = b'\020\001' - _FOREIGNENUM._serialized_start=16178 - _FOREIGNENUM._serialized_end=16242 - _TESTENUMWITHDUPVALUE._serialized_start=16244 - _TESTENUMWITHDUPVALUE._serialized_end=16319 - _TESTSPARSEENUM._serialized_start=16322 - _TESTSPARSEENUM._serialized_end=16459 - _VERYLARGEENUM._serialized_start=16462 - _VERYLARGEENUM._serialized_end=18393 + _FOREIGNENUM._serialized_start=21889 + _FOREIGNENUM._serialized_end=21953 + _TESTENUMWITHDUPVALUE._serialized_start=21955 + _TESTENUMWITHDUPVALUE._serialized_end=22030 + _TESTSPARSEENUM._serialized_start=22033 + _TESTSPARSEENUM._serialized_end=22170 + _VERYLARGEENUM._serialized_start=22173 + _VERYLARGEENUM._serialized_end=24104 _TESTALLTYPES._serialized_start=93 - _TESTALLTYPES._serialized_end=3274 - _TESTALLTYPES_NESTEDMESSAGE._serialized_start=3117 - _TESTALLTYPES_NESTEDMESSAGE._serialized_end=3144 - _TESTALLTYPES_OPTIONALGROUP._serialized_start=3146 - _TESTALLTYPES_OPTIONALGROUP._serialized_end=3172 - _TESTALLTYPES_REPEATEDGROUP._serialized_start=3174 - _TESTALLTYPES_REPEATEDGROUP._serialized_end=3200 - _TESTALLTYPES_NESTEDENUM._serialized_start=3202 - _TESTALLTYPES_NESTEDENUM._serialized_end=3259 - _NESTEDTESTALLTYPES._serialized_start=3277 - _NESTEDTESTALLTYPES._serialized_end=3464 - _TESTDEPRECATEDFIELDS._serialized_start=3466 - _TESTDEPRECATEDFIELDS._serialized_end=3575 - _TESTDEPRECATEDMESSAGE._serialized_start=3577 - _TESTDEPRECATEDMESSAGE._serialized_end=3604 - _FOREIGNMESSAGE._serialized_start=3606 - _FOREIGNMESSAGE._serialized_end=3644 - _TESTRESERVEDFIELDS._serialized_start=3646 - _TESTRESERVEDFIELDS._serialized_end=3694 - _TESTALLEXTENSIONS._serialized_start=3696 - _TESTALLEXTENSIONS._serialized_end=3725 - _OPTIONALGROUP_EXTENSION._serialized_start=3727 - _OPTIONALGROUP_EXTENSION._serialized_end=3763 - _REPEATEDGROUP_EXTENSION._serialized_start=3765 - _REPEATEDGROUP_EXTENSION._serialized_end=3801 - _TESTGROUP._serialized_start=3804 - _TESTGROUP._serialized_end=3973 - _TESTGROUP_OPTIONALGROUP._serialized_start=3146 - _TESTGROUP_OPTIONALGROUP._serialized_end=3172 - _TESTGROUPEXTENSION._serialized_start=3975 - _TESTGROUPEXTENSION._serialized_end=4005 - _TESTNESTEDEXTENSION._serialized_start=4008 - _TESTNESTEDEXTENSION._serialized_end=4447 - _TESTNESTEDEXTENSION_OPTIONALGROUP_EXTENSION._serialized_start=3727 - _TESTNESTEDEXTENSION_OPTIONALGROUP_EXTENSION._serialized_end=3763 - _TESTCHILDEXTENSION._serialized_start=4449 - _TESTCHILDEXTENSION._serialized_end=4557 - _TESTREQUIRED._serialized_start=4560 - _TESTREQUIRED._serialized_end=5285 - _TESTREQUIREDFOREIGN._serialized_start=5288 - _TESTREQUIREDFOREIGN._serialized_end=5442 - _TESTREQUIREDMESSAGE._serialized_start=5445 - _TESTREQUIREDMESSAGE._serialized_end=5643 - _TESTFOREIGNNESTED._serialized_start=5645 - _TESTFOREIGNNESTED._serialized_end=5735 - _TESTEMPTYMESSAGE._serialized_start=5737 - _TESTEMPTYMESSAGE._serialized_end=5755 - _TESTEMPTYMESSAGEWITHEXTENSIONS._serialized_start=5757 - _TESTEMPTYMESSAGEWITHEXTENSIONS._serialized_end=5799 - _TESTPICKLENESTEDMESSAGE._serialized_start=5801 - _TESTPICKLENESTEDMESSAGE._serialized_end=5890 - _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE._serialized_start=5828 - _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE._serialized_end=5890 - _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE._serialized_start=5857 - _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE._serialized_end=5890 - _TESTMULTIPLEEXTENSIONRANGES._serialized_start=5892 - _TESTMULTIPLEEXTENSIONRANGES._serialized_end=5947 - _TESTREALLYLARGETAGNUMBER._serialized_start=5949 - _TESTREALLYLARGETAGNUMBER._serialized_end=6001 - _TESTRECURSIVEMESSAGE._serialized_start=6003 - _TESTRECURSIVEMESSAGE._serialized_end=6088 - _TESTMUTUALRECURSIONA._serialized_start=6091 - _TESTMUTUALRECURSIONA._serialized_end=6444 - _TESTMUTUALRECURSIONA_SUBMESSAGE._serialized_start=6236 - _TESTMUTUALRECURSIONA_SUBMESSAGE._serialized_end=6300 - _TESTMUTUALRECURSIONA_SUBGROUP._serialized_start=6303 - _TESTMUTUALRECURSIONA_SUBGROUP._serialized_end=6444 - _TESTMUTUALRECURSIONB._serialized_start=6446 - _TESTMUTUALRECURSIONB._serialized_end=6544 - _TESTISINITIALIZED._serialized_start=6547 - _TESTISINITIALIZED._serialized_end=6749 - _TESTISINITIALIZED_SUBMESSAGE._serialized_start=6638 - _TESTISINITIALIZED_SUBMESSAGE._serialized_end=6749 - _TESTISINITIALIZED_SUBMESSAGE_SUBGROUP._serialized_start=6728 - _TESTISINITIALIZED_SUBMESSAGE_SUBGROUP._serialized_end=6749 - _TESTDUPFIELDNUMBER._serialized_start=6752 - _TESTDUPFIELDNUMBER._serialized_end=6931 - _TESTDUPFIELDNUMBER_FOO._serialized_start=6897 - _TESTDUPFIELDNUMBER_FOO._serialized_end=6913 - _TESTDUPFIELDNUMBER_BAR._serialized_start=6915 - _TESTDUPFIELDNUMBER_BAR._serialized_end=6931 - _TESTEAGERMESSAGE._serialized_start=6933 - _TESTEAGERMESSAGE._serialized_end=7009 - _TESTLAZYMESSAGE._serialized_start=7011 - _TESTLAZYMESSAGE._serialized_end=7086 - _TESTNESTEDMESSAGEHASBITS._serialized_start=7089 - _TESTNESTEDMESSAGEHASBITS._serialized_end=7345 - _TESTNESTEDMESSAGEHASBITS_NESTEDMESSAGE._serialized_start=7210 - _TESTNESTEDMESSAGEHASBITS_NESTEDMESSAGE._serialized_end=7345 - _TESTCAMELCASEFIELDNAMES._serialized_start=7348 - _TESTCAMELCASEFIELDNAMES._serialized_end=7833 - _TESTFIELDORDERINGS._serialized_start=7836 - _TESTFIELDORDERINGS._serialized_end=8049 - _TESTFIELDORDERINGS_NESTEDMESSAGE._serialized_start=7998 - _TESTFIELDORDERINGS_NESTEDMESSAGE._serialized_end=8037 - _TESTEXTENSIONORDERINGS1._serialized_start=8052 - _TESTEXTENSIONORDERINGS1._serialized_end=8208 - _TESTEXTENSIONORDERINGS2._serialized_start=8211 - _TESTEXTENSIONORDERINGS2._serialized_end=8551 - _TESTEXTENSIONORDERINGS2_TESTEXTENSIONORDERINGS3._serialized_start=8258 - _TESTEXTENSIONORDERINGS2_TESTEXTENSIONORDERINGS3._serialized_end=8439 - _TESTEXTREMEDEFAULTVALUES._serialized_start=8554 - _TESTEXTREMEDEFAULTVALUES._serialized_end=9504 - _SPARSEENUMMESSAGE._serialized_start=9506 - _SPARSEENUMMESSAGE._serialized_end=9581 - _ONESTRING._serialized_start=9583 - _ONESTRING._serialized_end=9608 - _MORESTRING._serialized_start=9610 - _MORESTRING._serialized_end=9636 - _ONEBYTES._serialized_start=9638 - _ONEBYTES._serialized_end=9662 - _MOREBYTES._serialized_start=9664 - _MOREBYTES._serialized_end=9689 - _INT32MESSAGE._serialized_start=9691 - _INT32MESSAGE._serialized_end=9719 - _UINT32MESSAGE._serialized_start=9721 - _UINT32MESSAGE._serialized_end=9750 - _INT64MESSAGE._serialized_start=9752 - _INT64MESSAGE._serialized_end=9780 - _UINT64MESSAGE._serialized_start=9782 - _UINT64MESSAGE._serialized_end=9811 - _BOOLMESSAGE._serialized_start=9813 - _BOOLMESSAGE._serialized_end=9840 - _TESTONEOF._serialized_start=9843 - _TESTONEOF._serialized_end=10051 - _TESTONEOF_FOOGROUP._serialized_start=10012 - _TESTONEOF_FOOGROUP._serialized_end=10044 - _TESTONEOFBACKWARDSCOMPATIBLE._serialized_start=10054 - _TESTONEOFBACKWARDSCOMPATIBLE._serialized_end=10285 - _TESTONEOFBACKWARDSCOMPATIBLE_FOOGROUP._serialized_start=10012 - _TESTONEOFBACKWARDSCOMPATIBLE_FOOGROUP._serialized_end=10044 - _TESTONEOF2._serialized_start=10288 - _TESTONEOF2._serialized_end=11269 - _TESTONEOF2_FOOGROUP._serialized_start=11129 - _TESTONEOF2_FOOGROUP._serialized_end=11161 - _TESTONEOF2_NESTEDMESSAGE._serialized_start=11163 - _TESTONEOF2_NESTEDMESSAGE._serialized_end=11214 - _TESTONEOF2_NESTEDENUM._serialized_start=3202 - _TESTONEOF2_NESTEDENUM._serialized_end=3241 - _TESTREQUIREDONEOF._serialized_start=11272 - _TESTREQUIREDONEOF._serialized_end=11456 - _TESTREQUIREDONEOF_NESTEDMESSAGE._serialized_start=11409 - _TESTREQUIREDONEOF_NESTEDMESSAGE._serialized_end=11449 - _TESTPACKEDTYPES._serialized_start=11459 - _TESTPACKEDTYPES._serialized_end=11885 - _TESTUNPACKEDTYPES._serialized_start=11888 - _TESTUNPACKEDTYPES._serialized_end=12344 - _TESTPACKEDEXTENSIONS._serialized_start=12346 - _TESTPACKEDEXTENSIONS._serialized_end=12378 - _TESTUNPACKEDEXTENSIONS._serialized_start=12380 - _TESTUNPACKEDEXTENSIONS._serialized_end=12414 - _TESTDYNAMICEXTENSIONS._serialized_start=12417 - _TESTDYNAMICEXTENSIONS._serialized_end=12954 - _TESTDYNAMICEXTENSIONS_DYNAMICMESSAGETYPE._serialized_start=12837 - _TESTDYNAMICEXTENSIONS_DYNAMICMESSAGETYPE._serialized_end=12881 - _TESTDYNAMICEXTENSIONS_DYNAMICENUMTYPE._serialized_start=12883 - _TESTDYNAMICEXTENSIONS_DYNAMICENUMTYPE._serialized_end=12954 - _TESTREPEATEDSCALARDIFFERENTTAGSIZES._serialized_start=12957 - _TESTREPEATEDSCALARDIFFERENTTAGSIZES._serialized_end=13149 - _TESTPARSINGMERGE._serialized_start=13152 - _TESTPARSINGMERGE._serialized_end=14423 - _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR._serialized_start=13504 - _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR._serialized_end=14058 - _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP1._serialized_start=13942 - _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP1._serialized_end=13999 - _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP2._serialized_start=14001 - _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP2._serialized_end=14058 - _TESTPARSINGMERGE_OPTIONALGROUP._serialized_start=14060 - _TESTPARSINGMERGE_OPTIONALGROUP._serialized_end=14142 - _TESTPARSINGMERGE_REPEATEDGROUP._serialized_start=14144 - _TESTPARSINGMERGE_REPEATEDGROUP._serialized_end=14226 - _TESTCOMMENTINJECTIONMESSAGE._serialized_start=14425 - _TESTCOMMENTINJECTIONMESSAGE._serialized_end=14493 - _FOOREQUEST._serialized_start=14495 - _FOOREQUEST._serialized_end=14507 - _FOORESPONSE._serialized_start=14509 - _FOORESPONSE._serialized_end=14522 - _FOOCLIENTMESSAGE._serialized_start=14524 - _FOOCLIENTMESSAGE._serialized_end=14542 - _FOOSERVERMESSAGE._serialized_start=14544 - _FOOSERVERMESSAGE._serialized_end=14562 - _BARREQUEST._serialized_start=14564 - _BARREQUEST._serialized_end=14576 - _BARRESPONSE._serialized_start=14578 - _BARRESPONSE._serialized_end=14591 - _TESTJSONNAME._serialized_start=14594 - _TESTJSONNAME._serialized_end=14760 - _TESTHUGEFIELDNUMBERS._serialized_start=14763 - _TESTHUGEFIELDNUMBERS._serialized_end=15528 - _TESTHUGEFIELDNUMBERS_OPTIONALGROUP._serialized_start=15407 - _TESTHUGEFIELDNUMBERS_OPTIONALGROUP._serialized_end=15443 - _TESTHUGEFIELDNUMBERS_STRINGSTRINGMAPENTRY._serialized_start=15445 - _TESTHUGEFIELDNUMBERS_STRINGSTRINGMAPENTRY._serialized_end=15499 - _TESTEXTENSIONINSIDETABLE._serialized_start=15531 - _TESTEXTENSIONINSIDETABLE._serialized_end=15708 - _TESTEXTENSIONRANGESERIALIZE._serialized_start=15711 - _TESTEXTENSIONRANGESERIALIZE._serialized_end=16176 - _TESTSERVICE._serialized_start=18396 - _TESTSERVICE._serialized_end=18549 -TestService = service_reflection.GeneratedServiceType('TestService', (_service.Service,), dict( - DESCRIPTOR = _TESTSERVICE, - __module__ = 'google.protobuf.unittest_pb2' - )) - -TestService_Stub = service_reflection.GeneratedServiceStubType('TestService_Stub', (TestService,), dict( - DESCRIPTOR = _TESTSERVICE, - __module__ = 'google.protobuf.unittest_pb2' - )) - - + _TESTALLTYPES._serialized_end=3367 + _TESTALLTYPES_NESTEDMESSAGE._serialized_start=3210 + _TESTALLTYPES_NESTEDMESSAGE._serialized_end=3237 + _TESTALLTYPES_OPTIONALGROUP._serialized_start=3239 + _TESTALLTYPES_OPTIONALGROUP._serialized_end=3265 + _TESTALLTYPES_REPEATEDGROUP._serialized_start=3267 + _TESTALLTYPES_REPEATEDGROUP._serialized_end=3293 + _TESTALLTYPES_NESTEDENUM._serialized_start=3295 + _TESTALLTYPES_NESTEDENUM._serialized_end=3352 + _NESTEDTESTALLTYPES._serialized_start=3370 + _NESTEDTESTALLTYPES._serialized_end=3678 + _TESTDEPRECATEDFIELDS._serialized_start=3680 + _TESTDEPRECATEDFIELDS._serialized_end=3789 + _TESTDEPRECATEDMESSAGE._serialized_start=3791 + _TESTDEPRECATEDMESSAGE._serialized_end=3818 + _FOREIGNMESSAGE._serialized_start=3820 + _FOREIGNMESSAGE._serialized_end=3858 + _TESTRESERVEDFIELDS._serialized_start=3860 + _TESTRESERVEDFIELDS._serialized_end=3908 + _TESTALLEXTENSIONS._serialized_start=3910 + _TESTALLEXTENSIONS._serialized_end=3939 + _OPTIONALGROUP_EXTENSION._serialized_start=3941 + _OPTIONALGROUP_EXTENSION._serialized_end=3977 + _REPEATEDGROUP_EXTENSION._serialized_start=3979 + _REPEATEDGROUP_EXTENSION._serialized_end=4015 + _TESTGROUP._serialized_start=4018 + _TESTGROUP._serialized_end=4187 + _TESTGROUP_OPTIONALGROUP._serialized_start=3239 + _TESTGROUP_OPTIONALGROUP._serialized_end=3265 + _TESTGROUPEXTENSION._serialized_start=4189 + _TESTGROUPEXTENSION._serialized_end=4219 + _TESTNESTEDEXTENSION._serialized_start=4222 + _TESTNESTEDEXTENSION._serialized_end=4661 + _TESTNESTEDEXTENSION_OPTIONALGROUP_EXTENSION._serialized_start=3941 + _TESTNESTEDEXTENSION_OPTIONALGROUP_EXTENSION._serialized_end=3977 + _TESTCHILDEXTENSION._serialized_start=4663 + _TESTCHILDEXTENSION._serialized_end=4771 + _TESTCHILDEXTENSIONDATA._serialized_start=4774 + _TESTCHILDEXTENSIONDATA._serialized_end=5116 + _TESTCHILDEXTENSIONDATA_NESTEDTESTALLEXTENSIONSDATA._serialized_start=4922 + _TESTCHILDEXTENSIONDATA_NESTEDTESTALLEXTENSIONSDATA._serialized_end=5116 + _TESTCHILDEXTENSIONDATA_NESTEDTESTALLEXTENSIONSDATA_NESTEDDYNAMICEXTENSIONS._serialized_start=5069 + _TESTCHILDEXTENSIONDATA_NESTEDTESTALLEXTENSIONSDATA_NESTEDDYNAMICEXTENSIONS._serialized_end=5116 + _TESTNESTEDCHILDEXTENSION._serialized_start=5118 + _TESTNESTEDCHILDEXTENSION._serialized_end=5209 + _TESTNESTEDCHILDEXTENSIONDATA._serialized_start=5211 + _TESTNESTEDCHILDEXTENSIONDATA._serialized_end=5310 + _TESTREQUIRED._serialized_start=5313 + _TESTREQUIRED._serialized_end=6099 + _TESTREQUIREDFOREIGN._serialized_start=6102 + _TESTREQUIREDFOREIGN._serialized_end=6256 + _TESTREQUIREDMESSAGE._serialized_start=6259 + _TESTREQUIREDMESSAGE._serialized_end=6457 + _TESTNESTEDREQUIREDFOREIGN._serialized_start=6460 + _TESTNESTEDREQUIREDFOREIGN._serialized_end=6620 + _TESTFOREIGNNESTED._serialized_start=6622 + _TESTFOREIGNNESTED._serialized_end=6712 + _TESTEMPTYMESSAGE._serialized_start=6714 + _TESTEMPTYMESSAGE._serialized_end=6732 + _TESTEMPTYMESSAGEWITHEXTENSIONS._serialized_start=6734 + _TESTEMPTYMESSAGEWITHEXTENSIONS._serialized_end=6776 + _TESTPICKLENESTEDMESSAGE._serialized_start=6778 + _TESTPICKLENESTEDMESSAGE._serialized_end=6867 + _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE._serialized_start=6805 + _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE._serialized_end=6867 + _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE._serialized_start=6834 + _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE._serialized_end=6867 + _TESTMULTIPLEEXTENSIONRANGES._serialized_start=6869 + _TESTMULTIPLEEXTENSIONRANGES._serialized_end=6924 + _TESTREALLYLARGETAGNUMBER._serialized_start=6926 + _TESTREALLYLARGETAGNUMBER._serialized_end=6978 + _TESTRECURSIVEMESSAGE._serialized_start=6980 + _TESTRECURSIVEMESSAGE._serialized_end=7065 + _TESTMUTUALRECURSIONA._serialized_start=7068 + _TESTMUTUALRECURSIONA._serialized_end=7421 + _TESTMUTUALRECURSIONA_SUBMESSAGE._serialized_start=7213 + _TESTMUTUALRECURSIONA_SUBMESSAGE._serialized_end=7277 + _TESTMUTUALRECURSIONA_SUBGROUP._serialized_start=7280 + _TESTMUTUALRECURSIONA_SUBGROUP._serialized_end=7421 + _TESTMUTUALRECURSIONB._serialized_start=7423 + _TESTMUTUALRECURSIONB._serialized_end=7521 + _TESTISINITIALIZED._serialized_start=7524 + _TESTISINITIALIZED._serialized_end=7726 + _TESTISINITIALIZED_SUBMESSAGE._serialized_start=7615 + _TESTISINITIALIZED_SUBMESSAGE._serialized_end=7726 + _TESTISINITIALIZED_SUBMESSAGE_SUBGROUP._serialized_start=7705 + _TESTISINITIALIZED_SUBMESSAGE_SUBGROUP._serialized_end=7726 + _TESTDUPFIELDNUMBER._serialized_start=7729 + _TESTDUPFIELDNUMBER._serialized_end=7908 + _TESTDUPFIELDNUMBER_FOO._serialized_start=7874 + _TESTDUPFIELDNUMBER_FOO._serialized_end=7890 + _TESTDUPFIELDNUMBER_BAR._serialized_start=7892 + _TESTDUPFIELDNUMBER_BAR._serialized_end=7908 + _TESTEAGERMESSAGE._serialized_start=7910 + _TESTEAGERMESSAGE._serialized_end=7986 + _TESTLAZYMESSAGE._serialized_start=7988 + _TESTLAZYMESSAGE._serialized_end=8063 + _TESTEAGERMAYBELAZY._serialized_start=8066 + _TESTEAGERMAYBELAZY._serialized_end=8337 + _TESTEAGERMAYBELAZY_NESTEDMESSAGE._serialized_start=8270 + _TESTEAGERMAYBELAZY_NESTEDMESSAGE._serialized_end=8337 + _TESTNESTEDMESSAGEHASBITS._serialized_start=8340 + _TESTNESTEDMESSAGEHASBITS._serialized_end=8596 + _TESTNESTEDMESSAGEHASBITS_NESTEDMESSAGE._serialized_start=8461 + _TESTNESTEDMESSAGEHASBITS_NESTEDMESSAGE._serialized_end=8596 + _TESTCAMELCASEFIELDNAMES._serialized_start=8599 + _TESTCAMELCASEFIELDNAMES._serialized_end=9084 + _TESTFIELDORDERINGS._serialized_start=9087 + _TESTFIELDORDERINGS._serialized_end=9300 + _TESTFIELDORDERINGS_NESTEDMESSAGE._serialized_start=9249 + _TESTFIELDORDERINGS_NESTEDMESSAGE._serialized_end=9288 + _TESTEXTENSIONORDERINGS1._serialized_start=9303 + _TESTEXTENSIONORDERINGS1._serialized_end=9459 + _TESTEXTENSIONORDERINGS2._serialized_start=9462 + _TESTEXTENSIONORDERINGS2._serialized_end=9802 + _TESTEXTENSIONORDERINGS2_TESTEXTENSIONORDERINGS3._serialized_start=9509 + _TESTEXTENSIONORDERINGS2_TESTEXTENSIONORDERINGS3._serialized_end=9690 + _TESTEXTREMEDEFAULTVALUES._serialized_start=9805 + _TESTEXTREMEDEFAULTVALUES._serialized_end=10755 + _SPARSEENUMMESSAGE._serialized_start=10757 + _SPARSEENUMMESSAGE._serialized_end=10832 + _ONESTRING._serialized_start=10834 + _ONESTRING._serialized_end=10859 + _MORESTRING._serialized_start=10861 + _MORESTRING._serialized_end=10887 + _ONEBYTES._serialized_start=10889 + _ONEBYTES._serialized_end=10913 + _MOREBYTES._serialized_start=10915 + _MOREBYTES._serialized_end=10940 + _MANYOPTIONALSTRING._serialized_start=10943 + _MANYOPTIONALSTRING._serialized_end=11434 + _INT32MESSAGE._serialized_start=11436 + _INT32MESSAGE._serialized_end=11464 + _UINT32MESSAGE._serialized_start=11466 + _UINT32MESSAGE._serialized_end=11495 + _INT64MESSAGE._serialized_start=11497 + _INT64MESSAGE._serialized_end=11525 + _UINT64MESSAGE._serialized_start=11527 + _UINT64MESSAGE._serialized_end=11556 + _BOOLMESSAGE._serialized_start=11558 + _BOOLMESSAGE._serialized_end=11585 + _TESTONEOF._serialized_start=11588 + _TESTONEOF._serialized_end=11796 + _TESTONEOF_FOOGROUP._serialized_start=11757 + _TESTONEOF_FOOGROUP._serialized_end=11789 + _TESTONEOFBACKWARDSCOMPATIBLE._serialized_start=11799 + _TESTONEOFBACKWARDSCOMPATIBLE._serialized_end=12030 + _TESTONEOFBACKWARDSCOMPATIBLE_FOOGROUP._serialized_start=11757 + _TESTONEOFBACKWARDSCOMPATIBLE_FOOGROUP._serialized_end=11789 + _TESTONEOF2._serialized_start=12033 + _TESTONEOF2._serialized_end=13014 + _TESTONEOF2_FOOGROUP._serialized_start=12874 + _TESTONEOF2_FOOGROUP._serialized_end=12906 + _TESTONEOF2_NESTEDMESSAGE._serialized_start=12908 + _TESTONEOF2_NESTEDMESSAGE._serialized_end=12959 + _TESTONEOF2_NESTEDENUM._serialized_start=3295 + _TESTONEOF2_NESTEDENUM._serialized_end=3334 + _TESTREQUIREDONEOF._serialized_start=13017 + _TESTREQUIREDONEOF._serialized_end=13201 + _TESTREQUIREDONEOF_NESTEDMESSAGE._serialized_start=13154 + _TESTREQUIREDONEOF_NESTEDMESSAGE._serialized_end=13194 + _TESTPACKEDTYPES._serialized_start=13204 + _TESTPACKEDTYPES._serialized_end=13630 + _TESTUNPACKEDTYPES._serialized_start=13633 + _TESTUNPACKEDTYPES._serialized_end=14089 + _TESTPACKEDEXTENSIONS._serialized_start=14091 + _TESTPACKEDEXTENSIONS._serialized_end=14123 + _TESTUNPACKEDEXTENSIONS._serialized_start=14125 + _TESTUNPACKEDEXTENSIONS._serialized_end=14159 + _TESTDYNAMICEXTENSIONS._serialized_start=14162 + _TESTDYNAMICEXTENSIONS._serialized_end=14699 + _TESTDYNAMICEXTENSIONS_DYNAMICMESSAGETYPE._serialized_start=14582 + _TESTDYNAMICEXTENSIONS_DYNAMICMESSAGETYPE._serialized_end=14626 + _TESTDYNAMICEXTENSIONS_DYNAMICENUMTYPE._serialized_start=14628 + _TESTDYNAMICEXTENSIONS_DYNAMICENUMTYPE._serialized_end=14699 + _TESTREPEATEDSCALARDIFFERENTTAGSIZES._serialized_start=14702 + _TESTREPEATEDSCALARDIFFERENTTAGSIZES._serialized_end=14894 + _TESTPARSINGMERGE._serialized_start=14897 + _TESTPARSINGMERGE._serialized_end=16168 + _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR._serialized_start=15249 + _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR._serialized_end=15803 + _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP1._serialized_start=15687 + _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP1._serialized_end=15744 + _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP2._serialized_start=15746 + _TESTPARSINGMERGE_REPEATEDFIELDSGENERATOR_GROUP2._serialized_end=15803 + _TESTPARSINGMERGE_OPTIONALGROUP._serialized_start=15805 + _TESTPARSINGMERGE_OPTIONALGROUP._serialized_end=15887 + _TESTPARSINGMERGE_REPEATEDGROUP._serialized_start=15889 + _TESTPARSINGMERGE_REPEATEDGROUP._serialized_end=15971 + _TESTMERGEEXCEPTION._serialized_start=16170 + _TESTMERGEEXCEPTION._serialized_end=16252 + _TESTCOMMENTINJECTIONMESSAGE._serialized_start=16254 + _TESTCOMMENTINJECTIONMESSAGE._serialized_end=16322 + _TESTMESSAGESIZE._serialized_start=16324 + _TESTMESSAGESIZE._serialized_end=16413 + _FOOREQUEST._serialized_start=16415 + _FOOREQUEST._serialized_end=16427 + _FOORESPONSE._serialized_start=16429 + _FOORESPONSE._serialized_end=16442 + _FOOCLIENTMESSAGE._serialized_start=16444 + _FOOCLIENTMESSAGE._serialized_end=16462 + _FOOSERVERMESSAGE._serialized_start=16464 + _FOOSERVERMESSAGE._serialized_end=16482 + _BARREQUEST._serialized_start=16484 + _BARREQUEST._serialized_end=16496 + _BARRESPONSE._serialized_start=16498 + _BARRESPONSE._serialized_end=16511 + _TESTJSONNAME._serialized_start=16514 + _TESTJSONNAME._serialized_end=16680 + _TESTHUGEFIELDNUMBERS._serialized_start=16683 + _TESTHUGEFIELDNUMBERS._serialized_end=17448 + _TESTHUGEFIELDNUMBERS_OPTIONALGROUP._serialized_start=17327 + _TESTHUGEFIELDNUMBERS_OPTIONALGROUP._serialized_end=17363 + _TESTHUGEFIELDNUMBERS_STRINGSTRINGMAPENTRY._serialized_start=17365 + _TESTHUGEFIELDNUMBERS_STRINGSTRINGMAPENTRY._serialized_end=17419 + _TESTEXTENSIONINSIDETABLE._serialized_start=17451 + _TESTEXTENSIONINSIDETABLE._serialized_end=17628 + _TESTNESTEDGROUPEXTENSIONOUTER._serialized_start=17631 + _TESTNESTEDGROUPEXTENSIONOUTER._serialized_end=18165 + _TESTNESTEDGROUPEXTENSIONOUTER_LAYER1OPTIONALGROUP._serialized_start=17764 + _TESTNESTEDGROUPEXTENSIONOUTER_LAYER1OPTIONALGROUP._serialized_end=18165 + _TESTNESTEDGROUPEXTENSIONOUTER_LAYER1OPTIONALGROUP_LAYER2REPEATEDGROUP._serialized_start=18056 + _TESTNESTEDGROUPEXTENSIONOUTER_LAYER1OPTIONALGROUP_LAYER2REPEATEDGROUP._serialized_end=18106 + _TESTNESTEDGROUPEXTENSIONOUTER_LAYER1OPTIONALGROUP_LAYER2ANOTHEROPTIONALREPEATEDGROUP._serialized_start=18108 + _TESTNESTEDGROUPEXTENSIONOUTER_LAYER1OPTIONALGROUP_LAYER2ANOTHEROPTIONALREPEATEDGROUP._serialized_end=18165 + _TESTNESTEDGROUPEXTENSIONINNEREXTENSION._serialized_start=18167 + _TESTNESTEDGROUPEXTENSIONINNEREXTENSION._serialized_end=18227 + _TESTEXTENSIONRANGESERIALIZE._serialized_start=18230 + _TESTEXTENSIONRANGESERIALIZE._serialized_end=18695 + _TESTVERIFYINT32SIMPLE._serialized_start=18698 + _TESTVERIFYINT32SIMPLE._serialized_end=18827 + _TESTVERIFYINT32._serialized_start=18830 + _TESTVERIFYINT32._serialized_end=19075 + _TESTVERIFYMOSTLYINT32._serialized_start=19078 + _TESTVERIFYMOSTLYINT32._serialized_end=19408 + _TESTVERIFYMOSTLYINT32BIGFIELDNUMBER._serialized_start=19411 + _TESTVERIFYMOSTLYINT32BIGFIELDNUMBER._serialized_end=19784 + _TESTVERIFYUINT32SIMPLE._serialized_start=19787 + _TESTVERIFYUINT32SIMPLE._serialized_end=19921 + _TESTVERIFYUINT32._serialized_start=19924 + _TESTVERIFYUINT32._serialized_end=20174 + _TESTVERIFYONEUINT32._serialized_start=20177 + _TESTVERIFYONEUINT32._serialized_end=20427 + _TESTVERIFYONEINT32BIGFIELDNUMBER._serialized_start=20430 + _TESTVERIFYONEINT32BIGFIELDNUMBER._serialized_end=20719 + _TESTVERIFYINT32BIGFIELDNUMBER._serialized_start=20722 + _TESTVERIFYINT32BIGFIELDNUMBER._serialized_end=21038 + _TESTVERIFYUINT32BIGFIELDNUMBER._serialized_start=21041 + _TESTVERIFYUINT32BIGFIELDNUMBER._serialized_end=21364 + _TESTVERIFYBIGFIELDNUMBERUINT32._serialized_start=21367 + _TESTVERIFYBIGFIELDNUMBERUINT32._serialized_end=21887 + _TESTVERIFYBIGFIELDNUMBERUINT32_NESTED._serialized_start=21485 + _TESTVERIFYBIGFIELDNUMBERUINT32_NESTED._serialized_end=21887 + _TESTSERVICE._serialized_start=24107 + _TESTSERVICE._serialized_end=24260 +_builder.BuildServices(DESCRIPTOR, 'google.protobuf.unittest_pb2', globals()) # @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/unittest_proto3_arena_pb2.py b/windows/python/google/protobuf/unittest_proto3_arena_pb2.py index 810363e4a..0f58add6d 100644 --- a/windows/python/google/protobuf/unittest_proto3_arena_pb2.py +++ b/windows/python/google/protobuf/unittest_proto3_arena_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_proto3_arena.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -20,100 +18,10 @@ except AttributeError: google_dot_protobuf_dot_unittest__import__public__pb2 = google_dot_protobuf_dot_unittest__import__pb2.google.protobuf.unittest_import_public_pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+google/protobuf/unittest_proto3_arena.proto\x12\x15proto3_arena_unittest\x1a%google/protobuf/unittest_import.proto\"\x8c\x19\n\x0cTestAllTypes\x12\x16\n\x0eoptional_int32\x18\x01 \x01(\x05\x12\x16\n\x0eoptional_int64\x18\x02 \x01(\x03\x12\x17\n\x0foptional_uint32\x18\x03 \x01(\r\x12\x17\n\x0foptional_uint64\x18\x04 \x01(\x04\x12\x17\n\x0foptional_sint32\x18\x05 \x01(\x11\x12\x17\n\x0foptional_sint64\x18\x06 \x01(\x12\x12\x18\n\x10optional_fixed32\x18\x07 \x01(\x07\x12\x18\n\x10optional_fixed64\x18\x08 \x01(\x06\x12\x19\n\x11optional_sfixed32\x18\t \x01(\x0f\x12\x19\n\x11optional_sfixed64\x18\n \x01(\x10\x12\x16\n\x0eoptional_float\x18\x0b \x01(\x02\x12\x17\n\x0foptional_double\x18\x0c \x01(\x01\x12\x15\n\roptional_bool\x18\r \x01(\x08\x12\x17\n\x0foptional_string\x18\x0e \x01(\t\x12\x16\n\x0eoptional_bytes\x18\x0f \x01(\x0c\x12R\n\x17optional_nested_message\x18\x12 \x01(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessage\x12G\n\x18optional_foreign_message\x18\x13 \x01(\x0b\x32%.proto3_arena_unittest.ForeignMessage\x12H\n\x17optional_import_message\x18\x14 \x01(\x0b\x32\'.protobuf_unittest_import.ImportMessage\x12L\n\x14optional_nested_enum\x18\x15 \x01(\x0e\x32..proto3_arena_unittest.TestAllTypes.NestedEnum\x12\x41\n\x15optional_foreign_enum\x18\x16 \x01(\x0e\x32\".proto3_arena_unittest.ForeignEnum\x12!\n\x15optional_string_piece\x18\x18 \x01(\tB\x02\x08\x02\x12\x19\n\roptional_cord\x18\x19 \x01(\tB\x02\x08\x01\x12U\n\x1eoptional_public_import_message\x18\x1a \x01(\x0b\x32-.protobuf_unittest_import.PublicImportMessage\x12T\n\x15optional_lazy_message\x18\x1b \x01(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessageB\x02(\x01\x12Q\n\x1coptional_lazy_import_message\x18s \x01(\x0b\x32\'.protobuf_unittest_import.ImportMessageB\x02(\x01\x12\x16\n\x0erepeated_int32\x18\x1f \x03(\x05\x12\x16\n\x0erepeated_int64\x18 \x03(\x03\x12\x17\n\x0frepeated_uint32\x18! \x03(\r\x12\x17\n\x0frepeated_uint64\x18\" \x03(\x04\x12\x17\n\x0frepeated_sint32\x18# \x03(\x11\x12\x17\n\x0frepeated_sint64\x18$ \x03(\x12\x12\x18\n\x10repeated_fixed32\x18% \x03(\x07\x12\x18\n\x10repeated_fixed64\x18& \x03(\x06\x12\x19\n\x11repeated_sfixed32\x18\' \x03(\x0f\x12\x19\n\x11repeated_sfixed64\x18( \x03(\x10\x12\x16\n\x0erepeated_float\x18) \x03(\x02\x12\x17\n\x0frepeated_double\x18* \x03(\x01\x12\x15\n\rrepeated_bool\x18+ \x03(\x08\x12\x17\n\x0frepeated_string\x18, \x03(\t\x12\x16\n\x0erepeated_bytes\x18- \x03(\x0c\x12\"\n\x15proto3_optional_int32\x18t \x01(\x05H\x01\x88\x01\x01\x12\"\n\x15proto3_optional_int64\x18u \x01(\x03H\x02\x88\x01\x01\x12#\n\x16proto3_optional_uint32\x18v \x01(\rH\x03\x88\x01\x01\x12#\n\x16proto3_optional_uint64\x18w \x01(\x04H\x04\x88\x01\x01\x12#\n\x16proto3_optional_sint32\x18x \x01(\x11H\x05\x88\x01\x01\x12#\n\x16proto3_optional_sint64\x18y \x01(\x12H\x06\x88\x01\x01\x12$\n\x17proto3_optional_fixed32\x18z \x01(\x07H\x07\x88\x01\x01\x12$\n\x17proto3_optional_fixed64\x18{ \x01(\x06H\x08\x88\x01\x01\x12%\n\x18proto3_optional_sfixed32\x18| \x01(\x0fH\t\x88\x01\x01\x12%\n\x18proto3_optional_sfixed64\x18} \x01(\x10H\n\x88\x01\x01\x12\"\n\x15proto3_optional_float\x18~ \x01(\x02H\x0b\x88\x01\x01\x12#\n\x16proto3_optional_double\x18\x7f \x01(\x01H\x0c\x88\x01\x01\x12\"\n\x14proto3_optional_bool\x18\x80\x01 \x01(\x08H\r\x88\x01\x01\x12$\n\x16proto3_optional_string\x18\x81\x01 \x01(\tH\x0e\x88\x01\x01\x12#\n\x15proto3_optional_bytes\x18\x82\x01 \x01(\x0cH\x0f\x88\x01\x01\x12R\n\x17repeated_nested_message\x18\x30 \x03(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessage\x12G\n\x18repeated_foreign_message\x18\x31 \x03(\x0b\x32%.proto3_arena_unittest.ForeignMessage\x12H\n\x17repeated_import_message\x18\x32 \x03(\x0b\x32\'.protobuf_unittest_import.ImportMessage\x12L\n\x14repeated_nested_enum\x18\x33 \x03(\x0e\x32..proto3_arena_unittest.TestAllTypes.NestedEnum\x12\x41\n\x15repeated_foreign_enum\x18\x34 \x03(\x0e\x32\".proto3_arena_unittest.ForeignEnum\x12!\n\x15repeated_string_piece\x18\x36 \x03(\tB\x02\x08\x02\x12\x19\n\rrepeated_cord\x18\x37 \x03(\tB\x02\x08\x01\x12T\n\x15repeated_lazy_message\x18\x39 \x03(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessageB\x02(\x01\x12\x16\n\x0coneof_uint32\x18o \x01(\rH\x00\x12Q\n\x14oneof_nested_message\x18p \x01(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessageH\x00\x12\x16\n\x0coneof_string\x18q \x01(\tH\x00\x12\x15\n\x0boneof_bytes\x18r \x01(\x0cH\x00\x1a\x1b\n\rNestedMessage\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05\"C\n\nNestedEnum\x12\x08\n\x04ZERO\x10\x00\x12\x07\n\x03\x46OO\x10\x01\x12\x07\n\x03\x42\x41R\x10\x02\x12\x07\n\x03\x42\x41Z\x10\x03\x12\x10\n\x03NEG\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x42\r\n\x0boneof_fieldB\x18\n\x16_proto3_optional_int32B\x18\n\x16_proto3_optional_int64B\x19\n\x17_proto3_optional_uint32B\x19\n\x17_proto3_optional_uint64B\x19\n\x17_proto3_optional_sint32B\x19\n\x17_proto3_optional_sint64B\x1a\n\x18_proto3_optional_fixed32B\x1a\n\x18_proto3_optional_fixed64B\x1b\n\x19_proto3_optional_sfixed32B\x1b\n\x19_proto3_optional_sfixed64B\x18\n\x16_proto3_optional_floatB\x19\n\x17_proto3_optional_doubleB\x17\n\x15_proto3_optional_boolB\x19\n\x17_proto3_optional_stringB\x18\n\x16_proto3_optional_bytes\"\xae\x03\n\x0fTestPackedTypes\x12\x18\n\x0cpacked_int32\x18Z \x03(\x05\x42\x02\x10\x01\x12\x18\n\x0cpacked_int64\x18[ \x03(\x03\x42\x02\x10\x01\x12\x19\n\rpacked_uint32\x18\\ \x03(\rB\x02\x10\x01\x12\x19\n\rpacked_uint64\x18] \x03(\x04\x42\x02\x10\x01\x12\x19\n\rpacked_sint32\x18^ \x03(\x11\x42\x02\x10\x01\x12\x19\n\rpacked_sint64\x18_ \x03(\x12\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed32\x18` \x03(\x07\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed64\x18\x61 \x03(\x06\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed32\x18\x62 \x03(\x0f\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed64\x18\x63 \x03(\x10\x42\x02\x10\x01\x12\x18\n\x0cpacked_float\x18\x64 \x03(\x02\x42\x02\x10\x01\x12\x19\n\rpacked_double\x18\x65 \x03(\x01\x42\x02\x10\x01\x12\x17\n\x0bpacked_bool\x18\x66 \x03(\x08\x42\x02\x10\x01\x12;\n\x0bpacked_enum\x18g \x03(\x0e\x32\".proto3_arena_unittest.ForeignEnumB\x02\x10\x01\"\xdf\x03\n\x11TestUnpackedTypes\x12\x1a\n\x0erepeated_int32\x18\x01 \x03(\x05\x42\x02\x10\x00\x12\x1a\n\x0erepeated_int64\x18\x02 \x03(\x03\x42\x02\x10\x00\x12\x1b\n\x0frepeated_uint32\x18\x03 \x03(\rB\x02\x10\x00\x12\x1b\n\x0frepeated_uint64\x18\x04 \x03(\x04\x42\x02\x10\x00\x12\x1b\n\x0frepeated_sint32\x18\x05 \x03(\x11\x42\x02\x10\x00\x12\x1b\n\x0frepeated_sint64\x18\x06 \x03(\x12\x42\x02\x10\x00\x12\x1c\n\x10repeated_fixed32\x18\x07 \x03(\x07\x42\x02\x10\x00\x12\x1c\n\x10repeated_fixed64\x18\x08 \x03(\x06\x42\x02\x10\x00\x12\x1d\n\x11repeated_sfixed32\x18\t \x03(\x0f\x42\x02\x10\x00\x12\x1d\n\x11repeated_sfixed64\x18\n \x03(\x10\x42\x02\x10\x00\x12\x1a\n\x0erepeated_float\x18\x0b \x03(\x02\x42\x02\x10\x00\x12\x1b\n\x0frepeated_double\x18\x0c \x03(\x01\x42\x02\x10\x00\x12\x19\n\rrepeated_bool\x18\r \x03(\x08\x42\x02\x10\x00\x12P\n\x14repeated_nested_enum\x18\x0e \x03(\x0e\x32..proto3_arena_unittest.TestAllTypes.NestedEnumB\x02\x10\x00\"\xc7\x01\n\x12NestedTestAllTypes\x12\x38\n\x05\x63hild\x18\x01 \x01(\x0b\x32).proto3_arena_unittest.NestedTestAllTypes\x12\x34\n\x07payload\x18\x02 \x01(\x0b\x32#.proto3_arena_unittest.TestAllTypes\x12\x41\n\x0erepeated_child\x18\x03 \x03(\x0b\x32).proto3_arena_unittest.NestedTestAllTypes\"\x1b\n\x0e\x46oreignMessage\x12\t\n\x01\x63\x18\x01 \x01(\x05\"\x12\n\x10TestEmptyMessage\"Y\n\x17TestPickleNestedMessage\x1a>\n\rNestedMessage\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05\x1a!\n\x13NestedNestedMessage\x12\n\n\x02\x63\x63\x18\x01 \x01(\x05*R\n\x0b\x46oreignEnum\x12\x10\n\x0c\x46OREIGN_ZERO\x10\x00\x12\x0f\n\x0b\x46OREIGN_FOO\x10\x04\x12\x0f\n\x0b\x46OREIGN_BAR\x10\x05\x12\x0f\n\x0b\x46OREIGN_BAZ\x10\x06\x42\x03\xf8\x01\x01\x62\x06proto3') - -_FOREIGNENUM = DESCRIPTOR.enum_types_by_name['ForeignEnum'] -ForeignEnum = enum_type_wrapper.EnumTypeWrapper(_FOREIGNENUM) -FOREIGN_ZERO = 0 -FOREIGN_FOO = 4 -FOREIGN_BAR = 5 -FOREIGN_BAZ = 6 - - -_TESTALLTYPES = DESCRIPTOR.message_types_by_name['TestAllTypes'] -_TESTALLTYPES_NESTEDMESSAGE = _TESTALLTYPES.nested_types_by_name['NestedMessage'] -_TESTPACKEDTYPES = DESCRIPTOR.message_types_by_name['TestPackedTypes'] -_TESTUNPACKEDTYPES = DESCRIPTOR.message_types_by_name['TestUnpackedTypes'] -_NESTEDTESTALLTYPES = DESCRIPTOR.message_types_by_name['NestedTestAllTypes'] -_FOREIGNMESSAGE = DESCRIPTOR.message_types_by_name['ForeignMessage'] -_TESTEMPTYMESSAGE = DESCRIPTOR.message_types_by_name['TestEmptyMessage'] -_TESTPICKLENESTEDMESSAGE = DESCRIPTOR.message_types_by_name['TestPickleNestedMessage'] -_TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE = _TESTPICKLENESTEDMESSAGE.nested_types_by_name['NestedMessage'] -_TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE = _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE.nested_types_by_name['NestedNestedMessage'] -_TESTALLTYPES_NESTEDENUM = _TESTALLTYPES.enum_types_by_name['NestedEnum'] -TestAllTypes = _reflection.GeneratedProtocolMessageType('TestAllTypes', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTALLTYPES_NESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_proto3_arena_pb2' - # @@protoc_insertion_point(class_scope:proto3_arena_unittest.TestAllTypes.NestedMessage) - }) - , - 'DESCRIPTOR' : _TESTALLTYPES, - '__module__' : 'google.protobuf.unittest_proto3_arena_pb2' - # @@protoc_insertion_point(class_scope:proto3_arena_unittest.TestAllTypes) - }) -_sym_db.RegisterMessage(TestAllTypes) -_sym_db.RegisterMessage(TestAllTypes.NestedMessage) - -TestPackedTypes = _reflection.GeneratedProtocolMessageType('TestPackedTypes', (_message.Message,), { - 'DESCRIPTOR' : _TESTPACKEDTYPES, - '__module__' : 'google.protobuf.unittest_proto3_arena_pb2' - # @@protoc_insertion_point(class_scope:proto3_arena_unittest.TestPackedTypes) - }) -_sym_db.RegisterMessage(TestPackedTypes) - -TestUnpackedTypes = _reflection.GeneratedProtocolMessageType('TestUnpackedTypes', (_message.Message,), { - 'DESCRIPTOR' : _TESTUNPACKEDTYPES, - '__module__' : 'google.protobuf.unittest_proto3_arena_pb2' - # @@protoc_insertion_point(class_scope:proto3_arena_unittest.TestUnpackedTypes) - }) -_sym_db.RegisterMessage(TestUnpackedTypes) - -NestedTestAllTypes = _reflection.GeneratedProtocolMessageType('NestedTestAllTypes', (_message.Message,), { - 'DESCRIPTOR' : _NESTEDTESTALLTYPES, - '__module__' : 'google.protobuf.unittest_proto3_arena_pb2' - # @@protoc_insertion_point(class_scope:proto3_arena_unittest.NestedTestAllTypes) - }) -_sym_db.RegisterMessage(NestedTestAllTypes) - -ForeignMessage = _reflection.GeneratedProtocolMessageType('ForeignMessage', (_message.Message,), { - 'DESCRIPTOR' : _FOREIGNMESSAGE, - '__module__' : 'google.protobuf.unittest_proto3_arena_pb2' - # @@protoc_insertion_point(class_scope:proto3_arena_unittest.ForeignMessage) - }) -_sym_db.RegisterMessage(ForeignMessage) - -TestEmptyMessage = _reflection.GeneratedProtocolMessageType('TestEmptyMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTEMPTYMESSAGE, - '__module__' : 'google.protobuf.unittest_proto3_arena_pb2' - # @@protoc_insertion_point(class_scope:proto3_arena_unittest.TestEmptyMessage) - }) -_sym_db.RegisterMessage(TestEmptyMessage) - -TestPickleNestedMessage = _reflection.GeneratedProtocolMessageType('TestPickleNestedMessage', (_message.Message,), { - - 'NestedMessage' : _reflection.GeneratedProtocolMessageType('NestedMessage', (_message.Message,), { - - 'NestedNestedMessage' : _reflection.GeneratedProtocolMessageType('NestedNestedMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_proto3_arena_pb2' - # @@protoc_insertion_point(class_scope:proto3_arena_unittest.TestPickleNestedMessage.NestedMessage.NestedNestedMessage) - }) - , - 'DESCRIPTOR' : _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_proto3_arena_pb2' - # @@protoc_insertion_point(class_scope:proto3_arena_unittest.TestPickleNestedMessage.NestedMessage) - }) - , - 'DESCRIPTOR' : _TESTPICKLENESTEDMESSAGE, - '__module__' : 'google.protobuf.unittest_proto3_arena_pb2' - # @@protoc_insertion_point(class_scope:proto3_arena_unittest.TestPickleNestedMessage) - }) -_sym_db.RegisterMessage(TestPickleNestedMessage) -_sym_db.RegisterMessage(TestPickleNestedMessage.NestedMessage) -_sym_db.RegisterMessage(TestPickleNestedMessage.NestedMessage.NestedNestedMessage) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+google/protobuf/unittest_proto3_arena.proto\x12\x15proto3_arena_unittest\x1a%google/protobuf/unittest_import.proto\"\xed\x19\n\x0cTestAllTypes\x12\x16\n\x0eoptional_int32\x18\x01 \x01(\x05\x12\x16\n\x0eoptional_int64\x18\x02 \x01(\x03\x12\x17\n\x0foptional_uint32\x18\x03 \x01(\r\x12\x17\n\x0foptional_uint64\x18\x04 \x01(\x04\x12\x17\n\x0foptional_sint32\x18\x05 \x01(\x11\x12\x17\n\x0foptional_sint64\x18\x06 \x01(\x12\x12\x18\n\x10optional_fixed32\x18\x07 \x01(\x07\x12\x18\n\x10optional_fixed64\x18\x08 \x01(\x06\x12\x19\n\x11optional_sfixed32\x18\t \x01(\x0f\x12\x19\n\x11optional_sfixed64\x18\n \x01(\x10\x12\x16\n\x0eoptional_float\x18\x0b \x01(\x02\x12\x17\n\x0foptional_double\x18\x0c \x01(\x01\x12\x15\n\roptional_bool\x18\r \x01(\x08\x12\x17\n\x0foptional_string\x18\x0e \x01(\t\x12\x16\n\x0eoptional_bytes\x18\x0f \x01(\x0c\x12R\n\x17optional_nested_message\x18\x12 \x01(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessage\x12G\n\x18optional_foreign_message\x18\x13 \x01(\x0b\x32%.proto3_arena_unittest.ForeignMessage\x12H\n\x17optional_import_message\x18\x14 \x01(\x0b\x32\'.protobuf_unittest_import.ImportMessage\x12L\n\x14optional_nested_enum\x18\x15 \x01(\x0e\x32..proto3_arena_unittest.TestAllTypes.NestedEnum\x12\x41\n\x15optional_foreign_enum\x18\x16 \x01(\x0e\x32\".proto3_arena_unittest.ForeignEnum\x12!\n\x15optional_string_piece\x18\x18 \x01(\tB\x02\x08\x02\x12\x19\n\roptional_cord\x18\x19 \x01(\tB\x02\x08\x01\x12U\n\x1eoptional_public_import_message\x18\x1a \x01(\x0b\x32-.protobuf_unittest_import.PublicImportMessage\x12T\n\x15optional_lazy_message\x18\x1b \x01(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessageB\x02(\x01\x12_\n optional_unverified_lazy_message\x18\x1c \x01(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessageB\x02x\x01\x12Q\n\x1coptional_lazy_import_message\x18s \x01(\x0b\x32\'.protobuf_unittest_import.ImportMessageB\x02(\x01\x12\x16\n\x0erepeated_int32\x18\x1f \x03(\x05\x12\x16\n\x0erepeated_int64\x18 \x03(\x03\x12\x17\n\x0frepeated_uint32\x18! \x03(\r\x12\x17\n\x0frepeated_uint64\x18\" \x03(\x04\x12\x17\n\x0frepeated_sint32\x18# \x03(\x11\x12\x17\n\x0frepeated_sint64\x18$ \x03(\x12\x12\x18\n\x10repeated_fixed32\x18% \x03(\x07\x12\x18\n\x10repeated_fixed64\x18& \x03(\x06\x12\x19\n\x11repeated_sfixed32\x18\' \x03(\x0f\x12\x19\n\x11repeated_sfixed64\x18( \x03(\x10\x12\x16\n\x0erepeated_float\x18) \x03(\x02\x12\x17\n\x0frepeated_double\x18* \x03(\x01\x12\x15\n\rrepeated_bool\x18+ \x03(\x08\x12\x17\n\x0frepeated_string\x18, \x03(\t\x12\x16\n\x0erepeated_bytes\x18- \x03(\x0c\x12\"\n\x15proto3_optional_int32\x18t \x01(\x05H\x01\x88\x01\x01\x12\"\n\x15proto3_optional_int64\x18u \x01(\x03H\x02\x88\x01\x01\x12#\n\x16proto3_optional_uint32\x18v \x01(\rH\x03\x88\x01\x01\x12#\n\x16proto3_optional_uint64\x18w \x01(\x04H\x04\x88\x01\x01\x12#\n\x16proto3_optional_sint32\x18x \x01(\x11H\x05\x88\x01\x01\x12#\n\x16proto3_optional_sint64\x18y \x01(\x12H\x06\x88\x01\x01\x12$\n\x17proto3_optional_fixed32\x18z \x01(\x07H\x07\x88\x01\x01\x12$\n\x17proto3_optional_fixed64\x18{ \x01(\x06H\x08\x88\x01\x01\x12%\n\x18proto3_optional_sfixed32\x18| \x01(\x0fH\t\x88\x01\x01\x12%\n\x18proto3_optional_sfixed64\x18} \x01(\x10H\n\x88\x01\x01\x12\"\n\x15proto3_optional_float\x18~ \x01(\x02H\x0b\x88\x01\x01\x12#\n\x16proto3_optional_double\x18\x7f \x01(\x01H\x0c\x88\x01\x01\x12\"\n\x14proto3_optional_bool\x18\x80\x01 \x01(\x08H\r\x88\x01\x01\x12$\n\x16proto3_optional_string\x18\x81\x01 \x01(\tH\x0e\x88\x01\x01\x12#\n\x15proto3_optional_bytes\x18\x82\x01 \x01(\x0cH\x0f\x88\x01\x01\x12R\n\x17repeated_nested_message\x18\x30 \x03(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessage\x12G\n\x18repeated_foreign_message\x18\x31 \x03(\x0b\x32%.proto3_arena_unittest.ForeignMessage\x12H\n\x17repeated_import_message\x18\x32 \x03(\x0b\x32\'.protobuf_unittest_import.ImportMessage\x12L\n\x14repeated_nested_enum\x18\x33 \x03(\x0e\x32..proto3_arena_unittest.TestAllTypes.NestedEnum\x12\x41\n\x15repeated_foreign_enum\x18\x34 \x03(\x0e\x32\".proto3_arena_unittest.ForeignEnum\x12!\n\x15repeated_string_piece\x18\x36 \x03(\tB\x02\x08\x02\x12\x19\n\rrepeated_cord\x18\x37 \x03(\tB\x02\x08\x01\x12T\n\x15repeated_lazy_message\x18\x39 \x03(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessageB\x02(\x01\x12\x16\n\x0coneof_uint32\x18o \x01(\rH\x00\x12Q\n\x14oneof_nested_message\x18p \x01(\x0b\x32\x31.proto3_arena_unittest.TestAllTypes.NestedMessageH\x00\x12\x16\n\x0coneof_string\x18q \x01(\tH\x00\x12\x15\n\x0boneof_bytes\x18r \x01(\x0cH\x00\x1a\x1b\n\rNestedMessage\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05\"C\n\nNestedEnum\x12\x08\n\x04ZERO\x10\x00\x12\x07\n\x03\x46OO\x10\x01\x12\x07\n\x03\x42\x41R\x10\x02\x12\x07\n\x03\x42\x41Z\x10\x03\x12\x10\n\x03NEG\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x42\r\n\x0boneof_fieldB\x18\n\x16_proto3_optional_int32B\x18\n\x16_proto3_optional_int64B\x19\n\x17_proto3_optional_uint32B\x19\n\x17_proto3_optional_uint64B\x19\n\x17_proto3_optional_sint32B\x19\n\x17_proto3_optional_sint64B\x1a\n\x18_proto3_optional_fixed32B\x1a\n\x18_proto3_optional_fixed64B\x1b\n\x19_proto3_optional_sfixed32B\x1b\n\x19_proto3_optional_sfixed64B\x18\n\x16_proto3_optional_floatB\x19\n\x17_proto3_optional_doubleB\x17\n\x15_proto3_optional_boolB\x19\n\x17_proto3_optional_stringB\x18\n\x16_proto3_optional_bytes\"\xae\x03\n\x0fTestPackedTypes\x12\x18\n\x0cpacked_int32\x18Z \x03(\x05\x42\x02\x10\x01\x12\x18\n\x0cpacked_int64\x18[ \x03(\x03\x42\x02\x10\x01\x12\x19\n\rpacked_uint32\x18\\ \x03(\rB\x02\x10\x01\x12\x19\n\rpacked_uint64\x18] \x03(\x04\x42\x02\x10\x01\x12\x19\n\rpacked_sint32\x18^ \x03(\x11\x42\x02\x10\x01\x12\x19\n\rpacked_sint64\x18_ \x03(\x12\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed32\x18` \x03(\x07\x42\x02\x10\x01\x12\x1a\n\x0epacked_fixed64\x18\x61 \x03(\x06\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed32\x18\x62 \x03(\x0f\x42\x02\x10\x01\x12\x1b\n\x0fpacked_sfixed64\x18\x63 \x03(\x10\x42\x02\x10\x01\x12\x18\n\x0cpacked_float\x18\x64 \x03(\x02\x42\x02\x10\x01\x12\x19\n\rpacked_double\x18\x65 \x03(\x01\x42\x02\x10\x01\x12\x17\n\x0bpacked_bool\x18\x66 \x03(\x08\x42\x02\x10\x01\x12;\n\x0bpacked_enum\x18g \x03(\x0e\x32\".proto3_arena_unittest.ForeignEnumB\x02\x10\x01\"\xdf\x03\n\x11TestUnpackedTypes\x12\x1a\n\x0erepeated_int32\x18\x01 \x03(\x05\x42\x02\x10\x00\x12\x1a\n\x0erepeated_int64\x18\x02 \x03(\x03\x42\x02\x10\x00\x12\x1b\n\x0frepeated_uint32\x18\x03 \x03(\rB\x02\x10\x00\x12\x1b\n\x0frepeated_uint64\x18\x04 \x03(\x04\x42\x02\x10\x00\x12\x1b\n\x0frepeated_sint32\x18\x05 \x03(\x11\x42\x02\x10\x00\x12\x1b\n\x0frepeated_sint64\x18\x06 \x03(\x12\x42\x02\x10\x00\x12\x1c\n\x10repeated_fixed32\x18\x07 \x03(\x07\x42\x02\x10\x00\x12\x1c\n\x10repeated_fixed64\x18\x08 \x03(\x06\x42\x02\x10\x00\x12\x1d\n\x11repeated_sfixed32\x18\t \x03(\x0f\x42\x02\x10\x00\x12\x1d\n\x11repeated_sfixed64\x18\n \x03(\x10\x42\x02\x10\x00\x12\x1a\n\x0erepeated_float\x18\x0b \x03(\x02\x42\x02\x10\x00\x12\x1b\n\x0frepeated_double\x18\x0c \x03(\x01\x42\x02\x10\x00\x12\x19\n\rrepeated_bool\x18\r \x03(\x08\x42\x02\x10\x00\x12P\n\x14repeated_nested_enum\x18\x0e \x03(\x0e\x32..proto3_arena_unittest.TestAllTypes.NestedEnumB\x02\x10\x00\"\xc7\x01\n\x12NestedTestAllTypes\x12\x38\n\x05\x63hild\x18\x01 \x01(\x0b\x32).proto3_arena_unittest.NestedTestAllTypes\x12\x34\n\x07payload\x18\x02 \x01(\x0b\x32#.proto3_arena_unittest.TestAllTypes\x12\x41\n\x0erepeated_child\x18\x03 \x03(\x0b\x32).proto3_arena_unittest.NestedTestAllTypes\"\x1b\n\x0e\x46oreignMessage\x12\t\n\x01\x63\x18\x01 \x01(\x05\"\x12\n\x10TestEmptyMessage\"Y\n\x17TestPickleNestedMessage\x1a>\n\rNestedMessage\x12\n\n\x02\x62\x62\x18\x01 \x01(\x05\x1a!\n\x13NestedNestedMessage\x12\n\n\x02\x63\x63\x18\x01 \x01(\x05*R\n\x0b\x46oreignEnum\x12\x10\n\x0c\x46OREIGN_ZERO\x10\x00\x12\x0f\n\x0b\x46OREIGN_FOO\x10\x04\x12\x0f\n\x0b\x46OREIGN_BAR\x10\x05\x12\x0f\n\x0b\x46OREIGN_BAZ\x10\x06\x42\x03\xf8\x01\x01\x62\x06proto3') +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.unittest_proto3_arena_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None @@ -124,6 +32,8 @@ if _descriptor._USE_C_DESCRIPTORS == False: _TESTALLTYPES.fields_by_name['optional_cord']._serialized_options = b'\010\001' _TESTALLTYPES.fields_by_name['optional_lazy_message']._options = None _TESTALLTYPES.fields_by_name['optional_lazy_message']._serialized_options = b'(\001' + _TESTALLTYPES.fields_by_name['optional_unverified_lazy_message']._options = None + _TESTALLTYPES.fields_by_name['optional_unverified_lazy_message']._serialized_options = b'x\001' _TESTALLTYPES.fields_by_name['optional_lazy_import_message']._options = None _TESTALLTYPES.fields_by_name['optional_lazy_import_message']._serialized_options = b'(\001' _TESTALLTYPES.fields_by_name['repeated_string_piece']._options = None @@ -188,28 +98,28 @@ if _descriptor._USE_C_DESCRIPTORS == False: _TESTUNPACKEDTYPES.fields_by_name['repeated_bool']._serialized_options = b'\020\000' _TESTUNPACKEDTYPES.fields_by_name['repeated_nested_enum']._options = None _TESTUNPACKEDTYPES.fields_by_name['repeated_nested_enum']._serialized_options = b'\020\000' - _FOREIGNENUM._serialized_start=4581 - _FOREIGNENUM._serialized_end=4663 + _FOREIGNENUM._serialized_start=4678 + _FOREIGNENUM._serialized_end=4760 _TESTALLTYPES._serialized_start=110 - _TESTALLTYPES._serialized_end=3322 - _TESTALLTYPES_NESTEDMESSAGE._serialized_start=2806 - _TESTALLTYPES_NESTEDMESSAGE._serialized_end=2833 - _TESTALLTYPES_NESTEDENUM._serialized_start=2835 - _TESTALLTYPES_NESTEDENUM._serialized_end=2902 - _TESTPACKEDTYPES._serialized_start=3325 - _TESTPACKEDTYPES._serialized_end=3755 - _TESTUNPACKEDTYPES._serialized_start=3758 - _TESTUNPACKEDTYPES._serialized_end=4237 - _NESTEDTESTALLTYPES._serialized_start=4240 - _NESTEDTESTALLTYPES._serialized_end=4439 - _FOREIGNMESSAGE._serialized_start=4441 - _FOREIGNMESSAGE._serialized_end=4468 - _TESTEMPTYMESSAGE._serialized_start=4470 - _TESTEMPTYMESSAGE._serialized_end=4488 - _TESTPICKLENESTEDMESSAGE._serialized_start=4490 - _TESTPICKLENESTEDMESSAGE._serialized_end=4579 - _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE._serialized_start=4517 - _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE._serialized_end=4579 - _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE._serialized_start=4546 - _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE._serialized_end=4579 + _TESTALLTYPES._serialized_end=3419 + _TESTALLTYPES_NESTEDMESSAGE._serialized_start=2903 + _TESTALLTYPES_NESTEDMESSAGE._serialized_end=2930 + _TESTALLTYPES_NESTEDENUM._serialized_start=2932 + _TESTALLTYPES_NESTEDENUM._serialized_end=2999 + _TESTPACKEDTYPES._serialized_start=3422 + _TESTPACKEDTYPES._serialized_end=3852 + _TESTUNPACKEDTYPES._serialized_start=3855 + _TESTUNPACKEDTYPES._serialized_end=4334 + _NESTEDTESTALLTYPES._serialized_start=4337 + _NESTEDTESTALLTYPES._serialized_end=4536 + _FOREIGNMESSAGE._serialized_start=4538 + _FOREIGNMESSAGE._serialized_end=4565 + _TESTEMPTYMESSAGE._serialized_start=4567 + _TESTEMPTYMESSAGE._serialized_end=4585 + _TESTPICKLENESTEDMESSAGE._serialized_start=4587 + _TESTPICKLENESTEDMESSAGE._serialized_end=4676 + _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE._serialized_start=4614 + _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE._serialized_end=4676 + _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE._serialized_start=4643 + _TESTPICKLENESTEDMESSAGE_NESTEDMESSAGE_NESTEDNESTEDMESSAGE._serialized_end=4676 # @@protoc_insertion_point(module_scope) diff --git a/windows/python/google/protobuf/unknown_fields.py b/windows/python/google/protobuf/unknown_fields.py new file mode 100644 index 000000000..3bd828619 --- /dev/null +++ b/windows/python/google/protobuf/unknown_fields.py @@ -0,0 +1,120 @@ +# Protocol Buffers - Google's data interchange format +# Copyright 2008 Google Inc. All rights reserved. +# https://developers.google.com/protocol-buffers/ +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Contains Unknown Fields APIs. + +Simple usage example: + unknown_field_set = UnknownFieldSet(message) + for unknown_field in unknown_field_set: + wire_type = unknown_field.wire_type + field_number = unknown_field.field_number + data = unknown_field.data +""" + + +from google.protobuf.internal import api_implementation + +if api_implementation._c_module is not None: # pylint: disable=protected-access + UnknownFieldSet = api_implementation._c_module.UnknownFieldSet # pylint: disable=protected-access +else: + from google.protobuf.internal import decoder # pylint: disable=g-import-not-at-top + from google.protobuf.internal import wire_format # pylint: disable=g-import-not-at-top + + class UnknownField: + """A parsed unknown field.""" + + # Disallows assignment to other attributes. + __slots__ = ['_field_number', '_wire_type', '_data'] + + def __init__(self, field_number, wire_type, data): + self._field_number = field_number + self._wire_type = wire_type + self._data = data + return + + @property + def field_number(self): + return self._field_number + + @property + def wire_type(self): + return self._wire_type + + @property + def data(self): + return self._data + + class UnknownFieldSet: + """UnknownField container.""" + + # Disallows assignment to other attributes. + __slots__ = ['_values'] + + def __init__(self, msg): + + def InternalAdd(field_number, wire_type, data): + unknown_field = UnknownField(field_number, wire_type, data) + self._values.append(unknown_field) + + self._values = [] + msg_des = msg.DESCRIPTOR + # pylint: disable=protected-access + unknown_fields = msg._unknown_fields + if (msg_des.has_options and + msg_des.GetOptions().message_set_wire_format): + local_decoder = decoder.UnknownMessageSetItemDecoder() + for _, buffer in unknown_fields: + (field_number, data) = local_decoder(memoryview(buffer)) + InternalAdd(field_number, wire_format.WIRETYPE_LENGTH_DELIMITED, data) + else: + for tag_bytes, buffer in unknown_fields: + # pylint: disable=protected-access + (tag, _) = decoder._DecodeVarint(tag_bytes, 0) + field_number, wire_type = wire_format.UnpackTag(tag) + if field_number == 0: + raise RuntimeError('Field number 0 is illegal.') + (data, _) = decoder._DecodeUnknownField( + memoryview(buffer), 0, wire_type) + InternalAdd(field_number, wire_type, data) + + def __getitem__(self, index): + size = len(self._values) + if index < 0: + index += size + if index < 0 or index >= size: + raise IndexError('index %d out of range'.index) + + return self._values[index] + + def __len__(self): + return len(self._values) + + def __iter__(self): + return iter(self._values) diff --git a/windows/python/google/protobuf/util/json_format_pb2.py b/windows/python/google/protobuf/util/json_format_pb2.py index f312e6478..66a5836c8 100644 --- a/windows/python/google/protobuf/util/json_format_pb2.py +++ b/windows/python/google/protobuf/util/json_format_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/util/json_format.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -17,170 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&google/protobuf/util/json_format.proto\x12\x11protobuf_unittest\"\x89\x01\n\x13TestFlagsAndStrings\x12\t\n\x01\x41\x18\x01 \x02(\x05\x12K\n\rrepeatedgroup\x18\x02 \x03(\n24.protobuf_unittest.TestFlagsAndStrings.RepeatedGroup\x1a\x1a\n\rRepeatedGroup\x12\t\n\x01\x66\x18\x03 \x02(\t\"!\n\x14TestBase64ByteArrays\x12\t\n\x01\x61\x18\x01 \x02(\x0c\"G\n\x12TestJavaScriptJSON\x12\t\n\x01\x61\x18\x01 \x01(\x05\x12\r\n\x05\x66inal\x18\x02 \x01(\x02\x12\n\n\x02in\x18\x03 \x01(\t\x12\x0b\n\x03Var\x18\x04 \x01(\t\"Q\n\x18TestJavaScriptOrderJSON1\x12\t\n\x01\x64\x18\x01 \x01(\x05\x12\t\n\x01\x63\x18\x02 \x01(\x05\x12\t\n\x01x\x18\x03 \x01(\x08\x12\t\n\x01\x62\x18\x04 \x01(\x05\x12\t\n\x01\x61\x18\x05 \x01(\x05\"\x89\x01\n\x18TestJavaScriptOrderJSON2\x12\t\n\x01\x64\x18\x01 \x01(\x05\x12\t\n\x01\x63\x18\x02 \x01(\x05\x12\t\n\x01x\x18\x03 \x01(\x08\x12\t\n\x01\x62\x18\x04 \x01(\x05\x12\t\n\x01\x61\x18\x05 \x01(\x05\x12\x36\n\x01z\x18\x06 \x03(\x0b\x32+.protobuf_unittest.TestJavaScriptOrderJSON1\"$\n\x0cTestLargeInt\x12\t\n\x01\x61\x18\x01 \x02(\x03\x12\t\n\x01\x62\x18\x02 \x02(\x04\"\xa0\x01\n\x0bTestNumbers\x12\x30\n\x01\x61\x18\x01 \x01(\x0e\x32%.protobuf_unittest.TestNumbers.MyType\x12\t\n\x01\x62\x18\x02 \x01(\x05\x12\t\n\x01\x63\x18\x03 \x01(\x02\x12\t\n\x01\x64\x18\x04 \x01(\x08\x12\t\n\x01\x65\x18\x05 \x01(\x01\x12\t\n\x01\x66\x18\x06 \x01(\r\"(\n\x06MyType\x12\x06\n\x02OK\x10\x00\x12\x0b\n\x07WARNING\x10\x01\x12\t\n\x05\x45RROR\x10\x02\"T\n\rTestCamelCase\x12\x14\n\x0cnormal_field\x18\x01 \x01(\t\x12\x15\n\rCAPITAL_FIELD\x18\x02 \x01(\x05\x12\x16\n\x0e\x43\x61melCaseField\x18\x03 \x01(\x05\"|\n\x0bTestBoolMap\x12=\n\x08\x62ool_map\x18\x01 \x03(\x0b\x32+.protobuf_unittest.TestBoolMap.BoolMapEntry\x1a.\n\x0c\x42oolMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"O\n\rTestRecursion\x12\r\n\x05value\x18\x01 \x01(\x05\x12/\n\x05\x63hild\x18\x02 \x01(\x0b\x32 .protobuf_unittest.TestRecursion\"\x86\x01\n\rTestStringMap\x12\x43\n\nstring_map\x18\x01 \x03(\x0b\x32/.protobuf_unittest.TestStringMap.StringMapEntry\x1a\x30\n\x0eStringMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc4\x01\n\x14TestStringSerializer\x12\x15\n\rscalar_string\x18\x01 \x01(\t\x12\x17\n\x0frepeated_string\x18\x02 \x03(\t\x12J\n\nstring_map\x18\x03 \x03(\x0b\x32\x36.protobuf_unittest.TestStringSerializer.StringMapEntry\x1a\x30\n\x0eStringMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"$\n\x18TestMessageWithExtension*\x08\x08\x64\x10\x80\x80\x80\x80\x02\"z\n\rTestExtension\x12\r\n\x05value\x18\x01 \x01(\t2Z\n\x03\x65xt\x12+.protobuf_unittest.TestMessageWithExtension\x18\x64 \x01(\x0b\x32 .protobuf_unittest.TestExtension\"Q\n\x14TestDefaultEnumValue\x12\x39\n\nenum_value\x18\x01 \x01(\x0e\x32\x1c.protobuf_unittest.EnumValue:\x07\x44\x45\x46\x41ULT*2\n\tEnumValue\x12\x0c\n\x08PROTOCOL\x10\x00\x12\n\n\x06\x42UFFER\x10\x01\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x02') -_ENUMVALUE = DESCRIPTOR.enum_types_by_name['EnumValue'] -EnumValue = enum_type_wrapper.EnumTypeWrapper(_ENUMVALUE) -PROTOCOL = 0 -BUFFER = 1 -DEFAULT = 2 - - -_TESTFLAGSANDSTRINGS = DESCRIPTOR.message_types_by_name['TestFlagsAndStrings'] -_TESTFLAGSANDSTRINGS_REPEATEDGROUP = _TESTFLAGSANDSTRINGS.nested_types_by_name['RepeatedGroup'] -_TESTBASE64BYTEARRAYS = DESCRIPTOR.message_types_by_name['TestBase64ByteArrays'] -_TESTJAVASCRIPTJSON = DESCRIPTOR.message_types_by_name['TestJavaScriptJSON'] -_TESTJAVASCRIPTORDERJSON1 = DESCRIPTOR.message_types_by_name['TestJavaScriptOrderJSON1'] -_TESTJAVASCRIPTORDERJSON2 = DESCRIPTOR.message_types_by_name['TestJavaScriptOrderJSON2'] -_TESTLARGEINT = DESCRIPTOR.message_types_by_name['TestLargeInt'] -_TESTNUMBERS = DESCRIPTOR.message_types_by_name['TestNumbers'] -_TESTCAMELCASE = DESCRIPTOR.message_types_by_name['TestCamelCase'] -_TESTBOOLMAP = DESCRIPTOR.message_types_by_name['TestBoolMap'] -_TESTBOOLMAP_BOOLMAPENTRY = _TESTBOOLMAP.nested_types_by_name['BoolMapEntry'] -_TESTRECURSION = DESCRIPTOR.message_types_by_name['TestRecursion'] -_TESTSTRINGMAP = DESCRIPTOR.message_types_by_name['TestStringMap'] -_TESTSTRINGMAP_STRINGMAPENTRY = _TESTSTRINGMAP.nested_types_by_name['StringMapEntry'] -_TESTSTRINGSERIALIZER = DESCRIPTOR.message_types_by_name['TestStringSerializer'] -_TESTSTRINGSERIALIZER_STRINGMAPENTRY = _TESTSTRINGSERIALIZER.nested_types_by_name['StringMapEntry'] -_TESTMESSAGEWITHEXTENSION = DESCRIPTOR.message_types_by_name['TestMessageWithExtension'] -_TESTEXTENSION = DESCRIPTOR.message_types_by_name['TestExtension'] -_TESTDEFAULTENUMVALUE = DESCRIPTOR.message_types_by_name['TestDefaultEnumValue'] -_TESTNUMBERS_MYTYPE = _TESTNUMBERS.enum_types_by_name['MyType'] -TestFlagsAndStrings = _reflection.GeneratedProtocolMessageType('TestFlagsAndStrings', (_message.Message,), { - - 'RepeatedGroup' : _reflection.GeneratedProtocolMessageType('RepeatedGroup', (_message.Message,), { - 'DESCRIPTOR' : _TESTFLAGSANDSTRINGS_REPEATEDGROUP, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestFlagsAndStrings.RepeatedGroup) - }) - , - 'DESCRIPTOR' : _TESTFLAGSANDSTRINGS, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestFlagsAndStrings) - }) -_sym_db.RegisterMessage(TestFlagsAndStrings) -_sym_db.RegisterMessage(TestFlagsAndStrings.RepeatedGroup) - -TestBase64ByteArrays = _reflection.GeneratedProtocolMessageType('TestBase64ByteArrays', (_message.Message,), { - 'DESCRIPTOR' : _TESTBASE64BYTEARRAYS, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestBase64ByteArrays) - }) -_sym_db.RegisterMessage(TestBase64ByteArrays) - -TestJavaScriptJSON = _reflection.GeneratedProtocolMessageType('TestJavaScriptJSON', (_message.Message,), { - 'DESCRIPTOR' : _TESTJAVASCRIPTJSON, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestJavaScriptJSON) - }) -_sym_db.RegisterMessage(TestJavaScriptJSON) - -TestJavaScriptOrderJSON1 = _reflection.GeneratedProtocolMessageType('TestJavaScriptOrderJSON1', (_message.Message,), { - 'DESCRIPTOR' : _TESTJAVASCRIPTORDERJSON1, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestJavaScriptOrderJSON1) - }) -_sym_db.RegisterMessage(TestJavaScriptOrderJSON1) - -TestJavaScriptOrderJSON2 = _reflection.GeneratedProtocolMessageType('TestJavaScriptOrderJSON2', (_message.Message,), { - 'DESCRIPTOR' : _TESTJAVASCRIPTORDERJSON2, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestJavaScriptOrderJSON2) - }) -_sym_db.RegisterMessage(TestJavaScriptOrderJSON2) - -TestLargeInt = _reflection.GeneratedProtocolMessageType('TestLargeInt', (_message.Message,), { - 'DESCRIPTOR' : _TESTLARGEINT, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestLargeInt) - }) -_sym_db.RegisterMessage(TestLargeInt) - -TestNumbers = _reflection.GeneratedProtocolMessageType('TestNumbers', (_message.Message,), { - 'DESCRIPTOR' : _TESTNUMBERS, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestNumbers) - }) -_sym_db.RegisterMessage(TestNumbers) - -TestCamelCase = _reflection.GeneratedProtocolMessageType('TestCamelCase', (_message.Message,), { - 'DESCRIPTOR' : _TESTCAMELCASE, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestCamelCase) - }) -_sym_db.RegisterMessage(TestCamelCase) - -TestBoolMap = _reflection.GeneratedProtocolMessageType('TestBoolMap', (_message.Message,), { - - 'BoolMapEntry' : _reflection.GeneratedProtocolMessageType('BoolMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTBOOLMAP_BOOLMAPENTRY, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestBoolMap.BoolMapEntry) - }) - , - 'DESCRIPTOR' : _TESTBOOLMAP, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestBoolMap) - }) -_sym_db.RegisterMessage(TestBoolMap) -_sym_db.RegisterMessage(TestBoolMap.BoolMapEntry) - -TestRecursion = _reflection.GeneratedProtocolMessageType('TestRecursion', (_message.Message,), { - 'DESCRIPTOR' : _TESTRECURSION, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestRecursion) - }) -_sym_db.RegisterMessage(TestRecursion) - -TestStringMap = _reflection.GeneratedProtocolMessageType('TestStringMap', (_message.Message,), { - - 'StringMapEntry' : _reflection.GeneratedProtocolMessageType('StringMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTSTRINGMAP_STRINGMAPENTRY, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestStringMap.StringMapEntry) - }) - , - 'DESCRIPTOR' : _TESTSTRINGMAP, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestStringMap) - }) -_sym_db.RegisterMessage(TestStringMap) -_sym_db.RegisterMessage(TestStringMap.StringMapEntry) - -TestStringSerializer = _reflection.GeneratedProtocolMessageType('TestStringSerializer', (_message.Message,), { - - 'StringMapEntry' : _reflection.GeneratedProtocolMessageType('StringMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTSTRINGSERIALIZER_STRINGMAPENTRY, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestStringSerializer.StringMapEntry) - }) - , - 'DESCRIPTOR' : _TESTSTRINGSERIALIZER, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestStringSerializer) - }) -_sym_db.RegisterMessage(TestStringSerializer) -_sym_db.RegisterMessage(TestStringSerializer.StringMapEntry) - -TestMessageWithExtension = _reflection.GeneratedProtocolMessageType('TestMessageWithExtension', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGEWITHEXTENSION, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestMessageWithExtension) - }) -_sym_db.RegisterMessage(TestMessageWithExtension) - -TestExtension = _reflection.GeneratedProtocolMessageType('TestExtension', (_message.Message,), { - 'DESCRIPTOR' : _TESTEXTENSION, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestExtension) - }) -_sym_db.RegisterMessage(TestExtension) - -TestDefaultEnumValue = _reflection.GeneratedProtocolMessageType('TestDefaultEnumValue', (_message.Message,), { - 'DESCRIPTOR' : _TESTDEFAULTENUMVALUE, - '__module__' : 'google.protobuf.util.json_format_pb2' - # @@protoc_insertion_point(class_scope:protobuf_unittest.TestDefaultEnumValue) - }) -_sym_db.RegisterMessage(TestDefaultEnumValue) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.util.json_format_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: TestMessageWithExtension.RegisterExtension(_TESTEXTENSION.extensions_by_name['ext']) diff --git a/windows/python/google/protobuf/util/json_format_proto3_pb2.py b/windows/python/google/protobuf/util/json_format_proto3_pb2.py index b20b8f52b..5498deafa 100644 --- a/windows/python/google/protobuf/util/json_format_proto3_pb2.py +++ b/windows/python/google/protobuf/util/json_format_proto3_pb2.py @@ -2,11 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/util/json_format_proto3.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -24,291 +22,8 @@ from google.protobuf import unittest_pb2 as google_dot_protobuf_dot_unittest__pb DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-google/protobuf/util/json_format_proto3.proto\x12\x06proto3\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1egoogle/protobuf/unittest.proto\"\x1c\n\x0bMessageType\x12\r\n\x05value\x18\x01 \x01(\x05\"\x94\x05\n\x0bTestMessage\x12\x12\n\nbool_value\x18\x01 \x01(\x08\x12\x13\n\x0bint32_value\x18\x02 \x01(\x05\x12\x13\n\x0bint64_value\x18\x03 \x01(\x03\x12\x14\n\x0cuint32_value\x18\x04 \x01(\r\x12\x14\n\x0cuint64_value\x18\x05 \x01(\x04\x12\x13\n\x0b\x66loat_value\x18\x06 \x01(\x02\x12\x14\n\x0c\x64ouble_value\x18\x07 \x01(\x01\x12\x14\n\x0cstring_value\x18\x08 \x01(\t\x12\x13\n\x0b\x62ytes_value\x18\t \x01(\x0c\x12$\n\nenum_value\x18\n \x01(\x0e\x32\x10.proto3.EnumType\x12*\n\rmessage_value\x18\x0b \x01(\x0b\x32\x13.proto3.MessageType\x12\x1b\n\x13repeated_bool_value\x18\x15 \x03(\x08\x12\x1c\n\x14repeated_int32_value\x18\x16 \x03(\x05\x12\x1c\n\x14repeated_int64_value\x18\x17 \x03(\x03\x12\x1d\n\x15repeated_uint32_value\x18\x18 \x03(\r\x12\x1d\n\x15repeated_uint64_value\x18\x19 \x03(\x04\x12\x1c\n\x14repeated_float_value\x18\x1a \x03(\x02\x12\x1d\n\x15repeated_double_value\x18\x1b \x03(\x01\x12\x1d\n\x15repeated_string_value\x18\x1c \x03(\t\x12\x1c\n\x14repeated_bytes_value\x18\x1d \x03(\x0c\x12-\n\x13repeated_enum_value\x18\x1e \x03(\x0e\x32\x10.proto3.EnumType\x12\x33\n\x16repeated_message_value\x18\x1f \x03(\x0b\x32\x13.proto3.MessageType\"\x8c\x02\n\tTestOneof\x12\x1b\n\x11oneof_int32_value\x18\x01 \x01(\x05H\x00\x12\x1c\n\x12oneof_string_value\x18\x02 \x01(\tH\x00\x12\x1b\n\x11oneof_bytes_value\x18\x03 \x01(\x0cH\x00\x12,\n\x10oneof_enum_value\x18\x04 \x01(\x0e\x32\x10.proto3.EnumTypeH\x00\x12\x32\n\x13oneof_message_value\x18\x05 \x01(\x0b\x32\x13.proto3.MessageTypeH\x00\x12\x36\n\x10oneof_null_value\x18\x06 \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x42\r\n\x0boneof_value\"\xe1\x04\n\x07TestMap\x12.\n\x08\x62ool_map\x18\x01 \x03(\x0b\x32\x1c.proto3.TestMap.BoolMapEntry\x12\x30\n\tint32_map\x18\x02 \x03(\x0b\x32\x1d.proto3.TestMap.Int32MapEntry\x12\x30\n\tint64_map\x18\x03 \x03(\x0b\x32\x1d.proto3.TestMap.Int64MapEntry\x12\x32\n\nuint32_map\x18\x04 \x03(\x0b\x32\x1e.proto3.TestMap.Uint32MapEntry\x12\x32\n\nuint64_map\x18\x05 \x03(\x0b\x32\x1e.proto3.TestMap.Uint64MapEntry\x12\x32\n\nstring_map\x18\x06 \x03(\x0b\x32\x1e.proto3.TestMap.StringMapEntry\x1a.\n\x0c\x42oolMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a/\n\rInt32MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a/\n\rInt64MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x30\n\x0eUint32MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x30\n\x0eUint64MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x30\n\x0eStringMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"\x85\x06\n\rTestNestedMap\x12\x34\n\x08\x62ool_map\x18\x01 \x03(\x0b\x32\".proto3.TestNestedMap.BoolMapEntry\x12\x36\n\tint32_map\x18\x02 \x03(\x0b\x32#.proto3.TestNestedMap.Int32MapEntry\x12\x36\n\tint64_map\x18\x03 \x03(\x0b\x32#.proto3.TestNestedMap.Int64MapEntry\x12\x38\n\nuint32_map\x18\x04 \x03(\x0b\x32$.proto3.TestNestedMap.Uint32MapEntry\x12\x38\n\nuint64_map\x18\x05 \x03(\x0b\x32$.proto3.TestNestedMap.Uint64MapEntry\x12\x38\n\nstring_map\x18\x06 \x03(\x0b\x32$.proto3.TestNestedMap.StringMapEntry\x12\x32\n\x07map_map\x18\x07 \x03(\x0b\x32!.proto3.TestNestedMap.MapMapEntry\x1a.\n\x0c\x42oolMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a/\n\rInt32MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a/\n\rInt64MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x30\n\x0eUint32MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x30\n\x0eUint64MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x30\n\x0eStringMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x44\n\x0bMapMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.proto3.TestNestedMap:\x02\x38\x01\"{\n\rTestStringMap\x12\x38\n\nstring_map\x18\x01 \x03(\x0b\x32$.proto3.TestStringMap.StringMapEntry\x1a\x30\n\x0eStringMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xee\x07\n\x0bTestWrapper\x12.\n\nbool_value\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x30\n\x0bint32_value\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x30\n\x0bint64_value\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x32\n\x0cuint32_value\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x32\n\x0cuint64_value\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.UInt64Value\x12\x30\n\x0b\x66loat_value\x18\x06 \x01(\x0b\x32\x1b.google.protobuf.FloatValue\x12\x32\n\x0c\x64ouble_value\x18\x07 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x32\n\x0cstring_value\x18\x08 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12\x30\n\x0b\x62ytes_value\x18\t \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x12\x37\n\x13repeated_bool_value\x18\x0b \x03(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x39\n\x14repeated_int32_value\x18\x0c \x03(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x39\n\x14repeated_int64_value\x18\r \x03(\x0b\x32\x1b.google.protobuf.Int64Value\x12;\n\x15repeated_uint32_value\x18\x0e \x03(\x0b\x32\x1c.google.protobuf.UInt32Value\x12;\n\x15repeated_uint64_value\x18\x0f \x03(\x0b\x32\x1c.google.protobuf.UInt64Value\x12\x39\n\x14repeated_float_value\x18\x10 \x03(\x0b\x32\x1b.google.protobuf.FloatValue\x12;\n\x15repeated_double_value\x18\x11 \x03(\x0b\x32\x1c.google.protobuf.DoubleValue\x12;\n\x15repeated_string_value\x18\x12 \x03(\x0b\x32\x1c.google.protobuf.StringValue\x12\x39\n\x14repeated_bytes_value\x18\x13 \x03(\x0b\x32\x1b.google.protobuf.BytesValue\"n\n\rTestTimestamp\x12)\n\x05value\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0erepeated_value\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\"k\n\x0cTestDuration\x12(\n\x05value\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x31\n\x0erepeated_value\x18\x02 \x03(\x0b\x32\x19.google.protobuf.Duration\":\n\rTestFieldMask\x12)\n\x05value\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"e\n\nTestStruct\x12&\n\x05value\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12/\n\x0erepeated_value\x18\x02 \x03(\x0b\x32\x17.google.protobuf.Struct\"\\\n\x07TestAny\x12#\n\x05value\x18\x01 \x01(\x0b\x32\x14.google.protobuf.Any\x12,\n\x0erepeated_value\x18\x02 \x03(\x0b\x32\x14.google.protobuf.Any\"b\n\tTestValue\x12%\n\x05value\x18\x01 \x01(\x0b\x32\x16.google.protobuf.Value\x12.\n\x0erepeated_value\x18\x02 \x03(\x0b\x32\x16.google.protobuf.Value\"n\n\rTestListValue\x12)\n\x05value\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.ListValue\x12\x32\n\x0erepeated_value\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.ListValue\"\x89\x01\n\rTestBoolValue\x12\x12\n\nbool_value\x18\x01 \x01(\x08\x12\x34\n\x08\x62ool_map\x18\x02 \x03(\x0b\x32\".proto3.TestBoolValue.BoolMapEntry\x1a.\n\x0c\x42oolMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\x08\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"+\n\x12TestCustomJsonName\x12\x15\n\x05value\x18\x01 \x01(\x05R\x06@value\"J\n\x0eTestExtensions\x12\x38\n\nextensions\x18\x01 \x01(\x0b\x32$.protobuf_unittest.TestAllExtensions\"\x84\x01\n\rTestEnumValue\x12%\n\x0b\x65num_value1\x18\x01 \x01(\x0e\x32\x10.proto3.EnumType\x12%\n\x0b\x65num_value2\x18\x02 \x01(\x0e\x32\x10.proto3.EnumType\x12%\n\x0b\x65num_value3\x18\x03 \x01(\x0e\x32\x10.proto3.EnumType*\x1c\n\x08\x45numType\x12\x07\n\x03\x46OO\x10\x00\x12\x07\n\x03\x42\x41R\x10\x01\x42,\n\x18\x63om.google.protobuf.utilB\x10JsonFormatProto3b\x06proto3') -_ENUMTYPE = DESCRIPTOR.enum_types_by_name['EnumType'] -EnumType = enum_type_wrapper.EnumTypeWrapper(_ENUMTYPE) -FOO = 0 -BAR = 1 - - -_MESSAGETYPE = DESCRIPTOR.message_types_by_name['MessageType'] -_TESTMESSAGE = DESCRIPTOR.message_types_by_name['TestMessage'] -_TESTONEOF = DESCRIPTOR.message_types_by_name['TestOneof'] -_TESTMAP = DESCRIPTOR.message_types_by_name['TestMap'] -_TESTMAP_BOOLMAPENTRY = _TESTMAP.nested_types_by_name['BoolMapEntry'] -_TESTMAP_INT32MAPENTRY = _TESTMAP.nested_types_by_name['Int32MapEntry'] -_TESTMAP_INT64MAPENTRY = _TESTMAP.nested_types_by_name['Int64MapEntry'] -_TESTMAP_UINT32MAPENTRY = _TESTMAP.nested_types_by_name['Uint32MapEntry'] -_TESTMAP_UINT64MAPENTRY = _TESTMAP.nested_types_by_name['Uint64MapEntry'] -_TESTMAP_STRINGMAPENTRY = _TESTMAP.nested_types_by_name['StringMapEntry'] -_TESTNESTEDMAP = DESCRIPTOR.message_types_by_name['TestNestedMap'] -_TESTNESTEDMAP_BOOLMAPENTRY = _TESTNESTEDMAP.nested_types_by_name['BoolMapEntry'] -_TESTNESTEDMAP_INT32MAPENTRY = _TESTNESTEDMAP.nested_types_by_name['Int32MapEntry'] -_TESTNESTEDMAP_INT64MAPENTRY = _TESTNESTEDMAP.nested_types_by_name['Int64MapEntry'] -_TESTNESTEDMAP_UINT32MAPENTRY = _TESTNESTEDMAP.nested_types_by_name['Uint32MapEntry'] -_TESTNESTEDMAP_UINT64MAPENTRY = _TESTNESTEDMAP.nested_types_by_name['Uint64MapEntry'] -_TESTNESTEDMAP_STRINGMAPENTRY = _TESTNESTEDMAP.nested_types_by_name['StringMapEntry'] -_TESTNESTEDMAP_MAPMAPENTRY = _TESTNESTEDMAP.nested_types_by_name['MapMapEntry'] -_TESTSTRINGMAP = DESCRIPTOR.message_types_by_name['TestStringMap'] -_TESTSTRINGMAP_STRINGMAPENTRY = _TESTSTRINGMAP.nested_types_by_name['StringMapEntry'] -_TESTWRAPPER = DESCRIPTOR.message_types_by_name['TestWrapper'] -_TESTTIMESTAMP = DESCRIPTOR.message_types_by_name['TestTimestamp'] -_TESTDURATION = DESCRIPTOR.message_types_by_name['TestDuration'] -_TESTFIELDMASK = DESCRIPTOR.message_types_by_name['TestFieldMask'] -_TESTSTRUCT = DESCRIPTOR.message_types_by_name['TestStruct'] -_TESTANY = DESCRIPTOR.message_types_by_name['TestAny'] -_TESTVALUE = DESCRIPTOR.message_types_by_name['TestValue'] -_TESTLISTVALUE = DESCRIPTOR.message_types_by_name['TestListValue'] -_TESTBOOLVALUE = DESCRIPTOR.message_types_by_name['TestBoolValue'] -_TESTBOOLVALUE_BOOLMAPENTRY = _TESTBOOLVALUE.nested_types_by_name['BoolMapEntry'] -_TESTCUSTOMJSONNAME = DESCRIPTOR.message_types_by_name['TestCustomJsonName'] -_TESTEXTENSIONS = DESCRIPTOR.message_types_by_name['TestExtensions'] -_TESTENUMVALUE = DESCRIPTOR.message_types_by_name['TestEnumValue'] -MessageType = _reflection.GeneratedProtocolMessageType('MessageType', (_message.Message,), { - 'DESCRIPTOR' : _MESSAGETYPE, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.MessageType) - }) -_sym_db.RegisterMessage(MessageType) - -TestMessage = _reflection.GeneratedProtocolMessageType('TestMessage', (_message.Message,), { - 'DESCRIPTOR' : _TESTMESSAGE, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestMessage) - }) -_sym_db.RegisterMessage(TestMessage) - -TestOneof = _reflection.GeneratedProtocolMessageType('TestOneof', (_message.Message,), { - 'DESCRIPTOR' : _TESTONEOF, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestOneof) - }) -_sym_db.RegisterMessage(TestOneof) - -TestMap = _reflection.GeneratedProtocolMessageType('TestMap', (_message.Message,), { - - 'BoolMapEntry' : _reflection.GeneratedProtocolMessageType('BoolMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_BOOLMAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestMap.BoolMapEntry) - }) - , - - 'Int32MapEntry' : _reflection.GeneratedProtocolMessageType('Int32MapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_INT32MAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestMap.Int32MapEntry) - }) - , - - 'Int64MapEntry' : _reflection.GeneratedProtocolMessageType('Int64MapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_INT64MAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestMap.Int64MapEntry) - }) - , - - 'Uint32MapEntry' : _reflection.GeneratedProtocolMessageType('Uint32MapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_UINT32MAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestMap.Uint32MapEntry) - }) - , - - 'Uint64MapEntry' : _reflection.GeneratedProtocolMessageType('Uint64MapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_UINT64MAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestMap.Uint64MapEntry) - }) - , - - 'StringMapEntry' : _reflection.GeneratedProtocolMessageType('StringMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTMAP_STRINGMAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestMap.StringMapEntry) - }) - , - 'DESCRIPTOR' : _TESTMAP, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestMap) - }) -_sym_db.RegisterMessage(TestMap) -_sym_db.RegisterMessage(TestMap.BoolMapEntry) -_sym_db.RegisterMessage(TestMap.Int32MapEntry) -_sym_db.RegisterMessage(TestMap.Int64MapEntry) -_sym_db.RegisterMessage(TestMap.Uint32MapEntry) -_sym_db.RegisterMessage(TestMap.Uint64MapEntry) -_sym_db.RegisterMessage(TestMap.StringMapEntry) - -TestNestedMap = _reflection.GeneratedProtocolMessageType('TestNestedMap', (_message.Message,), { - - 'BoolMapEntry' : _reflection.GeneratedProtocolMessageType('BoolMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTNESTEDMAP_BOOLMAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestNestedMap.BoolMapEntry) - }) - , - - 'Int32MapEntry' : _reflection.GeneratedProtocolMessageType('Int32MapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTNESTEDMAP_INT32MAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestNestedMap.Int32MapEntry) - }) - , - - 'Int64MapEntry' : _reflection.GeneratedProtocolMessageType('Int64MapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTNESTEDMAP_INT64MAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestNestedMap.Int64MapEntry) - }) - , - - 'Uint32MapEntry' : _reflection.GeneratedProtocolMessageType('Uint32MapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTNESTEDMAP_UINT32MAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestNestedMap.Uint32MapEntry) - }) - , - - 'Uint64MapEntry' : _reflection.GeneratedProtocolMessageType('Uint64MapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTNESTEDMAP_UINT64MAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestNestedMap.Uint64MapEntry) - }) - , - - 'StringMapEntry' : _reflection.GeneratedProtocolMessageType('StringMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTNESTEDMAP_STRINGMAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestNestedMap.StringMapEntry) - }) - , - - 'MapMapEntry' : _reflection.GeneratedProtocolMessageType('MapMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTNESTEDMAP_MAPMAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestNestedMap.MapMapEntry) - }) - , - 'DESCRIPTOR' : _TESTNESTEDMAP, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestNestedMap) - }) -_sym_db.RegisterMessage(TestNestedMap) -_sym_db.RegisterMessage(TestNestedMap.BoolMapEntry) -_sym_db.RegisterMessage(TestNestedMap.Int32MapEntry) -_sym_db.RegisterMessage(TestNestedMap.Int64MapEntry) -_sym_db.RegisterMessage(TestNestedMap.Uint32MapEntry) -_sym_db.RegisterMessage(TestNestedMap.Uint64MapEntry) -_sym_db.RegisterMessage(TestNestedMap.StringMapEntry) -_sym_db.RegisterMessage(TestNestedMap.MapMapEntry) - -TestStringMap = _reflection.GeneratedProtocolMessageType('TestStringMap', (_message.Message,), { - - 'StringMapEntry' : _reflection.GeneratedProtocolMessageType('StringMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTSTRINGMAP_STRINGMAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestStringMap.StringMapEntry) - }) - , - 'DESCRIPTOR' : _TESTSTRINGMAP, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestStringMap) - }) -_sym_db.RegisterMessage(TestStringMap) -_sym_db.RegisterMessage(TestStringMap.StringMapEntry) - -TestWrapper = _reflection.GeneratedProtocolMessageType('TestWrapper', (_message.Message,), { - 'DESCRIPTOR' : _TESTWRAPPER, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestWrapper) - }) -_sym_db.RegisterMessage(TestWrapper) - -TestTimestamp = _reflection.GeneratedProtocolMessageType('TestTimestamp', (_message.Message,), { - 'DESCRIPTOR' : _TESTTIMESTAMP, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestTimestamp) - }) -_sym_db.RegisterMessage(TestTimestamp) - -TestDuration = _reflection.GeneratedProtocolMessageType('TestDuration', (_message.Message,), { - 'DESCRIPTOR' : _TESTDURATION, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestDuration) - }) -_sym_db.RegisterMessage(TestDuration) - -TestFieldMask = _reflection.GeneratedProtocolMessageType('TestFieldMask', (_message.Message,), { - 'DESCRIPTOR' : _TESTFIELDMASK, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestFieldMask) - }) -_sym_db.RegisterMessage(TestFieldMask) - -TestStruct = _reflection.GeneratedProtocolMessageType('TestStruct', (_message.Message,), { - 'DESCRIPTOR' : _TESTSTRUCT, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestStruct) - }) -_sym_db.RegisterMessage(TestStruct) - -TestAny = _reflection.GeneratedProtocolMessageType('TestAny', (_message.Message,), { - 'DESCRIPTOR' : _TESTANY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestAny) - }) -_sym_db.RegisterMessage(TestAny) - -TestValue = _reflection.GeneratedProtocolMessageType('TestValue', (_message.Message,), { - 'DESCRIPTOR' : _TESTVALUE, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestValue) - }) -_sym_db.RegisterMessage(TestValue) - -TestListValue = _reflection.GeneratedProtocolMessageType('TestListValue', (_message.Message,), { - 'DESCRIPTOR' : _TESTLISTVALUE, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestListValue) - }) -_sym_db.RegisterMessage(TestListValue) - -TestBoolValue = _reflection.GeneratedProtocolMessageType('TestBoolValue', (_message.Message,), { - - 'BoolMapEntry' : _reflection.GeneratedProtocolMessageType('BoolMapEntry', (_message.Message,), { - 'DESCRIPTOR' : _TESTBOOLVALUE_BOOLMAPENTRY, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestBoolValue.BoolMapEntry) - }) - , - 'DESCRIPTOR' : _TESTBOOLVALUE, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestBoolValue) - }) -_sym_db.RegisterMessage(TestBoolValue) -_sym_db.RegisterMessage(TestBoolValue.BoolMapEntry) - -TestCustomJsonName = _reflection.GeneratedProtocolMessageType('TestCustomJsonName', (_message.Message,), { - 'DESCRIPTOR' : _TESTCUSTOMJSONNAME, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestCustomJsonName) - }) -_sym_db.RegisterMessage(TestCustomJsonName) - -TestExtensions = _reflection.GeneratedProtocolMessageType('TestExtensions', (_message.Message,), { - 'DESCRIPTOR' : _TESTEXTENSIONS, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestExtensions) - }) -_sym_db.RegisterMessage(TestExtensions) - -TestEnumValue = _reflection.GeneratedProtocolMessageType('TestEnumValue', (_message.Message,), { - 'DESCRIPTOR' : _TESTENUMVALUE, - '__module__' : 'google.protobuf.util.json_format_proto3_pb2' - # @@protoc_insertion_point(class_scope:proto3.TestEnumValue) - }) -_sym_db.RegisterMessage(TestEnumValue) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.util.json_format_proto3_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None diff --git a/windows/python/google/protobuf/wrappers_pb2.py b/windows/python/google/protobuf/wrappers_pb2.py index f11512ee2..e49eb4c15 100644 --- a/windows/python/google/protobuf/wrappers_pb2.py +++ b/windows/python/google/protobuf/wrappers_pb2.py @@ -2,10 +2,9 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/wrappers.proto """Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -16,80 +15,8 @@ _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1egoogle/protobuf/wrappers.proto\x12\x0fgoogle.protobuf\"\x1c\n\x0b\x44oubleValue\x12\r\n\x05value\x18\x01 \x01(\x01\"\x1b\n\nFloatValue\x12\r\n\x05value\x18\x01 \x01(\x02\"\x1b\n\nInt64Value\x12\r\n\x05value\x18\x01 \x01(\x03\"\x1c\n\x0bUInt64Value\x12\r\n\x05value\x18\x01 \x01(\x04\"\x1b\n\nInt32Value\x12\r\n\x05value\x18\x01 \x01(\x05\"\x1c\n\x0bUInt32Value\x12\r\n\x05value\x18\x01 \x01(\r\"\x1a\n\tBoolValue\x12\r\n\x05value\x18\x01 \x01(\x08\"\x1c\n\x0bStringValue\x12\r\n\x05value\x18\x01 \x01(\t\"\x1b\n\nBytesValue\x12\r\n\x05value\x18\x01 \x01(\x0c\x42\x83\x01\n\x13\x63om.google.protobufB\rWrappersProtoP\x01Z1google.golang.org/protobuf/types/known/wrapperspb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3') - - -_DOUBLEVALUE = DESCRIPTOR.message_types_by_name['DoubleValue'] -_FLOATVALUE = DESCRIPTOR.message_types_by_name['FloatValue'] -_INT64VALUE = DESCRIPTOR.message_types_by_name['Int64Value'] -_UINT64VALUE = DESCRIPTOR.message_types_by_name['UInt64Value'] -_INT32VALUE = DESCRIPTOR.message_types_by_name['Int32Value'] -_UINT32VALUE = DESCRIPTOR.message_types_by_name['UInt32Value'] -_BOOLVALUE = DESCRIPTOR.message_types_by_name['BoolValue'] -_STRINGVALUE = DESCRIPTOR.message_types_by_name['StringValue'] -_BYTESVALUE = DESCRIPTOR.message_types_by_name['BytesValue'] -DoubleValue = _reflection.GeneratedProtocolMessageType('DoubleValue', (_message.Message,), { - 'DESCRIPTOR' : _DOUBLEVALUE, - '__module__' : 'google.protobuf.wrappers_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.DoubleValue) - }) -_sym_db.RegisterMessage(DoubleValue) - -FloatValue = _reflection.GeneratedProtocolMessageType('FloatValue', (_message.Message,), { - 'DESCRIPTOR' : _FLOATVALUE, - '__module__' : 'google.protobuf.wrappers_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.FloatValue) - }) -_sym_db.RegisterMessage(FloatValue) - -Int64Value = _reflection.GeneratedProtocolMessageType('Int64Value', (_message.Message,), { - 'DESCRIPTOR' : _INT64VALUE, - '__module__' : 'google.protobuf.wrappers_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Int64Value) - }) -_sym_db.RegisterMessage(Int64Value) - -UInt64Value = _reflection.GeneratedProtocolMessageType('UInt64Value', (_message.Message,), { - 'DESCRIPTOR' : _UINT64VALUE, - '__module__' : 'google.protobuf.wrappers_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.UInt64Value) - }) -_sym_db.RegisterMessage(UInt64Value) - -Int32Value = _reflection.GeneratedProtocolMessageType('Int32Value', (_message.Message,), { - 'DESCRIPTOR' : _INT32VALUE, - '__module__' : 'google.protobuf.wrappers_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.Int32Value) - }) -_sym_db.RegisterMessage(Int32Value) - -UInt32Value = _reflection.GeneratedProtocolMessageType('UInt32Value', (_message.Message,), { - 'DESCRIPTOR' : _UINT32VALUE, - '__module__' : 'google.protobuf.wrappers_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.UInt32Value) - }) -_sym_db.RegisterMessage(UInt32Value) - -BoolValue = _reflection.GeneratedProtocolMessageType('BoolValue', (_message.Message,), { - 'DESCRIPTOR' : _BOOLVALUE, - '__module__' : 'google.protobuf.wrappers_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.BoolValue) - }) -_sym_db.RegisterMessage(BoolValue) - -StringValue = _reflection.GeneratedProtocolMessageType('StringValue', (_message.Message,), { - 'DESCRIPTOR' : _STRINGVALUE, - '__module__' : 'google.protobuf.wrappers_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.StringValue) - }) -_sym_db.RegisterMessage(StringValue) - -BytesValue = _reflection.GeneratedProtocolMessageType('BytesValue', (_message.Message,), { - 'DESCRIPTOR' : _BYTESVALUE, - '__module__' : 'google.protobuf.wrappers_pb2' - # @@protoc_insertion_point(class_scope:google.protobuf.BytesValue) - }) -_sym_db.RegisterMessage(BytesValue) - +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.wrappers_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None