From 13fd045dbb2b4dacea32be162a41d5a4b0d1802f Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Tue, 12 Sep 2017 10:32:01 -0700 Subject: Integrated internal changes from Google --- src/google/protobuf/any.pb.cc | 204 +- src/google/protobuf/any.pb.h | 54 +- src/google/protobuf/api.pb.cc | 820 +- src/google/protobuf/api.pb.h | 55 +- src/google/protobuf/arena.cc | 25 +- src/google/protobuf/arena.h | 259 +- src/google/protobuf/arena_impl.h | 5 +- src/google/protobuf/arenastring.h | 28 +- src/google/protobuf/compiler/code_generator.h | 3 +- .../protobuf/compiler/command_line_interface.cc | 55 +- .../protobuf/compiler/command_line_interface.h | 3 + .../compiler/command_line_interface_unittest.cc | 32 + src/google/protobuf/compiler/cpp/cpp_enum.cc | 38 +- src/google/protobuf/compiler/cpp/cpp_enum.h | 11 +- src/google/protobuf/compiler/cpp/cpp_enum_field.cc | 5 +- src/google/protobuf/compiler/cpp/cpp_extension.cc | 40 - src/google/protobuf/compiler/cpp/cpp_extension.h | 3 - src/google/protobuf/compiler/cpp/cpp_field.cc | 1 + src/google/protobuf/compiler/cpp/cpp_file.cc | 1009 +- src/google/protobuf/compiler/cpp/cpp_file.h | 35 +- src/google/protobuf/compiler/cpp/cpp_generator.cc | 31 +- src/google/protobuf/compiler/cpp/cpp_helpers.cc | 223 +- src/google/protobuf/compiler/cpp/cpp_helpers.h | 125 +- src/google/protobuf/compiler/cpp/cpp_map_field.cc | 41 +- src/google/protobuf/compiler/cpp/cpp_message.cc | 681 +- src/google/protobuf/compiler/cpp/cpp_message.h | 16 +- .../protobuf/compiler/cpp/cpp_message_field.cc | 336 +- .../protobuf/compiler/cpp/cpp_message_field.h | 3 + .../compiler/cpp/cpp_message_layout_helper.h | 61 + src/google/protobuf/compiler/cpp/cpp_options.h | 8 +- .../protobuf/compiler/cpp/cpp_padding_optimizer.cc | 220 + .../protobuf/compiler/cpp/cpp_padding_optimizer.h | 64 + .../protobuf/compiler/cpp/cpp_primitive_field.cc | 7 +- .../protobuf/compiler/cpp/cpp_string_field.cc | 46 +- .../protobuf/compiler/cpp/cpp_string_field.h | 1 + .../compiler/cpp/cpp_test_bad_identifiers.proto | 4 + src/google/protobuf/compiler/cpp/cpp_unittest.cc | 15 - src/google/protobuf/compiler/importer.cc | 10 +- src/google/protobuf/compiler/java/java_helpers.h | 15 + src/google/protobuf/compiler/java/java_message.cc | 175 +- .../protobuf/compiler/java/java_message_lite.cc | 292 +- .../compiler/java/java_shared_code_generator.cc | 11 +- src/google/protobuf/compiler/js/js_generator.cc | 92 +- .../protobuf/compiler/mock_code_generator.cc | 12 +- src/google/protobuf/compiler/parser.cc | 79 +- src/google/protobuf/compiler/parser.h | 6 + src/google/protobuf/compiler/parser_unittest.cc | 98 + src/google/protobuf/compiler/plugin.cc | 11 +- src/google/protobuf/compiler/plugin.pb.cc | 905 +- src/google/protobuf/compiler/plugin.pb.h | 62 +- .../protobuf/compiler/python/python_generator.cc | 2 +- src/google/protobuf/descriptor.cc | 337 +- src/google/protobuf/descriptor.h | 75 +- src/google/protobuf/descriptor.pb.cc | 13909 ++++++++----------- src/google/protobuf/descriptor.pb.h | 3069 +++- src/google/protobuf/descriptor.proto | 23 +- .../protobuf/descriptor_database_unittest.cc | 4 + src/google/protobuf/descriptor_unittest.cc | 273 + src/google/protobuf/duration.pb.cc | 128 +- src/google/protobuf/duration.pb.h | 39 +- src/google/protobuf/empty.pb.cc | 96 +- src/google/protobuf/empty.pb.h | 39 +- src/google/protobuf/extension_set.cc | 2 +- src/google/protobuf/extension_set.h | 55 +- src/google/protobuf/extension_set_heavy.cc | 10 +- src/google/protobuf/field_mask.pb.cc | 165 +- src/google/protobuf/field_mask.pb.h | 39 +- .../protobuf/generated_message_reflection.cc | 18 +- .../protobuf/generated_message_table_driven.h | 15 +- src/google/protobuf/has_bits.h | 10 +- src/google/protobuf/implicit_weak_message.cc | 51 + src/google/protobuf/implicit_weak_message.h | 89 + src/google/protobuf/io/coded_stream.cc | 7 +- src/google/protobuf/io/coded_stream.h | 41 +- src/google/protobuf/io/zero_copy_stream_impl.cc | 2 +- .../protobuf/io/zero_copy_stream_impl_lite.cc | 21 - .../protobuf/io/zero_copy_stream_impl_lite.h | 20 - .../protobuf/io/zero_copy_stream_unittest.cc | 2 +- src/google/protobuf/lite_arena_unittest.cc | 32 +- src/google/protobuf/lite_unittest.cc | 15 + src/google/protobuf/map.h | 4 +- src/google/protobuf/map_entry.h | 51 +- src/google/protobuf/map_entry_lite.h | 65 +- src/google/protobuf/map_field.h | 17 +- src/google/protobuf/map_field_lite.h | 15 + src/google/protobuf/map_field_test.cc | 4 +- src/google/protobuf/map_test.cc | 6 +- src/google/protobuf/message.cc | 6 +- src/google/protobuf/message.h | 30 +- src/google/protobuf/message_lite.cc | 39 +- src/google/protobuf/message_lite.h | 20 +- src/google/protobuf/message_unittest.cc | 2 +- src/google/protobuf/metadata_lite.h | 47 +- src/google/protobuf/repeated_field.h | 94 +- src/google/protobuf/repeated_field_unittest.cc | 294 +- src/google/protobuf/source_context.pb.cc | 149 +- src/google/protobuf/source_context.pb.h | 39 +- src/google/protobuf/struct.pb.cc | 722 +- src/google/protobuf/struct.pb.h | 103 +- src/google/protobuf/stubs/hash.h | 8 +- src/google/protobuf/stubs/port.h | 81 +- src/google/protobuf/test_messages_proto2.proto | 16 +- src/google/protobuf/testing/file.cc | 2 +- src/google/protobuf/testing/zcgunzip.cc | 5 +- src/google/protobuf/text_format.cc | 2 +- src/google/protobuf/text_format.h | 5 +- src/google/protobuf/timestamp.pb.cc | 128 +- src/google/protobuf/timestamp.pb.h | 39 +- src/google/protobuf/type.pb.cc | 1511 +- src/google/protobuf/type.pb.h | 90 +- src/google/protobuf/unittest_proto3_arena.proto | 2 +- src/google/protobuf/util/internal/json_escaping.cc | 2 +- src/google/protobuf/wire_format.h | 1 - src/google/protobuf/wire_format_lite.cc | 2 +- src/google/protobuf/wire_format_lite.h | 16 +- src/google/protobuf/wrappers.pb.cc | 758 +- src/google/protobuf/wrappers.pb.h | 97 +- 117 files changed, 13816 insertions(+), 15579 deletions(-) create mode 100644 src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h create mode 100644 src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc create mode 100644 src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h create mode 100644 src/google/protobuf/implicit_weak_message.cc create mode 100644 src/google/protobuf/implicit_weak_message.h (limited to 'src/google/protobuf') diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc index 7d538212..9beb316a 100644 --- a/src/google/protobuf/any.pb.cc +++ b/src/google/protobuf/any.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/any.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,57 +15,52 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { class AnyDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Any_default_instance_; - +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2fany_2eproto { +void InitDefaultsAnyImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_Any_default_instance_; + new (ptr) ::google::protobuf::Any(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Any::InitAsDefaultInstance(); +} -namespace { +void InitDefaultsAny() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsAnyImpl); +} ::google::protobuf::Metadata file_level_metadata[1]; -} // namespace - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField - const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, -}; - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField - const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - ::google::protobuf::internal::AuxillaryParseTableField(), -}; -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const - TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, -}; - -const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Any, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, type_url_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Any, value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Any, type_url_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Any, value_), }; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(Any)}, +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::google::protobuf::Any)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { - reinterpret_cast(&_Any_default_instance_), + reinterpret_cast(&::google::protobuf::_Any_default_instance_), }; -namespace { - void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; @@ -80,29 +74,15 @@ void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); } -} // namespace -void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::internal::InitProtobufDefaults(); - _Any_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Any_default_instance_);} - -void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); -} -namespace { void AddDescriptorsImpl() { InitDefaults(); - static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n\031google/protobuf/any.proto\022\017google.prot" "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002" " \001(\014Bo\n\023com.google.protobufB\010AnyProtoP\001Z" @@ -115,7 +95,6 @@ void AddDescriptorsImpl() { ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/any.proto", &protobuf_RegisterTypes); } -} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); @@ -127,12 +106,14 @@ struct StaticDescriptorInitializer { AddDescriptors(); } } static_descriptor_initializer; - } // namespace protobuf_google_2fprotobuf_2fany_2eproto - +namespace google { +namespace protobuf { // =================================================================== +void Any::InitAsDefaultInstance() { +} void Any::PackFrom(const ::google::protobuf::Message& message) { _any_metadata_.PackFrom(message); } @@ -154,7 +135,7 @@ const int Any::kValueFieldNumber; Any::Any() : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&type_url_, &value_) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fany_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fany_2eproto::InitDefaultsAny(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Any) @@ -198,12 +179,12 @@ void Any::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Any::descriptor() { - protobuf_google_2fprotobuf_2fany_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fany_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fany_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fany_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Any& Any::default_instance() { - protobuf_google_2fprotobuf_2fany_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fany_2eproto::InitDefaultsAny(); return *internal_default_instance(); } @@ -440,122 +421,11 @@ void Any::InternalSwap(Any* other) { ::google::protobuf::Metadata Any::GetMetadata() const { protobuf_google_2fprotobuf_2fany_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fany_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fany_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Any - -// string type_url = 1; -void Any::clear_type_url() { - type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -const ::std::string& Any::type_url() const { - // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url) - return type_url_.GetNoArena(); -} -void Any::set_type_url(const ::std::string& value) { - - type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url) -} -#if LANG_CXX11 -void Any::set_type_url(::std::string&& value) { - - type_url_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Any.type_url) -} -#endif -void Any::set_type_url(const char* value) { - GOOGLE_DCHECK(value != NULL); - - type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.Any.type_url) -} -void Any::set_type_url(const char* value, size_t size) { - - type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.type_url) -} -::std::string* Any::mutable_type_url() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url) - return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* Any::release_type_url() { - // @@protoc_insertion_point(field_release:google.protobuf.Any.type_url) - - return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void Any::set_allocated_type_url(::std::string* type_url) { - if (type_url != NULL) { - - } else { - - } - type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url) -} - -// bytes value = 2; -void Any::clear_value() { - value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -const ::std::string& Any::value() const { - // @@protoc_insertion_point(field_get:google.protobuf.Any.value) - return value_.GetNoArena(); -} -void Any::set_value(const ::std::string& value) { - - value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.Any.value) -} -#if LANG_CXX11 -void Any::set_value(::std::string&& value) { - - value_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Any.value) -} -#endif -void Any::set_value(const char* value) { - GOOGLE_DCHECK(value != NULL); - - value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.Any.value) -} -void Any::set_value(const void* value, size_t size) { - - value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.value) -} -::std::string* Any::mutable_value() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value) - return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* Any::release_value() { - // @@protoc_insertion_point(field_release:google.protobuf.Any.value) - - return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void Any::set_allocated_value(::std::string* value) { - if (value != NULL) { - - } else { - - } - value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h index 5ffda741..20a1cbed 100644 --- a/src/google/protobuf/any.pb.h +++ b/src/google/protobuf/any.pb.h @@ -31,31 +31,33 @@ #include #include // @@protoc_insertion_point(includes) -namespace google { -namespace protobuf { -class Any; -class AnyDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern AnyDefaultTypeInternal _Any_default_instance_; -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { namespace protobuf_google_2fprotobuf_2fany_2eproto { -// Internal implementation detail -- do not call these. +// Internal implementation detail -- do not use these members. struct LIBPROTOBUF_EXPORT TableStruct { static const ::google::protobuf::internal::ParseTableField entries[]; static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; + static const ::google::protobuf::internal::ParseTable schema[1]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; - static void InitDefaultsImpl(); + static const ::google::protobuf::uint32 offsets[]; }; void LIBPROTOBUF_EXPORT AddDescriptors(); -void LIBPROTOBUF_EXPORT InitDefaults(); +void LIBPROTOBUF_EXPORT InitDefaultsAnyImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsAny(); +inline void LIBPROTOBUF_EXPORT InitDefaults() { + InitDefaultsAny(); +} } // namespace protobuf_google_2fprotobuf_2fany_2eproto +namespace google { +namespace protobuf { +class Any; +class AnyDefaultTypeInternal; +LIBPROTOBUF_EXPORT extern AnyDefaultTypeInternal _Any_default_instance_; +} // namespace protobuf +} // namespace google +namespace google { +namespace protobuf { // =================================================================== @@ -70,9 +72,25 @@ class LIBPROTOBUF_EXPORT Any : public ::google::protobuf::Message /* @@protoc_in CopyFrom(from); return *this; } + #if LANG_CXX11 + Any(Any&& from) noexcept + : Any() { + *this = ::std::move(from); + } + + inline Any& operator=(Any&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif static const ::google::protobuf::Descriptor* descriptor(); static const Any& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Any* internal_default_instance() { return reinterpret_cast( &_Any_default_instance_); @@ -171,14 +189,14 @@ class LIBPROTOBUF_EXPORT Any : public ::google::protobuf::Message /* @@protoc_in ::google::protobuf::internal::ArenaStringPtr value_; mutable int _cached_size_; ::google::protobuf::internal::AnyMetadata _any_metadata_; - friend struct protobuf_google_2fprotobuf_2fany_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fany_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fany_2eproto::InitDefaultsAnyImpl(); }; // =================================================================== // =================================================================== -#if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -294,11 +312,9 @@ inline void Any::set_allocated_value(::std::string* value) { #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index 96a5074d..9134426b 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/api.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,97 +15,129 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { class ApiDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Api_default_instance_; class MethodDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Method_default_instance_; class MixinDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Mixin_default_instance_; - +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2fapi_2eproto { +void InitDefaultsApiImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMethod(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption(); + protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaultsSourceContext(); + protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMixin(); + { + void* ptr = &::google::protobuf::_Api_default_instance_; + new (ptr) ::google::protobuf::Api(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Api::InitAsDefaultInstance(); +} -namespace { +void InitDefaultsApi() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsApiImpl); +} -::google::protobuf::Metadata file_level_metadata[3]; +void InitDefaultsMethodImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; -} // namespace + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption(); + { + void* ptr = &::google::protobuf::_Method_default_instance_; + new (ptr) ::google::protobuf::Method(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Method::InitAsDefaultInstance(); +} -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField - const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, -}; +void InitDefaultsMethod() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMethodImpl); +} -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField - const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - ::google::protobuf::internal::AuxillaryParseTableField(), -}; -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const - TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, -}; +void InitDefaultsMixinImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; -const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_Mixin_default_instance_; + new (ptr) ::google::protobuf::Mixin(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Mixin::InitAsDefaultInstance(); +} + +void InitDefaultsMixin() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMixinImpl); +} + +::google::protobuf::Metadata file_level_metadata[3]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Api, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, methods_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, version_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, source_context_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, mixins_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Api, syntax_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Api, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Api, methods_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Api, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Api, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Api, source_context_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Api, mixins_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Api, syntax_), ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Method, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, request_type_url_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, request_streaming_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, response_type_url_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, response_streaming_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Method, syntax_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Method, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Method, request_type_url_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Method, request_streaming_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Method, response_type_url_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Method, response_streaming_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Method, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Method, syntax_), ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Mixin, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Mixin, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Mixin, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Mixin, root_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Mixin, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Mixin, root_), }; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(Api)}, - { 12, -1, sizeof(Method)}, - { 24, -1, sizeof(Mixin)}, +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::google::protobuf::Api)}, + { 12, -1, sizeof(::google::protobuf::Method)}, + { 24, -1, sizeof(::google::protobuf::Mixin)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { - reinterpret_cast(&_Api_default_instance_), - reinterpret_cast(&_Method_default_instance_), - reinterpret_cast(&_Mixin_default_instance_), + reinterpret_cast(&::google::protobuf::_Api_default_instance_), + reinterpret_cast(&::google::protobuf::_Method_default_instance_), + reinterpret_cast(&::google::protobuf::_Mixin_default_instance_), }; -namespace { - void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; @@ -120,37 +151,15 @@ void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3); } -} // namespace -void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::internal::InitProtobufDefaults(); - ::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaults(); - ::google::protobuf::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults(); - _Api_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Api_default_instance_);_Method_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Method_default_instance_);_Mixin_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Mixin_default_instance_);_Api_default_instance_._instance.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>( - ::google::protobuf::SourceContext::internal_default_instance()); -} - -void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); -} -namespace { void AddDescriptorsImpl() { InitDefaults(); - static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n\031google/protobuf/api.proto\022\017google.prot" "obuf\032$google/protobuf/source_context.pro" "to\032\032google/protobuf/type.proto\"\201\002\n\003Api\022\014" @@ -175,10 +184,9 @@ void AddDescriptorsImpl() { descriptor, 750); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/api.proto", &protobuf_RegisterTypes); - ::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors(); - ::google::protobuf::protobuf_google_2fprotobuf_2ftype_2eproto::AddDescriptors(); + ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors(); + ::protobuf_google_2fprotobuf_2ftype_2eproto::AddDescriptors(); } -} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); @@ -190,12 +198,16 @@ struct StaticDescriptorInitializer { AddDescriptors(); } } static_descriptor_initializer; - } // namespace protobuf_google_2fprotobuf_2fapi_2eproto - +namespace google { +namespace protobuf { // =================================================================== +void Api::InitAsDefaultInstance() { + ::google::protobuf::_Api_default_instance_._instance.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>( + ::google::protobuf::SourceContext::internal_default_instance()); +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Api::kNameFieldNumber; const int Api::kMethodsFieldNumber; @@ -209,7 +221,7 @@ const int Api::kSyntaxFieldNumber; Api::Api() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsApi(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Api) @@ -265,12 +277,12 @@ void Api::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Api::descriptor() { - protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Api& Api::default_instance() { - protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsApi(); return *internal_default_instance(); } @@ -720,266 +732,14 @@ void Api::InternalSwap(Api* other) { ::google::protobuf::Metadata Api::GetMetadata() const { protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Api - -// string name = 1; -void Api::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -const ::std::string& Api::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Api.name) - return name_.GetNoArena(); -} -void Api::set_name(const ::std::string& value) { - - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.Api.name) -} -#if LANG_CXX11 -void Api::set_name(::std::string&& value) { - - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Api.name) -} -#endif -void Api::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.Api.name) -} -void Api::set_name(const char* value, size_t size) { - - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Api.name) -} -::std::string* Api::mutable_name() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Api.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* Api::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Api.name) - - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void Api::set_allocated_name(::std::string* name) { - if (name != NULL) { - - } else { - - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.name) -} - -// repeated .google.protobuf.Method methods = 2; -int Api::methods_size() const { - return methods_.size(); -} -void Api::clear_methods() { - methods_.Clear(); -} -const ::google::protobuf::Method& Api::methods(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.Api.methods) - return methods_.Get(index); -} -::google::protobuf::Method* Api::mutable_methods(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.Api.methods) - return methods_.Mutable(index); -} -::google::protobuf::Method* Api::add_methods() { - // @@protoc_insertion_point(field_add:google.protobuf.Api.methods) - return methods_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >* -Api::mutable_methods() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.methods) - return &methods_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >& -Api::methods() const { - // @@protoc_insertion_point(field_list:google.protobuf.Api.methods) - return methods_; -} - -// repeated .google.protobuf.Option options = 3; -int Api::options_size() const { - return options_.size(); -} -void Api::clear_options() { - options_.Clear(); -} -const ::google::protobuf::Option& Api::options(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.Api.options) - return options_.Get(index); -} -::google::protobuf::Option* Api::mutable_options(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.Api.options) - return options_.Mutable(index); -} -::google::protobuf::Option* Api::add_options() { - // @@protoc_insertion_point(field_add:google.protobuf.Api.options) - return options_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* -Api::mutable_options() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.options) - return &options_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& -Api::options() const { - // @@protoc_insertion_point(field_list:google.protobuf.Api.options) - return options_; -} - -// string version = 4; -void Api::clear_version() { - version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -const ::std::string& Api::version() const { - // @@protoc_insertion_point(field_get:google.protobuf.Api.version) - return version_.GetNoArena(); -} -void Api::set_version(const ::std::string& value) { - - version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.Api.version) -} -#if LANG_CXX11 -void Api::set_version(::std::string&& value) { - - version_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Api.version) -} -#endif -void Api::set_version(const char* value) { - GOOGLE_DCHECK(value != NULL); - - version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.Api.version) -} -void Api::set_version(const char* value, size_t size) { - - version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Api.version) -} -::std::string* Api::mutable_version() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Api.version) - return version_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* Api::release_version() { - // @@protoc_insertion_point(field_release:google.protobuf.Api.version) - - return version_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void Api::set_allocated_version(::std::string* version) { - if (version != NULL) { - - } else { - - } - version_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), version); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.version) -} - -// .google.protobuf.SourceContext source_context = 5; -bool Api::has_source_context() const { - return this != internal_default_instance() && source_context_ != NULL; -} -void Api::clear_source_context() { - if (GetArenaNoVirtual() == NULL && source_context_ != NULL) delete source_context_; - source_context_ = NULL; -} -const ::google::protobuf::SourceContext& Api::source_context() const { - const ::google::protobuf::SourceContext* p = source_context_; - // @@protoc_insertion_point(field_get:google.protobuf.Api.source_context) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_SourceContext_default_instance_); -} -::google::protobuf::SourceContext* Api::mutable_source_context() { - - if (source_context_ == NULL) { - source_context_ = new ::google::protobuf::SourceContext; - } - // @@protoc_insertion_point(field_mutable:google.protobuf.Api.source_context) - return source_context_; -} -::google::protobuf::SourceContext* Api::release_source_context() { - // @@protoc_insertion_point(field_release:google.protobuf.Api.source_context) - - ::google::protobuf::SourceContext* temp = source_context_; - source_context_ = NULL; - return temp; -} -void Api::set_allocated_source_context(::google::protobuf::SourceContext* source_context) { - delete source_context_; - source_context_ = source_context; - if (source_context) { - - } else { - - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.source_context) -} - -// repeated .google.protobuf.Mixin mixins = 6; -int Api::mixins_size() const { - return mixins_.size(); -} -void Api::clear_mixins() { - mixins_.Clear(); -} -const ::google::protobuf::Mixin& Api::mixins(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.Api.mixins) - return mixins_.Get(index); -} -::google::protobuf::Mixin* Api::mutable_mixins(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.Api.mixins) - return mixins_.Mutable(index); -} -::google::protobuf::Mixin* Api::add_mixins() { - // @@protoc_insertion_point(field_add:google.protobuf.Api.mixins) - return mixins_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >* -Api::mutable_mixins() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.mixins) - return &mixins_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >& -Api::mixins() const { - // @@protoc_insertion_point(field_list:google.protobuf.Api.mixins) - return mixins_; -} - -// .google.protobuf.Syntax syntax = 7; -void Api::clear_syntax() { - syntax_ = 0; -} -::google::protobuf::Syntax Api::syntax() const { - // @@protoc_insertion_point(field_get:google.protobuf.Api.syntax) - return static_cast< ::google::protobuf::Syntax >(syntax_); -} -void Api::set_syntax(::google::protobuf::Syntax value) { - - syntax_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Api.syntax) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void Method::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Method::kNameFieldNumber; const int Method::kRequestTypeUrlFieldNumber; @@ -993,7 +753,7 @@ const int Method::kSyntaxFieldNumber; Method::Method() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMethod(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Method) @@ -1049,12 +809,12 @@ void Method::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Method::descriptor() { - protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Method& Method::default_instance() { - protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMethod(); return *internal_default_instance(); } @@ -1500,247 +1260,14 @@ void Method::InternalSwap(Method* other) { ::google::protobuf::Metadata Method::GetMetadata() const { protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Method - -// string name = 1; -void Method::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -const ::std::string& Method::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.name) - return name_.GetNoArena(); -} -void Method::set_name(const ::std::string& value) { - - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.Method.name) -} -#if LANG_CXX11 -void Method::set_name(::std::string&& value) { - - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Method.name) -} -#endif -void Method::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.Method.name) -} -void Method::set_name(const char* value, size_t size) { - - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Method.name) -} -::std::string* Method::mutable_name() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Method.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* Method::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Method.name) - - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void Method::set_allocated_name(::std::string* name) { - if (name != NULL) { - - } else { - - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.name) -} - -// string request_type_url = 2; -void Method::clear_request_type_url() { - request_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -const ::std::string& Method::request_type_url() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.request_type_url) - return request_type_url_.GetNoArena(); -} -void Method::set_request_type_url(const ::std::string& value) { - - request_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.Method.request_type_url) -} -#if LANG_CXX11 -void Method::set_request_type_url(::std::string&& value) { - - request_type_url_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Method.request_type_url) -} -#endif -void Method::set_request_type_url(const char* value) { - GOOGLE_DCHECK(value != NULL); - - request_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.Method.request_type_url) -} -void Method::set_request_type_url(const char* value, size_t size) { - - request_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Method.request_type_url) -} -::std::string* Method::mutable_request_type_url() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Method.request_type_url) - return request_type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* Method::release_request_type_url() { - // @@protoc_insertion_point(field_release:google.protobuf.Method.request_type_url) - - return request_type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void Method::set_allocated_request_type_url(::std::string* request_type_url) { - if (request_type_url != NULL) { - - } else { - - } - request_type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), request_type_url); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.request_type_url) -} - -// bool request_streaming = 3; -void Method::clear_request_streaming() { - request_streaming_ = false; -} -bool Method::request_streaming() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.request_streaming) - return request_streaming_; -} -void Method::set_request_streaming(bool value) { - - request_streaming_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Method.request_streaming) + return ::protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages]; } -// string response_type_url = 4; -void Method::clear_response_type_url() { - response_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -const ::std::string& Method::response_type_url() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.response_type_url) - return response_type_url_.GetNoArena(); -} -void Method::set_response_type_url(const ::std::string& value) { - - response_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.Method.response_type_url) -} -#if LANG_CXX11 -void Method::set_response_type_url(::std::string&& value) { - - response_type_url_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Method.response_type_url) -} -#endif -void Method::set_response_type_url(const char* value) { - GOOGLE_DCHECK(value != NULL); - - response_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.Method.response_type_url) -} -void Method::set_response_type_url(const char* value, size_t size) { - - response_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Method.response_type_url) -} -::std::string* Method::mutable_response_type_url() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Method.response_type_url) - return response_type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* Method::release_response_type_url() { - // @@protoc_insertion_point(field_release:google.protobuf.Method.response_type_url) - - return response_type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void Method::set_allocated_response_type_url(::std::string* response_type_url) { - if (response_type_url != NULL) { - - } else { - - } - response_type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), response_type_url); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.response_type_url) -} - -// bool response_streaming = 5; -void Method::clear_response_streaming() { - response_streaming_ = false; -} -bool Method::response_streaming() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.response_streaming) - return response_streaming_; -} -void Method::set_response_streaming(bool value) { - - response_streaming_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Method.response_streaming) -} - -// repeated .google.protobuf.Option options = 6; -int Method::options_size() const { - return options_.size(); -} -void Method::clear_options() { - options_.Clear(); -} -const ::google::protobuf::Option& Method::options(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.options) - return options_.Get(index); -} -::google::protobuf::Option* Method::mutable_options(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.Method.options) - return options_.Mutable(index); -} -::google::protobuf::Option* Method::add_options() { - // @@protoc_insertion_point(field_add:google.protobuf.Method.options) - return options_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >* -Method::mutable_options() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.Method.options) - return &options_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >& -Method::options() const { - // @@protoc_insertion_point(field_list:google.protobuf.Method.options) - return options_; -} - -// .google.protobuf.Syntax syntax = 7; -void Method::clear_syntax() { - syntax_ = 0; -} -::google::protobuf::Syntax Method::syntax() const { - // @@protoc_insertion_point(field_get:google.protobuf.Method.syntax) - return static_cast< ::google::protobuf::Syntax >(syntax_); -} -void Method::set_syntax(::google::protobuf::Syntax value) { - - syntax_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Method.syntax) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void Mixin::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Mixin::kNameFieldNumber; const int Mixin::kRootFieldNumber; @@ -1749,7 +1276,7 @@ const int Mixin::kRootFieldNumber; Mixin::Mixin() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMixin(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Mixin) @@ -1792,12 +1319,12 @@ void Mixin::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Mixin::descriptor() { - protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Mixin& Mixin::default_instance() { - protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMixin(); return *internal_default_instance(); } @@ -2046,122 +1573,11 @@ void Mixin::InternalSwap(Mixin* other) { ::google::protobuf::Metadata Mixin::GetMetadata() const { protobuf_google_2fprotobuf_2fapi_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Mixin - -// string name = 1; -void Mixin::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -const ::std::string& Mixin::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.Mixin.name) - return name_.GetNoArena(); -} -void Mixin::set_name(const ::std::string& value) { - - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.Mixin.name) -} -#if LANG_CXX11 -void Mixin::set_name(::std::string&& value) { - - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Mixin.name) -} -#endif -void Mixin::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.Mixin.name) -} -void Mixin::set_name(const char* value, size_t size) { - - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Mixin.name) -} -::std::string* Mixin::mutable_name() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Mixin.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* Mixin::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.Mixin.name) - - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void Mixin::set_allocated_name(::std::string* name) { - if (name != NULL) { - - } else { - - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.name) -} - -// string root = 2; -void Mixin::clear_root() { - root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -const ::std::string& Mixin::root() const { - // @@protoc_insertion_point(field_get:google.protobuf.Mixin.root) - return root_.GetNoArena(); -} -void Mixin::set_root(const ::std::string& value) { - - root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.Mixin.root) -} -#if LANG_CXX11 -void Mixin::set_root(::std::string&& value) { - - root_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Mixin.root) -} -#endif -void Mixin::set_root(const char* value) { - GOOGLE_DCHECK(value != NULL); - - root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.Mixin.root) -} -void Mixin::set_root(const char* value, size_t size) { - - root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Mixin.root) -} -::std::string* Mixin::mutable_root() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.Mixin.root) - return root_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* Mixin::release_root() { - // @@protoc_insertion_point(field_release:google.protobuf.Mixin.root) - - return root_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void Mixin::set_allocated_root(::std::string* root) { - if (root != NULL) { - - } else { - - } - root_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), root); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.root) + return ::protobuf_google_2fprotobuf_2fapi_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h index bed136db..c41d74bd 100644 --- a/src/google/protobuf/api.pb.h +++ b/src/google/protobuf/api.pb.h @@ -32,6 +32,30 @@ #include #include // @@protoc_insertion_point(includes) + +namespace protobuf_google_2fprotobuf_2fapi_2eproto { +// Internal implementation detail -- do not use these members. +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[3]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaultsApiImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsApi(); +void LIBPROTOBUF_EXPORT InitDefaultsMethodImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsMethod(); +void LIBPROTOBUF_EXPORT InitDefaultsMixinImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsMixin(); +inline void LIBPROTOBUF_EXPORT InitDefaults() { + InitDefaultsApi(); + InitDefaultsMethod(); + InitDefaultsMixin(); +} +} // namespace protobuf_google_2fprotobuf_2fapi_2eproto namespace google { namespace protobuf { class Api; @@ -45,25 +69,9 @@ class MixinDefaultTypeInternal; LIBPROTOBUF_EXPORT extern MixinDefaultTypeInternal _Mixin_default_instance_; } // namespace protobuf } // namespace google - namespace google { namespace protobuf { -namespace protobuf_google_2fprotobuf_2fapi_2eproto { -// Internal implementation detail -- do not call these. -struct LIBPROTOBUF_EXPORT TableStruct { - static const ::google::protobuf::internal::ParseTableField entries[]; - static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; - static const ::google::protobuf::internal::FieldMetadata field_metadata[]; - static const ::google::protobuf::internal::SerializationTable serialization_table[]; - static void InitDefaultsImpl(); -}; -void LIBPROTOBUF_EXPORT AddDescriptors(); -void LIBPROTOBUF_EXPORT InitDefaults(); -} // namespace protobuf_google_2fprotobuf_2fapi_2eproto - // =================================================================== class LIBPROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ { @@ -95,6 +103,7 @@ class LIBPROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_in static const ::google::protobuf::Descriptor* descriptor(); static const Api& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Api* internal_default_instance() { return reinterpret_cast( &_Api_default_instance_); @@ -238,7 +247,8 @@ class LIBPROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_in ::google::protobuf::SourceContext* source_context_; int syntax_; mutable int _cached_size_; - friend struct protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsApiImpl(); }; // ------------------------------------------------------------------- @@ -271,6 +281,7 @@ class LIBPROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc static const ::google::protobuf::Descriptor* descriptor(); static const Method& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Method* internal_default_instance() { return reinterpret_cast( &_Method_default_instance_); @@ -407,7 +418,8 @@ class LIBPROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc bool response_streaming_; int syntax_; mutable int _cached_size_; - friend struct protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMethodImpl(); }; // ------------------------------------------------------------------- @@ -440,6 +452,7 @@ class LIBPROTOBUF_EXPORT Mixin : public ::google::protobuf::Message /* @@protoc_ static const ::google::protobuf::Descriptor* descriptor(); static const Mixin& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Mixin* internal_default_instance() { return reinterpret_cast( &_Mixin_default_instance_); @@ -527,14 +540,14 @@ class LIBPROTOBUF_EXPORT Mixin : public ::google::protobuf::Message /* @@protoc_ ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::internal::ArenaStringPtr root_; mutable int _cached_size_; - friend struct protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fapi_2eproto::InitDefaultsMixinImpl(); }; // =================================================================== // =================================================================== -#if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -1139,7 +1152,6 @@ inline void Mixin::set_allocated_root(::std::string* root) { #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // ------------------------------------------------------------------- @@ -1147,7 +1159,6 @@ inline void Mixin::set_allocated_root(::std::string* root) { // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc index fe38f5dd..f0cc068d 100755 --- a/src/google/protobuf/arena.cc +++ b/src/google/protobuf/arena.cc @@ -38,6 +38,8 @@ #include #endif // ADDRESS_SANITIZER +#include + namespace google { static const size_t kMinCleanupListElements = 8; static const size_t kMaxCleanupListElements = 64; // 1kB on 64-bit. @@ -162,7 +164,8 @@ ArenaImpl::Block* ArenaImpl::ExpandCleanupList(Block* b) { return b; } -inline GOOGLE_ATTRIBUTE_ALWAYS_INLINE void ArenaImpl::AddCleanupInBlock( +inline GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE +void ArenaImpl::AddCleanupInBlock( Block* b, void* elem, void (*cleanup)(void*)) { if (b->cleanup == NULL || b->cleanup->len == b->cleanup->size) { b = ExpandCleanupList(b); @@ -194,7 +197,8 @@ void* ArenaImpl::AllocateAlignedAndAddCleanup(size_t n, return mem; } -inline GOOGLE_ATTRIBUTE_ALWAYS_INLINE ArenaImpl::Block* ArenaImpl::GetBlock(size_t n) { +inline GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE +ArenaImpl::Block* ArenaImpl::GetBlock(size_t n) { Block* my_block = NULL; // If this thread already owns a block in this arena then try to use that. @@ -221,8 +225,8 @@ inline GOOGLE_ATTRIBUTE_ALWAYS_INLINE ArenaImpl::Block* ArenaImpl::GetBlock(size return GetBlockSlow(tc, my_block, n); } -inline GOOGLE_ATTRIBUTE_ALWAYS_INLINE void* ArenaImpl::AllocFromBlock(Block* b, - size_t n) { +inline GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE +void* ArenaImpl::AllocFromBlock(Block* b, size_t n) { GOOGLE_DCHECK_EQ(internal::AlignUpTo8(b->pos), b->pos); // Must be already aligned. GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n); // Must be already aligned. GOOGLE_DCHECK_GE(b->avail(), n); @@ -346,6 +350,19 @@ ArenaImpl::Block* ArenaImpl::FindBlock(void* me) { } // namespace internal +void Arena::CallDestructorHooks() { + uint64 space_allocated = SpaceAllocated(); + // Call the reset hook + if (on_arena_reset_ != NULL) { + on_arena_reset_(this, hooks_cookie_, space_allocated); + } + + // Call the destruction hook + if (on_arena_destruction_ != NULL) { + on_arena_destruction_(this, hooks_cookie_, space_allocated); + } +} + void Arena::OnArenaAllocation(const std::type_info* allocated_type, size_t n) const { if (on_arena_allocation_ != NULL) { diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h index 78e8d902..a0cee22b 100644 --- a/src/google/protobuf/arena.h +++ b/src/google/protobuf/arena.h @@ -52,6 +52,7 @@ using type_info = ::type_info; #endif #include +#include namespace google { namespace protobuf { @@ -227,15 +228,8 @@ class LIBPROTOBUF_EXPORT Arena { Arena() : impl_(ArenaOptions()) { Init(ArenaOptions()); } ~Arena() { - uint64 space_allocated = SpaceAllocated(); - // Call the reset hook - if (on_arena_reset_ != NULL) { - on_arena_reset_(this, hooks_cookie_, space_allocated); - } - - // Call the destruction hook - if (on_arena_destruction_ != NULL) { - on_arena_destruction_(this, hooks_cookie_, space_allocated); + if (on_arena_reset_ != NULL || on_arena_destruction_ != NULL) { + CallDestructorHooks(); } } @@ -261,7 +255,21 @@ class LIBPROTOBUF_EXPORT Arena { // // This function also accepts any type T that satisfies the arena message // allocation protocol, documented above. - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE +#if LANG_CXX11 + template + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateMessage( + ::google::protobuf::Arena* arena, Args&&... args) { + static_assert( + InternalHelper::is_arena_constructable::value, + "CreateMessage can only construct types that are ArenaConstructable"); + if (arena == NULL) { + return new T(NULL, std::forward(args)...); + } else { + return arena->CreateMessageInternal(std::forward(args)...); + } + } +#endif + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateMessage(::google::protobuf::Arena* arena) { #if LANG_CXX11 static_assert( @@ -278,7 +286,7 @@ class LIBPROTOBUF_EXPORT Arena { // One-argument form of CreateMessage. This is useful for constructing objects // that implement the arena message construction protocol described above but // take additional constructor arguments. - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateMessage(::google::protobuf::Arena* arena, const Arg& arg) { #if LANG_CXX11 static_assert( @@ -295,7 +303,8 @@ class LIBPROTOBUF_EXPORT Arena { // Two-argument form of CreateMessage. This is useful for constructing objects // that implement the arena message construction protocol described above but // take additional constructor arguments. - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateMessage(::google::protobuf::Arena* arena, const Arg1& arg1, const Arg2& arg2) { @@ -327,7 +336,8 @@ class LIBPROTOBUF_EXPORT Arena { // if the object were allocated on the heap (except that the underlying memory // is obtained from the arena). #if LANG_CXX11 - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* Create(::google::protobuf::Arena* arena, Args&&... args) { if (arena == NULL) { return new T(std::forward(args)...); @@ -337,7 +347,7 @@ class LIBPROTOBUF_EXPORT Arena { } } #endif - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* Create(::google::protobuf::Arena* arena) { if (arena == NULL) { return new T(); @@ -347,7 +357,7 @@ class LIBPROTOBUF_EXPORT Arena { } // Version of the above with one constructor argument for the created object. - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* Create(::google::protobuf::Arena* arena, const Arg& arg) { if (arena == NULL) { return new T(arg); @@ -358,7 +368,8 @@ class LIBPROTOBUF_EXPORT Arena { } // Version of the above with two constructor arguments for the created object. - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* Create(::google::protobuf::Arena* arena, const Arg1& arg1, const Arg2& arg2) { if (arena == NULL) { return new T(arg1, arg2); @@ -371,9 +382,11 @@ class LIBPROTOBUF_EXPORT Arena { // Version of the above with three constructor arguments for the created // object. template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static T* Create(::google::protobuf::Arena* arena, - const Arg1& arg1, const Arg2& arg2, - const Arg3& arg3) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static T* Create(::google::protobuf::Arena* arena, + const Arg1& arg1, + const Arg2& arg2, + const Arg3& arg3) { if (arena == NULL) { return new T(arg1, arg2, arg3); } else { @@ -386,9 +399,10 @@ class LIBPROTOBUF_EXPORT Arena { // object. template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static T* Create(::google::protobuf::Arena* arena, - const Arg1& arg1, const Arg2& arg2, - const Arg3& arg3, const Arg4& arg4) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static T* Create(::google::protobuf::Arena* arena, + const Arg1& arg1, const Arg2& arg2, + const Arg3& arg3, const Arg4& arg4) { if (arena == NULL) { return new T(arg1, arg2, arg3, arg4); } else { @@ -401,10 +415,11 @@ class LIBPROTOBUF_EXPORT Arena { // object. template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static T* Create(::google::protobuf::Arena* arena, - const Arg1& arg1, const Arg2& arg2, - const Arg3& arg3, const Arg4& arg4, - const Arg5& arg5) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static T* Create(::google::protobuf::Arena* arena, + const Arg1& arg1, const Arg2& arg2, + const Arg3& arg3, const Arg4& arg4, + const Arg5& arg5) { if (arena == NULL) { return new T(arg1, arg2, arg3, arg4, arg5); } else { @@ -417,10 +432,11 @@ class LIBPROTOBUF_EXPORT Arena { // object. template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static T* Create(::google::protobuf::Arena* arena, - const Arg1& arg1, const Arg2& arg2, - const Arg3& arg3, const Arg4& arg4, - const Arg5& arg5, const Arg6& arg6) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static T* Create(::google::protobuf::Arena* arena, + const Arg1& arg1, const Arg2& arg2, + const Arg3& arg3, const Arg4& arg4, + const Arg5& arg5, const Arg6& arg6) { if (arena == NULL) { return new T(arg1, arg2, arg3, arg4, arg5, arg6); } else { @@ -433,11 +449,12 @@ class LIBPROTOBUF_EXPORT Arena { // object. template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static T* Create(::google::protobuf::Arena* arena, - const Arg1& arg1, const Arg2& arg2, - const Arg3& arg3, const Arg4& arg4, - const Arg5& arg5, const Arg6& arg6, - const Arg7& arg7) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static T* Create(::google::protobuf::Arena* arena, + const Arg1& arg1, const Arg2& arg2, + const Arg3& arg3, const Arg4& arg4, + const Arg5& arg5, const Arg6& arg6, + const Arg7& arg7) { if (arena == NULL) { return new T(arg1, arg2, arg3, arg4, arg5, arg6, arg7); } else { @@ -451,11 +468,12 @@ class LIBPROTOBUF_EXPORT Arena { template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static T* Create(::google::protobuf::Arena* arena, - const Arg1& arg1, const Arg2& arg2, - const Arg3& arg3, const Arg4& arg4, - const Arg5& arg5, const Arg6& arg6, - const Arg7& arg7, const Arg8& arg8) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static T* Create(::google::protobuf::Arena* arena, + const Arg1& arg1, const Arg2& arg2, + const Arg3& arg3, const Arg4& arg4, + const Arg5& arg5, const Arg6& arg6, + const Arg7& arg7, const Arg8& arg8) { if (arena == NULL) { return new T(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); } else { @@ -471,7 +489,7 @@ class LIBPROTOBUF_EXPORT Arena { // To ensure safe uses, this function checks at compile time // (when compiled as C++11) that T is trivially default-constructible and // trivially destructible. - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateArray(::google::protobuf::Arena* arena, size_t num_elements) { GOOGLE_CHECK_LE(num_elements, std::numeric_limits::max() / sizeof(T)) @@ -505,7 +523,7 @@ class LIBPROTOBUF_EXPORT Arena { // Any objects allocated on this arena are unusable after this call. It also // returns the total space used by the arena which is the sums of the sizes // of the allocated blocks. This method is not thread-safe. - GOOGLE_ATTRIBUTE_NOINLINE uint64 Reset() { + GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE uint64 Reset() { uint64 space_allocated = SpaceAllocated(); // Call the reset hook if (on_arena_reset_ != NULL) { @@ -516,7 +534,7 @@ class LIBPROTOBUF_EXPORT Arena { // Adds |object| to a list of heap-allocated objects to be freed with |delete| // when the arena is destroyed or reset. - template GOOGLE_ATTRIBUTE_NOINLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE void Own(T* object) { OwnInternal(object, google::protobuf::internal::is_convertible()); } @@ -526,7 +544,7 @@ class LIBPROTOBUF_EXPORT Arena { // that it does not free the underlying memory with |delete|; hence, it is // normally only used for objects that are placement-newed into // arena-allocated memory. - template GOOGLE_ATTRIBUTE_NOINLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE void OwnDestructor(T* object) { if (object != NULL) { impl_.AddCleanup(object, &internal::arena_destruct_object); @@ -537,8 +555,8 @@ class LIBPROTOBUF_EXPORT Arena { // will be manually called when the arena is destroyed or reset. This differs // from OwnDestructor() in that any member function may be specified, not only // the class destructor. - GOOGLE_ATTRIBUTE_NOINLINE void OwnCustomDestructor(void* object, - void (*destruct)(void*)) { + GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE void OwnCustomDestructor( + void* object, void (*destruct)(void*)) { impl_.AddCleanup(object, destruct); } @@ -546,7 +564,7 @@ class LIBPROTOBUF_EXPORT Arena { // message, or NULL otherwise. This differs from value->GetArena() in that the // latter is a virtual call, while this method is a templated call that // resolves at compile-time. - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static ::google::protobuf::Arena* GetArena(const T* value) { return GetArenaInternal(value, is_arena_constructable()); } @@ -612,6 +630,7 @@ class LIBPROTOBUF_EXPORT Arena { struct is_arena_constructable : InternalHelper::is_arena_constructable {}; private: + void CallDestructorHooks(); void OnArenaAllocation(const std::type_info* allocated_type, size_t n) const; inline void AllocHook(const std::type_info* allocated_type, size_t n) const { if (GOOGLE_PREDICT_FALSE(hooks_cookie_ != NULL)) { @@ -622,7 +641,7 @@ class LIBPROTOBUF_EXPORT Arena { // Allocate and also optionally call on_arena_allocation callback with the // allocated type info when the hooks are in place in ArenaOptions and // the cookie is not null. - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void* AllocateInternal(bool skip_explicit_ownership) { const size_t n = internal::AlignUpTo8(sizeof(T)); AllocHook(RTTI_TYPE_ID(T), n); @@ -640,26 +659,24 @@ class LIBPROTOBUF_EXPORT Arena { // as it can cause confusing API usages, and end up having double free in // user code. These are used only internally from LazyField and Repeated // fields, since they are designed to work in all mode combinations. - template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static Msg* CreateMaybeMessage(Arena* arena, - google::protobuf::internal::true_type) { + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static Msg* CreateMaybeMessage(Arena* arena, google::protobuf::internal::true_type) { return CreateMessage(arena); } - template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static T* CreateMaybeMessage(Arena* arena, - google::protobuf::internal::false_type) { + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static T* CreateMaybeMessage(Arena* arena, google::protobuf::internal::false_type) { return Create(arena); } - template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static T* CreateMaybeMessage(Arena* arena) { + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static T* CreateMaybeMessage(Arena* arena) { return CreateMaybeMessage(arena, is_arena_constructable()); } // Just allocate the required size for the given type assuming the // type has a trivial constructor. - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* CreateInternalRawArray(size_t num_elements) { GOOGLE_CHECK_LE(num_elements, std::numeric_limits::max() / sizeof(T)) @@ -671,84 +688,91 @@ class LIBPROTOBUF_EXPORT Arena { } #if LANG_CXX11 - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal(bool skip_explicit_ownership, Args&&... args) { return new (AllocateInternal(skip_explicit_ownership)) T(std::forward(args)...); } #else - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal(bool skip_explicit_ownership) { return new (AllocateInternal(skip_explicit_ownership)) T(); } - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal(bool skip_explicit_ownership, const Arg& arg) { return new (AllocateInternal(skip_explicit_ownership)) T(arg); } template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal(bool skip_explicit_ownership, - const Arg1& arg1, - const Arg2& arg2) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + T* CreateInternal(bool skip_explicit_ownership, + const Arg1& arg1, + const Arg2& arg2) { return new (AllocateInternal(skip_explicit_ownership)) T(arg1, arg2); } template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal(bool skip_explicit_ownership, - const Arg1& arg1, - const Arg2& arg2, - const Arg3& arg3) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + T* CreateInternal(bool skip_explicit_ownership, + const Arg1& arg1, + const Arg2& arg2, + const Arg3& arg3) { return new (AllocateInternal(skip_explicit_ownership)) T(arg1, arg2, arg3); } template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal(bool skip_explicit_ownership, - const Arg1& arg1, - const Arg2& arg2, - const Arg3& arg3, - const Arg4& arg4) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + T* CreateInternal(bool skip_explicit_ownership, + const Arg1& arg1, + const Arg2& arg2, + const Arg3& arg3, + const Arg4& arg4) { return new (AllocateInternal(skip_explicit_ownership)) T(arg1, arg2, arg3, arg4); } template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal(bool skip_explicit_ownership, - const Arg1& arg1, - const Arg2& arg2, - const Arg3& arg3, - const Arg4& arg4, - const Arg5& arg5) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + T* CreateInternal(bool skip_explicit_ownership, + const Arg1& arg1, + const Arg2& arg2, + const Arg3& arg3, + const Arg4& arg4, + const Arg5& arg5) { return new (AllocateInternal(skip_explicit_ownership)) T(arg1, arg2, arg3, arg4, arg5); } template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal(bool skip_explicit_ownership, - const Arg1& arg1, - const Arg2& arg2, - const Arg3& arg3, - const Arg4& arg4, - const Arg5& arg5, - const Arg6& arg6) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + T* CreateInternal(bool skip_explicit_ownership, + const Arg1& arg1, + const Arg2& arg2, + const Arg3& arg3, + const Arg4& arg4, + const Arg5& arg5, + const Arg6& arg6) { return new (AllocateInternal(skip_explicit_ownership)) T(arg1, arg2, arg3, arg4, arg5, arg6); } template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal(bool skip_explicit_ownership, - const Arg1& arg1, - const Arg2& arg2, - const Arg3& arg3, - const Arg4& arg4, - const Arg5& arg5, - const Arg6& arg6, - const Arg7& arg7) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + T* CreateInternal(bool skip_explicit_ownership, + const Arg1& arg1, + const Arg2& arg2, + const Arg3& arg3, + const Arg4& arg4, + const Arg5& arg5, + const Arg6& arg6, + const Arg7& arg7) { return new (AllocateInternal(skip_explicit_ownership)) T(arg1, arg2, arg3, arg4, arg5, arg6, arg7); } @@ -756,36 +780,46 @@ class LIBPROTOBUF_EXPORT Arena { template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateInternal(bool skip_explicit_ownership, - const Arg1& arg1, - const Arg2& arg2, - const Arg3& arg3, - const Arg4& arg4, - const Arg5& arg5, - const Arg6& arg6, - const Arg7& arg7, - const Arg8& arg8) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + T* CreateInternal(bool skip_explicit_ownership, + const Arg1& arg1, + const Arg2& arg2, + const Arg3& arg3, + const Arg4& arg4, + const Arg5& arg5, + const Arg6& arg6, + const Arg7& arg7, + const Arg8& arg8) { return new (AllocateInternal(skip_explicit_ownership)) T(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); } +#endif +#if LANG_CXX11 + template + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* CreateMessageInternal( + Args&&... args) { + return InternalHelper::Construct( + AllocateInternal(InternalHelper::is_destructor_skippable::value), + this, std::forward(args)...); + } #endif template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateMessageInternal() { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* CreateMessageInternal() { return InternalHelper::Construct( AllocateInternal(InternalHelper::is_destructor_skippable::value), this); } - template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateMessageInternal(const Arg& arg) { + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + T* CreateMessageInternal(const Arg& arg) { return InternalHelper::Construct( AllocateInternal(InternalHelper::is_destructor_skippable::value), this, arg); } template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateMessageInternal(const Arg1& arg1, - const Arg2& arg2) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + T* CreateMessageInternal(const Arg1& arg1, const Arg2& arg2) { return InternalHelper::Construct( AllocateInternal(InternalHelper::is_destructor_skippable::value), this, arg1, arg2); @@ -828,14 +862,14 @@ class LIBPROTOBUF_EXPORT Arena { // is a subtype of ::google::protobuf::Message and 'false_type' otherwise. Collapsing // all template instantiations to one for generic Message reduces code size, // using the virtual destructor instead. - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void OwnInternal(T* object, google::protobuf::internal::true_type) { if (object != NULL) { impl_.AddCleanup(object, &internal::arena_delete_object< ::google::protobuf::Message>); } } - template GOOGLE_ATTRIBUTE_ALWAYS_INLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void OwnInternal(T* object, google::protobuf::internal::false_type) { if (object != NULL) { impl_.AddCleanup(object, &internal::arena_delete_object); @@ -845,14 +879,15 @@ class LIBPROTOBUF_EXPORT Arena { // Implementation for GetArena(). Only message objects with // InternalArenaConstructable_ tags can be associated with an arena, and such // objects must implement a GetArenaNoVirtual() method. - template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static ::google::protobuf::Arena* GetArenaInternal( + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static ::google::protobuf::Arena* GetArenaInternal( const T* value, google::protobuf::internal::true_type) { return InternalHelper::GetArena(value); } template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static ::google::protobuf::Arena* GetArenaInternal( + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static ::google::protobuf::Arena* GetArenaInternal( const T* /* value */, google::protobuf::internal::false_type) { return NULL; } diff --git a/src/google/protobuf/arena_impl.h b/src/google/protobuf/arena_impl.h index b7f0c7b6..5fa2475f 100644 --- a/src/google/protobuf/arena_impl.h +++ b/src/google/protobuf/arena_impl.h @@ -42,6 +42,8 @@ #include #include +#include + namespace google { namespace protobuf { @@ -131,7 +133,8 @@ class LIBPROTOBUF_EXPORT ArenaImpl { // aligned at a multiple of 8 bytes. size_t pos; size_t size; // total size of the block. - GOOGLE_ATTRIBUTE_ALWAYS_INLINE size_t avail() const { return size - pos; } + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + size_t avail() const { return size - pos; } // data follows }; diff --git a/src/google/protobuf/arenastring.h b/src/google/protobuf/arenastring.h index 63fd00e5..c9d045a1 100755 --- a/src/google/protobuf/arenastring.h +++ b/src/google/protobuf/arenastring.h @@ -33,12 +33,11 @@ #include -#include +#include #include #include -#include - - +#include +#include // This is the implementation of arena string fields written for the open-source // release. The ArenaStringPtr struct below is an internal implementation class @@ -62,6 +61,12 @@ struct LIBPROTOBUF_EXPORT ArenaStringPtr { } } + inline void SetLite(const ::std::string* default_value, + const ::std::string& value, + ::google::protobuf::Arena* arena) { + Set(default_value, value, arena); + } + // Basic accessors. inline const ::std::string& Get() const { return *ptr_; } @@ -84,8 +89,9 @@ struct LIBPROTOBUF_EXPORT ArenaStringPtr { } ::std::string* released = NULL; if (arena != NULL) { - // ptr_ is owned by the arena -- we need to return a copy. - released = new ::std::string(*ptr_); + // ptr_ is owned by the arena. + released = new ::std::string; + released->swap(*ptr_); } else { released = ptr_; } @@ -143,7 +149,7 @@ struct LIBPROTOBUF_EXPORT ArenaStringPtr { // 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. - GOOGLE_ATTRIBUTE_ALWAYS_INLINE void Swap(ArenaStringPtr* other) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Swap(ArenaStringPtr* other) { std::swap(ptr_, other->ptr_); } @@ -291,15 +297,17 @@ struct LIBPROTOBUF_EXPORT ArenaStringPtr { private: ::std::string* ptr_; - GOOGLE_ATTRIBUTE_NOINLINE void CreateInstance(::google::protobuf::Arena* arena, - const ::std::string* initial_value) { + GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE + void CreateInstance(::google::protobuf::Arena* arena, + const ::std::string* initial_value) { GOOGLE_DCHECK(initial_value != NULL); ptr_ = new ::std::string(*initial_value); if (arena != NULL) { arena->Own(ptr_); } } - GOOGLE_ATTRIBUTE_NOINLINE void CreateInstanceNoArena(const ::std::string* initial_value) { + GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE + void CreateInstanceNoArena(const ::std::string* initial_value) { GOOGLE_DCHECK(initial_value != NULL); ptr_ = new ::std::string(*initial_value); } diff --git a/src/google/protobuf/compiler/code_generator.h b/src/google/protobuf/compiler/code_generator.h index dd6a59d8..4b1d90b8 100644 --- a/src/google/protobuf/compiler/code_generator.h +++ b/src/google/protobuf/compiler/code_generator.h @@ -51,6 +51,7 @@ class FileDescriptor; namespace compiler { class AccessInfoMap; + class Version; // Defined in this file. @@ -165,7 +166,7 @@ typedef GeneratorContext OutputDirectory; // "foo=bar,baz,qux=corge" // parses to the pairs: // ("foo", "bar"), ("baz", ""), ("qux", "corge") -LIBPROTOC_EXPORT void ParseGeneratorParameter( +void ParseGeneratorParameter( const string&, std::vector >*); } // namespace compiler diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index 5f864041..6c2fc164 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -69,9 +69,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -83,16 +80,11 @@ #include #include #include -#include -#include -#include -#include -#include -#include #include #include #include #include +#include namespace google { @@ -232,7 +224,7 @@ bool IsInstalledProtoPath(const string& path) { return access(file_path.c_str(), F_OK) != -1; } -// Add the paths where google/protobuf/descritor.proto and other well-known +// Add the paths where google/protobuf/descriptor.proto and other well-known // type protos are installed. void AddDefaultProtoPaths(vector >* paths) { // TODO(xiaofeng): The code currently only checks relative paths of where @@ -876,6 +868,7 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) { return 1; } + // We construct a separate GeneratorContext for each output location. Note // that two code generators may output to the same location, in which case // they should share a single GeneratorContext so that OpenForInsert() works. @@ -1019,7 +1012,8 @@ bool CommandLineInterface::PopulateSimpleDescriptorDatabase( bool parsed = file_descriptor_set.ParseFromFileDescriptor(fd); if (close(fd) != 0) { std::cerr << descriptor_set_in_names_[i] << ": close: " - << strerror(errno); + << strerror(errno) + << std::endl; return false; } @@ -1172,6 +1166,21 @@ bool CommandLineInterface::MakeInputsBeProtoPathRelative( return true; } +bool CommandLineInterface::ExpandArgumentFile(const string& file, + std::vector* arguments) { + // The argument file is searched in the working directory only. We don't + // use the proto import path here. + std::ifstream file_stream(file.c_str()); + if (!file_stream.is_open()) { + return false; + } + string argument; + // We don't support any kind of shell expansion right now. + while (std::getline(file_stream, argument)) { + arguments->push_back(argument); + } + return true; +} CommandLineInterface::ParseArgumentStatus CommandLineInterface::ParseArguments(int argc, const char* const argv[]) { @@ -1179,11 +1188,19 @@ CommandLineInterface::ParseArguments(int argc, const char* const argv[]) { std::vector arguments; for (int i = 1; i < argc; ++i) { + if (argv[i][0] == '@') { + if (!ExpandArgumentFile(argv[i] + 1, &arguments)) { + std::cerr << "Failed to open argument file: " << (argv[i] + 1) + << std::endl; + return PARSE_ARGUMENT_FAIL; + } + continue; + } arguments.push_back(argv[i]); } // if no arguments are given, show help - if(arguments.empty()) { + if (arguments.empty()) { PrintHelpText(); return PARSE_ARGUMENT_DONE_AND_EXIT; // Exit without running compiler. } @@ -1749,6 +1766,20 @@ void CommandLineInterface::PrintHelpText() { << string(19 - iter->first.size(), ' ') // Spaces for alignment. << iter->second.help_text << std::endl; } + std::cerr << +" @ Read options and filenames from file. If a\n" +" relative file path is specified, the file\n" +" will be searched in the working directory.\n" +" The --proto_path option will not affect how\n" +" this argument file is searched. Content of\n" +" the file will be expanded in the position of\n" +" @ as in the argument list. Note\n" +" that shell expansion is not applied to the\n" +" content of the file (i.e., you cannot use\n" +" quotes, wildcards, escapes, commands, etc.).\n" +" Each line corresponds to a single argument,\n" +" even if it contains spaces." + << std::endl; } bool CommandLineInterface::GenerateOutput( diff --git a/src/google/protobuf/compiler/command_line_interface.h b/src/google/protobuf/compiler/command_line_interface.h index e6596575..d5d85f2d 100644 --- a/src/google/protobuf/compiler/command_line_interface.h +++ b/src/google/protobuf/compiler/command_line_interface.h @@ -227,6 +227,9 @@ class LIBPROTOC_EXPORT CommandLineInterface { // Parse all command-line arguments. ParseArgumentStatus ParseArguments(int argc, const char* const argv[]); + // Read an argument file and append the file's content to the list of + // arguments. Return false if the file cannot be read. + bool ExpandArgumentFile(const string& file, std::vector* arguments); // Parses a command-line argument into a name/value pair. Returns // true if the next argument in the argv should be used as the value, diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc index 73d3e4c9..38d0e388 100644 --- a/src/google/protobuf/compiler/command_line_interface_unittest.cc +++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc @@ -35,6 +35,7 @@ #include #include #include + #ifndef _MSC_VER #include #endif @@ -84,6 +85,7 @@ using google::protobuf::internal::win32::write; // which case tcmalloc will print warnings that fail the plugin tests. #if !GOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN + namespace { bool FileExists(const string& path) { @@ -1559,6 +1561,36 @@ TEST_F(CommandLineInterfaceTest, WriteDependencyManifestFileForAbsolutePath) { } #endif // !_WIN32 +TEST_F(CommandLineInterfaceTest, TestArgumentFile) { + // Test parsing multiple input files using an argument file. + + CreateTempFile("foo.proto", + "syntax = \"proto2\";\n" + "message Foo {}\n"); + CreateTempFile("bar.proto", + "syntax = \"proto2\";\n" + "message Bar {}\n"); + CreateTempFile("arguments.txt", + "--test_out=$tmpdir\n" + "--plug_out=$tmpdir\n" + "--proto_path=$tmpdir\n" + "--direct_dependencies_violation_msg=%s is not imported\n" + "foo.proto\n" + "bar.proto"); + + Run("protocol_compiler @$tmpdir/arguments.txt"); + + ExpectNoErrors(); + ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", + "foo.proto", "Foo"); + ExpectGeneratedWithMultipleInputs("test_generator", "foo.proto,bar.proto", + "bar.proto", "Bar"); + ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", + "foo.proto", "Foo"); + ExpectGeneratedWithMultipleInputs("test_plugin", "foo.proto,bar.proto", + "bar.proto", "Bar"); +} + // ------------------------------------------------------------------- diff --git a/src/google/protobuf/compiler/cpp/cpp_enum.cc b/src/google/protobuf/compiler/cpp/cpp_enum.cc index 3b4b97e6..8adee0f5 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum.cc @@ -197,6 +197,8 @@ void EnumGenerator::GenerateSymbolImports(io::Printer* printer) { vars["nested_name"] = descriptor_->name(); vars["classname"] = classname_; vars["constexpr"] = options_.proto_h ? "constexpr " : ""; + vars["{"] = ""; + vars["}"] = ""; printer->Print(vars, "typedef $classname$ $nested_name$;\n"); for (int j = 0; j < descriptor_->value_count(); j++) { @@ -204,22 +206,27 @@ void EnumGenerator::GenerateSymbolImports(io::Printer* printer) { vars["deprecated_attr"] = descriptor_->value(j)->options().deprecated() ? "GOOGLE_PROTOBUF_DEPRECATED_ATTR " : ""; printer->Print(vars, - "$deprecated_attr$static $constexpr$const $nested_name$ $tag$ =\n" + "$deprecated_attr$static $constexpr$const $nested_name$ ${$$tag$$}$ =\n" " $classname$_$tag$;\n"); + printer->Annotate("{", "}", descriptor_->value(j)); } printer->Print(vars, "static inline bool $nested_name$_IsValid(int value) {\n" " return $classname$_IsValid(value);\n" "}\n" - "static const $nested_name$ $nested_name$_MIN =\n" - " $classname$_$nested_name$_MIN;\n" - "static const $nested_name$ $nested_name$_MAX =\n" + "static const $nested_name$ ${$$nested_name$_MIN$}$ =\n" + " $classname$_$nested_name$_MIN;\n"); + printer->Annotate("{", "}", descriptor_); + printer->Print(vars, + "static const $nested_name$ ${$$nested_name$_MAX$}$ =\n" " $classname$_$nested_name$_MAX;\n"); + printer->Annotate("{", "}", descriptor_); if (generate_array_size_) { printer->Print(vars, - "static const int $nested_name$_ARRAYSIZE =\n" + "static const int ${$$nested_name$_ARRAYSIZE$}$ =\n" " $classname$_$nested_name$_ARRAYSIZE;\n"); + printer->Annotate("{", "}", descriptor_); } if (HasDescriptorMethods(descriptor_->file(), options_)) { @@ -242,27 +249,10 @@ void EnumGenerator::GenerateSymbolImports(io::Printer* printer) { } } -void EnumGenerator::GenerateDescriptorInitializer(io::Printer* printer) { - std::map vars; - vars["index"] = SimpleItoa(descriptor_->index()); - vars["index_in_metadata"] = SimpleItoa(index_in_metadata_); - - if (descriptor_->containing_type() == NULL) { - printer->Print(vars, - "file_level_enum_descriptors[$index_in_metadata$] = " - "file->enum_type($index$);\n"); - } else { - vars["parent"] = ClassName(descriptor_->containing_type(), false); - printer->Print(vars, - "file_level_enum_descriptors[$index_in_metadata$] = " - "$parent$_descriptor->enum_type($index$);\n"); - } -} - -void EnumGenerator::GenerateMethods(io::Printer* printer) { +void EnumGenerator::GenerateMethods(int idx, io::Printer* printer) { std::map vars; vars["classname"] = classname_; - vars["index_in_metadata"] = SimpleItoa(index_in_metadata_); + vars["index_in_metadata"] = SimpleItoa(idx); vars["constexpr"] = options_.proto_h ? "constexpr " : ""; vars["file_namespace"] = FileLevelNamespace(descriptor_->file()->name()); diff --git a/src/google/protobuf/compiler/cpp/cpp_enum.h b/src/google/protobuf/compiler/cpp/cpp_enum.h index 0b568c57..0d2488a9 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum.h +++ b/src/google/protobuf/compiler/cpp/cpp_enum.h @@ -86,13 +86,10 @@ class EnumGenerator { // Source file stuff. - // Generate code that initializes the global variable storing the enum's - // descriptor. - void GenerateDescriptorInitializer(io::Printer* printer); - // Generate non-inline methods related to the enum, such as IsValidValue(). - // Goes in the .cc file. - void GenerateMethods(io::Printer* printer); + // Goes in the .cc file. EnumDescriptors are stored in an array, idx is + // the index in this array that corresponds with this enum. + void GenerateMethods(int idx, io::Printer* printer); private: const EnumDescriptor* descriptor_; @@ -101,8 +98,6 @@ class EnumGenerator { // whether to generate the *_ARRAYSIZE constant. const bool generate_array_size_; - int index_in_metadata_; - friend class FileGenerator; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator); }; diff --git a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc index 08a635fa..008490ed 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc @@ -232,9 +232,8 @@ GenerateSwappingCode(io::Printer* printer) const { void EnumOneofFieldGenerator:: GenerateConstructorCode(io::Printer* printer) const { - printer->Print( - variables_, - "_$classname$_default_instance_.$name$_ = $default$;\n"); + printer->Print(variables_, + "$ns$::_$classname$_default_instance_.$name$_ = $default$;\n"); } // =================================================================== diff --git a/src/google/protobuf/compiler/cpp/cpp_extension.cc b/src/google/protobuf/compiler/cpp/cpp_extension.cc index 6b1673b2..0a4e0bb9 100644 --- a/src/google/protobuf/compiler/cpp/cpp_extension.cc +++ b/src/google/protobuf/compiler/cpp/cpp_extension.cc @@ -167,46 +167,6 @@ void ExtensionGenerator::GenerateDefinition(io::Printer* printer) { " $name$($constant_name$, $default$);\n"); } -void ExtensionGenerator::GenerateRegistration(io::Printer* printer) { - std::map vars; - vars["extendee" ] = ExtendeeClassName(descriptor_); - vars["number" ] = SimpleItoa(descriptor_->number()); - vars["field_type" ] = SimpleItoa(static_cast(descriptor_->type())); - vars["is_repeated"] = descriptor_->is_repeated() ? "true" : "false"; - vars["is_packed" ] = (descriptor_->is_repeated() && - descriptor_->options().packed()) - ? "true" : "false"; - - switch (descriptor_->cpp_type()) { - case FieldDescriptor::CPPTYPE_ENUM: - printer->Print( - vars, - "::google::protobuf::internal::ExtensionSet::RegisterEnumExtension(\n" - " $extendee$::internal_default_instance(),\n" - " $number$, $field_type$, $is_repeated$, $is_packed$,\n"); - printer->Print( - " &$type$_IsValid);\n", - "type", ClassName(descriptor_->enum_type(), true)); - break; - case FieldDescriptor::CPPTYPE_MESSAGE: - printer->Print( - vars, - "::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(\n" - " $extendee$::internal_default_instance(),\n" - " $number$, $field_type$, $is_repeated$, $is_packed$,\n"); - printer->Print(" $type$::internal_default_instance());\n", "type", - ClassName(descriptor_->message_type(), true)); - break; - default: - printer->Print( - vars, - "::google::protobuf::internal::ExtensionSet::RegisterExtension(\n" - " $extendee$::internal_default_instance(),\n" - " $number$, $field_type$, $is_repeated$, $is_packed$);\n"); - break; - } -} - } // namespace cpp } // namespace compiler } // namespace protobuf diff --git a/src/google/protobuf/compiler/cpp/cpp_extension.h b/src/google/protobuf/compiler/cpp/cpp_extension.h index 1c1caf1f..30236d71 100644 --- a/src/google/protobuf/compiler/cpp/cpp_extension.h +++ b/src/google/protobuf/compiler/cpp/cpp_extension.h @@ -67,9 +67,6 @@ class ExtensionGenerator { // Source file stuff. void GenerateDefinition(io::Printer* printer); - // Generate code to register the extension. - void GenerateRegistration(io::Printer* printer); - private: const FieldDescriptor* descriptor_; string type_traits_; diff --git a/src/google/protobuf/compiler/cpp/cpp_field.cc b/src/google/protobuf/compiler/cpp/cpp_field.cc index dce9617c..f8e11855 100644 --- a/src/google/protobuf/compiler/cpp/cpp_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_field.cc @@ -61,6 +61,7 @@ using internal::WireFormat; void SetCommonFieldVariables(const FieldDescriptor* descriptor, std::map* variables, const Options& options) { + (*variables)["ns"] = Namespace(descriptor); (*variables)["name"] = FieldName(descriptor); (*variables)["index"] = SimpleItoa(descriptor->index()); (*variables)["number"] = SimpleItoa(descriptor->number()); diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc index a066a6a7..0e74f215 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.cc +++ b/src/google/protobuf/compiler/cpp/cpp_file.cc @@ -55,70 +55,24 @@ namespace google { namespace protobuf { namespace compiler { namespace cpp { -namespace { -// The list of names that are defined as macros on some platforms. We need to -// #undef them for the generated code to compile. -const char* kMacroNames[] = {"major", "minor"}; - -bool IsMacroName(const string& name) { - // Just do a linear search as the number of elements is very small. - for (int i = 0; i < GOOGLE_ARRAYSIZE(kMacroNames); ++i) { - if (name == kMacroNames[i]) return true; - } - return false; -} - -void CollectMacroNames(const Descriptor* message, std::vector* names) { - for (int i = 0; i < message->field_count(); ++i) { - const FieldDescriptor* field = message->field(i); - if (IsMacroName(field->name())) { - names->push_back(field->name()); - } - } - for (int i = 0; i < message->nested_type_count(); ++i) { - CollectMacroNames(message->nested_type(i), names); - } -} - -void CollectMacroNames(const FileDescriptor* file, std::vector* names) { - // Only do this for protobuf's own types. There are some google3 protos using - // macros as field names and the generated code compiles after the macro - // expansion. Undefing these macros actually breaks such code. - if (file->name() != "google/protobuf/compiler/plugin.proto") { - return; - } - for (int i = 0; i < file->message_type_count(); ++i) { - CollectMacroNames(file->message_type(i), names); - } -} - - -} // namespace - -// =================================================================== FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options) : file_(file), options_(options), scc_analyzer_(options), - message_generators_owner_( - new google::protobuf::scoped_ptr[file->message_type_count()]), enum_generators_owner_( new google::protobuf::scoped_ptr[file->enum_type_count()]), service_generators_owner_( new google::protobuf::scoped_ptr[file->service_count()]), extension_generators_owner_( new google::protobuf::scoped_ptr[file->extension_count()]) { - - for (int i = 0; i < file->message_type_count(); i++) { - message_generators_owner_[i].reset( - new MessageGenerator(file->message_type(i), options, &scc_analyzer_)); - message_generators_owner_[i]->Flatten(&message_generators_); - } - - for (int i = 0; i < message_generators_.size(); i++) { - message_generators_[i]->AddGenerators(&enum_generators_, - &extension_generators_); + std::vector msgs = FlattenMessagesInFile(file); + for (int i = 0; i < msgs.size(); i++) { + // Deleted in destructor + MessageGenerator* msg_gen = + new MessageGenerator(msgs[i], i, options, &scc_analyzer_); + message_generators_.push_back(msg_gen); + msg_gen->AddGenerators(&enum_generators_, &extension_generators_); } for (int i = 0; i < file->enum_type_count(); i++) { @@ -126,9 +80,6 @@ FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options) new EnumGenerator(file->enum_type(i), options)); enum_generators_.push_back(enum_generators_owner_[i].get()); } - for (int i = 0; i < enum_generators_.size(); i++) { - enum_generators_[i]->index_in_metadata_ = i; - } for (int i = 0; i < file->service_count(); i++) { service_generators_owner_[i].reset( @@ -147,14 +98,36 @@ FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options) extension_generators_.push_back(extension_generators_owner_[i].get()); } + package_parts_ = Split(file_->package(), ".", true); } -FileGenerator::~FileGenerator() {} +FileGenerator::~FileGenerator() { + for (int i = 0; i < message_generators_.size(); i++) { + delete message_generators_[i]; + } +} void FileGenerator::GenerateMacroUndefs(io::Printer* printer) { + // Only do this for protobuf's own types. There are some google3 protos using + // macros as field names and the generated code compiles after the macro + // expansion. Undefing these macros actually breaks such code. + if (file_->name() != "google/protobuf/compiler/plugin.proto") { + return; + } std::vector names_to_undef; - CollectMacroNames(file_, &names_to_undef); + std::vector fields; + ListAllFields(file_, &fields); + for (int i = 0; i < fields.size(); i++) { + const string& name = fields[i]->name(); + static const char* kMacroNames[] = {"major", "minor"}; + for (int i = 0; i < GOOGLE_ARRAYSIZE(kMacroNames); ++i) { + if (name == kMacroNames[i]) { + names_to_undef.push_back(name); + break; + } + } + } for (int i = 0; i < names_to_undef.size(); ++i) { printer->Print( "#ifdef $name$\n" @@ -170,43 +143,41 @@ void FileGenerator::GenerateHeader(io::Printer* printer) { GenerateMacroUndefs(printer); - GenerateForwardDeclarations(printer); - - // Open namespace. - GenerateNamespaceOpeners(printer); - GenerateGlobalStateFunctionDeclarations(printer); - printer->Print("\n"); + GenerateForwardDeclarations(printer); - GenerateEnumDefinitions(printer); + { + NamespaceOpener ns(Namespace(file_), printer); - printer->Print(kThickSeparator); - printer->Print("\n"); + printer->Print("\n"); - GenerateMessageDefinitions(printer); + GenerateEnumDefinitions(printer); - printer->Print("\n"); - printer->Print(kThickSeparator); - printer->Print("\n"); + printer->Print(kThickSeparator); + printer->Print("\n"); - GenerateServiceDefinitions(printer); + GenerateMessageDefinitions(printer); - GenerateExtensionIdentifiers(printer); + printer->Print("\n"); + printer->Print(kThickSeparator); + printer->Print("\n"); - printer->Print("\n"); - printer->Print(kThickSeparator); - printer->Print("\n"); + GenerateServiceDefinitions(printer); - GenerateInlineFunctionDefinitions(printer); + GenerateExtensionIdentifiers(printer); - printer->Print( - "\n" - "// @@protoc_insertion_point(namespace_scope)\n" - "\n"); + printer->Print("\n"); + printer->Print(kThickSeparator); + printer->Print("\n"); + + GenerateInlineFunctionDefinitions(printer); - // Close up namespace. - GenerateNamespaceClosers(printer); + printer->Print( + "\n" + "// @@protoc_insertion_point(namespace_scope)\n" + "\n"); + } // We need to specialize some templates in the ::google::protobuf namespace: GenerateProto2NamespaceEnumSpecializations(printer); @@ -269,15 +240,12 @@ void FileGenerator::GeneratePBHeader(io::Printer* printer, // TODO(gerbens) remove this. printer->Print( "// @@protoc_insertion_point(includes)\n"); - - // Open namespace. - GenerateNamespaceOpeners(printer); - printer->Print( - "\n" - "// @@protoc_insertion_point(namespace_scope)\n"); - // Close up namespace. - GenerateNamespaceClosers(printer); - + { + NamespaceOpener ns(Namespace(file_), printer); + printer->Print( + "\n" + "// @@protoc_insertion_point(namespace_scope)\n"); + } printer->Print( "\n" "// @@protoc_insertion_point(global_scope)\n" @@ -287,7 +255,7 @@ void FileGenerator::GeneratePBHeader(io::Printer* printer, GenerateBottomHeaderGuard(printer, filename_identifier); } -void FileGenerator::GenerateSource(io::Printer* printer) { +void FileGenerator::GenerateSourceIncludes(io::Printer* printer) { const bool use_system_include = IsWellKnownMessage(file_); string header = StripProto(file_->name()) + (options_.proto_h ? ".proto.h" : ".pb.h"); @@ -295,9 +263,6 @@ void FileGenerator::GenerateSource(io::Printer* printer) { "// Generated by the protocol buffer compiler. DO NOT EDIT!\n" "// source: $filename$\n" "\n" - // The generated code calls accessors that might be deprecated. We don't - // want the compiler to warn in generated code. - "#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION\n" "#include $left$$header$$right$\n" "\n" "#include \n" // for swap() @@ -340,101 +305,129 @@ void FileGenerator::GenerateSource(io::Printer* printer) { printer->Print( "// @@protoc_insertion_point(includes)\n"); +} + +void FileGenerator::GenerateSourceDefaultInstance(int idx, + io::Printer* printer) { + printer->Print( + "class $classname$DefaultTypeInternal {\n" + " public:\n" + " ::google::protobuf::internal::ExplicitlyConstructed<$classname$>\n" + " _instance;\n", + "classname", message_generators_[idx]->classname_); + printer->Indent(); + message_generators_[idx]->GenerateExtraDefaultFields(printer); + printer->Outdent(); + printer->Print("} _$classname$_default_instance_;\n", "classname", + message_generators_[idx]->classname_); +} - GenerateNamespaceOpeners(printer); +namespace { - for (int i = 0; i < message_generators_.size(); i++) { - string parent; - if (IsMapEntryMessage(message_generators_[i]->descriptor_)) { - parent = ClassName(message_generators_[i]->descriptor_->containing_type(), - false) + - "::"; +// Generates weak symbol declarations for types that are to be considered weakly +// referenced. +void GenerateWeakDeclarations( + const FileDescriptor* file, const Options& options, + SCCAnalyzer* scc_analyzer, + io::Printer* printer) { + std::vector fields; + ListAllFields(file, &fields); + + // To ensure determinism and minimize the number of namespace statements, + // we output the forward declarations sorted on namespace and type / function + // name. + std::set > messages; + std::set > inits; + for (int i = 0; i < fields.size(); ++i) { + const FieldDescriptor* field = fields[i]; + bool is_weak = IsImplicitWeakField(field, options); + if (is_weak) { + const Descriptor* msg = field->message_type(); + string flns = FileLevelNamespace(msg); + string repr = ClassName(scc_analyzer->GetSCC(msg)->GetRepresentative()); + inits.insert(std::make_pair(flns, "InitDefaults" + repr)); + inits.insert(std::make_pair(flns, "AddDescriptors")); + messages.insert(std::make_pair(Namespace(msg), ClassName(msg))); } - printer->Print( - "class $classname$DefaultTypeInternal {\n" - "public:\n" - " ::google::protobuf::internal::ExplicitlyConstructed<$parent$$classname$>\n" - " _instance;\n", - "parent", parent, "classname", message_generators_[i]->classname_); - printer->Indent(); - message_generators_[i]->GenerateExtraDefaultFields(printer); - printer->Outdent(); - printer->Print( - "} _$classname$_default_instance_;\n", - "classname", message_generators_[i]->classname_); } - for (int i = 0; i < enum_generators_.size(); i++) { - enum_generators_[i]->index_in_metadata_ = i; + if (messages.empty()) { + return; } - if (HasGenericServices(file_, options_)) { - for (int i = 0; i < service_generators_.size(); i++) { - service_generators_[i]->index_in_metadata_ = i; - } + + printer->Print("\n"); + NamespaceOpener ns(printer); + for (std::set >::const_iterator it = + messages.begin(); + it != messages.end(); ++it) { + ns.ChangeTo(it->first); + printer->Print( + "extern __attribute__((weak)) $classname$DefaultTypeInternal " + "_$classname$_default_instance_;\n", + "classname", it->second); + } + for (std::set >::const_iterator it = inits.begin(); + it != inits.end(); ++it) { + ns.ChangeTo(it->first); + printer->Print("void $name$() __attribute__((weak));\n", + "name", it->second); } +} - printer->Print( - "\n" - "namespace $file_namespace$ {\n" - "\n", - "file_namespace", FileLevelNamespace(file_->name())); +} // namespace - if (HasDescriptorMethods(file_, options_)) { - printer->Print( - "\n" - "namespace {\n" - "\n"); +void FileGenerator::GenerateSourceForMessage(int idx, io::Printer* printer) { + GenerateSourceIncludes(printer); + GenerateWeakDeclarations(file_, options_, &scc_analyzer_, printer); - if (!message_generators_.empty()) { - printer->Print("::google::protobuf::Metadata file_level_metadata[$size$];\n", - "size", SimpleItoa(message_generators_.size())); - } - if (!enum_generators_.empty()) { - printer->Print( - "const ::google::protobuf::EnumDescriptor* " - "file_level_enum_descriptors[$size$];\n", - "size", SimpleItoa(enum_generators_.size())); - } - if (HasGenericServices(file_, options_) && file_->service_count() > 0) { - printer->Print( - "const ::google::protobuf::ServiceDescriptor* " - "file_level_service_descriptors[$size$];\n", - "size", SimpleItoa(file_->service_count())); - } + { // package namespace + NamespaceOpener ns(Namespace(file_), printer); + + // Define default instances + GenerateSourceDefaultInstance(idx, printer); + + // Generate classes. + printer->Print("\n"); + message_generators_[idx]->GenerateClassMethods(printer); printer->Print( - "\n" - "} // namespace\n" - "\n"); - } + "\n" + "// @@protoc_insertion_point(namespace_scope)\n"); + } // end package namespace - // Define our externally-visible BuildDescriptors() function. (For the lite - // library, all this does is initialize default instances.) - GenerateBuildDescriptors(printer); + if (IsSCCRepresentative(message_generators_[idx]->descriptor_)) { + NamespaceOpener ns(FileLevelNamespace(file_), printer); + GenerateInitForSCC(GetSCC(message_generators_[idx]->descriptor_), printer); + } printer->Print( "\n" - "} // namespace $file_namespace$\n" - "\n", - "file_namespace", FileLevelNamespace(file_->name())); + "// @@protoc_insertion_point(global_scope)\n"); +} + +void FileGenerator::GenerateGlobalSource(io::Printer* printer) { + GenerateSourceIncludes(printer); + GenerateWeakDeclarations(file_, options_, &scc_analyzer_, printer); + + // TODO(gerbens) Generate tables here + + // Define the code to initialize reflection. This code uses a global + // constructor to register reflection data with the runtime pre-main. + if (HasDescriptorMethods(file_, options_)) { + NamespaceOpener ns(FileLevelNamespace(file_), printer); + GenerateReflectionInitializationCode(printer); + } + + NamespaceOpener ns(Namespace(file_), printer); // Generate enums. for (int i = 0; i < enum_generators_.size(); i++) { - enum_generators_[i]->GenerateMethods(printer); + enum_generators_[i]->GenerateMethods(i, printer); } - // Generate classes. - for (int i = 0; i < message_generators_.size(); i++) { - printer->Print("\n"); - printer->Print(kThickSeparator); - printer->Print("\n"); - message_generators_[i]->GenerateClassMethods(printer); - - printer->Print("#if PROTOBUF_INLINE_NOT_IN_HEADERS\n"); - // Generate class inline methods. - message_generators_[i]->GenerateInlineMethods(printer, - /* is_inline = */ false); - printer->Print("#endif // PROTOBUF_INLINE_NOT_IN_HEADERS\n"); + // Define extensions. + for (int i = 0; i < extension_generators_.size(); i++) { + extension_generators_[i]->GenerateDefinition(printer); } if (HasGenericServices(file_, options_)) { @@ -446,18 +439,76 @@ void FileGenerator::GenerateSource(io::Printer* printer) { service_generators_[i]->GenerateImplementation(printer); } } +} - // Define extensions. - for (int i = 0; i < extension_generators_.size(); i++) { - extension_generators_[i]->GenerateDefinition(printer); +void FileGenerator::GenerateSource(io::Printer* printer) { + GenerateSourceIncludes(printer); + GenerateWeakDeclarations(file_, options_, &scc_analyzer_, printer); + + { + NamespaceOpener ns(Namespace(file_), printer); + + // Define default instances + for (int i = 0; i < message_generators_.size(); i++) { + GenerateSourceDefaultInstance(i, printer); + if (UsingImplicitWeakFields(file_, options_)) { + printer->Print("void $classname$_Reference() {}\n", "classname", + message_generators_[i]->classname_); + } + } } - printer->Print( - "\n" - "// @@protoc_insertion_point(namespace_scope)\n"); + { + NamespaceOpener ns(FileLevelNamespace(file_), printer); + // Define the initialization code to initialize the default instances. + // This code doesn't use a global constructor. + GenerateInitializationCode(printer); - GenerateNamespaceClosers(printer); + // Define the code to initialize reflection. This code uses a global + // constructor to register reflection data with the runtime pre-main. + if (HasDescriptorMethods(file_, options_)) { + GenerateReflectionInitializationCode(printer); + } + } + + + { + NamespaceOpener ns(Namespace(file_), printer); + + // Actually implement the protos + + // Generate enums. + for (int i = 0; i < enum_generators_.size(); i++) { + enum_generators_[i]->GenerateMethods(i, printer); + } + // Generate classes. + for (int i = 0; i < message_generators_.size(); i++) { + printer->Print("\n"); + printer->Print(kThickSeparator); + printer->Print("\n"); + message_generators_[i]->GenerateClassMethods(printer); + } + + if (HasGenericServices(file_, options_)) { + // Generate services. + for (int i = 0; i < service_generators_.size(); i++) { + if (i == 0) printer->Print("\n"); + printer->Print(kThickSeparator); + printer->Print("\n"); + service_generators_[i]->GenerateImplementation(printer); + } + } + + // Define extensions. + for (int i = 0; i < extension_generators_.size(); i++) { + extension_generators_[i]->GenerateDefinition(printer); + } + + printer->Print( + "\n" + "// @@protoc_insertion_point(namespace_scope)\n"); + } printer->Print( "\n" "// @@protoc_insertion_point(global_scope)\n"); @@ -512,6 +563,10 @@ class FileGenerator::ForwardDeclarations { options.dllexport_decl.empty() ? "" : options.dllexport_decl + " ", "classname", it->first); + if (options.lite_implicit_weak_fields) { + printer->Print("void $classname$_Reference();\n", + "classname", it->first); + } } for (std::map::const_iterator it = namespaces_.begin(), @@ -532,13 +587,11 @@ class FileGenerator::ForwardDeclarations { std::map enums_; }; -void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { +void FileGenerator::GenerateReflectionInitializationCode(io::Printer* printer) { // AddDescriptors() is a file-level procedure which adds the encoded // FileDescriptorProto for this .proto file to the global DescriptorPool for // generated files (DescriptorPool::generated_pool()). It ordinarily runs at - // static initialization time, but is not used at all in LITE_RUNTIME mode - // except when extensions are used. This procedure also constructs default - // instances and registers extensions. + // static initialization time, but is not used at all in LITE_RUNTIME mode. // // Its sibling, AssignDescriptors(), actually pulls the compiled // FileDescriptor from the DescriptorPool and uses it to populate all of @@ -547,172 +600,83 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { // anyone calls descriptor() or GetReflection() on one of the types defined // in the file. - // In optimize_for = LITE_RUNTIME mode, we don't generate AssignDescriptors() - // and we only use AddDescriptors() to allocate default instances. - - // TODO(ckennelly): Gate this with the same options flag to enable - // table-driven parsing. - - printer->Print("PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField\n" - " const TableStruct::entries[] " - "GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); - printer->Indent(); - - std::vector entries; - size_t count = 0; - for (int i = 0; i < message_generators_.size(); i++) { - size_t value = message_generators_[i]->GenerateParseOffsets(printer); - entries.push_back(value); - count += value; - } - - // We need these arrays to exist, and MSVC does not like empty arrays. - if (count == 0) { - printer->Print("{0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0},\n"); - } - - printer->Outdent(); - printer->Print( - "};\n" - "\n" - "PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField\n" - " const TableStruct::aux[] " - "GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); - printer->Indent(); - - std::vector aux_entries; - count = 0; - for (int i = 0; i < message_generators_.size(); i++) { - size_t value = message_generators_[i]->GenerateParseAuxTable(printer); - aux_entries.push_back(value); - count += value; - } - - if (count == 0) { - printer->Print("::google::protobuf::internal::AuxillaryParseTableField(),\n"); + if (!message_generators_.empty()) { + printer->Print("::google::protobuf::Metadata file_level_metadata[$size$];\n", "size", + SimpleItoa(message_generators_.size())); } - - printer->Outdent(); - printer->Print( - "};\n" - "PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const\n" - " TableStruct::schema[] " - "GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); - printer->Indent(); - - size_t offset = 0; - size_t aux_offset = 0; - for (int i = 0; i < message_generators_.size(); i++) { - message_generators_[i]->GenerateParseTable(printer, offset, aux_offset); - offset += entries[i]; - aux_offset += aux_entries[i]; + if (!enum_generators_.empty()) { + printer->Print( + "const ::google::protobuf::EnumDescriptor* " + "file_level_enum_descriptors[$size$];\n", + "size", SimpleItoa(enum_generators_.size())); } - - if (message_generators_.empty()) { - printer->Print("{ NULL, NULL, 0, -1, -1, -1, -1, NULL, false },\n"); + if (HasGenericServices(file_, options_) && file_->service_count() > 0) { + printer->Print( + "const ::google::protobuf::ServiceDescriptor* " + "file_level_service_descriptors[$size$];\n", + "size", SimpleItoa(file_->service_count())); } - printer->Outdent(); - printer->Print( - "};\n" - "\n"); - - if (!message_generators_.empty() && options_.table_driven_serialization) { + if (!message_generators_.empty()) { printer->Print( - "const ::google::protobuf::internal::FieldMetadata TableStruct::field_metadata[] " - "= {\n"); + "\n" + "const ::google::protobuf::uint32 TableStruct::offsets[] " + "GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); printer->Indent(); - std::vector field_metadata_offsets; - int idx = 0; + std::vector > pairs; + pairs.reserve(message_generators_.size()); for (int i = 0; i < message_generators_.size(); i++) { - field_metadata_offsets.push_back(idx); - idx += message_generators_[i]->GenerateFieldMetadata(printer); + pairs.push_back(message_generators_[i]->GenerateOffsets(printer)); } - field_metadata_offsets.push_back(idx); printer->Outdent(); printer->Print( "};\n" - "const ::google::protobuf::internal::SerializationTable " - "TableStruct::serialization_table[] = {\n"); + "static const ::google::protobuf::internal::MigrationSchema schemas[] " + "GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); + printer->Indent(); + { + int offset = 0; + for (int i = 0; i < message_generators_.size(); i++) { + message_generators_[i]->GenerateSchema(printer, offset, + pairs[i].second); + offset += pairs[i].first; + } + } + printer->Outdent(); + printer->Print( + "};\n" + "\nstatic " + "::google::protobuf::Message const * const file_default_instances[] = {\n"); printer->Indent(); - // We rely on the order we layout the tables to match the order we - // calculate them with FlattenMessagesInFile, so we check here that - // these match exactly. - std::vector calculated_order = - FlattenMessagesInFile(file_); - GOOGLE_CHECK_EQ(calculated_order.size(), message_generators_.size()); for (int i = 0; i < message_generators_.size(); i++) { - GOOGLE_CHECK_EQ(calculated_order[i], message_generators_[i]->descriptor_); + const Descriptor* descriptor = message_generators_[i]->descriptor_; printer->Print( - "{$num_fields$, TableStruct::field_metadata + $index$},\n", - "classname", message_generators_[i]->classname_, "num_fields", - SimpleItoa(field_metadata_offsets[i + 1] - field_metadata_offsets[i]), - "index", SimpleItoa(field_metadata_offsets[i])); + "reinterpret_cast(&$ns$::_$classname$_default_instance_),\n", + "classname", ClassName(descriptor), "ns", Namespace(descriptor)); } printer->Outdent(); printer->Print( "};\n" "\n"); + } else { + // we still need these symbols to exist + printer->Print( + // MSVC doesn't like empty arrays, so we add a dummy. + "const ::google::protobuf::uint32 TableStruct::offsets[1] = {};\n" + "static const ::google::protobuf::internal::MigrationSchema* schemas = NULL;\n" + "static const ::google::protobuf::Message* const* " + "file_default_instances = NULL;\n" + "\n"); } - if (HasDescriptorMethods(file_, options_)) { - if (!message_generators_.empty()) { - printer->Print("const ::google::protobuf::uint32 TableStruct::offsets[] " - "GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); - printer->Indent(); - std::vector > pairs; - for (int i = 0; i < message_generators_.size(); i++) { - pairs.push_back(message_generators_[i]->GenerateOffsets(printer)); - } - printer->Outdent(); - printer->Print( - "};\n" - "static const ::google::protobuf::internal::MigrationSchema schemas[] " - "GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); - printer->Indent(); - { - int offset = 0; - for (int i = 0; i < message_generators_.size(); i++) { - message_generators_[i]->GenerateSchema(printer, offset, - pairs[i].second); - offset += pairs[i].first; - } - } - printer->Outdent(); - printer->Print( - "};\n" - "\nstatic " - "::google::protobuf::Message const * const file_default_instances[] = {\n"); - printer->Indent(); - for (int i = 0; i < message_generators_.size(); i++) { - const Descriptor* descriptor = message_generators_[i]->descriptor_; - printer->Print( - "reinterpret_cast(&_$classname$_default_instance_),\n", - "classname", ClassName(descriptor, false)); - } - printer->Outdent(); - printer->Print( - "};\n" - "\n"); - } else { - // we still need these symbols to exist - printer->Print( - // MSVC doesn't like empty arrays, so we add a dummy. - "const ::google::protobuf::uint32 TableStruct::offsets[1] = {};\n" - "static const ::google::protobuf::internal::MigrationSchema* schemas = NULL;\n" - "static const ::google::protobuf::Message* const* " - "file_default_instances = NULL;\n"); - } - // --------------------------------------------------------------- + // --------------------------------------------------------------- - // protobuf_AssignDescriptorsOnce(): The first time it is called, calls - // AssignDescriptors(). All later times, waits for the first call to - // complete and then returns. - string message_factory = "NULL"; + // protobuf_AssignDescriptorsOnce(): The first time it is called, calls + // AssignDescriptors(). All later times, waits for the first call to + // complete and then returns. + string message_factory = "NULL"; printer->Print( - "namespace {\n" - "\n" "void protobuf_AssignDescriptors() {\n" // Make sure the file has found its way into the pool. If a descriptor // is requested *during* static init then AddDescriptors() may not have @@ -733,20 +697,6 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { ? "file_level_service_descriptors" : "NULL", "factory", message_factory); - // TODO(gerbens) have the compiler include the schemas for map types - // so that this can go away, and we can potentially use table driven - // serialization for map types as well. - for (int i = 0; i < message_generators_.size(); i++) { - if (!IsMapEntryMessage(message_generators_[i]->descriptor_)) continue; - printer->Print( - "file_level_metadata[$index$].reflection = " - "$parent$::$classname$::CreateReflection(file_level_metadata[$index$]" - ".descriptor, _$classname$_default_instance_._instance.get_mutable());\n", - "index", SimpleItoa(i), "parent", - ClassName(message_generators_[i]->descriptor_->containing_type(), - false), - "classname", ClassName(message_generators_[i]->descriptor_, false)); - } printer->Print( "}\n" "\n" @@ -769,7 +719,8 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { // protobuf_AssignDescriptorsOnce, because that is called from all the // GetMetadata member methods. printer->Print( - "void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;\n" + "void protobuf_RegisterTypes(const ::std::string&) " + "GOOGLE_PROTOBUF_ATTRIBUTE_COLD;\n" "void protobuf_RegisterTypes(const ::std::string&) {\n" " protobuf_AssignDescriptorsOnce();\n"); printer->Indent(); @@ -783,63 +734,15 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { printer->Outdent(); printer->Print( - "}\n" - "\n" - "} // namespace\n"); - } - - // Now generate the InitDefaultsImpl() function. - printer->Print( - "void TableStruct::InitDefaultsImpl() {\n" - " GOOGLE_PROTOBUF_VERIFY_VERSION;\n\n" - // Force initialization of primitive values we depend on. - " ::google::protobuf::internal::InitProtobufDefaults();\n"); - - printer->Indent(); - - // Call the InitDefaults() methods for all of our dependencies, to make - // sure they get added first. - for (int i = 0; i < file_->dependency_count(); i++) { - const FileDescriptor* dependency = file_->dependency(i); - // Print the namespace prefix for the dependency. - string file_namespace = QualifiedFileLevelSymbol( - dependency->package(), FileLevelNamespace(dependency->name())); - // Call its AddDescriptors function. - printer->Print("$file_namespace$::InitDefaults();\n", "file_namespace", - file_namespace); - } - - // Allocate and initialize default instances. This can't be done lazily - // since default instances are returned by simple accessors and are used with - // extensions. Speaking of which, we also register extensions at this time. - for (int i = 0; i < message_generators_.size(); i++) { - message_generators_[i]->GenerateDefaultInstanceAllocator(printer); - } - for (int i = 0; i < extension_generators_.size(); i++) { - extension_generators_[i]->GenerateRegistration(printer); - } - for (int i = 0; i < message_generators_.size(); i++) { - message_generators_[i]->GenerateDefaultInstanceInitializer(printer); - } - printer->Outdent(); - printer->Print( - "}\n" - "\n" - "void InitDefaults() {\n" - " static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n" - " ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);\n" - "}\n"); - - // ----------------------------------------------------------------- + "}\n" + "\n"); - // Now generate the AddDescriptors() function. - printer->Print( - "namespace {\n" - "void AddDescriptorsImpl() {\n" - " InitDefaults();\n"); + // Now generate the AddDescriptors() function. + printer->Print( + "void AddDescriptorsImpl() {\n" + " InitDefaults();\n"); + printer->Indent(); - printer->Indent(); - if (HasDescriptorMethods(file_, options_)) { // Embed the descriptor. We simply serialize the entire // FileDescriptorProto // and embed it as a string literal, which is parsed and built into real @@ -850,10 +753,11 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { file_proto.SerializeToString(&file_data); printer->Print("static const char descriptor[] " - "GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); + "GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) " + "= {\n"); printer->Indent(); - if (file_data.size() > 66535) { + if (file_data.size() > 65535) { // Workaround for MSVC: "Error C1091: compiler limit: string exceeds 65535 // bytes in length". Declare a static array of characters rather than use // a string literal. Only write 25 bytes per line. @@ -887,31 +791,27 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { "::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(\n" " \"$filename$\", &protobuf_RegisterTypes);\n", "filename", file_->name()); - } // Call the AddDescriptors() methods for all of our dependencies, to make // sure they get added first. for (int i = 0; i < file_->dependency_count(); i++) { const FileDescriptor* dependency = file_->dependency(i); // Print the namespace prefix for the dependency. - string file_namespace = QualifiedFileLevelSymbol( - dependency->package(), FileLevelNamespace(dependency->name())); + string file_namespace = FileLevelNamespace(dependency); // Call its AddDescriptors function. - printer->Print("$file_namespace$::AddDescriptors();\n", "file_namespace", + printer->Print("::$file_namespace$::AddDescriptors();\n", "file_namespace", file_namespace); } printer->Outdent(); printer->Print( "}\n" - "} // anonymous namespace\n" "\n" "void AddDescriptors() {\n" " static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n" " ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);\n" "}\n"); - if (StaticInitializersForced(file_, options_)) { printer->Print( "// Force AddDescriptors() to be called at dynamic initialization " "time.\n" @@ -920,24 +820,213 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { " AddDescriptors();\n" " }\n" "} static_descriptor_initializer;\n"); - } } -void FileGenerator::GenerateNamespaceOpeners(io::Printer* printer) { - if (package_parts_.size() > 0) printer->Print("\n"); +void FileGenerator::GenerateInitForSCC(const SCC* scc, io::Printer* printer) { + const string scc_name = ClassName(scc->GetRepresentative()); + printer->Print( + "void InitDefaults$scc_name$Impl() {\n" + " GOOGLE_PROTOBUF_VERIFY_VERSION;\n\n" + // Force initialization of primitive values we depend on. + " ::google::protobuf::internal::InitProtobufDefaults();\n", + "scc_name", scc_name); - for (int i = 0; i < package_parts_.size(); i++) { - printer->Print("namespace $part$ {\n", - "part", package_parts_[i]); + printer->Indent(); + + // Call the InitDefaults() methods for all of our dependencies, to make + // sure they get added first. + for (int i = 0; i < scc->children.size(); i++) { + const SCC* child_scc = scc->children[i]; + const FileDescriptor* dependency = child_scc->GetRepresentative()->file(); + // Print the namespace prefix for the dependency. + string file_namespace = FileLevelNamespace(dependency); + std::map variables; + variables["file_namespace"] = file_namespace; + variables["scc_name"] = ClassName(child_scc->GetRepresentative(), false); + bool using_weak_fields = UsingImplicitWeakFields(file_, options_); + if (using_weak_fields) { + // We're building for lite with implicit weak fields, so we need to handle + // the possibility that this InitDefaults function is not linked into the + // binary. Some of these might actually be guaranteed to be non-null since + // we might have a strong reference to the dependency (via a required + // field, for example), but it's simplest to just assume that any of them + // could be null. + printer->Print( + variables, + "if (&$file_namespace$::InitDefaults$scc_name$ != NULL) {\n" + " $file_namespace$::InitDefaults$scc_name$();\n" + "}\n"); + } else { + printer->Print(variables, + "$file_namespace$::InitDefaults$scc_name$();\n"); + } + } + + // First construct all the necessary default instances. + for (int i = 0; i < message_generators_.size(); i++) { + if (scc_analyzer_.GetSCC(message_generators_[i]->descriptor_) != scc) { + continue; + } + // TODO(gerbens) This requires this function to be friend. Remove + // the need for this. + message_generators_[i]->GenerateFieldDefaultInstances(printer); + printer->Print( + "{\n" + " void* ptr = &$ns$::_$classname$_default_instance_;\n" + " new (ptr) $ns$::$classname$();\n", + "ns", Namespace(message_generators_[i]->descriptor_), + "classname", ClassName(message_generators_[i]->descriptor_)); + if (!IsMapEntryMessage(message_generators_[i]->descriptor_)) { + printer->Print( + " ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);\n"); + } + printer->Print("}\n"); } + + // TODO(gerbens) make default instances be the same as normal instances. + // Default instances differ from normal instances because they have cross + // linked message fields. + for (int i = 0; i < message_generators_.size(); i++) { + if (scc_analyzer_.GetSCC(message_generators_[i]->descriptor_) != scc) { + continue; + } + printer->Print("$classname$::InitAsDefaultInstance();\n", "classname", + QualifiedClassName(message_generators_[i]->descriptor_)); + } + printer->Outdent(); + printer->Print("}\n\n"); + printer->Print( + "void InitDefaults$scc_name$() {\n" + " static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n" + " ::google::protobuf::GoogleOnceInit(&once, " + "&InitDefaults$scc_name$Impl);\n" + "}\n\n", + "scc_name", scc_name); } -void FileGenerator::GenerateNamespaceClosers(io::Printer* printer) { - if (package_parts_.size() > 0) printer->Print("\n"); +void FileGenerator::GenerateInitializationCode(io::Printer* printer) { + // Messages depend on the existence of a default instance, which has to + // initialized properly. The default instances are allocated in the data + // segment, but we can't quite allocate the type directly. The destructors + // cannot run at program exit as this could lead to segfaults in a threaded + // environment. Hence these instances must be inplace constructed at first + // use. + + if (options_.table_driven_parsing) { + // TODO(ckennelly): Gate this with the same options flag to enable + // table-driven parsing. + printer->Print( + "PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField\n" + " const TableStruct::entries[] " + "GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); + printer->Indent(); - for (int i = package_parts_.size() - 1; i >= 0; i--) { - printer->Print("} // namespace $part$\n", - "part", package_parts_[i]); + std::vector entries; + size_t count = 0; + for (int i = 0; i < message_generators_.size(); i++) { + size_t value = message_generators_[i]->GenerateParseOffsets(printer); + entries.push_back(value); + count += value; + } + + // We need these arrays to exist, and MSVC does not like empty arrays. + if (count == 0) { + printer->Print("{0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0},\n"); + } + + printer->Outdent(); + printer->Print( + "};\n" + "\n" + "PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField\n" + " const TableStruct::aux[] " + "GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); + printer->Indent(); + + std::vector aux_entries; + count = 0; + for (int i = 0; i < message_generators_.size(); i++) { + size_t value = message_generators_[i]->GenerateParseAuxTable(printer); + aux_entries.push_back(value); + count += value; + } + + if (count == 0) { + printer->Print("::google::protobuf::internal::AuxillaryParseTableField(),\n"); + } + + printer->Outdent(); + printer->Print( + "};\n" + "PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const\n" + " TableStruct::schema[] " + "GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {\n"); + printer->Indent(); + + size_t offset = 0; + size_t aux_offset = 0; + for (int i = 0; i < message_generators_.size(); i++) { + message_generators_[i]->GenerateParseTable(printer, offset, aux_offset); + offset += entries[i]; + aux_offset += aux_entries[i]; + } + + if (message_generators_.empty()) { + printer->Print("{ NULL, NULL, 0, -1, -1, false },\n"); + } + + printer->Outdent(); + printer->Print( + "};\n" + "\n"); + } + + if (!message_generators_.empty() && options_.table_driven_serialization) { + printer->Print( + "const ::google::protobuf::internal::FieldMetadata TableStruct::field_metadata[] " + "= {\n"); + printer->Indent(); + std::vector field_metadata_offsets; + int idx = 0; + for (int i = 0; i < message_generators_.size(); i++) { + field_metadata_offsets.push_back(idx); + idx += message_generators_[i]->GenerateFieldMetadata(printer); + } + field_metadata_offsets.push_back(idx); + printer->Outdent(); + printer->Print( + "};\n" + "const ::google::protobuf::internal::SerializationTable " + "TableStruct::serialization_table[] = {\n"); + printer->Indent(); + // We rely on the order we layout the tables to match the order we + // calculate them with FlattenMessagesInFile, so we check here that + // these match exactly. + std::vector calculated_order = + FlattenMessagesInFile(file_); + GOOGLE_CHECK_EQ(calculated_order.size(), message_generators_.size()); + for (int i = 0; i < message_generators_.size(); i++) { + GOOGLE_CHECK_EQ(calculated_order[i], message_generators_[i]->descriptor_); + printer->Print( + "{$num_fields$, TableStruct::field_metadata + $index$},\n", + "classname", message_generators_[i]->classname_, "num_fields", + SimpleItoa(field_metadata_offsets[i + 1] - field_metadata_offsets[i]), + "index", SimpleItoa(field_metadata_offsets[i])); + } + printer->Outdent(); + printer->Print( + "};\n" + "\n"); + } + + // ----------------------------------------------------------------- + // All functionality that need private access. + + // Now generate the InitDefaults for each SCC. + for (int i = 0; i < message_generators_.size(); i++) { + if (IsSCCRepresentative(message_generators_[i]->descriptor_)) { + GenerateInitForSCC(GetSCC(message_generators_[i]->descriptor_), printer); + } } } @@ -985,6 +1074,9 @@ void FileGenerator::GenerateBottomHeaderGuard( } void FileGenerator::GenerateLibraryIncludes(io::Printer* printer) { + if (UsingImplicitWeakFields(file_, options_)) { + printer->Print("#include \n"); + } printer->Print( "#include \n" @@ -1114,31 +1206,56 @@ void FileGenerator::GenerateDependencyIncludes(io::Printer* printer) { void FileGenerator::GenerateGlobalStateFunctionDeclarations( io::Printer* printer) { - // Forward-declare the AddDescriptors, AssignDescriptors - // functions, so that we can declare them to be friends of each class. +// Forward-declare the AddDescriptors, InitDefaults because these are called +// by .pb.cc files depending on this file. printer->Print( "\n" "namespace $file_namespace$ {\n" - "// Internal implementation detail -- do not call these.\n" + "// Internal implementation detail -- do not use these members.\n" "struct $dllexport_decl$TableStruct {\n" + // These tables describe how to serialize and parse messages. Used + // for table driven code. " static const ::google::protobuf::internal::ParseTableField entries[];\n" " static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n" - " static const ::google::protobuf::internal::ParseTable schema[];\n" - " static const ::google::protobuf::uint32 offsets[];\n" + " static const ::google::protobuf::internal::ParseTable schema[$num$];\n" " static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n" " static const ::google::protobuf::internal::SerializationTable " "serialization_table[];\n" - // The following function(s) need to be able to access private members of - // the messages defined in the file. So we make them static members. - // This is the internal implementation of InitDefaults. It should only - // be called by InitDefaults which makes sure it will be called only once. - " static void InitDefaultsImpl();\n" - "};\n" - "void $dllexport_decl$AddDescriptors();\n" - "void $dllexport_decl$InitDefaults();\n" - "} // namespace $file_namespace$\n", - "file_namespace", FileLevelNamespace(file_->name()), "dllexport_decl", + " static const ::google::protobuf::uint32 offsets[];\n" + "};\n", + "file_namespace", FileLevelNamespace(file_), "dllexport_decl", + options_.dllexport_decl.empty() ? "" : options_.dllexport_decl + " ", + "num", SimpleItoa(std::max(size_t(1), message_generators_.size()))); + if (HasDescriptorMethods(file_, options_)) { + printer->Print( + "void $dllexport_decl$AddDescriptors();\n", "dllexport_decl", + options_.dllexport_decl.empty() ? "" : options_.dllexport_decl + " "); + } + for (int i = 0; i < message_generators_.size(); i++) { + if (!IsSCCRepresentative(message_generators_[i]->descriptor_)) continue; + string scc_name = ClassName(message_generators_[i]->descriptor_); + // TODO(gerbens) Remove the Impl from header. This is solely because + // it currently still needs to be a friend of the protos. + printer->Print( + "void $dllexport_decl$InitDefaults$scc_name$Impl();\n" + "void $dllexport_decl$InitDefaults$scc_name$();\n", + "scc_name", scc_name, "dllexport_decl", + options_.dllexport_decl.empty() ? "" : options_.dllexport_decl + " "); + } + // TODO(gerbens) This is for proto1 interoperability. Remove when proto1 + // is gone. + printer->Print( + "inline void $dllexport_decl$InitDefaults() {\n", "dllexport_decl", options_.dllexport_decl.empty() ? "" : options_.dllexport_decl + " "); + for (int i = 0; i < message_generators_.size(); i++) { + if (!IsSCCRepresentative(message_generators_[i]->descriptor_)) continue; + string scc_name = ClassName(message_generators_[i]->descriptor_); + printer->Print(" InitDefaults$scc_name$();\n", "scc_name", scc_name); + } + printer->Print("}\n"); + printer->Print( + "} // namespace $file_namespace$\n", + "file_namespace", FileLevelNamespace(file_)); } void FileGenerator::GenerateMessageDefinitions(io::Printer* printer) { @@ -1187,41 +1304,6 @@ void FileGenerator::GenerateExtensionIdentifiers(io::Printer* printer) { } void FileGenerator::GenerateInlineFunctionDefinitions(io::Printer* printer) { - // An aside about inline functions in .proto.h mode: - // - // The PROTOBUF_INLINE_NOT_IN_HEADERS symbol controls conditionally - // moving much of the inline functions to the .pb.cc file, which can be a - // significant performance benefit for compilation time, at the expense - // of non-inline function calls. - // - // However, in .proto.h mode, the definition of the internal dependent - // base class must remain in the header, and can never be out-lined. The - // dependent base class also needs access to has-bit manipuation - // functions, so the has-bit functions must be unconditionally inlined in - // proto_h mode. - // - // This gives us three flavors of functions: - // - // 1. Functions on the message not used by the internal dependent base - // class: in .proto.h mode, only some functions are defined on the - // message class; others are defined on the dependent base class. - // These are guarded and can be out-lined. These are generated by - // GenerateInlineMethods, and include has_* bit functions in - // non-proto_h mode. - // - // 2. Functions on the internal dependent base class: these functions - // are dependent on a template parameter, so they always need to - // remain in the header. - // - // 3. Functions on the message that are used by the dependent base: the - // dependent base class down casts itself to the message - // implementation class to access these functions (the has_* bit - // manipulation functions). Unlike #1, these functions must - // unconditionally remain in the header. These are emitted by - // GenerateDependentInlineMethods, even though they are not actually - // dependent. - - printer->Print("#if !PROTOBUF_INLINE_NOT_IN_HEADERS\n"); // TODO(gerbens) remove pragmas when gcc is no longer used. Current version // of gcc fires a bogus error when compiled with strict-aliasing. printer->Print( @@ -1242,7 +1324,6 @@ void FileGenerator::GenerateInlineFunctionDefinitions(io::Printer* printer) { "#ifdef __GNUC__\n" " #pragma GCC diagnostic pop\n" "#endif // __GNUC__\n"); - printer->Print("#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS\n"); for (int i = 0; i < message_generators_.size(); i++) { if (i > 0) { diff --git a/src/google/protobuf/compiler/cpp/cpp_file.h b/src/google/protobuf/compiler/cpp/cpp_file.h index e10fe2f3..7e61cbad 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.h +++ b/src/google/protobuf/compiler/cpp/cpp_file.h @@ -35,10 +35,12 @@ #ifndef GOOGLE_PROTOBUF_COMPILER_CPP_FILE_H__ #define GOOGLE_PROTOBUF_COMPILER_CPP_FILE_H__ +#include #include #ifndef _SHARED_PTR_H #include #endif +#include #include #include #include @@ -82,16 +84,21 @@ class FileGenerator { const string& info_path); void GenerateSource(io::Printer* printer); + int NumMessages() const { return message_generators_.size(); } + // Similar to GenerateSource but generates only one message + void GenerateSourceForMessage(int idx, io::Printer* printer); + void GenerateGlobalSource(io::Printer* printer); + private: // Internal type used by GenerateForwardDeclarations (defined in file.cc). class ForwardDeclarations; - // Generate the BuildDescriptors() procedure, which builds all descriptors - // for types defined in the file. - void GenerateBuildDescriptors(io::Printer* printer); + void GenerateSourceIncludes(io::Printer* printer); + void GenerateSourceDefaultInstance(int idx, io::Printer* printer); - void GenerateNamespaceOpeners(io::Printer* printer); - void GenerateNamespaceClosers(io::Printer* printer); + void GenerateInitForSCC(const SCC* scc, io::Printer* printer); + void GenerateInitializationCode(io::Printer* printer); + void GenerateReflectionInitializationCode(io::Printer* printer); // For other imports, generates their forward-declarations. void GenerateForwardDeclarations(io::Printer* printer); @@ -143,11 +150,23 @@ class FileGenerator { // a breaking change so we prefer the #undef approach. void GenerateMacroUndefs(io::Printer* printer); + bool IsSCCRepresentative(const Descriptor* d) { + return GetSCCRepresentative(d) == d; + } + const Descriptor* GetSCCRepresentative(const Descriptor* d) { + return GetSCC(d)->GetRepresentative(); + } + const SCC* GetSCC(const Descriptor* d) { + return scc_analyzer_.GetSCC(d); + } + + const FileDescriptor* file_; const Options options_; SCCAnalyzer scc_analyzer_; + // Contains the post-order walk of all the messages (and child messages) in // this file. If you need a pre-order walk just reverse iterate. std::vector message_generators_; @@ -155,10 +174,8 @@ class FileGenerator { std::vector service_generators_; std::vector extension_generators_; - // These members are just for owning (and thus proper deleting). Some of the - // message_ and enum_generators above are owned by child messages. - google::protobuf::scoped_array > - message_generators_owner_; + // These members are just for owning (and thus proper deleting). + // Nested (enum/extension)_generators are owned by child messages. google::protobuf::scoped_array > enum_generators_owner_; google::protobuf::scoped_array > service_generators_owner_; diff --git a/src/google/protobuf/compiler/cpp/cpp_generator.cc b/src/google/protobuf/compiler/cpp/cpp_generator.cc index 68abd0ef..e01e5dca 100644 --- a/src/google/protobuf/compiler/cpp/cpp_generator.cc +++ b/src/google/protobuf/compiler/cpp/cpp_generator.cc @@ -46,6 +46,7 @@ #include #include #include +#include namespace google { namespace protobuf { @@ -84,7 +85,7 @@ bool CppGenerator::Generate(const FileDescriptor* file, // __declspec(dllimport) depending on what is being compiled. // Options file_options; - + bool split_source = false; for (int i = 0; i < options.size(); i++) { if (options[i].first == "dllexport_decl") { file_options.dllexport_decl = options[i].second; @@ -98,10 +99,14 @@ bool CppGenerator::Generate(const FileDescriptor* file, file_options.annotation_guard_name = options[i].second; } else if (options[i].first == "lite") { file_options.enforce_lite = true; + } else if (options[i].first == "lite_implicit_weak_fields") { + file_options.lite_implicit_weak_fields = true; } else if (options[i].first == "table_driven_parsing") { file_options.table_driven_parsing = true; } else if (options[i].first == "table_driven_serialization") { file_options.table_driven_serialization = true; + } else if (options[i].first == "split_source") { + split_source = true; } else { *error = "Unknown generator option: " + options[i].first; return false; @@ -135,14 +140,13 @@ bool CppGenerator::Generate(const FileDescriptor* file, } } - basename.append(".pb"); { google::protobuf::scoped_ptr output( - generator_context->Open(basename + ".h")); + generator_context->Open(basename + ".pb.h")); GeneratedCodeInfo annotations; io::AnnotationProtoCollector annotation_collector( &annotations); - string info_path = basename + ".h.meta"; + string info_path = basename + ".pb.h.meta"; io::Printer printer(output.get(), '$', file_options.annotate_headers ? &annotation_collector : NULL); @@ -156,9 +160,24 @@ bool CppGenerator::Generate(const FileDescriptor* file, } // Generate cc file. - { + if (split_source) { + { + // This is the global .cc file, containing enum/services/tables/reflection + google::protobuf::scoped_ptr output( + generator_context->Open(basename + ".pb.cc")); + io::Printer printer(output.get(), '$'); + file_generator.GenerateGlobalSource(&printer); + } + for (int i = 0; i < file_generator.NumMessages(); i++) { + // TODO(gerbens) Agree on naming scheme. + google::protobuf::scoped_ptr output( + generator_context->Open(basename + "." + SimpleItoa(i) + ".cc")); + io::Printer printer(output.get(), '$'); + file_generator.GenerateSourceForMessage(i, &printer); + } + } else { google::protobuf::scoped_ptr output( - generator_context->Open(basename + ".cc")); + generator_context->Open(basename + ".pb.cc")); io::Printer printer(output.get(), '$'); file_generator.GenerateSource(&printer); } diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.cc b/src/google/protobuf/compiler/cpp/cpp_helpers.cc index 00959796..4aa77d06 100644 --- a/src/google/protobuf/compiler/cpp/cpp_helpers.cc +++ b/src/google/protobuf/compiler/cpp/cpp_helpers.cc @@ -32,10 +32,11 @@ // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. +#include #include #include +#include #include -#include #include #include @@ -105,6 +106,30 @@ bool HasExtension(const Descriptor* descriptor) { return false; } +// Encode [0..63] as 'A'-'Z', 'a'-'z', '0'-'9', '_' +char Base63Char(int value) { + GOOGLE_CHECK_GE(value, 0); + if (value < 26) return 'A' + value; + value -= 26; + if (value < 26) return 'a' + value; + value -= 26; + if (value < 10) return '0' + value; + GOOGLE_CHECK_EQ(value, 10); + return '_'; +} + +// Given a c identifier has 63 legal characters we can't implement base64 +// encoding. So we return the k least significant "digits" in base 63. +template +string Base63(I n, int k) { + string res; + while (k-- > 0) { + res += Base63Char(static_cast(n % 63)); + n /= 63; + } + return res; +} + } // namespace string UnderscoresToCamelCase(const string& input, bool cap_next_letter) { @@ -137,44 +162,63 @@ const char kThickSeparator[] = const char kThinSeparator[] = "// -------------------------------------------------------------------\n"; -string ClassName(const Descriptor* descriptor, bool qualified) { - - // Find "outer", the descriptor of the top-level message in which - // "descriptor" is embedded. - const Descriptor* outer = descriptor; - while (outer->containing_type() != NULL) outer = outer->containing_type(); - - const string& outer_name = outer->full_name(); - string inner_name = descriptor->full_name().substr(outer_name.size()); - - if (qualified) { - return "::" + DotsToColons(outer_name) + DotsToUnderscores(inner_name); - } else { - return outer->name() + DotsToUnderscores(inner_name); +bool CanInitializeByZeroing(const FieldDescriptor* field) { + if (field->is_repeated() || field->is_extension()) return false; + switch (field->cpp_type()) { + case FieldDescriptor::CPPTYPE_ENUM: + return field->default_value_enum()->number() == 0; + case FieldDescriptor::CPPTYPE_INT32: + return field->default_value_int32() == 0; + case FieldDescriptor::CPPTYPE_INT64: + return field->default_value_int64() == 0; + case FieldDescriptor::CPPTYPE_UINT32: + return field->default_value_uint32() == 0; + case FieldDescriptor::CPPTYPE_UINT64: + return field->default_value_uint64() == 0; + case FieldDescriptor::CPPTYPE_FLOAT: + return field->default_value_float() == 0; + case FieldDescriptor::CPPTYPE_DOUBLE: + return field->default_value_double() == 0; + case FieldDescriptor::CPPTYPE_BOOL: + return field->default_value_bool() == false; + default: + return false; } } -string ClassName(const EnumDescriptor* enum_descriptor, bool qualified) { +string ClassName(const Descriptor* descriptor) { + const Descriptor* parent = descriptor->containing_type(); + string res; + if (parent) res += ClassName(parent) + "_"; + res += descriptor->name(); + if (IsMapEntryMessage(descriptor)) res += "_DoNotUse"; + return res; +} + +string ClassName(const EnumDescriptor* enum_descriptor) { if (enum_descriptor->containing_type() == NULL) { - if (qualified) { - return "::" + DotsToColons(enum_descriptor->full_name()); - } else { - return enum_descriptor->name(); - } + return enum_descriptor->name(); } else { - string result = ClassName(enum_descriptor->containing_type(), qualified); - result += '_'; - result += enum_descriptor->name(); - return result; + return ClassName(enum_descriptor->containing_type()) + "_" + + enum_descriptor->name(); } } +string Namespace(const string& package) { + if (package.empty()) return ""; + return "::" + DotsToColons(package); +} + string DefaultInstanceName(const Descriptor* descriptor) { string prefix = descriptor->file()->package().empty() ? "" : "::"; return prefix + DotsToColons(descriptor->file()->package()) + "::_" + ClassName(descriptor, false) + "_default_instance_"; } +string ReferenceFunctionName(const Descriptor* descriptor) { + return QualifiedClassName(descriptor) + "_Reference"; +} + string DependentBaseClassTemplateName(const Descriptor* descriptor) { return ClassName(descriptor, false) + "_InternalBase"; } @@ -210,6 +254,30 @@ string EnumValueName(const EnumValueDescriptor* enum_value) { return result; } +int EstimateAlignmentSize(const FieldDescriptor* field) { + if (field == NULL) return 0; + if (field->is_repeated()) return 8; + switch (field->cpp_type()) { + case FieldDescriptor::CPPTYPE_BOOL: + return 1; + + case FieldDescriptor::CPPTYPE_INT32: + case FieldDescriptor::CPPTYPE_UINT32: + case FieldDescriptor::CPPTYPE_ENUM: + case FieldDescriptor::CPPTYPE_FLOAT: + return 4; + + case FieldDescriptor::CPPTYPE_INT64: + case FieldDescriptor::CPPTYPE_UINT64: + case FieldDescriptor::CPPTYPE_DOUBLE: + case FieldDescriptor::CPPTYPE_STRING: + case FieldDescriptor::CPPTYPE_MESSAGE: + return 8; + } + GOOGLE_LOG(FATAL) << "Can't get here."; + return -1; // Make compiler happy. +} + string FieldConstantName(const FieldDescriptor *field) { string field_name = UnderscoresToCamelCase(field->name(), true); string result = "k" + field_name + "FieldNumber"; @@ -484,19 +552,6 @@ string SafeFunctionName(const Descriptor* descriptor, return function_name; } -bool StaticInitializersForced(const FileDescriptor* file, - const Options& options) { - if (HasDescriptorMethods(file, options) || file->extension_count() > 0) { - return true; - } - for (int i = 0; i < file->message_type_count(); ++i) { - if (HasExtension(file->message_type(i))) { - return true; - } - } - return false; -} - static bool HasMapFields(const Descriptor* descriptor) { for (int i = 0; i < descriptor->field_count(); ++i) { @@ -672,13 +727,11 @@ void Flatten(const Descriptor* descriptor, } // namespace -std::vector FlattenMessagesInFile( - const FileDescriptor* file) { - std::vector result; +void FlattenMessagesInFile(const FileDescriptor* file, + std::vector* result) { for (int i = 0; i < file->message_type_count(); i++) { - Flatten(file->message_type(i), &result); + Flatten(file->message_type(i), result); } - return result; } bool HasWeakFields(const Descriptor* descriptor) { @@ -689,6 +742,27 @@ bool HasWeakFields(const FileDescriptor* file) { return false; } +bool UsingImplicitWeakFields(const FileDescriptor* file, + const Options& options) { + return options.lite_implicit_weak_fields && + GetOptimizeFor(file, options) == FileOptions::LITE_RUNTIME; +} + + +bool IsImplicitWeakField(const FieldDescriptor* field, const Options& options) { + return UsingImplicitWeakFields(field->file(), options) && + field->type() == FieldDescriptor::TYPE_MESSAGE && + !field->is_required() && !field->is_repeated() && !field->is_map() && + field->containing_oneof() == NULL && + field->message_type()->file() != field->file(); +} + +struct CompareDescriptors { + bool operator()(const Descriptor* a, const Descriptor* b) { + return a->full_name() < b->full_name(); + } +}; + SCCAnalyzer::NodeData SCCAnalyzer::DFS(const Descriptor* descriptor) { // Must not have visited already. GOOGLE_DCHECK_EQ(cache_.count(descriptor), 0); @@ -728,10 +802,33 @@ SCCAnalyzer::NodeData SCCAnalyzer::DFS(const Descriptor* descriptor) { if (scc_desc == descriptor) break; } + + // The order of descriptors is random and depends how this SCC was + // discovered. In-order to ensure maximum stability we sort it by name. + std::sort(scc->descriptors.begin(), scc->descriptors.end(), + CompareDescriptors()); + AddChildren(scc); } return result; } +void SCCAnalyzer::AddChildren(SCC* scc) { + std::set seen; + for (int i = 0; i < scc->descriptors.size(); i++) { + const Descriptor* descriptor = scc->descriptors[i]; + for (int j = 0; j < descriptor->field_count(); j++) { + const Descriptor* child_msg = descriptor->field(j)->message_type(); + if (child_msg) { + const SCC* child = GetSCC(child_msg); + if (child == scc) continue; + if (seen.insert(child).second) { + scc->children.push_back(child); + } + } + } + } +} + MessageAnalysis SCCAnalyzer::GetSCCAnalysis(const SCC* scc) { if (analysis_cache_.count(scc)) return analysis_cache_[scc]; MessageAnalysis result = MessageAnalysis(); @@ -784,6 +881,46 @@ MessageAnalysis SCCAnalyzer::GetSCCAnalysis(const SCC* scc) { return analysis_cache_[scc] = result; } +void ListAllFields(const Descriptor* d, + std::vector* fields) { + // Collect sub messages + for (int i = 0; i < d->nested_type_count(); i++) { + ListAllFields(d->nested_type(i), fields); + } + // Collect message level extensions. + for (int i = 0; i < d->extension_count(); i++) { + fields->push_back(d->extension(i)); + } + // Add types of fields necessary + for (int i = 0; i < d->field_count(); i++) { + fields->push_back(d->field(i)); + } +} + +void ListAllFields(const FileDescriptor* d, + std::vector* fields) { + // Collect file level message. + for (int i = 0; i < d->message_type_count(); i++) { + ListAllFields(d->message_type(i), fields); + } + // Collect message level extensions. + for (int i = 0; i < d->extension_count(); i++) { + fields->push_back(d->extension(i)); + } +} + +void ListAllTypesForServices(const FileDescriptor* fd, + std::vector* types) { + for (int i = 0; i < fd->service_count(); i++) { + const ServiceDescriptor* sd = fd->service(i); + for (int j = 0; j < sd->method_count(); j++) { + const MethodDescriptor* method = sd->method(j); + types->push_back(method->input_type()); + types->push_back(method->output_type()); + } + } +} + } // namespace cpp } // namespace compiler } // namespace protobuf diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.h b/src/google/protobuf/compiler/cpp/cpp_helpers.h index 6ae68591..550438dd 100644 --- a/src/google/protobuf/compiler/cpp/cpp_helpers.h +++ b/src/google/protobuf/compiler/cpp/cpp_helpers.h @@ -38,16 +38,13 @@ #include #include #include +#include #include #include +#include namespace google { namespace protobuf { - -namespace io { -class Printer; -} - namespace compiler { namespace cpp { @@ -56,6 +53,31 @@ namespace cpp { extern const char kThickSeparator[]; extern const char kThinSeparator[]; +// Name space of the proto file. This namespace is such that the string +// "::some_name" is the correct fully qualified namespace. +// This means if the package is empty the namespace is "", and otherwise +// the namespace is "::foo::bar::...::baz" without trailing semi-colons. +string Namespace(const string& package); +inline string Namespace(const FileDescriptor* d) { + return Namespace(d->package()); +} +template +string Namespace(const Desc* d) { + return Namespace(d->file()); +} + +// Returns true if it's safe to reset "field" to zero. +bool CanInitializeByZeroing(const FieldDescriptor* field); + +string ClassName(const Descriptor* descriptor); +string ClassName(const EnumDescriptor* enum_descriptor); +template +string QualifiedClassName(const Desc* d) { + return Namespace(d) + "::" + ClassName(d); +} + +// DEPRECATED just use ClassName or QualifiedClassName, a boolean is very +// unreadable at the callsite. // 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; @@ -64,12 +86,22 @@ extern const char kThinSeparator[]; // ::foo::bar::Baz_Qux // While the non-qualified version would be: // Baz_Qux -string ClassName(const Descriptor* descriptor, bool qualified); -string ClassName(const EnumDescriptor* enum_descriptor, bool qualified); +inline string ClassName(const Descriptor* descriptor, bool qualified) { + return qualified ? QualifiedClassName(descriptor) : ClassName(descriptor); +} + +inline string ClassName(const EnumDescriptor* descriptor, bool qualified) { + return qualified ? QualifiedClassName(descriptor) : ClassName(descriptor); +} // Fully qualified name of the default_instance of this message. string DefaultInstanceName(const Descriptor* descriptor); +// Returns the name of a no-op function that we can call to introduce a linker +// dependency on the given message type. This is used to implement implicit weak +// fields. +string ReferenceFunctionName(const Descriptor* descriptor); + // Name of the CRTP class template (for use with proto_h). // This is a class name, like "ProtoName_InternalBase". string DependentBaseClassTemplateName(const Descriptor* descriptor); @@ -92,6 +124,12 @@ string FieldName(const FieldDescriptor* field); // Get the sanitized name that should be used for the given enum in C++ code. string EnumValueName(const EnumValueDescriptor* enum_value); +// 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 +// 64-bit pointers. +int EstimateAlignmentSize(const FieldDescriptor* field); + // Get the unqualified name that should be used for a field's field // number constant. string FieldConstantName(const FieldDescriptor *field); @@ -150,6 +188,12 @@ string FilenameIdentifier(const string& filename); // For each .proto file generates a unique namespace. In this namespace global // definitions are put to prevent collisions. string FileLevelNamespace(const string& filename); +inline string FileLevelNamespace(const FileDescriptor* file) { + return FileLevelNamespace(file->name()); +} +inline string FileLevelNamespace(const Descriptor* d) { + return FileLevelNamespace(d->file()); +} // Return the qualified C++ name for a file level symbol. string QualifiedFileLevelSymbol(const string& package, const string& name); @@ -225,10 +269,6 @@ inline bool HasFastArraySerialization(const FileDescriptor* file, return GetOptimizeFor(file, options) == FileOptions::SPEED; } -// Returns whether we have to generate code with static initializers. -bool StaticInitializersForced(const FileDescriptor* file, - const Options& options); - inline bool IsMapEntryMessage(const Descriptor* descriptor) { return descriptor->options().map_entry(); @@ -289,12 +329,25 @@ inline ::google::protobuf::FileOptions_OptimizeMode GetOptimizeFor( } // This orders the messages in a .pb.cc as it's outputted by file.cc -std::vector FlattenMessagesInFile( - const FileDescriptor* file); +void FlattenMessagesInFile(const FileDescriptor* file, + std::vector* result); +inline std::vector FlattenMessagesInFile( + const FileDescriptor* file) { + std::vector result; + FlattenMessagesInFile(file, &result); + return result; +} bool HasWeakFields(const Descriptor* desc); bool HasWeakFields(const FileDescriptor* desc); +// Indicates whether we should use implicit weak fields for this file. +bool UsingImplicitWeakFields(const FileDescriptor* file, + const Options& options); + +// Indicates whether to treat this field as implicitly weak. +bool IsImplicitWeakField(const FieldDescriptor* field, const Options& options); + // Returns true if the "required" restriction check should be ignored for the // given field. inline static bool ShouldIgnoreRequiredFieldCheck(const FieldDescriptor* field, @@ -302,8 +355,46 @@ inline static bool ShouldIgnoreRequiredFieldCheck(const FieldDescriptor* field, return false; } +class LIBPROTOC_EXPORT NamespaceOpener { + public: + explicit NamespaceOpener(io::Printer* printer) : printer_(printer) {} + NamespaceOpener(const string& name, io::Printer* printer) + : printer_(printer) { + ChangeTo(name); + } + ~NamespaceOpener() { ChangeTo(""); } + + void ChangeTo(const string& name) { + std::vector new_stack_ = + Split(name, "::", true); + int len = std::min(name_stack_.size(), new_stack_.size()); + int common_idx = 0; + while (common_idx < len) { + if (name_stack_[common_idx] != new_stack_[common_idx]) break; + common_idx++; + } + for (int i = name_stack_.size() - 1; i >= common_idx; i--) { + printer_->Print("} // namespace $ns$\n", "ns", name_stack_[i]); + } + name_stack_.swap(new_stack_); + for (int i = common_idx; i < name_stack_.size(); i++) { + printer_->Print("namespace $ns$ {\n", "ns", name_stack_[i]); + } + } + + private: + io::Printer* printer_; + std::vector name_stack_; +}; + +// Description of each strongly connected component. Note that the order +// of both the descriptors in this SCC and the order of children is +// deterministic. struct SCC { std::vector descriptors; + std::vector children; + + const Descriptor* GetRepresentative() const { return descriptors[0]; } }; struct MessageAnalysis { @@ -357,8 +448,16 @@ class LIBPROTOC_EXPORT SCCAnalyzer { // Tarjan's Strongly Connected Components algo NodeData DFS(const Descriptor* descriptor); + + // Add the SCC's that are children of this SCC to its children. + void AddChildren(SCC* scc); }; +void ListAllFields(const FileDescriptor* d, + std::vector* fields); +void ListAllTypesForServices(const FileDescriptor* fd, + std::vector* types); + } // namespace cpp } // namespace compiler } // namespace protobuf diff --git a/src/google/protobuf/compiler/cpp/cpp_map_field.cc b/src/google/protobuf/compiler/cpp/cpp_map_field.cc index da33d29b..d06a1d39 100644 --- a/src/google/protobuf/compiler/cpp/cpp_map_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_map_field.cc @@ -114,50 +114,13 @@ MapFieldGenerator::~MapFieldGenerator() {} void MapFieldGenerator:: GeneratePrivateMembers(io::Printer* printer) const { - if (HasDescriptorMethods(descriptor_->file(), options_)) { - printer->Print( - variables_, - "public:\n" - "class $map_classname$ : public " - "::google::protobuf::internal::MapEntry<$map_classname$, \n" - " $key_cpp$, $val_cpp$,\n" - " $key_wire_type$,\n" - " $val_wire_type$,\n" - " $default_enum_value$ > {\n" - "public:\n" - " typedef ::google::protobuf::internal::MapEntry<$map_classname$, \n" - " $key_cpp$, $val_cpp$,\n" - " $key_wire_type$,\n" - " $val_wire_type$,\n" - " $default_enum_value$ > SuperType;\n" - " $map_classname$();\n" - " $map_classname$(::google::protobuf::Arena* arena);\n" - " void MergeFrom(const ::google::protobuf::Message& other) PROTOBUF_FINAL;\n" - " void MergeFrom(const $map_classname$& other);\n" - " static const Message* internal_default_instance() { return " - "reinterpret_cast(&_$map_classname$_default_instance_); }\n" - " ::google::protobuf::Metadata GetMetadata() const;\n" - "};\n"); - } else { - printer->Print(variables_, - "public:\n" - "typedef ::google::protobuf::internal::MapEntryLite<\n" - " $key_cpp$, $val_cpp$,\n" - " $key_wire_type$,\n" - " $val_wire_type$,\n" - " $default_enum_value$ >\n" - " $map_classname$;\n"); - } printer->Print(variables_, - "private:\n" "::google::protobuf::internal::MapField$lite$<\n" " $map_classname$,\n" " $key_cpp$, $val_cpp$,\n" " $key_wire_type$,\n" " $val_wire_type$,\n" - " $default_enum_value$ > $name$_;\n" - "private:\n"); + " $default_enum_value$ > $name$_;\n"); } void MapFieldGenerator:: @@ -262,7 +225,7 @@ GenerateMergeFromCodedStream(io::Printer* printer) const { printer->Print(variables_, " unknown_fields_stream.WriteVarint32($tag$u);\n" " unknown_fields_stream.WriteVarint32(\n" - " static_cast(data.size()));\n" + " static_cast< ::google::protobuf::uint32>(data.size()));\n" " unknown_fields_stream.WriteString(data);\n"); } diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index 63ebb3c5..cf9c1233 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -109,106 +110,6 @@ struct ExtensionRangeSorter { } }; -// This 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 -// 64-bit pointers. -int EstimateAlignmentSize(const FieldDescriptor* field) { - if (field == NULL) return 0; - if (field->is_repeated()) return 8; - switch (field->cpp_type()) { - case FieldDescriptor::CPPTYPE_BOOL: - return 1; - - case FieldDescriptor::CPPTYPE_INT32: - case FieldDescriptor::CPPTYPE_UINT32: - case FieldDescriptor::CPPTYPE_ENUM: - case FieldDescriptor::CPPTYPE_FLOAT: - return 4; - - case FieldDescriptor::CPPTYPE_INT64: - case FieldDescriptor::CPPTYPE_UINT64: - case FieldDescriptor::CPPTYPE_DOUBLE: - case FieldDescriptor::CPPTYPE_STRING: - case FieldDescriptor::CPPTYPE_MESSAGE: - return 8; - } - GOOGLE_LOG(FATAL) << "Can't get here."; - return -1; // Make compiler happy. -} - -// FieldGroup is just a helper for OptimizePadding below. It holds a vector of -// fields that are grouped together because they have compatible alignment, and -// a preferred location in the final field ordering. -class FieldGroup { - public: - FieldGroup() - : preferred_location_(0) {} - - // A group with a single field. - FieldGroup(float preferred_location, const FieldDescriptor* field) - : preferred_location_(preferred_location), - fields_(1, field) {} - - // Append the fields in 'other' to this group. - void Append(const FieldGroup& other) { - if (other.fields_.empty()) { - return; - } - // Preferred location is the average among all the fields, so we weight by - // the number of fields on each FieldGroup object. - preferred_location_ = - (preferred_location_ * fields_.size() + - (other.preferred_location_ * other.fields_.size())) / - (fields_.size() + other.fields_.size()); - fields_.insert(fields_.end(), other.fields_.begin(), other.fields_.end()); - } - - void SetPreferredLocation(float location) { preferred_location_ = location; } - const std::vector& fields() const { return fields_; } - - // FieldGroup objects sort by their preferred location. - bool operator<(const FieldGroup& other) const { - return preferred_location_ < other.preferred_location_; - } - - private: - // "preferred_location_" is an estimate of where this group should go in the - // final list of fields. We compute this by taking the average index of each - // field in this group in the original ordering of fields. This is very - // approximate, but should put this group close to where its member fields - // originally went. - float preferred_location_; - std::vector fields_; - // We rely on the default copy constructor and operator= so this type can be - // used in a vector. -}; - -// Helper for the code that emits the Clear() method. -bool CanInitializeByZeroing(const FieldDescriptor* field) { - if (field->is_repeated() || field->is_extension()) return false; - switch (field->cpp_type()) { - case internal::WireFormatLite::CPPTYPE_ENUM: - return field->default_value_enum()->number() == 0; - case internal::WireFormatLite::CPPTYPE_INT32: - return field->default_value_int32() == 0; - case internal::WireFormatLite::CPPTYPE_INT64: - return field->default_value_int64() == 0; - case internal::WireFormatLite::CPPTYPE_UINT32: - return field->default_value_uint32() == 0; - case internal::WireFormatLite::CPPTYPE_UINT64: - return field->default_value_uint64() == 0; - case internal::WireFormatLite::CPPTYPE_FLOAT: - return field->default_value_float() == 0; - case internal::WireFormatLite::CPPTYPE_DOUBLE: - return field->default_value_double() == 0; - case internal::WireFormatLite::CPPTYPE_BOOL: - return field->default_value_bool() == false; - default: - return false; - } -} - bool IsPOD(const FieldDescriptor* field) { if (field->is_repeated() || field->is_extension()) return false; switch (field->cpp_type()) { @@ -242,133 +143,6 @@ bool CanConstructByZeroing(const FieldDescriptor* field, return ret; } -// Reorder 'fields' so that if the fields are output into a c++ class in the new -// order, fields of similiar family (see below) are together and within each -// family, alignment padding is minimized. -// -// We try to do this while keeping each field as close as possible to its field -// number order so that we don't reduce cache locality much for function that -// access each field in order. Originally, OptimizePadding used declaration -// order for its decisions, but generated code minus the serializer/parsers uses -// the output of OptimizePadding as well (stored in -// MessageGenerator::optimized_order_). Since the serializers use field number -// order, we use that as a tie-breaker. -// -// TODO(ckennelly): If/when we have profiles available for the compiler, use -// those rather than respect declaration order. -// -// We classify each field into a particular "family" of fields, that we perform -// the same operation on in our generated functions. -// -// REPEATED is placed first, as the C++ compiler automatically initializes -// these fields in layout order. -// -// STRING is grouped next, as our Clear/SharedCtor/SharedDtor walks it and -// calls ArenaStringPtr::Destroy on each. -// -// -// MESSAGE is grouped next, as our Clear/SharedDtor code walks it and calls -// delete on each. We initialize these fields with a NULL pointer (see -// MessageFieldGenerator::GenerateConstructorCode), which allows them to be -// memset. -// -// ZERO_INITIALIZABLE is memset in Clear/SharedCtor -// -// OTHER these fields are initialized one-by-one. -void OptimizePadding(std::vector* fields, - const Options& options) { - // The sorted numeric order of Family determines the declaration order in the - // memory layout. - enum Family { - REPEATED = 0, - STRING = 1, - MESSAGE = 3, - ZERO_INITIALIZABLE = 4, - OTHER = 5, - kMaxFamily - }; - - // First divide fields into those that align to 1 byte, 4 bytes or 8 bytes. - std::vector aligned_to_1[kMaxFamily]; - std::vector aligned_to_4[kMaxFamily]; - std::vector aligned_to_8[kMaxFamily]; - for (int i = 0; i < fields->size(); ++i) { - const FieldDescriptor* field = (*fields)[i]; - - Family f = OTHER; - if (field->is_repeated()) { - f = REPEATED; - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_STRING) { - f = STRING; - } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - f = MESSAGE; - - } else if (CanInitializeByZeroing(field)) { - f = ZERO_INITIALIZABLE; - } - - const int j = field->number(); - switch (EstimateAlignmentSize(field)) { - case 1: aligned_to_1[f].push_back(FieldGroup(j, field)); break; - case 4: aligned_to_4[f].push_back(FieldGroup(j, field)); break; - case 8: aligned_to_8[f].push_back(FieldGroup(j, field)); break; - default: - GOOGLE_LOG(FATAL) << "Unknown alignment size."; - } - } - - // For each family, group fields to optimize padding. - for (int f = 0; f < kMaxFamily; f++) { - // Now group fields aligned to 1 byte into sets of 4, and treat those like a - // single field aligned to 4 bytes. - for (int i = 0; i < aligned_to_1[f].size(); i += 4) { - FieldGroup field_group; - for (int j = i; j < aligned_to_1[f].size() && j < i + 4; ++j) { - field_group.Append(aligned_to_1[f][j]); - } - aligned_to_4[f].push_back(field_group); - } - // Sort by preferred location to keep fields as close to their field number - // order as possible. Using stable_sort ensures that the output is - // consistent across runs. - std::stable_sort(aligned_to_4[f].begin(), aligned_to_4[f].end()); - - // Now group fields aligned to 4 bytes (or the 4-field groups created above) - // into pairs, and treat those like a single field aligned to 8 bytes. - for (int i = 0; i < aligned_to_4[f].size(); i += 2) { - FieldGroup field_group; - for (int j = i; j < aligned_to_4[f].size() && j < i + 2; ++j) { - field_group.Append(aligned_to_4[f][j]); - } - if (i == aligned_to_4[f].size() - 1) { - if (f == OTHER) { - // Move incomplete 4-byte block to the beginning. This is done to - // pair with the (possible) leftover blocks from the - // ZERO_INITIALIZABLE family. - field_group.SetPreferredLocation(-1); - } else { - // Move incomplete 4-byte block to the end. - field_group.SetPreferredLocation(fields->size() + 1); - } - } - aligned_to_8[f].push_back(field_group); - } - // Sort by preferred location. - std::stable_sort(aligned_to_8[f].begin(), aligned_to_8[f].end()); - } - - // Now pull out all the FieldDescriptors in order. - fields->clear(); - for (int f = 0; f < kMaxFamily; ++f) { - for (int i = 0; i < aligned_to_8[f].size(); ++i) { - fields->insert(fields->end(), - aligned_to_8[f][i].fields().begin(), - aligned_to_8[f][i].fields().end()); - } - } -} - - // Emits an if-statement with a condition that evaluates to true if |field| is // considered non-default (will be sent over the wire), for message types // without true field presence. Should only be called if @@ -423,25 +197,31 @@ bool HasHasMethod(const FieldDescriptor* field) { void CollectMapInfo(const Descriptor* descriptor, std::map* variables) { GOOGLE_CHECK(IsMapEntryMessage(descriptor)); + std::map& vars = *variables; const FieldDescriptor* key = descriptor->FindFieldByName("key"); const FieldDescriptor* val = descriptor->FindFieldByName("value"); - (*variables)["key"] = PrimitiveTypeName(key->cpp_type()); + vars["key_cpp"] = PrimitiveTypeName(key->cpp_type()); switch (val->cpp_type()) { case FieldDescriptor::CPPTYPE_MESSAGE: - (*variables)["val"] = FieldMessageTypeName(val); + vars["val_cpp"] = FieldMessageTypeName(val); break; case FieldDescriptor::CPPTYPE_ENUM: - (*variables)["val"] = ClassName(val->enum_type(), true); + vars["val_cpp"] = ClassName(val->enum_type(), true); break; default: - (*variables)["val"] = PrimitiveTypeName(val->cpp_type()); - } - (*variables)["key_wire_type"] = - "::google::protobuf::internal::WireFormatLite::TYPE_" + - ToUpper(DeclaredTypeMethodName(key->type())); - (*variables)["val_wire_type"] = - "::google::protobuf::internal::WireFormatLite::TYPE_" + - ToUpper(DeclaredTypeMethodName(val->type())); + vars["val_cpp"] = PrimitiveTypeName(val->cpp_type()); + } + vars["key_wire_type"] = "::google::protobuf::internal::WireFormatLite::TYPE_" + + ToUpper(DeclaredTypeMethodName(key->type())); + vars["val_wire_type"] = "::google::protobuf::internal::WireFormatLite::TYPE_" + + ToUpper(DeclaredTypeMethodName(val->type())); + if (descriptor->file()->syntax() != FileDescriptor::SYNTAX_PROTO3 && + val->type() == FieldDescriptor::TYPE_ENUM) { + const EnumValueDescriptor* default_value = val->default_value_enum(); + vars["default_enum_value"] = Int32ToString(default_value->number()); + } else { + vars["default_enum_value"] = "0"; + } } // Does the given field have a private (internal helper only) has_$name$() @@ -531,21 +311,22 @@ void SetUnknkownFieldsVariable(const Descriptor* descriptor, // =================================================================== MessageGenerator::MessageGenerator(const Descriptor* descriptor, + int index_in_file_messages, const Options& options, SCCAnalyzer* scc_analyzer) : descriptor_(descriptor), + index_in_file_messages_(index_in_file_messages), classname_(ClassName(descriptor, false)), options_(options), field_generators_(descriptor, options), max_has_bit_index_(0), - nested_generators_(new google::protobuf::scoped_ptr< - MessageGenerator>[descriptor->nested_type_count()]), enum_generators_( new google::protobuf::scoped_ptr[descriptor->enum_type_count()]), extension_generators_(new google::protobuf::scoped_ptr< ExtensionGenerator>[descriptor->extension_count()]), use_dependent_base_(false), num_weak_fields_(0), + message_layout_helper_(new PaddingOptimizer()), scc_analyzer_(scc_analyzer) { // Compute optimized field order to be used for layout and initialization // purposes. @@ -557,7 +338,8 @@ MessageGenerator::MessageGenerator(const Descriptor* descriptor, optimized_order_.push_back(field); } } - OptimizePadding(&optimized_order_, options_); + + message_layout_helper_->OptimizeLayout(&optimized_order_, options_); if (HasFieldPresence(descriptor_->file())) { // We use -1 as a sentinel. @@ -573,11 +355,6 @@ MessageGenerator::MessageGenerator(const Descriptor* descriptor, } } - for (int i = 0; i < descriptor->nested_type_count(); i++) { - nested_generators_[i].reset(new MessageGenerator(descriptor->nested_type(i), - options, scc_analyzer)); - } - for (int i = 0; i < descriptor->enum_type_count(); i++) { enum_generators_[i].reset( new EnumGenerator(descriptor->enum_type(i), options)); @@ -603,6 +380,9 @@ MessageGenerator::MessageGenerator(const Descriptor* descriptor, } table_driven_ = TableDrivenParsingEnabled(descriptor_, options_); + + scc_name_ = + ClassName(scc_analyzer_->GetSCC(descriptor_)->GetRepresentative(), false); } MessageGenerator::~MessageGenerator() {} @@ -620,14 +400,6 @@ size_t MessageGenerator::HasBitsSize() const { return sizeof_has_bits; } -void MessageGenerator::Flatten(std::vector* list) { - for (int i = 0; i < descriptor_->nested_type_count(); i++) { - nested_generators_[i]->Flatten(list); - } - index_in_file_messages_ = list->size(); - list->push_back(this); -} - void MessageGenerator::AddGenerators( std::vector* enum_generators, std::vector* extension_generators) { @@ -1010,8 +782,8 @@ GenerateFieldAccessorDefinitions(io::Printer* printer, bool is_inline) { } // Generate type-specific accessors. - field_generators_.get(field).GenerateInlineAccessorDefinitions(printer, - is_inline); + field_generators_.get(field).GenerateInlineAccessorDefinitions( + printer, /* is_inline = */ true); printer->Print("\n"); } @@ -1056,7 +828,42 @@ GenerateDependentBaseClassDefinition(io::Printer* printer) { void MessageGenerator:: GenerateClassDefinition(io::Printer* printer) { - if (IsMapEntryMessage(descriptor_)) return; + if (IsMapEntryMessage(descriptor_)) { + std::map vars; + vars["classname"] = classname_; + CollectMapInfo(descriptor_, &vars); + vars["lite"] = + HasDescriptorMethods(descriptor_->file(), options_) ? "" : "Lite"; + printer->Print( + vars, + "class $classname$ : public " + "::google::protobuf::internal::MapEntry$lite$<$classname$, \n" + " $key_cpp$, $val_cpp$,\n" + " $key_wire_type$,\n" + " $val_wire_type$,\n" + " $default_enum_value$ > {\n" + "public:\n" + " typedef ::google::protobuf::internal::MapEntry$lite$<$classname$, \n" + " $key_cpp$, $val_cpp$,\n" + " $key_wire_type$,\n" + " $val_wire_type$,\n" + " $default_enum_value$ > SuperType;\n" + " $classname$();\n" + " $classname$(::google::protobuf::Arena* arena);\n" + " void MergeFrom(const $classname$& other);\n" + " static const $classname$* internal_default_instance() { return " + "reinterpret_cast(&_$classname$_default_instance_); }\n"); + if (HasDescriptorMethods(descriptor_->file(), options_)) { + printer->Print( + " void MergeFrom(const ::google::protobuf::Message& other) PROTOBUF_FINAL;\n" + " ::google::protobuf::Metadata GetMetadata() const;\n" + "};\n"); + } else { + printer->Print("};\n"); + } + return; + } if (use_dependent_base_) { GenerateDependentBaseClassDefinition(printer); printer->Print("\n"); @@ -1109,26 +916,23 @@ GenerateClassDefinition(io::Printer* printer) { "\n"); } - // Generate move constructor and move assignment operator for types other than - // Any. - if (!IsAnyMessage(descriptor_)) { - printer->Print(vars, - "#if LANG_CXX11\n" - "$classname$($classname$&& from) noexcept\n" - " : $classname$() {\n" - " *this = ::std::move(from);\n" - "}\n" - "\n" - "inline $classname$& operator=($classname$&& from) noexcept {\n" - " if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n" - " if (this != &from) InternalSwap(&from);\n" - " } else {\n" - " CopyFrom(from);\n" - " }\n" - " return *this;\n" - "}\n" - "#endif\n"); - } + // Generate move constructor and move assignment operator. + printer->Print(vars, + "#if LANG_CXX11\n" + "$classname$($classname$&& from) noexcept\n" + " : $classname$() {\n" + " *this = ::std::move(from);\n" + "}\n" + "\n" + "inline $classname$& operator=($classname$&& from) noexcept {\n" + " if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n" + " if (this != &from) InternalSwap(&from);\n" + " } else {\n" + " CopyFrom(from);\n" + " }\n" + " return *this;\n" + "}\n" + "#endif\n"); SetUnknkownFieldsVariable(descriptor_, options_, &vars); if (PublicUnknownFieldsAccessors(descriptor_)) { @@ -1199,6 +1003,7 @@ GenerateClassDefinition(io::Printer* printer) { vars["message_index"] = SimpleItoa(index_in_file_messages_); printer->Print( vars, + "static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY\n" "static inline const $classname$* internal_default_instance() {\n" " return reinterpret_cast(\n" " &_$classname$_default_instance_);\n" @@ -1358,6 +1163,8 @@ GenerateClassDefinition(io::Printer* printer) { printer->Print("typedef $nested_full_name$ $nested_name$;\n", "nested_name", nested_type->name(), "nested_full_name", ClassName(nested_type, false)); + printer->Annotate("nested_full_name", nested_type); + printer->Annotate("nested_name", nested_type); } } @@ -1548,14 +1355,13 @@ GenerateClassDefinition(io::Printer* printer) { // The TableStruct struct needs access to the private parts, in order to // construct the offsets of all members. - // - // Some InitDefault and Shutdown are defined as static member functions of - // TableStruct such that they are also allowed to access private members. + // TODO(gerbens) Remove the friend for InitDefaults. printer->Print( - "friend struct $file_namespace$::TableStruct;\n", + "friend struct ::$file_namespace$::TableStruct;\n" + "friend void ::$file_namespace$::InitDefaults$scc_name$Impl();\n", // Vars. - "file_namespace", - FileLevelNamespace(descriptor_->file()->name())); + "scc_name", scc_name_, "file_namespace", + FileLevelNamespace(descriptor_)); printer->Outdent(); printer->Print("};"); @@ -1577,7 +1383,7 @@ GenerateDependentInlineMethods(io::Printer* printer) { void MessageGenerator:: GenerateInlineMethods(io::Printer* printer, bool is_inline) { if (IsMapEntryMessage(descriptor_)) return; - GenerateFieldAccessorDefinitions(printer, is_inline); + GenerateFieldAccessorDefinitions(printer, /* is_inline = */ true); // Generate oneof_case() functions. for (int i = 0; i < descriptor_->oneof_decl_count(); i++) { @@ -1634,7 +1440,8 @@ bool MessageGenerator::GenerateParseTable(io::Printer* printer, size_t offset, std::map vars; - vars["classname"] = classname_; + vars["classname"] = ClassName(descriptor_); + vars["classtype"] = QualifiedClassName(descriptor_); vars["offset"] = SimpleItoa(offset); vars["aux_offset"] = SimpleItoa(aux_offset); @@ -1661,48 +1468,34 @@ bool MessageGenerator::GenerateParseTable(io::Printer* printer, size_t offset, printer->Print(vars, "-1,\n"); } else { printer->Print(vars, - "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(\n" - " $classname$, _has_bits_),\n"); + "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(\n" + " $classtype$, _has_bits_),\n"); } if (descriptor_->oneof_decl_count() > 0) { printer->Print(vars, "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(\n" - " $classname$, _oneof_case_),\n"); + " $classtype$, _oneof_case_),\n"); } else { printer->Print("-1, // no _oneof_case_\n"); } if (descriptor_->extension_range_count() > 0) { printer->Print(vars, - "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET($classname$, " - "_extensions_),\n"); + "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET($classtype$, " + "_extensions_),\n"); } else { printer->Print("-1, // no _extensions_\n"); } // TODO(ckennelly): Consolidate this with the calculation for // AuxillaryParseTableField. - std::vector package_parts; - - const Descriptor* outer = descriptor_; - while (outer->containing_type() != NULL) { - outer = outer->containing_type(); - } - - package_parts = Split( - outer->full_name(), ".", true); - // outer->full_name() contains the class itself. Remove it as it is - // used in the name of the default instance variable. - GOOGLE_DCHECK_NE(package_parts.size(), 0); - package_parts.back().clear(); - - vars["ns"] = Join(package_parts, "::"); + vars["ns"] = Namespace(descriptor_); printer->Print(vars, - "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(\n" - " $classname$, _internal_metadata_),\n" - "&::$ns$_$classname$_default_instance_,\n"); + "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(\n" + " $classtype$, _internal_metadata_),\n" + "&$ns$::_$classname$_default_instance_,\n"); if (UseUnknownFieldSet(descriptor_->file(), options_)) { printer->Print(vars, "true,\n"); @@ -1717,15 +1510,14 @@ bool MessageGenerator::GenerateParseTable(io::Printer* printer, size_t offset, void MessageGenerator::GenerateSchema(io::Printer* printer, int offset, int has_offset) { - if (IsMapEntryMessage(descriptor_)) return; - std::map vars; - vars["classname"] = classname_; + vars["classname"] = QualifiedClassName(descriptor_); vars["offset"] = SimpleItoa(offset); - vars["has_bits_offsets"] = HasFieldPresence(descriptor_->file()) - ? SimpleItoa(offset + has_offset) - : "-1"; + vars["has_bits_offsets"] = + HasFieldPresence(descriptor_->file()) || IsMapEntryMessage(descriptor_) + ? SimpleItoa(offset + has_offset) + : "-1"; printer->Print(vars, "{ $offset$, $has_bits_offsets$, sizeof($classname$)},\n"); @@ -1804,6 +1596,8 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { return 0; } + string full_classname = QualifiedClassName(descriptor_); + std::vector sorted = SortFieldsByNumber(descriptor_); if (IsMapEntryMessage(descriptor_)) { for (int i = 0; i < 2; i++) { @@ -1812,9 +1606,7 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { field->number(), WireFormat::WireTypeForFieldType(field->type())); std::map vars; - vars["classname"] = classname_; - vars["parent_classname"] = - ClassName(descriptor_->containing_type(), false); + vars["classname"] = QualifiedClassName(descriptor_); vars["field_name"] = FieldName(field); vars["tag"] = SimpleItoa(tag); vars["hasbit"] = SimpleItoa(i); @@ -1824,23 +1616,18 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { GOOGLE_CHECK(!IsMapEntryMessage(field->message_type())); { vars["ptr"] = - QualifiedFileLevelSymbol( - field->message_type()->file()->package(), - FileLevelNamespace(field->message_type()->file()->name())) + + "::" + FileLevelNamespace(field->message_type()) + "::TableStruct::serialization_table + " + SimpleItoa(FindMessageIndexInFile(field->message_type())); } } - vars["extra"] = HasDescriptorMethods(descriptor_->file(), options_) - ? "::SuperType" - : ""; printer->Print(vars, "{GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(" - "::google::protobuf::internal::MapEntryHelper<$parent_classname$::$" - "classname$$extra$>, $field_name$_), $tag$," + "::google::protobuf::internal::MapEntryHelper<$classname$::" + "SuperType>, $field_name$_), $tag$," "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(" - "::google::protobuf::internal::MapEntryHelper<$parent_classname$::$" - "classname$$extra$>, _has_bits_) * 8 + $hasbit$, $type$, " + "::google::protobuf::internal::MapEntryHelper<$classname$::" + "SuperType>, _has_bits_) * 8 + $hasbit$, $type$, " "$ptr$},\n"); } return 2; @@ -1848,7 +1635,7 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { printer->Print( "{GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET($classname$, " "_cached_size_), 0, 0, 0, NULL},\n", - "classname", classname_); + "classname", full_classname); std::vector sorted_extensions; for (int i = 0; i < descriptor_->extension_range_count(); ++i) { sorted_extensions.push_back(descriptor_->extension_range(i)); @@ -1868,7 +1655,7 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { "::google::protobuf::internal::FieldMetadata::kSpecial, " "reinterpret_cast(::google::protobuf::internal::ExtensionSerializer)},\n", - "classname", classname_, "start", SimpleItoa(range->start), "end", + "classname", full_classname, "start", SimpleItoa(range->start), "end", SimpleItoa(range->end)); } if (i == sorted.size()) break; @@ -1886,14 +1673,14 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { classfieldname = field->containing_oneof()->name(); } std::map vars; - vars["classname"] = classname_; + vars["classname"] = full_classname; vars["field_name"] = classfieldname; vars["tag"] = SimpleItoa(tag); vars["ptr"] = "NULL"; if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { if (IsMapEntryMessage(field->message_type())) { vars["idx"] = SimpleItoa(FindMessageIndexInFile(field->message_type())); - vars["fieldclassname"] = ClassName(field->message_type(), false); + vars["fieldclassname"] = QualifiedClassName(field->message_type()); printer->Print(vars, "{GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET($" "classname$, $field_name$_), $tag$, $idx$, " @@ -1901,15 +1688,13 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { "reinterpret_cast(static_cast< " "::google::protobuf::internal::SpecialSerializer>(" "::google::protobuf::internal::MapFieldSerializer< " - "::google::protobuf::internal::MapEntryToMapField<$classname$::$" - "fieldclassname$>::MapFieldType, " + "::google::protobuf::internal::MapEntryToMapField<" + "$fieldclassname$>::MapFieldType, " "TableStruct::serialization_table>))},\n"); continue; } else { vars["ptr"] = - QualifiedFileLevelSymbol( - field->message_type()->file()->package(), - FileLevelNamespace(field->message_type()->file()->name())) + + "::" + FileLevelNamespace(field->message_type()) + "::TableStruct::serialization_table + " + SimpleItoa(FindMessageIndexInFile(field->message_type())); } @@ -1960,40 +1745,20 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { "_internal_metadata_), 0, ~0u, " "::google::protobuf::internal::FieldMetadata::kSpecial, reinterpret_cast($serializer$)},\n", - "classname", classname_, "serializer", serializer); + "classname", full_classname, "serializer", serializer); return num_field_metadata; } -void MessageGenerator:: -GenerateDefaultInstanceAllocator(io::Printer* printer) { - // Construct the default instances of all fields, as they will be used - // when creating the default instance of the entire message. +void MessageGenerator::GenerateFieldDefaultInstances(io::Printer* printer) { + // Construct the default instances for all fields that need one. for (int i = 0; i < descriptor_->field_count(); i++) { field_generators_.get(descriptor_->field(i)) .GenerateDefaultInstanceAllocator(printer); } - - // Construct the default instance. We can't call InitAsDefaultInstance() yet - // because we need to make sure all default instances that this one might - // depend on are constructed first. - printer->Print("_$classname$_default_instance_._instance.DefaultConstruct();\n" - "::google::protobuf::internal::OnShutdownDestroyMessage(\n" - " &_$classname$_default_instance_);", - "classname", classname_); } void MessageGenerator:: GenerateDefaultInstanceInitializer(io::Printer* printer) { - if (IsMapEntryMessage(descriptor_)) { - printer->Print( - "_$classname$_default_instance_._instance.get_mutable()->set_default_instance(_$" - "classname$_default_instance_._instance.get_mutable());\n" - "_$classname$_default_instance_._instance.get_mutable()->InitAsDefaultInstance();" - "\n", - "classname", classname_); - return; - } - // The default instance needs all of its embedded message pointers // cross-linked to other default instances. We can't do this initialization // in the constructor because some other default instances may not have been @@ -2016,10 +1781,11 @@ GenerateDefaultInstanceInitializer(io::Printer* printer) { } name += FieldName(field); printer->Print( - "$name$_ = const_cast< $type$*>(\n" + "$ns$::$name$_ = const_cast< $type$*>(\n" " $type$::internal_default_instance());\n", // Vars. - "name", name, "type", FieldMessageTypeName(field)); + "name", name, "type", FieldMessageTypeName(field), "ns", + Namespace(descriptor_)); } else if (field->containing_oneof() && HasDescriptorMethods(descriptor_->file(), options_)) { field_generators_.get(descriptor_->field(i)) @@ -2031,31 +1797,41 @@ GenerateDefaultInstanceInitializer(io::Printer* printer) { void MessageGenerator:: GenerateClassMethods(io::Printer* printer) { if (IsMapEntryMessage(descriptor_)) { + printer->Print( + "$classname$::$classname$() {}\n" + "$classname$::$classname$(::google::protobuf::Arena* arena) : " + "SuperType(arena) {}\n" + "void $classname$::MergeFrom(const $classname$& other) {\n" + " MergeFromInternal(other);\n" + "}\n", + "classname", classname_); if (HasDescriptorMethods(descriptor_->file(), options_)) { printer->Print( - "$parent$::$classname$::$classname$() {}\n" - "$parent$::$classname$::$classname$(::google::protobuf::Arena* arena) : " - "SuperType(arena) {}\n" - "::google::protobuf::Metadata $parent$::$classname$::GetMetadata() const {\n" - " $file_namespace$::protobuf_AssignDescriptorsOnce();\n" - " return $file_namespace$::file_level_metadata[$index$];\n" + "::google::protobuf::Metadata $classname$::GetMetadata() const {\n" + " ::$file_namespace$::protobuf_AssignDescriptorsOnce();\n" + " return ::$file_namespace$::file_level_metadata[$index$];\n" "}\n" - "void $parent$::$classname$::MergeFrom(\n" + "void $classname$::MergeFrom(\n" " const ::google::protobuf::Message& other) {\n" " ::google::protobuf::Message::MergeFrom(other);\n" "}\n" - "void $parent$::$classname$::MergeFrom(const $classname$& other) {\n" - " MergeFromInternal(other);\n" - "}\n" "\n", - "file_namespace", FileLevelNamespace(descriptor_->file()->name()), - "parent", ClassName(descriptor_->containing_type(), false), + "file_namespace", FileLevelNamespace(descriptor_), "classname", classname_, "index", SimpleItoa(index_in_file_messages_)); } return; } + // TODO(gerbens) Remove this function. With a little bit of cleanup and + // refactoring this is superfluous. + printer->Print("void $classname$::InitAsDefaultInstance() {\n", "classname", + classname_); + printer->Indent(); + GenerateDefaultInstanceInitializer(printer); + printer->Outdent(); + printer->Print("}\n"); + if (IsAnyMessage(descriptor_)) { printer->Print( "void $classname$::PackFrom(const ::google::protobuf::Message& message) {\n" @@ -2134,23 +1910,24 @@ GenerateClassMethods(io::Printer* printer) { if (options_.table_driven_serialization) { printer->Print( - "const void* $classname$::InternalGetTable() const {\n" - " return $file_namespace$::TableStruct::serialization_table + $index$;\n" - "}\n" - "\n", - "classname", classname_, "index", SimpleItoa(index_in_file_messages_), - "file_namespace", FileLevelNamespace(descriptor_->file()->name())); + "const void* $classname$::InternalGetTable() const {\n" + " return ::$file_namespace$::TableStruct::serialization_table + " + "$index$;\n" + "}\n" + "\n", + "classname", classname_, "index", SimpleItoa(index_in_file_messages_), + "file_namespace", FileLevelNamespace(descriptor_)); } if (HasDescriptorMethods(descriptor_->file(), options_)) { printer->Print( "::google::protobuf::Metadata $classname$::GetMetadata() const {\n" " $file_namespace$::protobuf_AssignDescriptorsOnce();\n" - " return " + " return ::" "$file_namespace$::file_level_metadata[kIndexInFileMessages];\n" "}\n" "\n", "classname", classname_, "file_namespace", - FileLevelNamespace(descriptor_->file()->name())); + FileLevelNamespace(descriptor_)); } else { printer->Print( "::std::string $classname$::GetTypeName() const {\n" @@ -2224,7 +2001,7 @@ size_t MessageGenerator::GenerateParseOffsets(io::Printer* printer) { WireFormat::TagSize(field->number(), field->type()); std::map vars; - vars["classname"] = classname_; + vars["classname"] = QualifiedClassName(descriptor_); if (field->containing_oneof() != NULL) { vars["name"] = field->containing_oneof()->name(); vars["presence"] = SimpleItoa(field->containing_oneof()->index()); @@ -2280,23 +2057,8 @@ size_t MessageGenerator::GenerateParseAuxTable(io::Printer* printer) { last_field_number++; break; case FieldDescriptor::CPPTYPE_MESSAGE: { - std::vector package_parts; - - const Descriptor* outer = field->message_type(); - while (outer->containing_type() != NULL) { - outer = outer->containing_type(); - } - - package_parts = Split( - outer->full_name(), ".", true); - // outer->full_name() contains the class itself. Remove it as it is - // used in the name of the default instance variable. - GOOGLE_DCHECK_NE(package_parts.size(), 0); - package_parts.back().clear(); - if (field->is_map()) { - vars["classname"] = ClassName(field->containing_type(), false) + - "::" + ClassName(field->message_type(), false); + vars["classname"] = QualifiedClassName(field->message_type()); printer->Print(vars, "{::google::protobuf::internal::AuxillaryParseTableField::map_" "aux{&::google::protobuf::internal::ParseMap<$classname$>}},\n"); @@ -2305,13 +2067,15 @@ size_t MessageGenerator::GenerateParseAuxTable(io::Printer* printer) { } else { vars["classname"] = ClassName(field->message_type(), false); } - vars["ns"] = Join(package_parts, "::"); + vars["ns"] = Namespace(field->message_type()); vars["type"] = FieldMessageTypeName(field); - vars["file_namespace"] = FileLevelNamespace(outer->file()->name()); + vars["file_namespace"] = + FileLevelNamespace(field->message_type()); - printer->Print(vars, + printer->Print( + vars, "{::google::protobuf::internal::AuxillaryParseTableField::message_aux{\n" - " &::$ns$_$classname$_default_instance_,\n"); + " &$ns$::_$classname$_default_instance_,\n"); bool dont_emit_table = !TableDrivenParsingEnabled(field->message_type(), options_); @@ -2320,8 +2084,8 @@ size_t MessageGenerator::GenerateParseAuxTable(io::Printer* printer) { printer->Print(" NULL,\n"); } else { printer->Print(vars, - " ::$ns$$file_namespace$::TableStruct::schema +\n" - " ::$ns$$classname$::kIndexInFileMessages,\n"); + " ::$file_namespace$::TableStruct::schema +\n" + " $ns$::$classname$::kIndexInFileMessages,\n"); } printer->Print("}},\n"); @@ -2333,8 +2097,9 @@ size_t MessageGenerator::GenerateParseAuxTable(io::Printer* printer) { case FieldOptions::STRING: vars["default"] = field->default_value_string().empty() - ? "&::google::protobuf::internal::fixed_address_empty_string" - : "&" + classname_ + "::_default_" + FieldName(field) + "_"; + ? "&::google::protobuf::internal::fixed_address_empty_string" + : "&" + Namespace(field) + " ::" + classname_ + + "::_default_" + FieldName(field) + "_"; break; case FieldOptions::CORD: case FieldOptions::STRING_PIECE: @@ -2360,11 +2125,11 @@ size_t MessageGenerator::GenerateParseAuxTable(io::Printer* printer) { std::pair MessageGenerator::GenerateOffsets( io::Printer* printer) { - if (IsMapEntryMessage(descriptor_)) return std::make_pair(0, 0); std::map variables; - variables["classname"] = classname_; + string full_classname = QualifiedClassName(descriptor_); + variables["classname"] = full_classname; - if (HasFieldPresence(descriptor_->file())) { + if (HasFieldPresence(descriptor_->file()) || IsMapEntryMessage(descriptor_)) { printer->Print( variables, "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET($classname$, " @@ -2405,27 +2170,29 @@ std::pair MessageGenerator::GenerateOffsets( for (int i = 0; i < descriptor_->field_count(); i++) { const FieldDescriptor* field = descriptor_->field(i); if (field->containing_oneof() || field->options().weak()) { - printer->Print( - "offsetof($classname$DefaultTypeInternal, $name$_),\n", - "classname", classname_, "name", FieldName(field)); + printer->Print("offsetof($classname$DefaultTypeInternal, $name$_),\n", + "classname", full_classname, "name", FieldName(field)); } else { printer->Print( "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET($classname$, " - "$name$_),\n", - "classname", classname_, - "name", FieldName(field)); + "$name$_),\n", + "classname", full_classname, "name", FieldName(field)); } } for (int i = 0; i < descriptor_->oneof_decl_count(); i++) { const OneofDescriptor* oneof = descriptor_->oneof_decl(i); printer->Print( - "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET($classname$, $name$_),\n", - "classname", classname_, - "name", oneof->name()); + "GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET($classname$, $name$_),\n", + "classname", full_classname, "name", oneof->name()); } - if (HasFieldPresence(descriptor_->file())) { + if (IsMapEntryMessage(descriptor_)) { + entries += 2; + printer->Print( + "0,\n" + "1,\n"); + } else if (HasFieldPresence(descriptor_->file())) { entries += has_bit_indices_.size(); for (int i = 0; i < has_bit_indices_.size(); i++) { const string index = has_bit_indices_[i] >= 0 ? @@ -2700,27 +2467,28 @@ GenerateStructors(io::Printer* printer) { "$classname$::$classname$()\n" " : $initializer$ {\n" " if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {\n" - " $file_namespace$::InitDefaults();\n" + " ::$file_namespace$::InitDefaults$scc_name$();\n" " }\n" " SharedCtor();\n" " // @@protoc_insertion_point(constructor:$full_name$)\n" "}\n", "classname", classname_, "full_name", descriptor_->full_name(), - "initializer", initializer_null, "file_namespace", - FileLevelNamespace(descriptor_->file()->name())); + "scc_name", scc_name_, "initializer", initializer_null, "file_namespace", + FileLevelNamespace(descriptor_)); if (SupportsArenas(descriptor_)) { printer->Print( "$classname$::$classname$(::google::protobuf::Arena* arena)\n" " : $initializer$ {\n" - " $file_namespace$::InitDefaults();\n" + " ::$file_namespace$::InitDefaults$scc_name$();\n" " SharedCtor();\n" " RegisterArenaDtor(arena);\n" " // @@protoc_insertion_point(arena_constructor:$full_name$)\n" "}\n", "initializer", initializer_with_arena, "classname", classname_, "superclass", superclass, "full_name", descriptor_->full_name(), - "file_namespace", FileLevelNamespace(descriptor_->file()->name())); + "scc_name", scc_name_, "file_namespace", + FileLevelNamespace(descriptor_)); } // Generate the copy constructor. @@ -2865,23 +2633,23 @@ GenerateStructors(io::Printer* printer) { !descriptor_->options().no_standard_descriptor_accessor()) { printer->Print( "const ::google::protobuf::Descriptor* $classname$::descriptor() {\n" - " $file_namespace$::protobuf_AssignDescriptorsOnce();\n" - " return " + " ::$file_namespace$::protobuf_AssignDescriptorsOnce();\n" + " return ::" "$file_namespace$::file_level_metadata[kIndexInFileMessages]." "descriptor;\n" "}\n" "\n", "classname", classname_, "file_namespace", - FileLevelNamespace(descriptor_->file()->name())); + FileLevelNamespace(descriptor_)); } printer->Print( "const $classname$& $classname$::default_instance() {\n" - " $file_namespace$::InitDefaults();\n" + " ::$file_namespace$::InitDefaults$scc_name$();\n" " return *internal_default_instance();\n" "}\n\n", - "classname", classname_, "file_namespace", - FileLevelNamespace(descriptor_->file()->name())); + "classname", classname_, "scc_name", scc_name_, "file_namespace", + FileLevelNamespace(descriptor_)); if (SupportsArenas(descriptor_)) { printer->Print( @@ -2930,6 +2698,9 @@ bool MessageGenerator::MaybeGenerateOptionalFieldCondition( void MessageGenerator:: GenerateClear(io::Printer* printer) { + // Performance tuning parameters + const int kMaxUnconditionalPrimitiveBytesClear = 4; + printer->Print( "void $classname$::Clear() {\n" "// @@protoc_insertion_point(message_clear_start:$full_name$)\n", @@ -2951,6 +2722,17 @@ GenerateClear(io::Printer* printer) { } int last_i = -1; + int unconditional_budget = kMaxUnconditionalPrimitiveBytesClear; + for (int i = 0; i < optimized_order_.size(); i++) { + const FieldDescriptor* field = optimized_order_[i]; + + if (!CanInitializeByZeroing(field)) { + continue; + } + + unconditional_budget -= EstimateAlignmentSize(field); + } + for (int i = 0; i < optimized_order_.size(); ) { // Detect infinite loops. GOOGLE_CHECK_NE(i, last_i); @@ -2998,7 +2780,8 @@ GenerateClear(io::Printer* printer) { if (last_chunk == -1) { last_chunk = chunk; last_chunk_start = i; - } else if (chunk != last_chunk) { + } else if ((memset_run_start == -1 || unconditional_budget < 0) && + chunk != last_chunk) { // Emit the fields for this chunk so far. break; } @@ -3012,6 +2795,11 @@ GenerateClear(io::Printer* printer) { last_chunk_mask |= static_cast(1) << (index % 32); } + if (memset_run_start != memset_run_end && unconditional_budget >= 0) { + // Flush the memset fields. + goto flush; + } + // Step 4: Non-repeated, non-zero initializable fields. for (; i < optimized_order_.size(); i++) { const FieldDescriptor* field = optimized_order_[i]; @@ -3037,6 +2825,8 @@ GenerateClear(io::Printer* printer) { last_chunk_mask |= static_cast(1) << (index % 32); } +flush: + if (last_chunk != -1) { GOOGLE_DCHECK_NE(-1, last_chunk_start); GOOGLE_DCHECK_NE(-1, last_chunk_end); @@ -3044,7 +2834,10 @@ GenerateClear(io::Printer* printer) { const int count = popcnt(last_chunk_mask); const bool have_outer_if = HasFieldPresence(descriptor_->file()) && - (last_chunk_start != last_chunk_end); + (last_chunk_start != last_chunk_end) && + (memset_run_start != last_chunk_start || + memset_run_end != last_chunk_end || + unconditional_budget < 0); if (have_outer_if) { // Check (up to) 8 has_bits at a time if we have more than one field in @@ -3613,12 +3406,11 @@ GenerateMergeFromCodedStream(io::Printer* printer) { printer->Print( "return ::google::protobuf::internal::MergePartialFromCodedStream$lite$(\n" " this,\n" - " $file_namespace$::TableStruct::schema[\n" + " ::$file_namespace$::TableStruct::schema[\n" " $classname$::kIndexInFileMessages],\n" " input);\n", - "classname", classname_, - "file_namespace", FileLevelNamespace(descriptor_->file()->name()), - "lite", lite); + "classname", classname_, "file_namespace", + FileLevelNamespace(descriptor_), "lite", lite); printer->Outdent(); @@ -3631,17 +3423,14 @@ GenerateMergeFromCodedStream(io::Printer* printer) { " ::google::protobuf::uint32 tag;\n"); if (!UseUnknownFieldSet(descriptor_->file(), options_)) { - // Use LazyStringOutputString to avoid initializing unknown fields string - // unless it is actually needed. For the same reason, disable eager refresh - // on the CodedOutputStream. printer->Print( - " ::google::protobuf::io::LazyStringOutputStream unknown_fields_string(\n" - " ::google::protobuf::NewPermanentCallback(&_internal_metadata_,\n" - " &::google::protobuf::internal::InternalMetadataWithArenaLite::\n" - " mutable_unknown_fields));\n" - " ::google::protobuf::io::CodedOutputStream unknown_fields_stream(\n" - " &unknown_fields_string, false);\n", - "classname", classname_); + " ::google::protobuf::internal::LiteUnknownFieldSetter unknown_fields_setter(\n" + " &_internal_metadata_);\n" + " ::google::protobuf::io::StringOutputStream unknown_fields_output(\n" + " unknown_fields_setter.buffer());\n" + " ::google::protobuf::io::CodedOutputStream unknown_fields_stream(\n" + " &unknown_fields_output, false);\n", + "classname", classname_); } printer->Print( diff --git a/src/google/protobuf/compiler/cpp/cpp_message.h b/src/google/protobuf/compiler/cpp/cpp_message.h index 352069eb..cf64f483 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.h +++ b/src/google/protobuf/compiler/cpp/cpp_message.h @@ -43,6 +43,7 @@ #include #include #include +#include #include namespace google { @@ -62,12 +63,10 @@ class ExtensionGenerator; // extension.h class MessageGenerator { public: // See generator.cc for the meaning of dllexport_decl. - MessageGenerator(const Descriptor* descriptor, const Options& options, - SCCAnalyzer* scc_analyzer); + MessageGenerator(const Descriptor* descriptor, int index_in_file_messages, + const Options& options, SCCAnalyzer* scc_analyzer); ~MessageGenerator(); - // Appends the pre-order walk of the nested generators to list. - void Flatten(std::vector* list); // Append the two types of nested generators to the corresponding vector. void AddGenerators(std::vector* enum_generators, std::vector* extension_generators); @@ -96,8 +95,8 @@ class MessageGenerator { // Generate extra fields void GenerateExtraDefaultFields(io::Printer* printer); - // Generates code that allocates the message's default instance. - void GenerateDefaultInstanceAllocator(io::Printer* printer); + // Generates code that creates default instances for fields. + void GenerateFieldDefaultInstances(io::Printer* printer); // Generates code that initializes the message's default instance. This // is separate from allocating because all default instances must be @@ -208,6 +207,7 @@ class MessageGenerator { std::vector RequiredFieldsBitMask() const; const Descriptor* descriptor_; + int index_in_file_messages_; string classname_; Options options_; FieldGeneratorMap field_generators_; @@ -218,7 +218,6 @@ class MessageGenerator { std::vector optimized_order_; std::vector has_bit_indices_; int max_has_bit_index_; - google::protobuf::scoped_array > nested_generators_; google::protobuf::scoped_array > enum_generators_; google::protobuf::scoped_array > extension_generators_; int num_required_fields_; @@ -227,9 +226,10 @@ class MessageGenerator { // table_driven_ indicates the generated message uses table-driven parsing. bool table_driven_; - int index_in_file_messages_; + google::protobuf::scoped_ptr message_layout_helper_; SCCAnalyzer* scc_analyzer_; + string scc_name_; friend class FileGenerator; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator); diff --git a/src/google/protobuf/compiler/cpp/cpp_message_field.cc b/src/google/protobuf/compiler/cpp/cpp_message_field.cc index da4c3950..5888f51a 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message_field.cc @@ -45,13 +45,42 @@ namespace cpp { namespace { +// When we are generating code for implicit weak fields, we need to insert some +// additional casts. These functions return the casted expression if +// implicit_weak_field is true but otherwise return the original expression. +// Ordinarily a static_cast is enough to cast google::protobuf::MessageLite* to a class +// deriving from it, but we need a reinterpret_cast in cases where the generated +// message is forward-declared but its full definition is not visible. +string StaticCast(const string& type, const string& expression, + bool implicit_weak_field) { + if (implicit_weak_field) { + return "static_cast< " + type + " >(" + expression + ")"; + } else { + return expression; + } +} + +string ReinterpretCast(const string& type, const string& expression, + bool implicit_weak_field) { + if (implicit_weak_field) { + return "reinterpret_cast< " + type + " >(" + expression + ")"; + } else { + return expression; + } +} + void SetMessageVariables(const FieldDescriptor* descriptor, std::map* variables, const Options& options) { SetCommonFieldVariables(descriptor, variables, options); (*variables)["type"] = FieldMessageTypeName(descriptor); + (*variables)["casted_member"] = + StaticCast((*variables)["type"] + "*", (*variables)["name"] + "_", + IsImplicitWeakField(descriptor, options)); (*variables)["type_default_instance"] = DefaultInstanceName(descriptor->message_type()); + (*variables)["type_reference_function"] = + ReferenceFunctionName(descriptor->message_type()); if (descriptor->options().weak() || !descriptor->containing_oneof()) { (*variables)["non_null_ptr_to_name"] = StrCat("this->", (*variables)["name"], "_"); @@ -85,7 +114,8 @@ MessageFieldGenerator::MessageFieldGenerator(const FieldDescriptor* descriptor, const Options& options) : FieldGenerator(options), descriptor_(descriptor), - dependent_field_(options.proto_h && IsFieldDependent(descriptor)) { + dependent_field_(options.proto_h && IsFieldDependent(descriptor)), + implicit_weak_field_(IsImplicitWeakField(descriptor, options)) { SetMessageVariables(descriptor, &variables_, options); } @@ -93,7 +123,11 @@ MessageFieldGenerator::~MessageFieldGenerator() {} void MessageFieldGenerator:: GeneratePrivateMembers(io::Printer* printer) const { - printer->Print(variables_, "$type$* $name$_;\n"); + if (implicit_weak_field_) { + printer->Print(variables_, "google::protobuf::MessageLite* $name$_;\n"); + } else { + printer->Print(variables_, "$type$* $name$_;\n"); + } } void MessageFieldGenerator:: @@ -108,7 +142,11 @@ GenerateDependentAccessorDeclarations(io::Printer* printer) const { if (!dependent_field_) { return; } - // Arena manipulation code is out-of-line in the derived message class. + // Arena manipulation code is out-of-line in the derived message class. The + // one exception is unsafe_arena_release_; this method has to be inline so + // that when the implicit weak field optimization is enabled, the method does + // not introduce a strong dependency on the submessage type unless the + // accessor actually gets called somewhere. printer->Print(variables_, "$deprecated_attr$$type$* ${$mutable_$name$$}$();\n"); printer->Annotate("{", "}", descriptor_); @@ -118,14 +156,22 @@ GenerateDependentAccessorDeclarations(io::Printer* printer) const { "$deprecated_attr$void ${$set_allocated_$name$$}$" "($type$* $name$);\n"); printer->Annotate("{", "}", descriptor_); + if (SupportsArenas(descriptor_)) { + printer->Print( + variables_, + "$deprecated_attr$$type$* ${$unsafe_arena_release_$name$$}$();\n"); + printer->Annotate("{", "}", descriptor_); + } } void MessageFieldGenerator:: GenerateAccessorDeclarations(io::Printer* printer) const { if (SupportsArenas(descriptor_)) { printer->Print(variables_, - "private:\n" - "void _slow_mutable_$name$();\n"); + "private:\n"); + if (!implicit_weak_field_) { + printer->Print(variables_, "void _slow_mutable_$name$();\n"); + } if (SupportsArenas(descriptor_->message_type())) { printer->Print(variables_, "void _slow_set_allocated_$name$(\n" @@ -135,6 +181,16 @@ GenerateAccessorDeclarations(io::Printer* printer) const { "$type$* _slow_$release_name$();\n" "public:\n"); } + if (implicit_weak_field_) { + // These private accessors are used by MergeFrom and + // MergePartialFromCodedStream, and their purpose is to provide access to + // the field without creating a strong dependency on the message type. + printer->Print(variables_, + "private:\n" + "const google::protobuf::MessageLite& _internal_$name$() const;\n" + "google::protobuf::MessageLite* _internal_mutable_$name$();\n" + "public:\n"); + } GenerateGetterDeclaration(printer); if (!dependent_field_) { printer->Print(variables_, @@ -146,12 +202,14 @@ GenerateAccessorDeclarations(io::Printer* printer) const { "$deprecated_attr$void ${$set_allocated_$name$$}$" "($type$* $name$);\n"); printer->Annotate("{", "}", descriptor_); + if (SupportsArenas(descriptor_)) { + printer->Print( + variables_, + "$deprecated_attr$$type$* ${$unsafe_arena_release_$name$$}$();\n"); + printer->Annotate("{", "}", descriptor_); + } } if (SupportsArenas(descriptor_)) { - printer->Print( - variables_, - "$deprecated_attr$$type$* ${$unsafe_arena_release_$name$$}$();\n"); - printer->Annotate("{", "}", descriptor_); printer->Print(variables_, "$deprecated_attr$void " "${$unsafe_arena_set_allocated_$name$$}$(\n" @@ -162,9 +220,39 @@ GenerateAccessorDeclarations(io::Printer* printer) const { void MessageFieldGenerator::GenerateNonInlineAccessorDefinitions( io::Printer* printer) const { - if (SupportsArenas(descriptor_)) { + if (implicit_weak_field_) { printer->Print(variables_, - "void $classname$::_slow_mutable_$name$() {\n"); + "const google::protobuf::MessageLite& $classname$::_internal_$name$() const {\n" + " if ($name$_ != NULL) {\n" + " return *$name$_;\n" + " } else if (&$type_default_instance$ != NULL) {\n" + " return *reinterpret_cast(\n" + " &$type_default_instance$);\n" + " } else {\n" + " return *reinterpret_cast(\n" + " &::google::protobuf::internal::implicit_weak_message_default_instance);\n" + " }\n" + "}\n"); + } + if (SupportsArenas(descriptor_)) { + if (implicit_weak_field_) { + printer->Print(variables_, + "google::protobuf::MessageLite* $classname$::_internal_mutable_$name$() {\n" + " $set_hasbit$\n" + " if ($name$_ == NULL) {\n" + " if (&$type_default_instance$ == NULL) {\n" + " $name$_ = ::google::protobuf::Arena::CreateMessage<\n" + " ::google::protobuf::internal::ImplicitWeakMessage>(\n" + " GetArenaNoVirtual());\n" + " } else {\n" + " $name$_ = reinterpret_cast(\n" + " &$type_default_instance$)->New(GetArenaNoVirtual());\n" + " }\n" + " }\n" + " return $name$_;\n"); + } else { + printer->Print(variables_, + "void $classname$::_slow_mutable_$name$() {\n"); if (SupportsArenas(descriptor_->message_type())) { printer->Print(variables_, " $name$_ = ::google::protobuf::Arena::CreateMessage< $type$ >(\n" @@ -174,23 +262,27 @@ void MessageFieldGenerator::GenerateNonInlineAccessorDefinitions( " $name$_ = ::google::protobuf::Arena::Create< $type$ >(\n" " GetArenaNoVirtual());\n"); } + } printer->Print(variables_, "}\n" "$type$* $classname$::_slow_$release_name$() {\n" " if ($name$_ == NULL) {\n" " return NULL;\n" - " } else {\n" - " $type$* temp = new $type$(*$name$_);\n" - " $name$_ = NULL;\n" - " return temp;\n" + " } else {\n"); + if (implicit_weak_field_) { + printer->Print(variables_, + " google::protobuf::MessageLite* temp = $name$_->New();\n" + " temp->CheckTypeAndMergeFrom(*$name$_);\n"); + } else { + printer->Print(variables_, + " $type$* temp = new $type$(*$name$_);\n"); + } + printer->Print(variables_, " $name$_ = NULL;\n"); + printer->Print( + " return $result$;\n", "result", + StaticCast(variables_.at("type") + "*", "temp", implicit_weak_field_)); + printer->Print(variables_, " }\n" - "}\n" - "$type$* $classname$::unsafe_arena_release_$name$() {\n" - " // @@protoc_insertion_point(field_unsafe_arena_release:$full_name$)\n" - " $clear_hasbit$\n" - " $type$* temp = $name$_;\n" - " $name$_ = NULL;\n" - " return temp;\n" "}\n"); if (SupportsArenas(descriptor_->message_type())) { // NOTE: the same logic is mirrored in weak_message_field.cc. Any @@ -202,12 +294,23 @@ void MessageFieldGenerator::GenerateNonInlineAccessorDefinitions( " ::google::protobuf::Arena::GetArena(*$name$) == NULL) {\n" " message_arena->Own(*$name$);\n" " } else if (message_arena !=\n" - " ::google::protobuf::Arena::GetArena(*$name$)) {\n" - " $type$* new_$name$ = \n" - " ::google::protobuf::Arena::CreateMessage< $type$ >(\n" - " message_arena);\n" - " new_$name$->CopyFrom(**$name$);\n" - " *$name$ = new_$name$;\n" + " ::google::protobuf::Arena::GetArena(*$name$)) {\n"); + if (implicit_weak_field_) { + printer->Print(variables_, + " google::protobuf::MessageLite* new_$name$ =\n" + " reinterpret_cast(\n" + " &$type_default_instance$)->New(GetArenaNoVirtual());\n" + " new_$name$->CheckTypeAndMergeFrom(**$name$);\n" + " *$name$ = static_cast< $type$* >(new_$name$);\n"); + } else { + printer->Print(variables_, + " $type$* new_$name$ =\n" + " ::google::protobuf::Arena::CreateMessage< $type$ >(\n" + " message_arena);\n" + " new_$name$->CopyFrom(**$name$);\n" + " *$name$ = new_$name$;\n"); + } + printer->Print(variables_, " }\n" "}\n"); } @@ -228,6 +331,20 @@ void MessageFieldGenerator::GenerateNonInlineAccessorDefinitions( " // @@protoc_insertion_point(field_unsafe_arena_set_allocated" ":$full_name$)\n" "}\n"); + } else if (implicit_weak_field_) { + printer->Print(variables_, + "google::protobuf::MessageLite* $classname$::_internal_mutable_$name$() {\n" + " $set_hasbit$\n" + " if ($name$_ == NULL) {\n" + " if (&$type_default_instance$ == NULL) {\n" + " $name$_ = new ::google::protobuf::internal::ImplicitWeakMessage;\n" + " } else {\n" + " $name$_ = reinterpret_cast(\n" + " &$type_default_instance$)->New();\n" + " }\n" + " }\n" + " return $name$_;\n" + "}\n"); } } @@ -243,6 +360,10 @@ GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const { variables["dependent_classname"] = DependentBaseClassTemplateName(descriptor_->containing_type()) + ""; variables["this_message"] = DependentBaseDownCast(); + variables["casted_reference"] = + ReinterpretCast(variables["dependent_typename"] + "*&", + variables["this_message"] + variables["name"] + "_", + implicit_weak_field_); if (!variables["set_hasbit"].empty()) { variables["set_hasbit"] = variables["this_message"] + variables["set_hasbit"]; @@ -255,19 +376,39 @@ GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const { if (SupportsArenas(descriptor_)) { printer->Print(variables, "template \n" - "inline $type$* $dependent_classname$::mutable_$name$() {\n" + "inline $type$* $dependent_classname$::mutable_$name$() {\n"); + if (implicit_weak_field_) { + printer->Print(variables, " $type_reference_function$();\n"); + } + printer->Print(variables, " $set_hasbit$\n" - " $dependent_typename$*& $name$_ = $this_message$$name$_;\n" - " if ($name$_ == NULL) {\n" - " $this_message$_slow_mutable_$name$();\n" + " $dependent_typename$*& $name$_ = $casted_reference$;\n" + " if ($name$_ == NULL) {\n"); + if (implicit_weak_field_) { + if (SupportsArenas(descriptor_->message_type())) { + printer->Print(variables, + " $name$_ = reinterpret_cast<$dependent_typename$*>(\n" + " reinterpret_cast(\n" + " &$type_default_instance$)->New(\n" + " $this_message$GetArenaNoVirtual()));\n"); + } + } else { + printer->Print(variables, + " $this_message$_slow_mutable_$name$();\n"); + } + printer->Print(variables, " }\n" " // @@protoc_insertion_point(field_mutable:$full_name$)\n" " return $name$_;\n" "}\n" "template \n" "inline $type$* $dependent_classname$::$release_name$() {\n" - " // @@protoc_insertion_point(field_release:$full_name$)\n" - " $dependent_typename$*& $name$_ = $this_message$$name$_;\n" + " // @@protoc_insertion_point(field_release:$full_name$)\n"); + if (implicit_weak_field_) { + printer->Print(variables, " $type_reference_function$();\n"); + } + printer->Print(variables, + " $dependent_typename$*& $name$_ = $casted_reference$;\n" " $clear_hasbit$\n" " if ($this_message$GetArenaNoVirtual() != NULL) {\n" " return $this_message$_slow_$release_name$();\n" @@ -281,7 +422,7 @@ GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const { "inline void $dependent_classname$::" "set_allocated_$name$($type$* $name$) {\n" " ::google::protobuf::Arena* message_arena = $this_message$GetArenaNoVirtual();\n" - " $dependent_typename$*& $name$_ = $this_message$$name$_;\n" + " $dependent_typename$*& $name$_ = $casted_reference$;\n" " if (message_arena == NULL) {\n" " delete $name$_;\n" " }\n" @@ -311,13 +452,27 @@ GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const { " }\n" // TODO(dlj): move insertion points to message class. " // @@protoc_insertion_point(field_set_allocated:$full_name$)\n" + "}\n" + "template \n" + "inline $type$* $dependent_classname$::unsafe_arena_release_$name$() {\n" + " // @@protoc_insertion_point(" + "field_unsafe_arena_release:$full_name$)\n"); + if (implicit_weak_field_) { + printer->Print(variables, " $type_reference_function$();\n"); + } + printer->Print(variables, + " $clear_hasbit$\n" + " $dependent_typename$*& $name$_ = $casted_reference$;\n" + " $dependent_typename$* temp = $name$_;\n" + " $name$_ = NULL;\n" + " return temp;\n" "}\n"); } else { printer->Print(variables, "template \n" "inline $type$* $dependent_classname$::mutable_$name$() {\n" " $set_hasbit$\n" - " $dependent_typename$*& $name$_ = $this_message$$name$_;\n" + " $dependent_typename$*& $name$_ = $casted_reference$;\n" " if ($name$_ == NULL) {\n" " $name$_ = new $dependent_typename$;\n" " }\n" @@ -326,9 +481,13 @@ GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const { "}\n" "template \n" "inline $type$* $dependent_classname$::$release_name$() {\n" - " // @@protoc_insertion_point(field_release:$full_name$)\n" + " // @@protoc_insertion_point(field_release:$full_name$)\n"); + if (implicit_weak_field_) { + printer->Print(variables, " $type_reference_function$();\n"); + } + printer->Print(variables, " $clear_hasbit$\n" - " $dependent_typename$*& $name$_ = $this_message$$name$_;\n" + " $dependent_typename$*& $name$_ = $casted_reference$;\n" " $dependent_typename$* temp = $name$_;\n" " $name$_ = NULL;\n" " return temp;\n" @@ -336,7 +495,7 @@ GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const { "template \n" "inline void $dependent_classname$::" "set_allocated_$name$($type$* $name$) {\n" - " $dependent_typename$*& $name$_ = $this_message$$name$_;\n" + " $dependent_typename$*& $name$_ = $casted_reference$;\n" " delete $name$_;\n"); if (SupportsArenas(descriptor_->message_type())) { @@ -366,9 +525,16 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, bool is_inline) const { std::map variables(variables_); variables["inline"] = is_inline ? "inline " : ""; + variables["const_member"] = ReinterpretCast( + "const " + variables["type"] + "*", variables["name"] + "_", + implicit_weak_field_); printer->Print(variables, - "$inline$const $type$& $classname$::$name$() const {\n" - " const $type$* p = $name$_;\n" + "$inline$const $type$& $classname$::$name$() const {\n"); + if (implicit_weak_field_) { + printer->Print(variables, " $type_reference_function$();\n"); + } + printer->Print(variables, + " const $type$* p = $const_member$;\n" " // @@protoc_insertion_point(field_get:$full_name$)\n" " return p != NULL ? *p : *reinterpret_cast(\n" " &$type_default_instance$);\n" @@ -381,11 +547,18 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, "$inline$" "$type$* $classname$::mutable_$name$() {\n" " $set_hasbit$\n" - " if ($name$_ == NULL) {\n" - " _slow_mutable_$name$();\n" + " if ($name$_ == NULL) {\n"); + if (implicit_weak_field_) { + printer->Print(variables, + " _internal_mutable_$name$();\n"); + } else { + printer->Print(variables, + " _slow_mutable_$name$();\n"); + } + printer->Print(variables, " }\n" " // @@protoc_insertion_point(field_mutable:$full_name$)\n" - " return $name$_;\n" + " return $casted_member$;\n" "}\n" "$inline$" "$type$* $classname$::$release_name$() {\n" @@ -394,7 +567,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, " if (GetArenaNoVirtual() != NULL) {\n" " return _slow_$release_name$();\n" " } else {\n" - " $type$* temp = $name$_;\n" + " $type$* temp = $casted_member$;\n" " $name$_ = NULL;\n" " return temp;\n" " }\n" @@ -429,6 +602,19 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, " $clear_hasbit$\n" " }\n" " // @@protoc_insertion_point(field_set_allocated:$full_name$)\n" + "}\n" + "$inline$" + "$type$* $classname$::unsafe_arena_release_$name$() {\n" + " // @@protoc_insertion_point(" + "field_unsafe_arena_release:$full_name$)\n"); + if (implicit_weak_field_) { + printer->Print(variables, " $type_reference_function$();\n"); + } + printer->Print(variables, + " $clear_hasbit$\n" + " $type$* temp = $casted_member$;\n" + " $name$_ = NULL;\n" + " return temp;\n" "}\n"); } else { printer->Print(variables, @@ -439,13 +625,13 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, " $name$_ = new $type$;\n" " }\n" " // @@protoc_insertion_point(field_mutable:$full_name$)\n" - " return $name$_;\n" + " return $casted_member$;\n" "}\n" "$inline$" "$type$* $classname$::$release_name$() {\n" " // @@protoc_insertion_point(field_release:$full_name$)\n" " $clear_hasbit$\n" - " $type$* temp = $name$_;\n" + " $type$* temp = $casted_member$;\n" " $name$_ = NULL;\n" " return temp;\n" "}\n" @@ -485,6 +671,9 @@ GenerateClearingCode(io::Printer* printer) const { "if ($this_message$GetArenaNoVirtual() == NULL && " "$this_message$$name$_ != NULL) delete $this_message$$name$_;\n" "$this_message$$name$_ = NULL;\n"); + } else if (implicit_weak_field_) { + printer->Print(variables, + "if ($this_message$$name$_ != NULL) $this_message$$name$_->Clear();\n"); } else { printer->Print(variables, "if ($this_message$$name$_ != NULL) $this_message$$name$_->" @@ -502,6 +691,10 @@ GenerateMessageClearingCode(io::Printer* printer) const { " delete $name$_;\n" "}\n" "$name$_ = NULL;\n"); + } else if (implicit_weak_field_) { + printer->Print(variables_, + "GOOGLE_DCHECK($name$_ != NULL);\n" + "$name$_->Clear();\n"); } else { printer->Print(variables_, "GOOGLE_DCHECK($name$_ != NULL);\n" @@ -511,8 +704,14 @@ GenerateMessageClearingCode(io::Printer* printer) const { void MessageFieldGenerator:: GenerateMergingCode(io::Printer* printer) const { - printer->Print(variables_, - "mutable_$name$()->$type$::MergeFrom(from.$name$());\n"); + if (implicit_weak_field_) { + printer->Print(variables_, + "_internal_mutable_$name$()->CheckTypeAndMergeFrom(\n" + " from._internal_$name$());\n"); + } else { + printer->Print(variables_, + "mutable_$name$()->$type$::MergeFrom(from.$name$());\n"); + } } void MessageFieldGenerator:: @@ -557,17 +756,24 @@ GenerateCopyConstructorCode(io::Printer* printer) const { // wasn't copied, so both of these methods allocate the submessage on the // heap. - printer->Print(variables_, - "if (from.has_$name$()) {\n" - " $name$_ = new $type$(*from.$name$_);\n" - "} else {\n" - " $name$_ = NULL;\n" - "}\n"); + string new_expression = (implicit_weak_field_ ? "from.$name$_->New()" + : "new $type$(*from.$name$_)"); + string output = + "if (from.has_$name$()) {\n" + " $name$_ = " + new_expression + ";\n" + "} else {\n" + " $name$_ = NULL;\n" + "}\n"; + printer->Print(variables_, output.c_str()); } void MessageFieldGenerator:: GenerateMergeFromCodedStream(io::Printer* printer) const { - if (descriptor_->type() == FieldDescriptor::TYPE_MESSAGE) { + if (implicit_weak_field_) { + printer->Print(variables_, + "DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(\n" + " input, _internal_mutable_$name$()));\n"); + } else if (descriptor_->type() == FieldDescriptor::TYPE_MESSAGE) { printer->Print(variables_, "DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(\n" " input, mutable_$name$()));\n"); @@ -595,9 +801,11 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const { void MessageFieldGenerator:: GenerateByteSize(io::Printer* printer) const { - printer->Print(variables_, + std::map variables = variables_; + variables["no_virtual"] = (implicit_weak_field_ ? "" : "NoVirtual"); + printer->Print(variables, "total_size += $tag_size$ +\n" - " ::google::protobuf::internal::WireFormatLite::$declared_type$SizeNoVirtual(\n" + " ::google::protobuf::internal::WireFormatLite::$declared_type$Size$no_virtual$(\n" " *$non_null_ptr_to_name$);\n"); } @@ -771,13 +979,15 @@ void MessageOneofFieldGenerator::InternalGenerateInlineAccessorDefinitions( " }\n" " // @@protoc_insertion_point(field_set_allocated:$full_name$)\n" "}\n" - "$inline$ $type$* $classname$::unsafe_arena_release_$name$() {\n" + "$tmpl$" + "$inline$" + "$type$* $dependent_classname$::unsafe_arena_release_$name$() {\n" " // @@protoc_insertion_point(field_unsafe_arena_release" ":$full_name$)\n" - " if (has_$name$()) {\n" - " clear_has_$oneof_name$();\n" - " $type$* temp = $oneof_prefix$$name$_;\n" - " $oneof_prefix$$name$_ = NULL;\n" + " if ($this_message$has_$name$()) {\n" + " $this_message$clear_has_$oneof_name$();\n" + " $dependent_typename$* temp = $this_message$$oneof_prefix$$name$_;\n" + " $this_message$$oneof_prefix$$name$_ = NULL;\n" " return temp;\n" " } else {\n" " return NULL;\n" diff --git a/src/google/protobuf/compiler/cpp/cpp_message_field.h b/src/google/protobuf/compiler/cpp/cpp_message_field.h index cd9737f0..14698992 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message_field.h +++ b/src/google/protobuf/compiler/cpp/cpp_message_field.h @@ -44,6 +44,8 @@ namespace protobuf { namespace compiler { namespace cpp { +bool IsImplicitWeakField(const FieldDescriptor* field, const Options& options); + class MessageFieldGenerator : public FieldGenerator { public: MessageFieldGenerator(const FieldDescriptor* descriptor, @@ -78,6 +80,7 @@ class MessageFieldGenerator : public FieldGenerator { const FieldDescriptor* descriptor_; const bool dependent_field_; + const bool implicit_weak_field_; std::map variables_; private: diff --git a/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h b/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h new file mode 100644 index 00000000..d502a6f0 --- /dev/null +++ b/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h @@ -0,0 +1,61 @@ +// 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: seongkim@google.com (Seong Beom Kim) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. + +#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__ +#define GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__ + +#include +#include + +namespace google { +namespace protobuf { +namespace compiler { +namespace cpp { + +// Provides an abstract interface to optimize message layout +// by rearranging the fields of a message. +class MessageLayoutHelper { + public: + virtual ~MessageLayoutHelper() {} + + virtual void OptimizeLayout(std::vector* fields, + const Options& options) = 0; +}; + +} // namespace cpp +} // namespace compiler +} // namespace protobuf + +} // namespace google +#endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__ diff --git a/src/google/protobuf/compiler/cpp/cpp_options.h b/src/google/protobuf/compiler/cpp/cpp_options.h index 04338083..4a29ad0e 100644 --- a/src/google/protobuf/compiler/cpp/cpp_options.h +++ b/src/google/protobuf/compiler/cpp/cpp_options.h @@ -39,6 +39,8 @@ namespace google { namespace protobuf { namespace compiler { +class AccessInfoMap; + namespace cpp { // Generator options (see generator.cc for a description of each): @@ -50,7 +52,9 @@ struct Options { annotate_headers(false), enforce_lite(false), table_driven_parsing(false), - table_driven_serialization(false) {} + table_driven_serialization(false), + lite_implicit_weak_fields(false), + access_info_map(NULL) {} string dllexport_decl; bool safe_boundary_check; @@ -60,8 +64,10 @@ struct Options { bool enforce_lite; bool table_driven_parsing; bool table_driven_serialization; + bool lite_implicit_weak_fields; string annotation_pragma_name; string annotation_guard_name; + const AccessInfoMap* access_info_map; }; } // namespace cpp diff --git a/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc b/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc new file mode 100644 index 00000000..e9303865 --- /dev/null +++ b/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc @@ -0,0 +1,220 @@ +// 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 + +#include + +namespace google { +namespace protobuf { +namespace compiler { +namespace cpp { + +namespace { + +// FieldGroup is just a helper for PaddingOptimizer below. It holds a vector of +// fields that are grouped together because they have compatible alignment, and +// a preferred location in the final field ordering. +class FieldGroup { + public: + FieldGroup() : preferred_location_(0) {} + + // A group with a single field. + FieldGroup(float preferred_location, const FieldDescriptor* field) + : preferred_location_(preferred_location), fields_(1, field) {} + + // Append the fields in 'other' to this group. + void Append(const FieldGroup& other) { + if (other.fields_.empty()) { + return; + } + // Preferred location is the average among all the fields, so we weight by + // the number of fields on each FieldGroup object. + preferred_location_ = (preferred_location_ * fields_.size() + + (other.preferred_location_ * other.fields_.size())) / + (fields_.size() + other.fields_.size()); + fields_.insert(fields_.end(), other.fields_.begin(), other.fields_.end()); + } + + void SetPreferredLocation(float location) { preferred_location_ = location; } + const std::vector& fields() const { return fields_; } + + // FieldGroup objects sort by their preferred location. + bool operator<(const FieldGroup& other) const { + return preferred_location_ < other.preferred_location_; + } + + private: + // "preferred_location_" is an estimate of where this group should go in the + // final list of fields. We compute this by taking the average index of each + // field in this group in the original ordering of fields. This is very + // approximate, but should put this group close to where its member fields + // originally went. + float preferred_location_; + std::vector fields_; + // We rely on the default copy constructor and operator= so this type can be + // used in a vector. +}; + +} // namespace + +// Reorder 'fields' so that if the fields are output into a c++ class in the new +// order, fields of similar family (see below) are together and within each +// family, alignment padding is minimized. +// +// We try to do this while keeping each field as close as possible to its field +// number order so that we don't reduce cache locality much for function that +// access each field in order. Originally, OptimizePadding used declaration +// order for its decisions, but generated code minus the serializer/parsers uses +// the output of OptimizePadding as well (stored in +// MessageGenerator::optimized_order_). Since the serializers use field number +// order, we use that as a tie-breaker. +// +// We classify each field into a particular "family" of fields, that we perform +// the same operation on in our generated functions. +// +// REPEATED is placed first, as the C++ compiler automatically initializes +// these fields in layout order. +// +// STRING is grouped next, as our Clear/SharedCtor/SharedDtor walks it and +// calls ArenaStringPtr::Destroy on each. +// +// +// MESSAGE is grouped next, as our Clear/SharedDtor code walks it and calls +// delete on each. We initialize these fields with a NULL pointer (see +// MessageFieldGenerator::GenerateConstructorCode), which allows them to be +// memset. +// +// ZERO_INITIALIZABLE is memset in Clear/SharedCtor +// +// OTHER these fields are initialized one-by-one. +void PaddingOptimizer::OptimizeLayout( + std::vector* fields, const Options& options) { + // The sorted numeric order of Family determines the declaration order in the + // memory layout. + enum Family { + REPEATED = 0, + STRING = 1, + MESSAGE = 3, + ZERO_INITIALIZABLE = 4, + OTHER = 5, + kMaxFamily + }; + + // First divide fields into those that align to 1 byte, 4 bytes or 8 bytes. + std::vector aligned_to_1[kMaxFamily]; + std::vector aligned_to_4[kMaxFamily]; + std::vector aligned_to_8[kMaxFamily]; + for (int i = 0; i < fields->size(); ++i) { + const FieldDescriptor* field = (*fields)[i]; + + Family f = OTHER; + if (field->is_repeated()) { + f = REPEATED; + } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_STRING) { + f = STRING; + } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { + f = MESSAGE; + + } else if (CanInitializeByZeroing(field)) { + f = ZERO_INITIALIZABLE; + } + + const int j = field->number(); + switch (EstimateAlignmentSize(field)) { + case 1: + aligned_to_1[f].push_back(FieldGroup(j, field)); + break; + case 4: + aligned_to_4[f].push_back(FieldGroup(j, field)); + break; + case 8: + aligned_to_8[f].push_back(FieldGroup(j, field)); + break; + default: + GOOGLE_LOG(FATAL) << "Unknown alignment size " << EstimateAlignmentSize(field) + << "for a field " << field->full_name() << "."; + } + } + + // For each family, group fields to optimize padding. + for (int f = 0; f < kMaxFamily; f++) { + // Now group fields aligned to 1 byte into sets of 4, and treat those like a + // single field aligned to 4 bytes. + for (int i = 0; i < aligned_to_1[f].size(); i += 4) { + FieldGroup field_group; + for (int j = i; j < aligned_to_1[f].size() && j < i + 4; ++j) { + field_group.Append(aligned_to_1[f][j]); + } + aligned_to_4[f].push_back(field_group); + } + // Sort by preferred location to keep fields as close to their field number + // order as possible. Using stable_sort ensures that the output is + // consistent across runs. + std::stable_sort(aligned_to_4[f].begin(), aligned_to_4[f].end()); + + // Now group fields aligned to 4 bytes (or the 4-field groups created above) + // into pairs, and treat those like a single field aligned to 8 bytes. + for (int i = 0; i < aligned_to_4[f].size(); i += 2) { + FieldGroup field_group; + for (int j = i; j < aligned_to_4[f].size() && j < i + 2; ++j) { + field_group.Append(aligned_to_4[f][j]); + } + if (i == aligned_to_4[f].size() - 1) { + if (f == OTHER) { + // Move incomplete 4-byte block to the beginning. This is done to + // pair with the (possible) leftover blocks from the + // ZERO_INITIALIZABLE family. + field_group.SetPreferredLocation(-1); + } else { + // Move incomplete 4-byte block to the end. + field_group.SetPreferredLocation(fields->size() + 1); + } + } + aligned_to_8[f].push_back(field_group); + } + // Sort by preferred location. + std::stable_sort(aligned_to_8[f].begin(), aligned_to_8[f].end()); + } + + // Now pull out all the FieldDescriptors in order. + fields->clear(); + for (int f = 0; f < kMaxFamily; ++f) { + for (int i = 0; i < aligned_to_8[f].size(); ++i) { + fields->insert(fields->end(), aligned_to_8[f][i].fields().begin(), + aligned_to_8[f][i].fields().end()); + } + } +} + +} // namespace cpp +} // namespace compiler +} // namespace protobuf +} // namespace google diff --git a/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h b/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h new file mode 100644 index 00000000..9641ba40 --- /dev/null +++ b/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h @@ -0,0 +1,64 @@ +// 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: seongkim@google.com (Seong Beom Kim) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. + +#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_PADDING_OPTIMIZER_H__ +#define GOOGLE_PROTOBUF_COMPILER_CPP_PADDING_OPTIMIZER_H__ + +#include + +namespace google { +namespace protobuf { +namespace compiler { +namespace cpp { + +// Rearranges the fields of a message to minimize padding. +// Fields are grouped by the type and the size. +// For example, grouping four boolean fields and one int32 +// field results in zero padding overhead. See OptimizeLayout's +// comment for details. +class PaddingOptimizer : public MessageLayoutHelper { + public: + PaddingOptimizer() {} + ~PaddingOptimizer() {} + + void OptimizeLayout(std::vector* fields, + const Options& options); +}; + +} // namespace cpp +} // namespace compiler +} // namespace protobuf + +} // namespace google +#endif // GOOGLE_PROTOBUF_COMPILER_CPP_PADDING_OPTIMIZER_H__ diff --git a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc index b05fcc4e..67cfc405 100644 --- a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc @@ -245,9 +245,8 @@ GenerateSwappingCode(io::Printer* printer) const { void PrimitiveOneofFieldGenerator:: GenerateConstructorCode(io::Printer* printer) const { - printer->Print( - variables_, - "_$classname$_default_instance_.$name$_ = $default$;\n"); + printer->Print(variables_, + "$ns$::_$classname$_default_instance_.$name$_ = $default$;\n"); } void PrimitiveOneofFieldGenerator:: @@ -433,7 +432,7 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const { " ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,\n" " target);\n" " target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(\n" - " static_cast< ::google::protobuf::uint32>(\n" + " static_cast< ::google::protobuf::int32>(\n" " _$name$_cached_byte_size_), target);\n" " target = ::google::protobuf::internal::WireFormatLite::\n" " Write$declared_type$NoTagToArray(this->$name$_, target);\n" diff --git a/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/src/google/protobuf/compiler/cpp/cpp_string_field.cc index fec13b6d..8e675751 100644 --- a/src/google/protobuf/compiler/cpp/cpp_string_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_string_field.cc @@ -58,8 +58,8 @@ void SetStringVariables(const FieldDescriptor* descriptor, (*variables)["default_variable"] = descriptor->default_value_string().empty() ? "&::google::protobuf::internal::GetEmptyStringAlreadyInited()" - : "&" + (*variables)["classname"] + "::" + default_variable_string + - ".get()"; + : "&" + Namespace(descriptor) + "::" + (*variables)["classname"] + + "::" + default_variable_string + ".get()"; (*variables)["pointer_type"] = descriptor->type() == FieldDescriptor::TYPE_BYTES ? "void" : "char"; (*variables)["null_check"] = "GOOGLE_DCHECK(value != NULL);\n"; @@ -71,6 +71,9 @@ void SetStringVariables(const FieldDescriptor* descriptor, (*variables)["full_name"] = descriptor->full_name(); (*variables)["string_piece"] = "::std::string"; + + (*variables)["lite"] = + HasDescriptorMethods(descriptor->file(), options) ? "" : "Lite"; } } // namespace @@ -79,7 +82,8 @@ void SetStringVariables(const FieldDescriptor* descriptor, StringFieldGenerator::StringFieldGenerator(const FieldDescriptor* descriptor, const Options& options) - : FieldGenerator(options), descriptor_(descriptor) { + : FieldGenerator(options), descriptor_(descriptor), + lite_(!HasDescriptorMethods(descriptor->file(), options)) { SetStringVariables(descriptor, &variables_, options); } @@ -207,13 +211,13 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, "}\n" "$inline$void $classname$::set_$name$(const ::std::string& value) {\n" " $set_hasbit$\n" - " $name$_.Set($default_variable$, value, GetArenaNoVirtual());\n" + " $name$_.Set$lite$($default_variable$, value, GetArenaNoVirtual());\n" " // @@protoc_insertion_point(field_set:$full_name$)\n" "}\n" "#if LANG_CXX11\n" "$inline$void $classname$::set_$name$(::std::string&& value) {\n" " $set_hasbit$\n" - " $name$_.Set(\n" + " $name$_.Set$lite$(\n" " $default_variable$, ::std::move(value), GetArenaNoVirtual());\n" " // @@protoc_insertion_point(field_set_rvalue:$full_name$)\n" "}\n" @@ -221,7 +225,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, "$inline$void $classname$::set_$name$(const char* value) {\n" " $null_check$" " $set_hasbit$\n" - " $name$_.Set($default_variable$, $string_piece$(value),\n" + " $name$_.Set$lite$($default_variable$, $string_piece$(value),\n" " GetArenaNoVirtual());\n" " // @@protoc_insertion_point(field_set_char:$full_name$)\n" "}\n" @@ -229,7 +233,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, "void $classname$::set_$name$(const $pointer_type$* value,\n" " size_t size) {\n" " $set_hasbit$\n" - " $name$_.Set($default_variable$, $string_piece$(\n" + " $name$_.Set$lite$($default_variable$, $string_piece$(\n" " reinterpret_cast(value), size), " "GetArenaNoVirtual());\n" " // @@protoc_insertion_point(field_set_pointer:$full_name$)\n" @@ -453,7 +457,7 @@ GenerateCopyConstructorCode(io::Printer* printer) const { if (SupportsArenas(descriptor_) || descriptor_->containing_oneof() != NULL) { // TODO(gpike): improve this printer->Print(variables_, - "$name$_.Set($default_variable$, from.$name$(),\n" + "$name$_.Set$lite$($default_variable$, from.$name$(),\n" " GetArenaNoVirtual());\n"); } else { printer->Print(variables_, @@ -480,13 +484,14 @@ GenerateDestructorCode(io::Printer* printer) const { void StringFieldGenerator:: GenerateDefaultInstanceAllocator(io::Printer* printer) const { if (!descriptor_->default_value_string().empty()) { - printer->Print(variables_, - "$classname$::$default_variable_name$.DefaultConstruct();\n" - "*$classname$::$default_variable_name$.get_mutable() = " - "::std::string($default$, $default_length$);\n" - "::google::protobuf::internal::OnShutdownDestroyString(\n" - " $classname$::$default_variable_name$.get_mutable());\n" - ); + printer->Print( + variables_, + "$ns$::$classname$::$default_variable_name$.DefaultConstruct();\n" + "*$ns$::$classname$::$default_variable_name$.get_mutable() = " + "::std::string($default$, $default_length$);\n" + "::google::protobuf::internal::OnShutdownDestroyString(\n" + " $ns$::$classname$::$default_variable_name$.get_mutable());\n" + ); } } @@ -572,7 +577,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, " set_has_$name$();\n" " $oneof_prefix$$name$_.UnsafeSetDefault($default_variable$);\n" " }\n" - " $oneof_prefix$$name$_.Set($default_variable$, value,\n" + " $oneof_prefix$$name$_.Set$lite$($default_variable$, value,\n" " GetArenaNoVirtual());\n" " // @@protoc_insertion_point(field_set:$full_name$)\n" "}\n" @@ -584,7 +589,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, " set_has_$name$();\n" " $oneof_prefix$$name$_.UnsafeSetDefault($default_variable$);\n" " }\n" - " $oneof_prefix$$name$_.Set(\n" + " $oneof_prefix$$name$_.Set$lite$(\n" " $default_variable$, ::std::move(value), GetArenaNoVirtual());\n" " // @@protoc_insertion_point(field_set_rvalue:$full_name$)\n" "}\n" @@ -596,7 +601,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, " set_has_$name$();\n" " $oneof_prefix$$name$_.UnsafeSetDefault($default_variable$);\n" " }\n" - " $oneof_prefix$$name$_.Set($default_variable$,\n" + " $oneof_prefix$$name$_.Set$lite$($default_variable$,\n" " $string_piece$(value), GetArenaNoVirtual());\n" " // @@protoc_insertion_point(field_set_char:$full_name$)\n" "}\n" @@ -608,7 +613,8 @@ GenerateInlineAccessorDefinitions(io::Printer* printer, " set_has_$name$();\n" " $oneof_prefix$$name$_.UnsafeSetDefault($default_variable$);\n" " }\n" - " $oneof_prefix$$name$_.Set($default_variable$, $string_piece$(\n" + " $oneof_prefix$$name$_.Set$lite$(\n" + " $default_variable$, $string_piece$(\n" " reinterpret_cast(value), size),\n" " GetArenaNoVirtual());\n" " // @@protoc_insertion_point(field_set_pointer:$full_name$)\n" @@ -806,7 +812,7 @@ void StringOneofFieldGenerator:: GenerateConstructorCode(io::Printer* printer) const { printer->Print( variables_, - "_$classname$_default_instance_.$name$_.UnsafeSetDefault(\n" + "$ns$::_$classname$_default_instance_.$name$_.UnsafeSetDefault(\n" " $default_variable$);\n"); } diff --git a/src/google/protobuf/compiler/cpp/cpp_string_field.h b/src/google/protobuf/compiler/cpp/cpp_string_field.h index 531252b0..933f3c6b 100644 --- a/src/google/protobuf/compiler/cpp/cpp_string_field.h +++ b/src/google/protobuf/compiler/cpp/cpp_string_field.h @@ -73,6 +73,7 @@ class StringFieldGenerator : public FieldGenerator { protected: const FieldDescriptor* descriptor_; std::map variables_; + const bool lite_; private: GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringFieldGenerator); diff --git a/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto b/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto index 4e25b2ea..7fe98759 100644 --- a/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto +++ b/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto @@ -151,6 +151,10 @@ enum ConflictingEnum { // NO_PROTO3 message DummyMessage {} +// Message names that could conflict. +message Shutdown {} +message TableStruct {} + service TestConflictingMethodNames { rpc Closure(DummyMessage) returns (DummyMessage); } diff --git a/src/google/protobuf/compiler/cpp/cpp_unittest.cc b/src/google/protobuf/compiler/cpp/cpp_unittest.cc index fdde771b..61cc32a4 100644 --- a/src/google/protobuf/compiler/cpp/cpp_unittest.cc +++ b/src/google/protobuf/compiler/cpp/cpp_unittest.cc @@ -744,21 +744,6 @@ TEST(GeneratedMessageTest, NonEmptyMergeFrom) { TestUtil::ExpectAllFieldsSet(message1); } -#if !defined(PROTOBUF_TEST_NO_DESCRIPTORS) || \ - !defined(GOOGLE_PROTOBUF_NO_RTTI) -#ifdef PROTOBUF_HAS_DEATH_TEST -#ifndef NDEBUG - -TEST(GeneratedMessageTest, MergeFromSelf) { - unittest::TestAllTypes message; - EXPECT_DEATH(message.MergeFrom(message), "pb[.]cc.*Check failed:"); - EXPECT_DEATH(message.MergeFrom(implicit_cast(message)), - "pb[.]cc.*Check failed:"); -} - -#endif // NDEBUG -#endif // PROTOBUF_HAS_DEATH_TEST -#endif // !PROTOBUF_TEST_NO_DESCRIPTORS || !GOOGLE_PROTOBUF_NO_RTTI // Test the generated SerializeWithCachedSizesToArray(), TEST(GeneratedMessageTest, SerializationToArray) { diff --git a/src/google/protobuf/compiler/importer.cc b/src/google/protobuf/compiler/importer.cc index 4c357aa0..9792ffe8 100644 --- a/src/google/protobuf/compiler/importer.cc +++ b/src/google/protobuf/compiler/importer.cc @@ -54,13 +54,17 @@ #include #include #include -#include #include +#include #ifdef _WIN32 #include #endif +namespace google { +namespace protobuf { +namespace compiler { + #ifdef _MSC_VER // DO NOT include , instead create functions in io_win32.{h,cc} and import // them like we do below. @@ -68,10 +72,6 @@ using google::protobuf::internal::win32::access; using google::protobuf::internal::win32::open; #endif -namespace google { -namespace protobuf { -namespace compiler { - // Returns true if the text looks like a Windows-style absolute path, starting // with a drive letter. Example: "C:\foo". TODO(kenton): Share this with // copy in command_line_interface.cc? diff --git a/src/google/protobuf/compiler/java/java_helpers.h b/src/google/protobuf/compiler/java/java_helpers.h index bd565ced..1ab168c4 100644 --- a/src/google/protobuf/compiler/java/java_helpers.h +++ b/src/google/protobuf/compiler/java/java_helpers.h @@ -136,6 +136,13 @@ inline string ShortMutableJavaClassName(const Descriptor* descriptor) { return descriptor->name(); } +// Whether the given descriptor is for one of the core descriptor protos. We +// cannot currently use the new runtime with core protos since there is a +// bootstrapping problem with obtaining their descriptors. +inline bool IsDescriptorProto(const Descriptor* descriptor) { + return descriptor->file()->name() == "google/protobuf/descriptor.proto"; +} + // Whether we should generate multiple java files for messages. inline bool MultipleJavaFiles( @@ -371,6 +378,10 @@ inline bool IsAnyMessage(const Descriptor* descriptor) { return descriptor->full_name() == "google.protobuf.Any"; } +inline bool IsWrappersProtoFile(const FileDescriptor* descriptor) { + return descriptor->name() == "google/protobuf/wrappers.proto"; +} + inline bool CheckUtf8(const FieldDescriptor* descriptor) { return descriptor->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 || descriptor->file()->options().java_string_check_utf8(); @@ -379,6 +390,10 @@ inline bool CheckUtf8(const FieldDescriptor* descriptor) { inline string GeneratedCodeVersionSuffix() { return "V3"; } + +inline bool EnableExperimentalRuntime(Context* context) { + return false; +} } // namespace java } // namespace compiler } // namespace protobuf diff --git a/src/google/protobuf/compiler/java/java_message.cc b/src/google/protobuf/compiler/java/java_message.cc index ecc67575..df0c95c8 100644 --- a/src/google/protobuf/compiler/java/java_message.cc +++ b/src/google/protobuf/compiler/java/java_message.cc @@ -379,7 +379,10 @@ void ImmutableMessageGenerator::Generate(io::Printer* printer) { "}\n"); if (context_->HasGeneratedMethods(descriptor_)) { - GenerateParsingConstructor(printer); + if (!EnableExperimentalRuntime(context_) || + IsDescriptorProto(descriptor_)) { + GenerateParsingConstructor(printer); + } } GenerateDescriptorMethods(printer); @@ -537,6 +540,17 @@ void ImmutableMessageGenerator::Generate(io::Printer* printer) { "\n", "classname", name_resolver_->GetImmutableClassName(descriptor_)); + // 'of' method for Wrappers + if (IsWrappersProtoFile(descriptor_->file())) { + printer->Print( + "public static $classname$ of($field_type$ value) {\n" + " return newBuilder().setValue(value).build();\n" + "}\n" + "\n", + "classname", name_resolver_->GetImmutableClassName(descriptor_), + "field_type", PrimitiveTypeName(GetJavaType(descriptor_->field(0)))); + } + GenerateParser(printer); printer->Print( @@ -576,95 +590,103 @@ GenerateMessageSerializationMethods(io::Printer* printer) { "public void writeTo(com.google.protobuf.CodedOutputStream output)\n" " throws java.io.IOException {\n"); printer->Indent(); - if (HasPackedFields(descriptor_)) { - // writeTo(CodedOutputStream output) might be invoked without - // getSerializedSize() ever being called, but we need the memoized - // sizes in case this message has packed fields. Rather than emit checks for - // each packed field, just call getSerializedSize() up front. - // In most cases, getSerializedSize() will have already been called anyway - // by one of the wrapper writeTo() methods, making this call cheap. - printer->Print( - "getSerializedSize();\n"); - } - if (descriptor_->extension_range_count() > 0) { - if (descriptor_->options().message_set_wire_format()) { - printer->Print( - "com.google.protobuf.GeneratedMessage$ver$\n" - " .ExtendableMessage<$classname$>.ExtensionWriter\n" - " extensionWriter = newMessageSetExtensionWriter();\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "ver", GeneratedCodeVersionSuffix()); - } else { - printer->Print( - "com.google.protobuf.GeneratedMessage$ver$\n" - " .ExtendableMessage<$classname$>.ExtensionWriter\n" - " extensionWriter = newExtensionWriter();\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_), - "ver", GeneratedCodeVersionSuffix()); + if (EnableExperimentalRuntime(context_) && !IsDescriptorProto(descriptor_)) { + printer->Print("writeToInternal(output);\n"); + } else { + if (HasPackedFields(descriptor_)) { + // writeTo(CodedOutputStream output) might be invoked without + // getSerializedSize() ever being called, but we need the memoized + // sizes in case this message has packed fields. Rather than emit checks + // for each packed field, just call getSerializedSize() up front. In most + // cases, getSerializedSize() will have already been called anyway by one + // of the wrapper writeTo() methods, making this call cheap. + printer->Print("getSerializedSize();\n"); } - } - // Merge the fields and the extension ranges, both sorted by field number. - for (int i = 0, j = 0; - i < descriptor_->field_count() || j < sorted_extensions.size(); - ) { - if (i == descriptor_->field_count()) { - GenerateSerializeOneExtensionRange(printer, sorted_extensions[j++]); - } else if (j == sorted_extensions.size()) { - GenerateSerializeOneField(printer, sorted_fields[i++]); - } else if (sorted_fields[i]->number() < sorted_extensions[j]->start) { - GenerateSerializeOneField(printer, sorted_fields[i++]); - } else { - GenerateSerializeOneExtensionRange(printer, sorted_extensions[j++]); + if (descriptor_->extension_range_count() > 0) { + if (descriptor_->options().message_set_wire_format()) { + printer->Print( + "com.google.protobuf.GeneratedMessage$ver$\n" + " .ExtendableMessage<$classname$>.ExtensionWriter\n" + " extensionWriter = newMessageSetExtensionWriter();\n", + "classname", name_resolver_->GetImmutableClassName(descriptor_), + "ver", GeneratedCodeVersionSuffix()); + } else { + printer->Print( + "com.google.protobuf.GeneratedMessage$ver$\n" + " .ExtendableMessage<$classname$>.ExtensionWriter\n" + " extensionWriter = newExtensionWriter();\n", + "classname", name_resolver_->GetImmutableClassName(descriptor_), + "ver", GeneratedCodeVersionSuffix()); + } } - } - if (descriptor_->options().message_set_wire_format()) { - printer->Print( - "unknownFields.writeAsMessageSetTo(output);\n"); - } else { - printer->Print( - "unknownFields.writeTo(output);\n"); + // Merge the fields and the extension ranges, both sorted by field number. + for (int i = 0, j = 0; + i < descriptor_->field_count() || j < sorted_extensions.size();) { + if (i == descriptor_->field_count()) { + GenerateSerializeOneExtensionRange(printer, sorted_extensions[j++]); + } else if (j == sorted_extensions.size()) { + GenerateSerializeOneField(printer, sorted_fields[i++]); + } else if (sorted_fields[i]->number() < sorted_extensions[j]->start) { + GenerateSerializeOneField(printer, sorted_fields[i++]); + } else { + GenerateSerializeOneExtensionRange(printer, sorted_extensions[j++]); + } + } + + if (descriptor_->options().message_set_wire_format()) { + printer->Print("unknownFields.writeAsMessageSetTo(output);\n"); + } else { + printer->Print("unknownFields.writeTo(output);\n"); + } } printer->Outdent(); printer->Print( - "}\n" - "\n" - "public int getSerializedSize() {\n" - " int size = memoizedSize;\n" - " if (size != -1) return size;\n" - "\n" - " size = 0;\n"); + "}\n" + "\n" + "public int getSerializedSize() {\n" + " int size = memoizedSize;\n" + " if (size != -1) return size;\n" + "\n"); printer->Indent(); + if (EnableExperimentalRuntime(context_) && !IsDescriptorProto(descriptor_)) { + printer->Print( + "memoizedSize = getSerializedSizeInternal();\n" + "return memoizedSize;\n"); + } else { - for (int i = 0; i < descriptor_->field_count(); i++) { - field_generators_.get(sorted_fields[i]).GenerateSerializedSizeCode(printer); - } + printer->Print("size = 0;\n"); + + for (int i = 0; i < descriptor_->field_count(); i++) { + field_generators_.get(sorted_fields[i]) + .GenerateSerializedSizeCode(printer); + } + + if (descriptor_->extension_range_count() > 0) { + if (descriptor_->options().message_set_wire_format()) { + printer->Print("size += extensionsSerializedSizeAsMessageSet();\n"); + } else { + printer->Print("size += extensionsSerializedSize();\n"); + } + } - if (descriptor_->extension_range_count() > 0) { if (descriptor_->options().message_set_wire_format()) { printer->Print( - "size += extensionsSerializedSizeAsMessageSet();\n"); + "size += unknownFields.getSerializedSizeAsMessageSet();\n"); } else { - printer->Print( - "size += extensionsSerializedSize();\n"); + printer->Print("size += unknownFields.getSerializedSize();\n"); } - } - if (descriptor_->options().message_set_wire_format()) { - printer->Print( - "size += unknownFields.getSerializedSizeAsMessageSet();\n"); - } else { printer->Print( - "size += unknownFields.getSerializedSize();\n"); + "memoizedSize = size;\n" + "return size;\n"); } printer->Outdent(); printer->Print( - " memoizedSize = size;\n" - " return size;\n" "}\n" "\n"); } @@ -1199,7 +1221,10 @@ GenerateParsingConstructor(io::Printer* printer) { // Initialize all fields to default. printer->Print( - "this();\n"); + "this();\n" + "if (extensionRegistry == null) {\n" + " throw new java.lang.NullPointerException();\n" + "}\n"); // Use builder bits to track mutable repeated fields. int totalBuilderBits = 0; @@ -1335,10 +1360,18 @@ void ImmutableMessageGenerator::GenerateParser(io::Printer* printer) { " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" " throws com.google.protobuf.InvalidProtocolBufferException {\n", "classname", descriptor_->name()); - if (context_->HasGeneratedMethods(descriptor_)) { + if (EnableExperimentalRuntime(context_) && !IsDescriptorProto(descriptor_)) { + printer->Indent(); printer->Print( - " return new $classname$(input, extensionRegistry);\n", + "$classname$ msg = new $classname$();\n" + "msg.mergeFromInternal(input, extensionRegistry);\n" + "msg.makeImmutableInternal();\n" + "return msg;\n", "classname", descriptor_->name()); + printer->Outdent(); + } else if (context_->HasGeneratedMethods(descriptor_)) { + printer->Print(" return new $classname$(input, extensionRegistry);\n", + "classname", descriptor_->name()); } else { // When parsing constructor isn't generated, use builder to parse // messages. Note, will fallback to use reflection based mergeFieldFrom() diff --git a/src/google/protobuf/compiler/java/java_message_lite.cc b/src/google/protobuf/compiler/java/java_message_lite.cc index 26f16439..29b4f98b 100644 --- a/src/google/protobuf/compiler/java/java_message_lite.cc +++ b/src/google/protobuf/compiler/java/java_message_lite.cc @@ -332,17 +332,19 @@ void ImmutableMessageLiteGenerator::Generate(io::Printer* printer) { printer->Print("\n"); } - GenerateMessageSerializationMethods(printer); + if (!EnableExperimentalRuntime(context_)) { + GenerateMessageSerializationMethods(printer); + } GenerateParseFromMethods(printer); GenerateBuilder(printer); if (HasRequiredFields(descriptor_)) { // Memoizes whether the protocol buffer is fully initialized (has all - // required fields). -1 means not yet computed. 0 means false and 1 means - // true. + // required fields). 0 means false, 1 means true, and all other values + // mean not yet computed. printer->Print( - "private byte memoizedIsInitialized = -1;\n"); + "private byte memoizedIsInitialized = 2;\n"); } printer->Print( @@ -415,13 +417,33 @@ void ImmutableMessageLiteGenerator::Generate(io::Printer* printer) { " }\n" " }\n" " }\n" - " return PARSER;\n" - "}\n", + " return PARSER;\n", "classname", name_resolver_->GetImmutableClassName(descriptor_)); printer->Outdent(); - printer->Outdent(); + if (HasRequiredFields(descriptor_)) { + printer->Print( + "}\n" + "case GET_MEMOIZED_IS_INITIALIZED: {\n" + " return memoizedIsInitialized;\n" + "}\n" + "case SET_MEMOIZED_IS_INITIALIZED: {\n" + " memoizedIsInitialized = (byte) (arg0 == null ? 0 : 1);\n" + " return null;\n" + "}\n"); + } else { + printer->Print( + "}\n" + "case GET_MEMOIZED_IS_INITIALIZED: {\n" + " return (byte) 1;\n" + "}\n" + "case SET_MEMOIZED_IS_INITIALIZED: {\n" + " return null;\n" + "}\n"); + } + + printer->Outdent(); printer->Print( " }\n" " throw new UnsupportedOperationException();\n" @@ -455,6 +477,17 @@ void ImmutableMessageLiteGenerator::Generate(io::Printer* printer) { "\n", "classname", name_resolver_->GetImmutableClassName(descriptor_)); + // 'of' method for Wrappers + if (IsWrappersProtoFile(descriptor_->file())) { + printer->Print( + "public static $classname$ of($field_type$ value) {\n" + " return newBuilder().setValue(value).build();\n" + "}\n" + "\n", + "classname", name_resolver_->GetImmutableClassName(descriptor_), + "field_type", PrimitiveTypeName(GetJavaType(descriptor_->field(0)))); + } + GenerateParser(printer); // Extensions must be declared after the DEFAULT_INSTANCE is initialized @@ -490,36 +523,34 @@ GenerateMessageSerializationMethods(io::Printer* printer) { if (HasPackedFields(descriptor_)) { // writeTo(CodedOutputStream output) might be invoked without // getSerializedSize() ever being called, but we need the memoized - // sizes in case this message has packed fields. Rather than emit checks for - // each packed field, just call getSerializedSize() up front. - // In most cases, getSerializedSize() will have already been called anyway - // by one of the wrapper writeTo() methods, making this call cheap. - printer->Print( - "getSerializedSize();\n"); + // sizes in case this message has packed fields. Rather than emit checks + // for each packed field, just call getSerializedSize() up front. In most + // cases, getSerializedSize() will have already been called anyway by one + // of the wrapper writeTo() methods, making this call cheap. + printer->Print("getSerializedSize();\n"); } if (descriptor_->extension_range_count() > 0) { if (descriptor_->options().message_set_wire_format()) { printer->Print( - "com.google.protobuf.GeneratedMessageLite\n" - " .ExtendableMessage<$classname$, $classname$.Builder>\n" - " .ExtensionWriter extensionWriter =\n" - " newMessageSetExtensionWriter();\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); + "com.google.protobuf.GeneratedMessageLite\n" + " .ExtendableMessage<$classname$, $classname$.Builder>\n" + " .ExtensionWriter extensionWriter =\n" + " newMessageSetExtensionWriter();\n", + "classname", name_resolver_->GetImmutableClassName(descriptor_)); } else { printer->Print( - "com.google.protobuf.GeneratedMessageLite\n" - " .ExtendableMessage<$classname$, $classname$.Builder>\n" - " .ExtensionWriter extensionWriter =\n" - " newExtensionWriter();\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); + "com.google.protobuf.GeneratedMessageLite\n" + " .ExtendableMessage<$classname$, $classname$.Builder>\n" + " .ExtensionWriter extensionWriter =\n" + " newExtensionWriter();\n", + "classname", name_resolver_->GetImmutableClassName(descriptor_)); } } // Merge the fields and the extension ranges, both sorted by field number. for (int i = 0, j = 0; - i < descriptor_->field_count() || j < sorted_extensions.size(); - ) { + i < descriptor_->field_count() || j < sorted_extensions.size();) { if (i == descriptor_->field_count()) { GenerateSerializeOneExtensionRange(printer, sorted_extensions[j++]); } else if (j == sorted_extensions.size()) { @@ -532,23 +563,22 @@ GenerateMessageSerializationMethods(io::Printer* printer) { } if (descriptor_->options().message_set_wire_format()) { - printer->Print( - "unknownFields.writeAsMessageSetTo(output);\n"); + printer->Print("unknownFields.writeAsMessageSetTo(output);\n"); } else { - printer->Print( - "unknownFields.writeTo(output);\n"); + printer->Print("unknownFields.writeTo(output);\n"); } printer->Outdent(); printer->Print( - "}\n" - "\n" - "public int getSerializedSize() {\n" - " int size = memoizedSerializedSize;\n" - " if (size != -1) return size;\n" - "\n" - " size = 0;\n"); + "}\n" + "\n" + "public int getSerializedSize() {\n" + " int size = memoizedSerializedSize;\n" + " if (size != -1) return size;\n" + "\n"); printer->Indent(); + printer->Print( + "size = 0;\n"); for (int i = 0; i < descriptor_->field_count(); i++) { field_generators_.get(sorted_fields[i]).GenerateSerializedSizeCode(printer); @@ -556,26 +586,24 @@ GenerateMessageSerializationMethods(io::Printer* printer) { if (descriptor_->extension_range_count() > 0) { if (descriptor_->options().message_set_wire_format()) { - printer->Print( - "size += extensionsSerializedSizeAsMessageSet();\n"); + printer->Print("size += extensionsSerializedSizeAsMessageSet();\n"); } else { - printer->Print( - "size += extensionsSerializedSize();\n"); + printer->Print("size += extensionsSerializedSize();\n"); } } if (descriptor_->options().message_set_wire_format()) { - printer->Print( - "size += unknownFields.getSerializedSizeAsMessageSet();\n"); + printer->Print("size += unknownFields.getSerializedSizeAsMessageSet();\n"); } else { - printer->Print( - "size += unknownFields.getSerializedSize();\n"); + printer->Print("size += unknownFields.getSerializedSize();\n"); } + printer->Print( + "memoizedSerializedSize = size;\n" + "return size;\n"); + printer->Outdent(); printer->Print( - " memoizedSerializedSize = size;\n" - " return size;\n" "}\n" "\n"); } @@ -702,7 +730,10 @@ void ImmutableMessageLiteGenerator::GenerateDynamicMethodIsInitialized( return; } - // Don't directly compare to -1 to avoid an Android x86 JIT bug. + // TODO(xiaofeng): Remove this when b/64445758 is fixed. We don't need to + // check memoizedIsInitialized here because the caller does that already, + // but right now proguard proto shrinker asserts on the bytecode layout of + // this code so it can't be removed until proguard is updated. printer->Print( "byte isInitialized = memoizedIsInitialized;\n" "if (isInitialized == 1) return DEFAULT_INSTANCE;\n" @@ -720,9 +751,6 @@ void ImmutableMessageLiteGenerator::GenerateDynamicMethodIsInitialized( if (field->is_required()) { printer->Print( "if (!has$name$()) {\n" - " if (shouldMemoize) {\n" - " memoizedIsInitialized = 0;\n" - " }\n" " return null;\n" "}\n", "name", info->capitalized_name); @@ -739,9 +767,6 @@ void ImmutableMessageLiteGenerator::GenerateDynamicMethodIsInitialized( case FieldDescriptor::LABEL_REQUIRED: printer->Print( "if (!get$name$().isInitialized()) {\n" - " if (shouldMemoize) {\n" - " memoizedIsInitialized = 0;\n" - " }\n" " return null;\n" "}\n", "type", name_resolver_->GetImmutableClassName( @@ -765,9 +790,6 @@ void ImmutableMessageLiteGenerator::GenerateDynamicMethodIsInitialized( } printer->Print( " if (!get$name$().isInitialized()) {\n" - " if (shouldMemoize) {\n" - " memoizedIsInitialized = 0;\n" - " }\n" " return null;\n" " }\n" "}\n", @@ -778,9 +800,6 @@ void ImmutableMessageLiteGenerator::GenerateDynamicMethodIsInitialized( printer->Print( "for ($type$ item : get$name$Map().values()) {\n" " if (!item.isInitialized()) {\n" - " if (shouldMemoize) {\n" - " memoizedIsInitialized = 0;\n" - " }\n" " return null;\n" " }\n" "}\n", @@ -791,9 +810,6 @@ void ImmutableMessageLiteGenerator::GenerateDynamicMethodIsInitialized( printer->Print( "for (int i = 0; i < get$name$Count(); i++) {\n" " if (!get$name$(i).isInitialized()) {\n" - " if (shouldMemoize) {\n" - " memoizedIsInitialized = 0;\n" - " }\n" " return null;\n" " }\n" "}\n", @@ -809,16 +825,10 @@ void ImmutableMessageLiteGenerator::GenerateDynamicMethodIsInitialized( if (descriptor_->extension_range_count() > 0) { printer->Print( "if (!extensionsAreInitialized()) {\n" - " if (shouldMemoize) {\n" - " memoizedIsInitialized = 0;\n" - " }\n" " return null;\n" "}\n"); } - printer->Print( - "if (shouldMemoize) memoizedIsInitialized = 1;\n"); - printer->Print( "return DEFAULT_INSTANCE;\n" "\n"); @@ -946,99 +956,107 @@ void ImmutableMessageLiteGenerator::GenerateDynamicMethodMergeFromStream( "com.google.protobuf.CodedInputStream input =\n" " (com.google.protobuf.CodedInputStream) arg0;\n" "com.google.protobuf.ExtensionRegistryLite extensionRegistry =\n" - " (com.google.protobuf.ExtensionRegistryLite) arg1;\n"); + " (com.google.protobuf.ExtensionRegistryLite) arg1;\n" + "if (extensionRegistry == null) {\n" + " throw new java.lang.NullPointerException();\n" + "}\n"); printer->Print( "try {\n"); printer->Indent(); - printer->Print( - "boolean done = false;\n" - "while (!done) {\n"); - printer->Indent(); - - printer->Print( - "int tag = input.readTag();\n" - "switch (tag) {\n"); - printer->Indent(); + if (EnableExperimentalRuntime(context_)) { + printer->Print( + "mergeFromInternal(input, extensionRegistry);\n" + "return DEFAULT_INSTANCE;\n"); + } else { + printer->Print( + "boolean done = false;\n" + "while (!done) {\n"); + printer->Indent(); - printer->Print( - "case 0:\n" // zero signals EOF / limit reached - " done = true;\n" - " break;\n"); + printer->Print( + "int tag = input.readTag();\n" + "switch (tag) {\n"); + printer->Indent(); - if (descriptor_->extension_range_count() > 0) { - if (descriptor_->options().message_set_wire_format()) { - printer->Print( - "default: {\n" - " if (!parseUnknownFieldAsMessageSet(\n" - " getDefaultInstanceForType(), input, extensionRegistry,\n" - " tag)) {\n" - " done = true;\n" // it's an endgroup tag - " }\n" - " break;\n" - "}\n"); + printer->Print( + "case 0:\n" // zero signals EOF / limit reached + " done = true;\n" + " break;\n"); + + if (descriptor_->extension_range_count() > 0) { + if (descriptor_->options().message_set_wire_format()) { + printer->Print( + "default: {\n" + " if (!parseUnknownFieldAsMessageSet(\n" + " getDefaultInstanceForType(), input, extensionRegistry,\n" + " tag)) {\n" + " done = true;\n" // it's an endgroup tag + " }\n" + " break;\n" + "}\n"); + } else { + printer->Print( + "default: {\n" + " if (!parseUnknownField(getDefaultInstanceForType(),\n" + " input, extensionRegistry, tag)) {\n" + " done = true;\n" // it's an endgroup tag + " }\n" + " break;\n" + "}\n"); + } } else { printer->Print( "default: {\n" - " if (!parseUnknownField(getDefaultInstanceForType(),\n" - " input, extensionRegistry, tag)) {\n" + " if (!parseUnknownField(tag, input)) {\n" " done = true;\n" // it's an endgroup tag " }\n" " break;\n" "}\n"); } - } else { - printer->Print( - "default: {\n" - " if (!parseUnknownField(tag, input)) {\n" - " done = true;\n" // it's an endgroup tag - " }\n" - " break;\n" - "}\n"); - } - google::protobuf::scoped_array sorted_fields( - SortFieldsByNumber(descriptor_)); - for (int i = 0; i < descriptor_->field_count(); i++) { - const FieldDescriptor* field = sorted_fields[i]; - uint32 tag = WireFormatLite::MakeTag(field->number(), - WireFormat::WireTypeForFieldType(field->type())); - - printer->Print( - "case $tag$: {\n", - "tag", SimpleItoa(static_cast(tag))); - printer->Indent(); - - field_generators_.get(field).GenerateParsingCode(printer); - - printer->Outdent(); - printer->Print( - " break;\n" - "}\n"); + google::protobuf::scoped_array sorted_fields( + SortFieldsByNumber(descriptor_)); + for (int i = 0; i < descriptor_->field_count(); i++) { + const FieldDescriptor* field = sorted_fields[i]; + uint32 tag = WireFormatLite::MakeTag( + field->number(), WireFormat::WireTypeForFieldType(field->type())); - if (field->is_packable()) { - // To make packed = true wire compatible, we generate parsing code from a - // packed version of this field regardless of field->options().packed(). - uint32 packed_tag = WireFormatLite::MakeTag(field->number(), - WireFormatLite::WIRETYPE_LENGTH_DELIMITED); - printer->Print( - "case $tag$: {\n", - "tag", SimpleItoa(static_cast(packed_tag))); + printer->Print("case $tag$: {\n", "tag", + SimpleItoa(static_cast(tag))); printer->Indent(); - field_generators_.get(field).GenerateParsingCodeFromPacked(printer); + field_generators_.get(field).GenerateParsingCode(printer); printer->Outdent(); printer->Print( " break;\n" "}\n"); + + if (field->is_packable()) { + // To make packed = true wire compatible, we generate parsing code from + // a packed version of this field regardless of + // field->options().packed(). + uint32 packed_tag = WireFormatLite::MakeTag( + field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED); + printer->Print("case $tag$: {\n", "tag", + SimpleItoa(static_cast(packed_tag))); + printer->Indent(); + + field_generators_.get(field).GenerateParsingCodeFromPacked(printer); + + printer->Outdent(); + printer->Print( + " break;\n" + "}\n"); + } } - } - printer->Outdent(); - printer->Outdent(); - printer->Print( - " }\n" // switch (tag) - "}\n"); // while (!done) + printer->Outdent(); + printer->Outdent(); + printer->Print( + " }\n" // switch (tag) + "}\n"); // while (!done) + } printer->Outdent(); printer->Print( diff --git a/src/google/protobuf/compiler/java/java_shared_code_generator.cc b/src/google/protobuf/compiler/java/java_shared_code_generator.cc index f73bfb04..9a42aba9 100644 --- a/src/google/protobuf/compiler/java/java_shared_code_generator.cc +++ b/src/google/protobuf/compiler/java/java_shared_code_generator.cc @@ -140,13 +140,16 @@ void SharedCodeGenerator::GenerateDescriptors(io::Printer* printer) { "java.lang.String[] descriptorData = {\n"); printer->Indent(); - // Only write 40 bytes per line. + // Limit the number of bytes per line. static const int kBytesPerLine = 40; + // Limit the number of lines per string part. + static const int kLinesPerPart = 400; + // Every block of bytes, start a new string literal, in order to avoid the + // 64k length limit. Note that this value needs to be <64k. + static const int kBytesPerPart = kBytesPerLine * kLinesPerPart; for (int i = 0; i < file_data.size(); i += kBytesPerLine) { if (i > 0) { - // Every 400 lines, start a new string literal, in order to avoid the - // 64k length limit. - if (i % 400 == 0) { + if (i % kBytesPerPart == 0) { printer->Print(",\n"); } else { printer->Print(" +\n"); diff --git a/src/google/protobuf/compiler/js/js_generator.cc b/src/google/protobuf/compiler/js/js_generator.cc index 73d32762..812ca9d8 100755 --- a/src/google/protobuf/compiler/js/js_generator.cc +++ b/src/google/protobuf/compiler/js/js_generator.cc @@ -1082,6 +1082,40 @@ string JSReturnClause(const FieldDescriptor* desc) { return ""; } +string JSTypeTag(const FieldDescriptor* desc) { + switch (desc->type()) { + case FieldDescriptor::TYPE_DOUBLE: + case FieldDescriptor::TYPE_FLOAT: + return "Float"; + case FieldDescriptor::TYPE_INT32: + case FieldDescriptor::TYPE_UINT32: + case FieldDescriptor::TYPE_INT64: + case FieldDescriptor::TYPE_UINT64: + case FieldDescriptor::TYPE_FIXED32: + case FieldDescriptor::TYPE_FIXED64: + case FieldDescriptor::TYPE_SINT32: + case FieldDescriptor::TYPE_SINT64: + case FieldDescriptor::TYPE_SFIXED32: + case FieldDescriptor::TYPE_SFIXED64: + if (IsIntegralFieldWithStringJSType(desc)) { + return "StringInt"; + } else { + return "Int"; + } + case FieldDescriptor::TYPE_BOOL: + return "Boolean"; + case FieldDescriptor::TYPE_STRING: + return "String"; + case FieldDescriptor::TYPE_BYTES: + return "Bytes"; + case FieldDescriptor::TYPE_ENUM: + return "Enum"; + default: + assert(false); + } + return ""; +} + string JSReturnDoc(const GeneratorOptions& options, const FieldDescriptor* desc) { return ""; @@ -2569,26 +2603,44 @@ void Generator::GenerateClassField(const GeneratorOptions& options, /* singular_if_not_packed = */ false), "returndoc", JSReturnDoc(options, field)); } - printer->Print( - "$class$.prototype.set$name$ = function(value) {\n" - " jspb.Message.set$oneoftag$Field(this, $index$", - "class", GetMessagePath(options, field->containing_type()), - "name", JSGetterName(options, field), - "oneoftag", (field->containing_oneof() ? "Oneof" : ""), - "index", JSFieldIndex(field)); - printer->Print( - "$oneofgroup$, $type$value$rptvalueinit$$typeclose$);$returnvalue$\n" - "};\n" - "\n" - "\n", - "type", - untyped ? "/** @type{string|number|boolean|Array|undefined} */(" : "", - "typeclose", untyped ? ")" : "", - "oneofgroup", - (field->containing_oneof() ? (", " + JSOneofArray(options, field)) - : ""), - "returnvalue", JSReturnClause(field), "rptvalueinit", - (field->is_repeated() ? " || []" : "")); + + if (field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 && + !field->is_repeated() && !field->is_map() && + !HasFieldPresence(options, field)) { + // Proto3 non-repeated and non-map fields without presence use the + // setProto3*Field function. + printer->Print( + "$class$.prototype.set$name$ = function(value) {\n" + " jspb.Message.setProto3$typetag$Field(this, $index$, " + "value);$returnvalue$\n" + "};\n" + "\n" + "\n", + "class", GetMessagePath(options, field->containing_type()), "name", + JSGetterName(options, field), "typetag", JSTypeTag(field), "index", + JSFieldIndex(field), "returnvalue", JSReturnClause(field)); + } else { + // Otherwise, use the regular setField function. + printer->Print( + "$class$.prototype.set$name$ = function(value) {\n" + " jspb.Message.set$oneoftag$Field(this, $index$", + "class", GetMessagePath(options, field->containing_type()), "name", + JSGetterName(options, field), "oneoftag", + (field->containing_oneof() ? "Oneof" : ""), "index", + JSFieldIndex(field)); + printer->Print( + "$oneofgroup$, $type$value$rptvalueinit$$typeclose$);$returnvalue$\n" + "};\n" + "\n" + "\n", + "type", + untyped ? "/** @type{string|number|boolean|Array|undefined} */(" : "", + "typeclose", untyped ? ")" : "", "oneofgroup", + (field->containing_oneof() ? (", " + JSOneofArray(options, field)) + : ""), + "returnvalue", JSReturnClause(field), "rptvalueinit", + (field->is_repeated() ? " || []" : "")); + } if (untyped) { printer->Print( diff --git a/src/google/protobuf/compiler/mock_code_generator.cc b/src/google/protobuf/compiler/mock_code_generator.cc index cc660f4a..bfcb83df 100644 --- a/src/google/protobuf/compiler/mock_code_generator.cc +++ b/src/google/protobuf/compiler/mock_code_generator.cc @@ -57,12 +57,12 @@ #include #include -#ifdef major -#undef major -#endif -#ifdef minor -#undef minor -#endif +#ifdef major +#undef major +#endif +#ifdef minor +#undef minor +#endif namespace google { namespace protobuf { diff --git a/src/google/protobuf/compiler/parser.cc b/src/google/protobuf/compiler/parser.cc index bb4a44c3..03d05ad4 100644 --- a/src/google/protobuf/compiler/parser.cc +++ b/src/google/protobuf/compiler/parser.cc @@ -1540,7 +1540,6 @@ bool Parser::ParseReserved(DescriptorProto* message, } } - bool Parser::ParseReservedNames(DescriptorProto* message, const LocationRecorder& parent_location) { do { @@ -1601,6 +1600,81 @@ bool Parser::ParseReservedNumbers(DescriptorProto* message, return true; } +bool Parser::ParseReserved(EnumDescriptorProto* message, + const LocationRecorder& message_location) { + // Parse the declaration. + DO(Consume("reserved")); + if (LookingAtType(io::Tokenizer::TYPE_STRING)) { + LocationRecorder location(message_location, + DescriptorProto::kReservedNameFieldNumber); + return ParseReservedNames(message, location); + } else { + LocationRecorder location(message_location, + DescriptorProto::kReservedRangeFieldNumber); + return ParseReservedNumbers(message, location); + } +} + +bool Parser::ParseReservedNames(EnumDescriptorProto* message, + const LocationRecorder& parent_location) { + do { + LocationRecorder location(parent_location, message->reserved_name_size()); + DO(ConsumeString(message->add_reserved_name(), "Expected enum value.")); + } while (TryConsume(",")); + DO(ConsumeEndOfDeclaration(";", &parent_location)); + return true; +} + +bool Parser::ParseReservedNumbers(EnumDescriptorProto* message, + const LocationRecorder& parent_location) { + bool first = true; + do { + LocationRecorder location(parent_location, message->reserved_range_size()); + + EnumDescriptorProto::EnumReservedRange* range = + message->add_reserved_range(); + int start, end; + io::Tokenizer::Token start_token; + { + LocationRecorder start_location( + location, EnumDescriptorProto::EnumReservedRange::kStartFieldNumber); + start_token = input_->current(); + DO(ConsumeSignedInteger(&start, (first ? + "Expected enum value or number range." : + "Expected enum number range."))); + } + + if (TryConsume("to")) { + LocationRecorder end_location( + location, EnumDescriptorProto::EnumReservedRange::kEndFieldNumber); + if (TryConsume("max")) { + // This is in the enum descriptor path, which doesn't have the message + // set duality to fix up, so it doesn't integrate with the sentinel. + + // Evaluate 'max' to INT_MAX - 1 so that incrementing to create the + // exclusive range end doesn't cause an overflow. + // Note, this prevents reserving the actual INT_MAX enum value. + end = INT_MAX; + } else { + DO(ConsumeSignedInteger(&end, "Expected integer.")); + } + } else { + LocationRecorder end_location( + location, EnumDescriptorProto::EnumReservedRange::kEndFieldNumber); + end_location.StartAt(start_token); + end_location.EndAt(start_token); + end = start; + } + + range->set_start(start); + range->set_end(end); + first = false; + } while (TryConsume(",")); + + DO(ConsumeEndOfDeclaration(";", &parent_location)); + return true; +} + bool Parser::ParseExtend(RepeatedPtrField* extensions, RepeatedPtrField* messages, const LocationRecorder& parent_location, @@ -1781,6 +1855,8 @@ bool Parser::ParseEnumStatement(EnumDescriptorProto* enum_type, EnumDescriptorProto::kOptionsFieldNumber); return ParseOption(enum_type->mutable_options(), location, containing_file, OPTION_STATEMENT); + } else if (LookingAt("reserved")) { + return ParseReserved(enum_type, enum_location); } else { LocationRecorder location(enum_location, EnumDescriptorProto::kValueFieldNumber, enum_type->value_size()); @@ -2167,4 +2243,5 @@ void SourceLocationTable::Clear() { } // namespace compiler } // namespace protobuf + } // namespace google diff --git a/src/google/protobuf/compiler/parser.h b/src/google/protobuf/compiler/parser.h index dd8b6586..33b4c700 100644 --- a/src/google/protobuf/compiler/parser.h +++ b/src/google/protobuf/compiler/parser.h @@ -371,6 +371,12 @@ class LIBPROTOBUF_EXPORT Parser { const LocationRecorder& parent_location); bool ParseReservedNumbers(DescriptorProto* message, const LocationRecorder& parent_location); + bool ParseReserved(EnumDescriptorProto* message, + const LocationRecorder& message_location); + bool ParseReservedNames(EnumDescriptorProto* message, + const LocationRecorder& parent_location); + bool ParseReservedNumbers(EnumDescriptorProto* message, + const LocationRecorder& parent_location); // Parse an "extend" declaration. (See also comments for // ParseMessageField().) diff --git a/src/google/protobuf/compiler/parser_unittest.cc b/src/google/protobuf/compiler/parser_unittest.cc index 97831f71..9b59842e 100644 --- a/src/google/protobuf/compiler/parser_unittest.cc +++ b/src/google/protobuf/compiler/parser_unittest.cc @@ -994,6 +994,42 @@ TEST_F(ParseEnumTest, ValueOptions) { "}"); } +TEST_F(ParseEnumTest, ReservedRange) { + ExpectParsesTo( + "enum TestEnum {\n" + " FOO = 0;\n" + " reserved -2147483648, -6 to -4, -1 to 1, 2, 15, 9 to 11, 3, 20 to max;\n" + "}\n", + + "enum_type {" + " name: \"TestEnum\"" + " value { name:\"FOO\" number:0 }" + " reserved_range { start:-2147483648 end:-2147483648 }" + " reserved_range { start:-6 end:-4 }" + " reserved_range { start:-1 end:1 }" + " reserved_range { start:2 end:2 }" + " reserved_range { start:15 end:15 }" + " reserved_range { start:9 end:11 }" + " reserved_range { start:3 end:3 }" + " reserved_range { start:20 end:2147483647 }" + "}"); +} + +TEST_F(ParseEnumTest, ReservedNames) { + ExpectParsesTo( + "enum TestEnum {\n" + " FOO = 0;\n" + " reserved \"foo\", \"bar\";\n" + "}\n", + + "enum_type {" + " name: \"TestEnum\"" + " value { name:\"FOO\" number:0 }" + " reserved_name: \"foo\"" + " reserved_name: \"bar\"" + "}"); +} + // =================================================================== typedef ParserTest ParseServiceTest; @@ -1488,6 +1524,51 @@ TEST_F(ParseErrorTest, EnumValueMissingNumber) { "1:5: Missing numeric value for enum constant.\n"); } +TEST_F(ParseErrorTest, EnumReservedStandaloneMaxNotAllowed) { + ExpectHasErrors( + "enum TestEnum {\n" + " FOO = 1;\n" + " reserved max;\n" + "}\n", + "2:11: Expected enum value or number range.\n"); +} + +TEST_F(ParseErrorTest, EnumReservedMixNameAndNumber) { + ExpectHasErrors( + "enum TestEnum {\n" + " FOO = 1;\n" + " reserved 10, \"foo\";\n" + "}\n", + "2:15: Expected enum number range.\n"); +} + +TEST_F(ParseErrorTest, EnumReservedPositiveNumberOutOfRange) { + ExpectHasErrors( + "enum TestEnum {\n" + "FOO = 1;\n" + " reserved 2147483648;\n" + "}\n", + "2:11: Integer out of range.\n"); +} + +TEST_F(ParseErrorTest, EnumReservedNegativeNumberOutOfRange) { + ExpectHasErrors( + "enum TestEnum {\n" + "FOO = 1;\n" + " reserved -2147483649;\n" + "}\n", + "2:12: Integer out of range.\n"); +} + +TEST_F(ParseErrorTest, EnumReservedMissingQuotes) { + ExpectHasErrors( + "enum TestEnum {\n" + " FOO = 1;\n" + " reserved foo;\n" + "}\n", + "2:11: Expected enum value or number range.\n"); +} + // ------------------------------------------------------------------- // Reserved field number errors @@ -1515,6 +1596,23 @@ TEST_F(ParseErrorTest, ReservedMissingQuotes) { "1:11: Expected field name or number range.\n"); } +TEST_F(ParseErrorTest, ReservedNegativeNumber) { + ExpectHasErrors( + "message Foo {\n" + " reserved -10;\n" + "}\n", + "1:11: Expected field name or number range.\n"); +} + +TEST_F(ParseErrorTest, ReservedNumberOutOfRange) { + ExpectHasErrors( + "message Foo {\n" + " reserved 2147483648;\n" + "}\n", + "1:11: Integer out of range.\n"); +} + + // ------------------------------------------------------------------- // Service errors diff --git a/src/google/protobuf/compiler/plugin.cc b/src/google/protobuf/compiler/plugin.cc index cb5e37bb..7f975510 100644 --- a/src/google/protobuf/compiler/plugin.cc +++ b/src/google/protobuf/compiler/plugin.cc @@ -41,13 +41,18 @@ #include #endif -#include #include #include #include #include #include #include +#include + + +namespace google { +namespace protobuf { +namespace compiler { #if defined(_MSC_VER) // DO NOT include , instead create functions in io_win32.{h,cc} and import @@ -55,10 +60,6 @@ using google::protobuf::internal::win32::setmode; #endif -namespace google { -namespace protobuf { -namespace compiler { - class GeneratorResponseContext : public GeneratorContext { public: GeneratorResponseContext( diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 07883a37..557e2d7a 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/compiler/plugin.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,121 +15,168 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { namespace compiler { class VersionDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Version_default_instance_; class CodeGeneratorRequestDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _CodeGeneratorRequest_default_instance_; class CodeGeneratorResponse_FileDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _CodeGeneratorResponse_File_default_instance_; class CodeGeneratorResponseDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _CodeGeneratorResponse_default_instance_; - +} // namespace compiler +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto { +void InitDefaultsVersionImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::compiler::_Version_default_instance_; + new (ptr) ::google::protobuf::compiler::Version(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::compiler::Version::InitAsDefaultInstance(); +} -namespace { +void InitDefaultsVersion() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsVersionImpl); +} -::google::protobuf::Metadata file_level_metadata[4]; +void InitDefaultsCodeGeneratorRequestImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; -} // namespace + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProto(); + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsVersion(); + { + void* ptr = &::google::protobuf::compiler::_CodeGeneratorRequest_default_instance_; + new (ptr) ::google::protobuf::compiler::CodeGeneratorRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::compiler::CodeGeneratorRequest::InitAsDefaultInstance(); +} -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField - const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, -}; +void InitDefaultsCodeGeneratorRequest() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsCodeGeneratorRequestImpl); +} -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField - const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - ::google::protobuf::internal::AuxillaryParseTableField(), -}; -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const - TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, -}; +void InitDefaultsCodeGeneratorResponse_FileImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::compiler::_CodeGeneratorResponse_File_default_instance_; + new (ptr) ::google::protobuf::compiler::CodeGeneratorResponse_File(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::compiler::CodeGeneratorResponse_File::InitAsDefaultInstance(); +} -const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, _internal_metadata_), +void InitDefaultsCodeGeneratorResponse_File() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsCodeGeneratorResponse_FileImpl); +} + +void InitDefaultsCodeGeneratorResponseImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsCodeGeneratorResponse_File(); + { + void* ptr = &::google::protobuf::compiler::_CodeGeneratorResponse_default_instance_; + new (ptr) ::google::protobuf::compiler::CodeGeneratorResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::compiler::CodeGeneratorResponse::InitAsDefaultInstance(); +} + +void InitDefaultsCodeGeneratorResponse() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsCodeGeneratorResponseImpl); +} + +::google::protobuf::Metadata file_level_metadata[4]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::Version, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::Version, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, major_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, minor_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, patch_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Version, suffix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::Version, major_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::Version, minor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::Version, patch_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::Version, suffix_), 1, 2, 3, 0, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorRequest, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorRequest, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, file_to_generate_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, parameter_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, proto_file_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, compiler_version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorRequest, file_to_generate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorRequest, parameter_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorRequest, proto_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorRequest, compiler_version_), ~0u, 0, ~0u, 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorResponse_File, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorResponse_File, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, insertion_point_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, content_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorResponse_File, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorResponse_File, insertion_point_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorResponse_File, content_), 0, 1, 2, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorResponse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorResponse, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, error_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorResponse, error_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::compiler::CodeGeneratorResponse, file_), 0, ~0u, }; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { 0, 9, sizeof(Version)}, - { 13, 22, sizeof(CodeGeneratorRequest)}, - { 26, 34, sizeof(CodeGeneratorResponse_File)}, - { 37, 44, sizeof(CodeGeneratorResponse)}, +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 9, sizeof(::google::protobuf::compiler::Version)}, + { 13, 22, sizeof(::google::protobuf::compiler::CodeGeneratorRequest)}, + { 26, 34, sizeof(::google::protobuf::compiler::CodeGeneratorResponse_File)}, + { 37, 44, sizeof(::google::protobuf::compiler::CodeGeneratorResponse)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { - reinterpret_cast(&_Version_default_instance_), - reinterpret_cast(&_CodeGeneratorRequest_default_instance_), - reinterpret_cast(&_CodeGeneratorResponse_File_default_instance_), - reinterpret_cast(&_CodeGeneratorResponse_default_instance_), + reinterpret_cast(&::google::protobuf::compiler::_Version_default_instance_), + reinterpret_cast(&::google::protobuf::compiler::_CodeGeneratorRequest_default_instance_), + reinterpret_cast(&::google::protobuf::compiler::_CodeGeneratorResponse_File_default_instance_), + reinterpret_cast(&::google::protobuf::compiler::_CodeGeneratorResponse_default_instance_), }; -namespace { - void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; @@ -144,38 +190,15 @@ void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); } -} // namespace -void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::internal::InitProtobufDefaults(); - ::google::protobuf::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); - _Version_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Version_default_instance_);_CodeGeneratorRequest_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_CodeGeneratorRequest_default_instance_);_CodeGeneratorResponse_File_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_CodeGeneratorResponse_File_default_instance_);_CodeGeneratorResponse_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_CodeGeneratorResponse_default_instance_);_CodeGeneratorRequest_default_instance_._instance.get_mutable()->compiler_version_ = const_cast< ::google::protobuf::compiler::Version*>( - ::google::protobuf::compiler::Version::internal_default_instance()); -} - -void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); -} -namespace { void AddDescriptorsImpl() { InitDefaults(); - static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n%google/protobuf/compiler/plugin.proto\022" "\030google.protobuf.compiler\032 google/protob" "uf/descriptor.proto\"F\n\007Version\022\r\n\005major\030" @@ -197,9 +220,8 @@ void AddDescriptorsImpl() { descriptor, 638); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/compiler/plugin.proto", &protobuf_RegisterTypes); - ::google::protobuf::protobuf_google_2fprotobuf_2fdescriptor_2eproto::AddDescriptors(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::AddDescriptors(); } -} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); @@ -211,12 +233,15 @@ struct StaticDescriptorInitializer { AddDescriptors(); } } static_descriptor_initializer; - } // namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto - +namespace google { +namespace protobuf { +namespace compiler { // =================================================================== +void Version::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Version::kMajorFieldNumber; const int Version::kMinorFieldNumber; @@ -227,7 +252,7 @@ const int Version::kSuffixFieldNumber; Version::Version() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsVersion(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.Version) @@ -271,12 +296,12 @@ void Version::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Version::descriptor() { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Version& Version::default_instance() { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsVersion(); return *internal_default_instance(); } @@ -599,151 +624,16 @@ void Version::InternalSwap(Version* other) { ::google::protobuf::Metadata Version::GetMetadata() const { protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Version - -// optional int32 major = 1; -bool Version::has_major() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void Version::set_has_major() { - _has_bits_[0] |= 0x00000002u; -} -void Version::clear_has_major() { - _has_bits_[0] &= ~0x00000002u; -} -void Version::clear_major() { - major_ = 0; - clear_has_major(); -} -::google::protobuf::int32 Version::major() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.major) - return major_; -} -void Version::set_major(::google::protobuf::int32 value) { - set_has_major(); - major_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.major) -} - -// optional int32 minor = 2; -bool Version::has_minor() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void Version::set_has_minor() { - _has_bits_[0] |= 0x00000004u; -} -void Version::clear_has_minor() { - _has_bits_[0] &= ~0x00000004u; -} -void Version::clear_minor() { - minor_ = 0; - clear_has_minor(); -} -::google::protobuf::int32 Version::minor() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.minor) - return minor_; -} -void Version::set_minor(::google::protobuf::int32 value) { - set_has_minor(); - minor_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.minor) + return ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages]; } -// optional int32 patch = 3; -bool Version::has_patch() const { - return (_has_bits_[0] & 0x00000008u) != 0; -} -void Version::set_has_patch() { - _has_bits_[0] |= 0x00000008u; -} -void Version::clear_has_patch() { - _has_bits_[0] &= ~0x00000008u; -} -void Version::clear_patch() { - patch_ = 0; - clear_has_patch(); -} -::google::protobuf::int32 Version::patch() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.patch) - return patch_; -} -void Version::set_patch(::google::protobuf::int32 value) { - set_has_patch(); - patch_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.patch) -} - -// optional string suffix = 4; -bool Version::has_suffix() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void Version::set_has_suffix() { - _has_bits_[0] |= 0x00000001u; -} -void Version::clear_has_suffix() { - _has_bits_[0] &= ~0x00000001u; -} -void Version::clear_suffix() { - suffix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_suffix(); -} -const ::std::string& Version::suffix() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.suffix) - return suffix_.GetNoArena(); -} -void Version::set_suffix(const ::std::string& value) { - set_has_suffix(); - suffix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.suffix) -} -#if LANG_CXX11 -void Version::set_suffix(::std::string&& value) { - set_has_suffix(); - suffix_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.Version.suffix) -} -#endif -void Version::set_suffix(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_suffix(); - suffix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.Version.suffix) -} -void Version::set_suffix(const char* value, size_t size) { - set_has_suffix(); - suffix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.Version.suffix) -} -::std::string* Version::mutable_suffix() { - set_has_suffix(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.Version.suffix) - return suffix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* Version::release_suffix() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.Version.suffix) - clear_has_suffix(); - return suffix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void Version::set_allocated_suffix(::std::string* suffix) { - if (suffix != NULL) { - set_has_suffix(); - } else { - clear_has_suffix(); - } - suffix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), suffix); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.Version.suffix) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void CodeGeneratorRequest::InitAsDefaultInstance() { + ::google::protobuf::compiler::_CodeGeneratorRequest_default_instance_._instance.get_mutable()->compiler_version_ = const_cast< ::google::protobuf::compiler::Version*>( + ::google::protobuf::compiler::Version::internal_default_instance()); +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int CodeGeneratorRequest::kFileToGenerateFieldNumber; const int CodeGeneratorRequest::kParameterFieldNumber; @@ -754,7 +644,7 @@ const int CodeGeneratorRequest::kCompilerVersionFieldNumber; CodeGeneratorRequest::CodeGeneratorRequest() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsCodeGeneratorRequest(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.CodeGeneratorRequest) @@ -801,12 +691,12 @@ void CodeGeneratorRequest::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CodeGeneratorRequest::descriptor() { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const CodeGeneratorRequest& CodeGeneratorRequest::default_instance() { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsCodeGeneratorRequest(); return *internal_default_instance(); } @@ -1150,224 +1040,14 @@ void CodeGeneratorRequest::InternalSwap(CodeGeneratorRequest* other) { ::google::protobuf::Metadata CodeGeneratorRequest::GetMetadata() const { protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// CodeGeneratorRequest - -// repeated string file_to_generate = 1; -int CodeGeneratorRequest::file_to_generate_size() const { - return file_to_generate_.size(); -} -void CodeGeneratorRequest::clear_file_to_generate() { - file_to_generate_.Clear(); -} -const ::std::string& CodeGeneratorRequest::file_to_generate(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return file_to_generate_.Get(index); -} -::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); -} -void CodeGeneratorRequest::set_file_to_generate(int index, const ::std::string& value) { - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - file_to_generate_.Mutable(index)->assign(value); -} -#if LANG_CXX11 -void CodeGeneratorRequest::set_file_to_generate(int index, ::std::string&& value) { - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - file_to_generate_.Mutable(index)->assign(std::move(value)); -} -#endif -void CodeGeneratorRequest::set_file_to_generate(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); - file_to_generate_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -void CodeGeneratorRequest::set_file_to_generate(int index, const char* value, size_t size) { - file_to_generate_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -::std::string* CodeGeneratorRequest::add_file_to_generate() { - // @@protoc_insertion_point(field_add_mutable:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return file_to_generate_.Add(); -} -void CodeGeneratorRequest::add_file_to_generate(const ::std::string& value) { - file_to_generate_.Add()->assign(value); - // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -#if LANG_CXX11 -void CodeGeneratorRequest::add_file_to_generate(::std::string&& value) { - file_to_generate_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -#endif -void CodeGeneratorRequest::add_file_to_generate(const char* value) { - GOOGLE_DCHECK(value != NULL); - file_to_generate_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -void CodeGeneratorRequest::add_file_to_generate(const char* value, size_t size) { - file_to_generate_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) -} -const ::google::protobuf::RepeatedPtrField< ::std::string>& -CodeGeneratorRequest::file_to_generate() const { - // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return file_to_generate_; -} -::google::protobuf::RepeatedPtrField< ::std::string>* -CodeGeneratorRequest::mutable_file_to_generate() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) - return &file_to_generate_; -} - -// optional string parameter = 2; -bool CodeGeneratorRequest::has_parameter() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void CodeGeneratorRequest::set_has_parameter() { - _has_bits_[0] |= 0x00000001u; -} -void CodeGeneratorRequest::clear_has_parameter() { - _has_bits_[0] &= ~0x00000001u; -} -void CodeGeneratorRequest::clear_parameter() { - parameter_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_parameter(); -} -const ::std::string& CodeGeneratorRequest::parameter() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.parameter) - return parameter_.GetNoArena(); -} -void CodeGeneratorRequest::set_parameter(const ::std::string& value) { - set_has_parameter(); - parameter_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.parameter) -} -#if LANG_CXX11 -void CodeGeneratorRequest::set_parameter(::std::string&& value) { - set_has_parameter(); - parameter_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.CodeGeneratorRequest.parameter) -} -#endif -void CodeGeneratorRequest::set_parameter(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_parameter(); - parameter_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorRequest.parameter) -} -void CodeGeneratorRequest::set_parameter(const char* value, size_t size) { - set_has_parameter(); - parameter_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorRequest.parameter) -} -::std::string* CodeGeneratorRequest::mutable_parameter() { - set_has_parameter(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.parameter) - return parameter_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* CodeGeneratorRequest::release_parameter() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.parameter) - clear_has_parameter(); - return parameter_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void CodeGeneratorRequest::set_allocated_parameter(::std::string* parameter) { - if (parameter != NULL) { - set_has_parameter(); - } else { - clear_has_parameter(); - } - parameter_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), parameter); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.parameter) -} - -// repeated .google.protobuf.FileDescriptorProto proto_file = 15; -int CodeGeneratorRequest::proto_file_size() const { - return proto_file_.size(); -} -void CodeGeneratorRequest::clear_proto_file() { - proto_file_.Clear(); -} -const ::google::protobuf::FileDescriptorProto& CodeGeneratorRequest::proto_file(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.proto_file) - return proto_file_.Get(index); -} -::google::protobuf::FileDescriptorProto* CodeGeneratorRequest::mutable_proto_file(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.proto_file) - return proto_file_.Mutable(index); -} -::google::protobuf::FileDescriptorProto* CodeGeneratorRequest::add_proto_file() { - // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.proto_file) - return proto_file_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >* -CodeGeneratorRequest::mutable_proto_file() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.proto_file) - return &proto_file_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >& -CodeGeneratorRequest::proto_file() const { - // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorRequest.proto_file) - return proto_file_; -} - -// optional .google.protobuf.compiler.Version compiler_version = 3; -bool CodeGeneratorRequest::has_compiler_version() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void CodeGeneratorRequest::set_has_compiler_version() { - _has_bits_[0] |= 0x00000002u; -} -void CodeGeneratorRequest::clear_has_compiler_version() { - _has_bits_[0] &= ~0x00000002u; -} -void CodeGeneratorRequest::clear_compiler_version() { - if (compiler_version_ != NULL) compiler_version_->::google::protobuf::compiler::Version::Clear(); - clear_has_compiler_version(); -} -const ::google::protobuf::compiler::Version& CodeGeneratorRequest::compiler_version() const { - const ::google::protobuf::compiler::Version* p = compiler_version_; - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::compiler::_Version_default_instance_); -} -::google::protobuf::compiler::Version* CodeGeneratorRequest::mutable_compiler_version() { - set_has_compiler_version(); - if (compiler_version_ == NULL) { - compiler_version_ = new ::google::protobuf::compiler::Version; - } - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) - return compiler_version_; -} -::google::protobuf::compiler::Version* CodeGeneratorRequest::release_compiler_version() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) - clear_has_compiler_version(); - ::google::protobuf::compiler::Version* temp = compiler_version_; - compiler_version_ = NULL; - return temp; -} -void CodeGeneratorRequest::set_allocated_compiler_version(::google::protobuf::compiler::Version* compiler_version) { - delete compiler_version_; - compiler_version_ = compiler_version; - if (compiler_version) { - set_has_compiler_version(); - } else { - clear_has_compiler_version(); - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void CodeGeneratorResponse_File::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int CodeGeneratorResponse_File::kNameFieldNumber; const int CodeGeneratorResponse_File::kInsertionPointFieldNumber; @@ -1377,7 +1057,7 @@ const int CodeGeneratorResponse_File::kContentFieldNumber; CodeGeneratorResponse_File::CodeGeneratorResponse_File() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsCodeGeneratorResponse_File(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.CodeGeneratorResponse.File) @@ -1427,12 +1107,12 @@ void CodeGeneratorResponse_File::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CodeGeneratorResponse_File::descriptor() { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const CodeGeneratorResponse_File& CodeGeneratorResponse_File::default_instance() { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsCodeGeneratorResponse_File(); return *internal_default_instance(); } @@ -1752,205 +1432,14 @@ void CodeGeneratorResponse_File::InternalSwap(CodeGeneratorResponse_File* other) ::google::protobuf::Metadata CodeGeneratorResponse_File::GetMetadata() const { protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// CodeGeneratorResponse_File - -// optional string name = 1; -bool CodeGeneratorResponse_File::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void CodeGeneratorResponse_File::set_has_name() { - _has_bits_[0] |= 0x00000001u; -} -void CodeGeneratorResponse_File::clear_has_name() { - _has_bits_[0] &= ~0x00000001u; -} -void CodeGeneratorResponse_File::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); -} -const ::std::string& CodeGeneratorResponse_File::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.name) - return name_.GetNoArena(); -} -void CodeGeneratorResponse_File::set_name(const ::std::string& value) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.name) -} -#if LANG_CXX11 -void CodeGeneratorResponse_File::set_name(::std::string&& value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.CodeGeneratorResponse.File.name) -} -#endif -void CodeGeneratorResponse_File::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.File.name) -} -void CodeGeneratorResponse_File::set_name(const char* value, size_t size) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorResponse.File.name) -} -::std::string* CodeGeneratorResponse_File::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* CodeGeneratorResponse_File::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.name) - clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void CodeGeneratorResponse_File::set_allocated_name(::std::string* name) { - if (name != NULL) { - set_has_name(); - } else { - clear_has_name(); - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.name) -} - -// optional string insertion_point = 2; -bool CodeGeneratorResponse_File::has_insertion_point() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void CodeGeneratorResponse_File::set_has_insertion_point() { - _has_bits_[0] |= 0x00000002u; -} -void CodeGeneratorResponse_File::clear_has_insertion_point() { - _has_bits_[0] &= ~0x00000002u; -} -void CodeGeneratorResponse_File::clear_insertion_point() { - insertion_point_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_insertion_point(); -} -const ::std::string& CodeGeneratorResponse_File::insertion_point() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) - return insertion_point_.GetNoArena(); -} -void CodeGeneratorResponse_File::set_insertion_point(const ::std::string& value) { - set_has_insertion_point(); - insertion_point_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) -} -#if LANG_CXX11 -void CodeGeneratorResponse_File::set_insertion_point(::std::string&& value) { - set_has_insertion_point(); - insertion_point_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) -} -#endif -void CodeGeneratorResponse_File::set_insertion_point(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_insertion_point(); - insertion_point_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) -} -void CodeGeneratorResponse_File::set_insertion_point(const char* value, size_t size) { - set_has_insertion_point(); - insertion_point_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) -} -::std::string* CodeGeneratorResponse_File::mutable_insertion_point() { - set_has_insertion_point(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) - return insertion_point_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* CodeGeneratorResponse_File::release_insertion_point() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) - clear_has_insertion_point(); - return insertion_point_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void CodeGeneratorResponse_File::set_allocated_insertion_point(::std::string* insertion_point) { - if (insertion_point != NULL) { - set_has_insertion_point(); - } else { - clear_has_insertion_point(); - } - insertion_point_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), insertion_point); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) -} - -// optional string content = 15; -bool CodeGeneratorResponse_File::has_content() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void CodeGeneratorResponse_File::set_has_content() { - _has_bits_[0] |= 0x00000004u; -} -void CodeGeneratorResponse_File::clear_has_content() { - _has_bits_[0] &= ~0x00000004u; -} -void CodeGeneratorResponse_File::clear_content() { - content_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_content(); -} -const ::std::string& CodeGeneratorResponse_File::content() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.content) - return content_.GetNoArena(); -} -void CodeGeneratorResponse_File::set_content(const ::std::string& value) { - set_has_content(); - content_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.content) -} -#if LANG_CXX11 -void CodeGeneratorResponse_File::set_content(::std::string&& value) { - set_has_content(); - content_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.CodeGeneratorResponse.File.content) -} -#endif -void CodeGeneratorResponse_File::set_content(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_content(); - content_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.File.content) -} -void CodeGeneratorResponse_File::set_content(const char* value, size_t size) { - set_has_content(); - content_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorResponse.File.content) -} -::std::string* CodeGeneratorResponse_File::mutable_content() { - set_has_content(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.content) - return content_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* CodeGeneratorResponse_File::release_content() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.content) - clear_has_content(); - return content_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void CodeGeneratorResponse_File::set_allocated_content(::std::string* content) { - if (content != NULL) { - set_has_content(); - } else { - clear_has_content(); - } - content_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), content); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.content) + return ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void CodeGeneratorResponse::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int CodeGeneratorResponse::kErrorFieldNumber; const int CodeGeneratorResponse::kFileFieldNumber; @@ -1959,7 +1448,7 @@ const int CodeGeneratorResponse::kFileFieldNumber; CodeGeneratorResponse::CodeGeneratorResponse() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsCodeGeneratorResponse(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.CodeGeneratorResponse) @@ -1998,12 +1487,12 @@ void CodeGeneratorResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CodeGeneratorResponse::descriptor() { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const CodeGeneratorResponse& CodeGeneratorResponse::default_instance() { - protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsCodeGeneratorResponse(); return *internal_default_instance(); } @@ -2250,109 +1739,11 @@ void CodeGeneratorResponse::InternalSwap(CodeGeneratorResponse* other) { ::google::protobuf::Metadata CodeGeneratorResponse::GetMetadata() const { protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// CodeGeneratorResponse - -// optional string error = 1; -bool CodeGeneratorResponse::has_error() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void CodeGeneratorResponse::set_has_error() { - _has_bits_[0] |= 0x00000001u; -} -void CodeGeneratorResponse::clear_has_error() { - _has_bits_[0] &= ~0x00000001u; -} -void CodeGeneratorResponse::clear_error() { - error_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_error(); -} -const ::std::string& CodeGeneratorResponse::error() const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.error) - return error_.GetNoArena(); -} -void CodeGeneratorResponse::set_error(const ::std::string& value) { - set_has_error(); - error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.error) -} -#if LANG_CXX11 -void CodeGeneratorResponse::set_error(::std::string&& value) { - set_has_error(); - error_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.CodeGeneratorResponse.error) -} -#endif -void CodeGeneratorResponse::set_error(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_error(); - error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.error) -} -void CodeGeneratorResponse::set_error(const char* value, size_t size) { - set_has_error(); - error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorResponse.error) -} -::std::string* CodeGeneratorResponse::mutable_error() { - set_has_error(); - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.error) - return error_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* CodeGeneratorResponse::release_error() { - // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.error) - clear_has_error(); - return error_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void CodeGeneratorResponse::set_allocated_error(::std::string* error) { - if (error != NULL) { - set_has_error(); - } else { - clear_has_error(); - } - error_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.error) -} - -// repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15; -int CodeGeneratorResponse::file_size() const { - return file_.size(); -} -void CodeGeneratorResponse::clear_file() { - file_.Clear(); -} -const ::google::protobuf::compiler::CodeGeneratorResponse_File& CodeGeneratorResponse::file(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.file) - return file_.Get(index); -} -::google::protobuf::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::mutable_file(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.file) - return file_.Mutable(index); -} -::google::protobuf::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::add_file() { - // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorResponse.file) - return file_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >* -CodeGeneratorResponse::mutable_file() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorResponse.file) - return &file_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >& -CodeGeneratorResponse::file() const { - // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorResponse.file) - return file_; + return ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace compiler } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index 2d66f035..0c2ad703 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -37,6 +37,33 @@ #ifdef minor #undef minor #endif + +namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto { +// Internal implementation detail -- do not use these members. +struct LIBPROTOC_EXPORT TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[4]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void LIBPROTOC_EXPORT AddDescriptors(); +void LIBPROTOC_EXPORT InitDefaultsVersionImpl(); +void LIBPROTOC_EXPORT InitDefaultsVersion(); +void LIBPROTOC_EXPORT InitDefaultsCodeGeneratorRequestImpl(); +void LIBPROTOC_EXPORT InitDefaultsCodeGeneratorRequest(); +void LIBPROTOC_EXPORT InitDefaultsCodeGeneratorResponse_FileImpl(); +void LIBPROTOC_EXPORT InitDefaultsCodeGeneratorResponse_File(); +void LIBPROTOC_EXPORT InitDefaultsCodeGeneratorResponseImpl(); +void LIBPROTOC_EXPORT InitDefaultsCodeGeneratorResponse(); +inline void LIBPROTOC_EXPORT InitDefaults() { + InitDefaultsVersion(); + InitDefaultsCodeGeneratorRequest(); + InitDefaultsCodeGeneratorResponse_File(); + InitDefaultsCodeGeneratorResponse(); +} +} // namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto namespace google { namespace protobuf { namespace compiler { @@ -55,26 +82,10 @@ LIBPROTOC_EXPORT extern VersionDefaultTypeInternal _Version_default_instance_; } // namespace compiler } // namespace protobuf } // namespace google - namespace google { namespace protobuf { namespace compiler { -namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto { -// Internal implementation detail -- do not call these. -struct LIBPROTOC_EXPORT TableStruct { - static const ::google::protobuf::internal::ParseTableField entries[]; - static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; - static const ::google::protobuf::internal::FieldMetadata field_metadata[]; - static const ::google::protobuf::internal::SerializationTable serialization_table[]; - static void InitDefaultsImpl(); -}; -void LIBPROTOC_EXPORT AddDescriptors(); -void LIBPROTOC_EXPORT InitDefaults(); -} // namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto - // =================================================================== class LIBPROTOC_EXPORT Version : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.Version) */ { @@ -113,6 +124,7 @@ class LIBPROTOC_EXPORT Version : public ::google::protobuf::Message /* @@protoc_ static const ::google::protobuf::Descriptor* descriptor(); static const Version& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Version* internal_default_instance() { return reinterpret_cast( &_Version_default_instance_); @@ -219,7 +231,8 @@ class LIBPROTOC_EXPORT Version : public ::google::protobuf::Message /* @@protoc_ ::google::protobuf::int32 major_; ::google::protobuf::int32 minor_; ::google::protobuf::int32 patch_; - friend struct protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsVersionImpl(); }; // ------------------------------------------------------------------- @@ -259,6 +272,7 @@ class LIBPROTOC_EXPORT CodeGeneratorRequest : public ::google::protobuf::Message static const ::google::protobuf::Descriptor* descriptor(); static const CodeGeneratorRequest& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const CodeGeneratorRequest* internal_default_instance() { return reinterpret_cast( &_CodeGeneratorRequest_default_instance_); @@ -383,7 +397,8 @@ class LIBPROTOC_EXPORT CodeGeneratorRequest : public ::google::protobuf::Message ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto > proto_file_; ::google::protobuf::internal::ArenaStringPtr parameter_; ::google::protobuf::compiler::Version* compiler_version_; - friend struct protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsCodeGeneratorRequestImpl(); }; // ------------------------------------------------------------------- @@ -423,6 +438,7 @@ class LIBPROTOC_EXPORT CodeGeneratorResponse_File : public ::google::protobuf::M static const ::google::protobuf::Descriptor* descriptor(); static const CodeGeneratorResponse_File& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const CodeGeneratorResponse_File* internal_default_instance() { return reinterpret_cast( &_CodeGeneratorResponse_File_default_instance_); @@ -535,7 +551,8 @@ class LIBPROTOC_EXPORT CodeGeneratorResponse_File : public ::google::protobuf::M ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::internal::ArenaStringPtr insertion_point_; ::google::protobuf::internal::ArenaStringPtr content_; - friend struct protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsCodeGeneratorResponse_FileImpl(); }; // ------------------------------------------------------------------- @@ -575,6 +592,7 @@ class LIBPROTOC_EXPORT CodeGeneratorResponse : public ::google::protobuf::Messag static const ::google::protobuf::Descriptor* descriptor(); static const CodeGeneratorResponse& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const CodeGeneratorResponse* internal_default_instance() { return reinterpret_cast( &_CodeGeneratorResponse_default_instance_); @@ -666,14 +684,14 @@ class LIBPROTOC_EXPORT CodeGeneratorResponse : public ::google::protobuf::Messag mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File > file_; ::google::protobuf::internal::ArenaStringPtr error_; - friend struct protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::InitDefaultsCodeGeneratorResponseImpl(); }; // =================================================================== // =================================================================== -#if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -1320,7 +1338,6 @@ CodeGeneratorResponse::file() const { #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // ------------------------------------------------------------------- @@ -1330,7 +1347,6 @@ CodeGeneratorResponse::file() const { // @@protoc_insertion_point(namespace_scope) - } // namespace compiler } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/compiler/python/python_generator.cc b/src/google/protobuf/compiler/python/python_generator.cc index 97769835..5ca6b4ee 100644 --- a/src/google/protobuf/compiler/python/python_generator.cc +++ b/src/google/protobuf/compiler/python/python_generator.cc @@ -1151,7 +1151,7 @@ void Generator::PrintFieldDescriptor( " has_default_value=$has_default_value$, default_value=$default_value$,\n" " message_type=None, enum_type=None, containing_type=None,\n" " is_extension=$is_extension$, extension_scope=None,\n" - " options=$options$$json_name$)"; + " options=$options$$json_name$, file=DESCRIPTOR)"; printer_->Print(m, field_descriptor_decl); } diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 89b37ee3..58829560 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -593,7 +593,7 @@ class DescriptorPool::Tables { // These return NULL if not found. inline const FileDescriptor* FindFile(const string& key) const; inline const FieldDescriptor* FindExtension(const Descriptor* extendee, - int number); + int number) const; inline void FindAllExtensions(const Descriptor* extendee, std::vector* out) const; @@ -752,11 +752,27 @@ class FileDescriptorTables { const SourceCodeInfo_Location* GetSourceLocation( const std::vector& path, const SourceCodeInfo* info) const; + // Must be called after BuildFileImpl(), even if the build failed and + // we are going to roll back to the last checkpoint. + void FinalizeTables(); + private: - SymbolsByParentMap symbols_by_parent_; - FieldsByNameMap fields_by_lowercase_name_; - FieldsByNameMap fields_by_camelcase_name_; - FieldsByNumberMap fields_by_number_; // Not including extensions. + const void* FindParentForFieldsByMap(const FieldDescriptor* field) const; + static void FieldsByLowercaseNamesLazyInitStatic( + const FileDescriptorTables* tables); + void FieldsByLowercaseNamesLazyInitInternal() const; + static void FieldsByCamelcaseNamesLazyInitStatic( + const FileDescriptorTables* tables); + void FieldsByCamelcaseNamesLazyInitInternal() const; + + SymbolsByParentMap symbols_by_parent_; + mutable FieldsByNameMap fields_by_lowercase_name_; + mutable FieldsByNameMap* fields_by_lowercase_name_tmp_; + mutable GoogleOnceDynamic fields_by_lowercase_name_once_; + mutable FieldsByNameMap fields_by_camelcase_name_; + mutable FieldsByNameMap* fields_by_camelcase_name_tmp_; + mutable GoogleOnceDynamic fields_by_camelcase_name_once_; + FieldsByNumberMap fields_by_number_; // Not including extensions. EnumValuesByNumberMap enum_values_by_number_; mutable EnumValuesByNumberMap unknown_enum_values_by_number_ GOOGLE_GUARDED_BY(unknown_enum_values_mu_); @@ -793,14 +809,16 @@ DescriptorPool::Tables::~Tables() { } FileDescriptorTables::FileDescriptorTables() - // Initialize all the hash tables to start out with a small # of buckets + // Initialize all the hash tables to start out with a small # of buckets. : symbols_by_parent_(3), fields_by_lowercase_name_(3), + fields_by_lowercase_name_tmp_(new FieldsByNameMap()), fields_by_camelcase_name_(3), + fields_by_camelcase_name_tmp_(new FieldsByNameMap()), fields_by_number_(3), enum_values_by_number_(3), - unknown_enum_values_by_number_(3) { -} + unknown_enum_values_by_number_(3), + locations_by_path_(3) {} FileDescriptorTables::~FileDescriptorTables() {} @@ -960,14 +978,59 @@ inline const FieldDescriptor* FileDescriptorTables::FindFieldByNumber( return FindPtrOrNull(fields_by_number_, std::make_pair(parent, number)); } +const void* FileDescriptorTables::FindParentForFieldsByMap( + const FieldDescriptor* field) const { + if (field->is_extension()) { + if (field->extension_scope() == NULL) { + return field->file(); + } else { + return field->extension_scope(); + } + } else { + return field->containing_type(); + } +} + +void FileDescriptorTables::FieldsByLowercaseNamesLazyInitStatic( + const FileDescriptorTables* tables) { + tables->FieldsByLowercaseNamesLazyInitInternal(); +} + +void FileDescriptorTables::FieldsByLowercaseNamesLazyInitInternal() const { + for (FieldsByNumberMap::const_iterator it = fields_by_number_.begin(); + it != fields_by_number_.end(); it++) { + PointerStringPair lowercase_key(FindParentForFieldsByMap(it->second), + it->second->lowercase_name().c_str()); + InsertIfNotPresent(&fields_by_lowercase_name_, lowercase_key, it->second); + } +} + inline const FieldDescriptor* FileDescriptorTables::FindFieldByLowercaseName( const void* parent, const string& lowercase_name) const { + fields_by_lowercase_name_once_.Init( + &FileDescriptorTables::FieldsByLowercaseNamesLazyInitStatic, this); return FindPtrOrNull(fields_by_lowercase_name_, PointerStringPair(parent, lowercase_name.c_str())); } +void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic( + const FileDescriptorTables* tables) { + tables->FieldsByCamelcaseNamesLazyInitInternal(); +} + +void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitInternal() const { + for (FieldsByNumberMap::const_iterator it = fields_by_number_.begin(); + it != fields_by_number_.end(); it++) { + PointerStringPair camelcase_key(FindParentForFieldsByMap(it->second), + it->second->camelcase_name().c_str()); + InsertIfNotPresent(&fields_by_camelcase_name_, camelcase_key, it->second); + } +} + inline const FieldDescriptor* FileDescriptorTables::FindFieldByCamelcaseName( const void* parent, const string& camelcase_name) const { + fields_by_camelcase_name_once_.Init( + &FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic, this); return FindPtrOrNull(fields_by_camelcase_name_, PointerStringPair(parent, camelcase_name.c_str())); } @@ -1031,7 +1094,7 @@ FileDescriptorTables::FindEnumValueByNumberCreatingIfUnknown( inline const FieldDescriptor* DescriptorPool::Tables::FindExtension( - const Descriptor* extendee, int number) { + const Descriptor* extendee, int number) const { return FindPtrOrNull(extensions_, std::make_pair(extendee, number)); } @@ -1072,24 +1135,40 @@ bool DescriptorPool::Tables::AddFile(const FileDescriptor* file) { } } +void FileDescriptorTables::FinalizeTables() { + // Clean up the temporary maps used by AddFieldByStylizedNames(). + delete fields_by_lowercase_name_tmp_; + fields_by_lowercase_name_tmp_ = NULL; + delete fields_by_camelcase_name_tmp_; + fields_by_camelcase_name_tmp_ = NULL; +} + void FileDescriptorTables::AddFieldByStylizedNames( const FieldDescriptor* field) { - const void* parent; - if (field->is_extension()) { - if (field->extension_scope() == NULL) { - parent = field->file(); - } else { - parent = field->extension_scope(); - } - } else { - parent = field->containing_type(); - } + const void* parent = FindParentForFieldsByMap(field); + + // We want fields_by_{lower,camel}case_name_ to be lazily built, but + // cross-link order determines which entry will be present in the case of a + // conflict. So we use the temporary maps that get destroyed after + // BuildFileImpl() to detect the conflicts, and only store the conflicts in + // the map that will persist. We will then lazily populate the rest of the + // entries from fields_by_number_. PointerStringPair lowercase_key(parent, field->lowercase_name().c_str()); - InsertIfNotPresent(&fields_by_lowercase_name_, lowercase_key, field); + if (!InsertIfNotPresent(fields_by_lowercase_name_tmp_, lowercase_key, + field)) { + InsertIfNotPresent( + &fields_by_lowercase_name_, lowercase_key, + FindPtrOrNull(*fields_by_lowercase_name_tmp_, lowercase_key)); + } PointerStringPair camelcase_key(parent, field->camelcase_name().c_str()); - InsertIfNotPresent(&fields_by_camelcase_name_, camelcase_key, field); + if (!InsertIfNotPresent(fields_by_camelcase_name_tmp_, camelcase_key, + field)) { + InsertIfNotPresent( + &fields_by_camelcase_name_, camelcase_key, + FindPtrOrNull(*fields_by_camelcase_name_tmp_, camelcase_key)); + } } bool FileDescriptorTables::AddFieldByNumber(const FieldDescriptor* field) { @@ -1419,6 +1498,15 @@ const MethodDescriptor* DescriptorPool::FindMethodByName( const FieldDescriptor* DescriptorPool::FindExtensionByNumber( const Descriptor* extendee, int number) const { + // A faster path to reduce lock contention in finding extensions, assuming + // most extensions will be cache hit. + if (mutex_ != NULL) { + ReaderMutexLock lock(mutex_); + const FieldDescriptor* result = tables_->FindExtension(extendee, number); + if (result != NULL) { + return result; + } + } MutexLockMaybe lock(mutex_); tables_->known_bad_symbols_.clear(); tables_->known_bad_files_.clear(); @@ -1721,6 +1809,18 @@ Descriptor::FindReservedRangeContainingNumber(int number) const { return NULL; } +const EnumDescriptor::ReservedRange* +EnumDescriptor::FindReservedRangeContainingNumber(int number) const { + // TODO(chrisn): Consider a non-linear search. + for (int i = 0; i < reserved_range_count(); i++) { + if (number >= reserved_range(i)->start && + number <= reserved_range(i)->end) { + return reserved_range(i); + } + } + return NULL; +} + // ------------------------------------------------------------------- bool DescriptorPool::TryFindFileInFallbackDatabase(const string& name) const { @@ -1826,8 +1926,8 @@ bool DescriptorPool::TryFindExtensionInFallbackDatabase( // =================================================================== -bool FieldDescriptor::is_map() const { - return type() == TYPE_MESSAGE && message_type()->options().map_entry(); +bool FieldDescriptor::is_map_message_type() const { + return message_type_->options().map_entry(); } string FieldDescriptor::DefaultValueAsString(bool quote_string_type) const { @@ -2063,6 +2163,14 @@ void EnumDescriptor::CopyTo(EnumDescriptorProto* proto) const { for (int i = 0; i < value_count(); i++) { value(i)->CopyTo(proto->add_value()); } + for (int i = 0; i < reserved_range_count(); i++) { + EnumDescriptorProto::EnumReservedRange* range = proto->add_reserved_range(); + range->set_start(reserved_range(i)->start); + range->set_end(reserved_range(i)->end); + } + for (int i = 0; i < reserved_name_count(); i++) { + proto->add_reserved_name(reserved_name(i)); + } if (&options() != &EnumOptions::default_instance()) { proto->mutable_options()->CopyFrom(options()); @@ -2695,6 +2803,30 @@ void EnumDescriptor::DebugString(int depth, string *contents, for (int i = 0; i < value_count(); i++) { value(i)->DebugString(depth, contents, debug_string_options); } + + if (reserved_range_count() > 0) { + strings::SubstituteAndAppend(contents, "$0 reserved ", prefix); + for (int i = 0; i < reserved_range_count(); i++) { + const EnumDescriptor::ReservedRange* range = reserved_range(i); + if (range->end == range->start) { + strings::SubstituteAndAppend(contents, "$0, ", range->start); + } else { + strings::SubstituteAndAppend(contents, "$0 to $1, ", + range->start, range->end); + } + } + contents->replace(contents->size() - 2, 2, ";\n"); + } + + if (reserved_name_count() > 0) { + strings::SubstituteAndAppend(contents, "$0 reserved ", prefix); + for (int i = 0; i < reserved_name_count(); i++) { + strings::SubstituteAndAppend(contents, "\"$0\", ", + CEscape(reserved_name(i))); + } + contents->replace(contents->size() - 2, 2, ";\n"); + } + strings::SubstituteAndAppend(contents, "$0}\n", prefix); comment_printer.AddPostComment(contents); @@ -2994,7 +3126,7 @@ class DescriptorBuilder { friend class OptionInterpreter; // Non-recursive part of BuildFile functionality. - const FileDescriptor* BuildFileImpl(const FileDescriptorProto& proto); + FileDescriptor* BuildFileImpl(const FileDescriptorProto& proto); const DescriptorPool* pool_; DescriptorPool::Tables* tables_; // for convenience @@ -3178,6 +3310,9 @@ class DescriptorBuilder { void BuildReservedRange(const DescriptorProto::ReservedRange& proto, const Descriptor* parent, Descriptor::ReservedRange* result); + void BuildReservedRange(const EnumDescriptorProto::EnumReservedRange& proto, + const EnumDescriptor* parent, + EnumDescriptor::ReservedRange* result); void BuildOneof(const OneofDescriptorProto& proto, Descriptor* parent, OneofDescriptor* result); @@ -4089,14 +4224,25 @@ const FileDescriptor* DescriptorBuilder::BuildFile( tables_->pending_files_.pop_back(); } } - return BuildFileImpl(proto); -} -const FileDescriptor* DescriptorBuilder::BuildFileImpl( - const FileDescriptorProto& proto) { // Checkpoint the tables so that we can roll back if something goes wrong. tables_->AddCheckpoint(); + FileDescriptor* result = BuildFileImpl(proto); + + file_tables_->FinalizeTables(); + if (result) { + tables_->ClearLastCheckpoint(); + result->finished_building_ = true; + } else { + tables_->RollbackToLastCheckpoint(); + } + + return result; +} + +FileDescriptor* DescriptorBuilder::BuildFileImpl( + const FileDescriptorProto& proto) { FileDescriptor* result = tables_->Allocate(); file_ = result; @@ -4148,7 +4294,6 @@ const FileDescriptor* DescriptorBuilder::BuildFileImpl( "A file with this name is already in the pool."); // Bail out early so that if this is actually the exact same file, we // don't end up reporting that every single symbol is already defined. - tables_->RollbackToLastCheckpoint(); return NULL; } if (!result->package().empty()) { @@ -4189,17 +4334,16 @@ const FileDescriptor* DescriptorBuilder::BuildFileImpl( // Recursive import. dependency/result is not fully initialized, and it's // dangerous to try to do anything with it. The recursive import error // will be detected and reported in DescriptorBuilder::BuildFile(). - tables_->RollbackToLastCheckpoint(); return NULL; } if (dependency == NULL) { - if (pool_->allow_unknown_ || - (!pool_->enforce_weak_ && weak_deps.find(i) != weak_deps.end())) { - dependency = - pool_->NewPlaceholderFileWithMutexHeld(proto.dependency(i)); - } else { - if (!pool_->lazily_build_dependencies_) { + if (!pool_->lazily_build_dependencies_) { + if (pool_->allow_unknown_ || + (!pool_->enforce_weak_ && weak_deps.find(i) != weak_deps.end())) { + dependency = + pool_->NewPlaceholderFileWithMutexHeld(proto.dependency(i)); + } else { AddImportError(proto, i); } } @@ -4325,11 +4469,8 @@ const FileDescriptor* DescriptorBuilder::BuildFileImpl( } if (had_errors_) { - tables_->RollbackToLastCheckpoint(); return NULL; } else { - tables_->ClearLastCheckpoint(); - result->finished_building_ = true; return result; } } @@ -4807,6 +4948,19 @@ void DescriptorBuilder::BuildReservedRange( } } +void DescriptorBuilder::BuildReservedRange( + const EnumDescriptorProto::EnumReservedRange& proto, + const EnumDescriptor* parent, EnumDescriptor::ReservedRange* result) { + result->start = proto.start(); + result->end = proto.end(); + + if (result->start > result->end) { + AddError(parent->full_name(), proto, + DescriptorPool::ErrorCollector::NUMBER, + "Reserved range end number must be greater than start number."); + } +} + void DescriptorBuilder::BuildOneof(const OneofDescriptorProto& proto, Descriptor* parent, OneofDescriptor* result) { @@ -4928,6 +5082,17 @@ void DescriptorBuilder::BuildEnum(const EnumDescriptorProto& proto, } BUILD_ARRAY(proto, result, value, BuildEnumValue, result); + BUILD_ARRAY(proto, result, reserved_range, BuildReservedRange, result); + + // Copy reserved names. + int reserved_name_count = proto.reserved_name_size(); + result->reserved_name_count_ = reserved_name_count; + result->reserved_names_ = + tables_->AllocateArray(reserved_name_count); + for (int i = 0; i < reserved_name_count; ++i) { + result->reserved_names_[i] = + tables_->AllocateString(proto.reserved_name(i)); + } CheckEnumValueUniqueness(proto, result); @@ -4940,6 +5105,56 @@ void DescriptorBuilder::BuildEnum(const EnumDescriptorProto& proto, AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); + + for (int i = 0; i < proto.reserved_range_size(); i++) { + const EnumDescriptorProto_EnumReservedRange& range1 = + proto.reserved_range(i); + for (int j = i + 1; j < proto.reserved_range_size(); j++) { + const EnumDescriptorProto_EnumReservedRange& range2 = + proto.reserved_range(j); + if (range1.end() > range2.start() && range2.end() > range1.start()) { + AddError(result->full_name(), proto.reserved_range(i), + DescriptorPool::ErrorCollector::NUMBER, + strings::Substitute("Reserved range $0 to $1 overlaps with " + "already-defined range $2 to $3.", + range2.start(), range2.end() - 1, + range1.start(), range1.end() - 1)); + } + } + } + + hash_set reserved_name_set; + for (int i = 0; i < proto.reserved_name_size(); i++) { + const string& name = proto.reserved_name(i); + if (reserved_name_set.find(name) == reserved_name_set.end()) { + reserved_name_set.insert(name); + } else { + AddError(name, proto, DescriptorPool::ErrorCollector::NAME, + strings::Substitute( + "Enum value \"$0\" is reserved multiple times.", + name)); + } + } + + for (int i = 0; i < result->value_count(); i++) { + const EnumValueDescriptor* value = result->value(i); + for (int j = 0; j < result->reserved_range_count(); j++) { + const EnumDescriptor::ReservedRange* range = result->reserved_range(j); + if (range->start <= value->number() && value->number() <= range->end) { + AddError(value->full_name(), proto.reserved_range(j), + DescriptorPool::ErrorCollector::NUMBER, + strings::Substitute( + "Enum value \"$0\" uses reserved number $1.", + value->name(), value->number())); + } + } + if (reserved_name_set.find(value->name()) != reserved_name_set.end()) { + AddError(value->full_name(), proto.value(i), + DescriptorPool::ErrorCollector::NAME, + strings::Substitute( + "Enum value \"$0\" is reserved.", value->name())); + } + } } void DescriptorBuilder::BuildEnumValue(const EnumValueDescriptorProto& proto, @@ -5248,25 +5463,27 @@ void DescriptorBuilder::CrossLinkField( bool expecting_enum = (proto.type() == FieldDescriptorProto::TYPE_ENUM) || proto.has_default_value(); + // In case of weak fields we force building the dependency. We need to know + // if the type exist or not. If it doesnt exist we substitute Empty which + // should only be done if the type can't be found in the generated pool. + // TODO(gerbens) Ideally we should query the database directly to check + // if weak fields exist or not so that we don't need to force building + // weak dependencies. However the name lookup rules for symbols are + // somewhat complicated, so I defer it too another CL. + bool is_weak = !pool_->enforce_weak_ && proto.options().weak(); + bool is_lazy = pool_->lazily_build_dependencies_ && !is_weak; + Symbol type = LookupSymbol(proto.type_name(), field->full_name(), expecting_enum ? DescriptorPool::PLACEHOLDER_ENUM : DescriptorPool::PLACEHOLDER_MESSAGE, - LOOKUP_TYPES, !pool_->lazily_build_dependencies_); - - // If the type is a weak type, we change the type to a google.protobuf.Empty field. - if (type.IsNull() && !pool_->enforce_weak_ && proto.options().weak()) { - type = FindSymbol(kNonLinkedWeakMessageReplacementName); - } + LOOKUP_TYPES, !is_lazy); if (type.IsNull()) { - if (pool_->lazily_build_dependencies_) { + if (is_lazy) { // Save the symbol names for later for lookup, and allocate the once // object needed for the accessors. string name = proto.type_name(); - if (!pool_->enforce_weak_ && proto.options().weak()) { - name = kNonLinkedWeakMessageReplacementName; - } field->type_once_ = tables_->AllocateOnceDynamic(); field->type_name_ = tables_->AllocateString(name); if (proto.has_default_value()) { @@ -5284,10 +5501,17 @@ void DescriptorBuilder::CrossLinkField( } return; } else { - AddNotDefinedError(field->full_name(), proto, - DescriptorPool::ErrorCollector::TYPE, - proto.type_name()); - return; + // If the type is a weak type, we change the type to a google.protobuf.Empty + // field. + if (is_weak) { + type = FindSymbol(kNonLinkedWeakMessageReplacementName); + } + if (type.IsNull()) { + AddNotDefinedError(field->full_name(), proto, + DescriptorPool::ErrorCollector::TYPE, + proto.type_name()); + return; + } } } @@ -6835,13 +7059,6 @@ const EnumValueDescriptor* FieldDescriptor::default_value_enum() const { return default_value_enum_; } -FieldDescriptor::Type FieldDescriptor::type() const { - if (type_once_) { - type_once_->Init(&FieldDescriptor::TypeOnceInit, this); - } - return type_; -} - void FileDescriptor::InternalDependenciesOnceInit() const { GOOGLE_CHECK(finished_building_ == true); for (int i = 0; i < dependency_count(); i++) { diff --git a/src/google/protobuf/descriptor.h b/src/google/protobuf/descriptor.h index 57128e6b..5f5159a8 100644 --- a/src/google/protobuf/descriptor.h +++ b/src/google/protobuf/descriptor.h @@ -741,6 +741,9 @@ class LIBPROTOBUF_EXPORT FieldDescriptor { // to this descriptor from the file root. void GetLocationPath(std::vector* output) const; + // Returns true if this is a map message type. + bool is_map_message_type() const; + const string* name_; const string* full_name_; const string* lowercase_name_; @@ -924,12 +927,42 @@ class LIBPROTOBUF_EXPORT EnumDescriptor { // See Descriptor::DebugStringWithOptions(). string DebugStringWithOptions(const DebugStringOptions& options) const; - // Returns true if this is a placeholder for an unknown enum. This will // only be the case if this descriptor comes from a DescriptorPool // with AllowUnknownDependencies() set. bool is_placeholder() const; + // Reserved fields ------------------------------------------------- + + // A range of reserved field numbers. + struct ReservedRange { + int start; // inclusive + int end; // inclusive + }; + + // The number of reserved ranges in this message type. + int reserved_range_count() const; + // Gets an reserved range by index, where 0 <= index < + // reserved_range_count(). These are returned in the order they were defined + // in the .proto file. + const EnumDescriptor::ReservedRange* reserved_range(int index) const; + + // Returns true if the number is in one of the reserved ranges. + bool IsReservedNumber(int number) const; + + // Returns NULL if no reserved range contains the given number. + const EnumDescriptor::ReservedRange* + FindReservedRangeContainingNumber(int number) const; + + // The number of reserved field names in this message type. + int reserved_name_count() const; + + // Gets a reserved name by index, where 0 <= index < reserved_name_count(). + const string& reserved_name(int index) const; + + // Returns true if the field name is reserved. + bool IsReservedName(const string& name) const; + // Source Location --------------------------------------------------- // Updates |*out_location| to the source location of the complete @@ -976,6 +1009,12 @@ class LIBPROTOBUF_EXPORT EnumDescriptor { int value_count_; EnumValueDescriptor* values_; + + int reserved_range_count_; + int reserved_name_count_; + EnumDescriptor::ReservedRange* reserved_ranges_; + const string** reserved_names_; + // IMPORTANT: If you add a new field, make sure to search for all instances // of Allocate() and AllocateArray() in // descriptor.cc and update them to initialize the field. @@ -1864,6 +1903,10 @@ PROTOBUF_DEFINE_ARRAY_ACCESSOR(EnumDescriptor, value, const EnumValueDescriptor*) PROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumDescriptor, EnumOptions) PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, is_placeholder, bool) +PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, reserved_range_count, int) +PROTOBUF_DEFINE_ARRAY_ACCESSOR(EnumDescriptor, reserved_range, + const EnumDescriptor::ReservedRange*) +PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, reserved_name_count, int) PROTOBUF_DEFINE_STRING_ACCESSOR(EnumValueDescriptor, name) PROTOBUF_DEFINE_STRING_ACCESSOR(EnumValueDescriptor, full_name) @@ -1935,6 +1978,32 @@ inline const string& Descriptor::reserved_name(int index) const { return *reserved_names_[index]; } +inline bool EnumDescriptor::IsReservedNumber(int number) const { + return FindReservedRangeContainingNumber(number) != NULL; +} + +inline bool EnumDescriptor::IsReservedName(const string& name) const { + for (int i = 0; i < reserved_name_count(); i++) { + if (name == reserved_name(i)) { + return true; + } + } + return false; +} + +// Can't use PROTOBUF_DEFINE_ARRAY_ACCESSOR because reserved_names_ is actually +// an array of pointers rather than the usual array of objects. +inline const string& EnumDescriptor::reserved_name(int index) const { + return *reserved_names_[index]; +} + +inline FieldDescriptor::Type FieldDescriptor::type() const { + if (type_once_) { + type_once_->Init(&FieldDescriptor::TypeOnceInit, this); + } + return type_; +} + inline bool FieldDescriptor::is_required() const { return label() == LABEL_REQUIRED; } @@ -1951,6 +2020,10 @@ inline bool FieldDescriptor::is_packable() const { return is_repeated() && IsTypePackable(type()); } +inline bool FieldDescriptor::is_map() const { + return type() == TYPE_MESSAGE && is_map_message_type(); +} + // To save space, index() is computed by looking at the descriptor's position // in the parent's array of children. inline int FieldDescriptor::index() const { diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 69c0ab0d..99f64c99 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/descriptor.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,1234 +15,2524 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { class FileDescriptorSetDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _FileDescriptorSet_default_instance_; class FileDescriptorProtoDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _FileDescriptorProto_default_instance_; class DescriptorProto_ExtensionRangeDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _DescriptorProto_ExtensionRange_default_instance_; class DescriptorProto_ReservedRangeDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _DescriptorProto_ReservedRange_default_instance_; class DescriptorProtoDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _DescriptorProto_default_instance_; class ExtensionRangeOptionsDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _ExtensionRangeOptions_default_instance_; class FieldDescriptorProtoDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _FieldDescriptorProto_default_instance_; class OneofDescriptorProtoDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _OneofDescriptorProto_default_instance_; +class EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _EnumDescriptorProto_EnumReservedRange_default_instance_; class EnumDescriptorProtoDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _EnumDescriptorProto_default_instance_; class EnumValueDescriptorProtoDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _EnumValueDescriptorProto_default_instance_; class ServiceDescriptorProtoDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _ServiceDescriptorProto_default_instance_; class MethodDescriptorProtoDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _MethodDescriptorProto_default_instance_; class FileOptionsDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _FileOptions_default_instance_; class MessageOptionsDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _MessageOptions_default_instance_; class FieldOptionsDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _FieldOptions_default_instance_; class OneofOptionsDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _OneofOptions_default_instance_; class EnumOptionsDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _EnumOptions_default_instance_; class EnumValueOptionsDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _EnumValueOptions_default_instance_; class ServiceOptionsDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _ServiceOptions_default_instance_; class MethodOptionsDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _MethodOptions_default_instance_; class UninterpretedOption_NamePartDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _UninterpretedOption_NamePart_default_instance_; class UninterpretedOptionDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _UninterpretedOption_default_instance_; class SourceCodeInfo_LocationDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _SourceCodeInfo_Location_default_instance_; class SourceCodeInfoDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _SourceCodeInfo_default_instance_; class GeneratedCodeInfo_AnnotationDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _GeneratedCodeInfo_Annotation_default_instance_; class GeneratedCodeInfoDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _GeneratedCodeInfo_default_instance_; - +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto { +void InitDefaultsFileDescriptorSetImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProto(); + { + void* ptr = &::google::protobuf::_FileDescriptorSet_default_instance_; + new (ptr) ::google::protobuf::FileDescriptorSet(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::FileDescriptorSet::InitAsDefaultInstance(); +} -namespace { +void InitDefaultsFileDescriptorSet() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFileDescriptorSetImpl); +} -::google::protobuf::Metadata file_level_metadata[26]; -const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[6]; +void InitDefaultsFileDescriptorProtoImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; -} // namespace + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceDescriptorProto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileOptions(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo(); + { + void* ptr = &::google::protobuf::_FileDescriptorProto_default_instance_; + new (ptr) ::google::protobuf::FileDescriptorProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::FileDescriptorProto::InitAsDefaultInstance(); +} -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField - const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, -}; +void InitDefaultsFileDescriptorProto() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFileDescriptorProtoImpl); +} -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField - const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - ::google::protobuf::internal::AuxillaryParseTableField(), -}; -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const - TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, -}; +void InitDefaultsDescriptorProto_ExtensionRangeImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; -const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, file_), - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, package_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, dependency_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, public_dependency_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, weak_dependency_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, message_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, enum_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, service_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, extension_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, source_code_info_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, syntax_), - 0, - 1, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - 3, - 4, - 2, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, start_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, end_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, options_), - 1, - 2, - 0, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, start_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, end_), - 0, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, field_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, nested_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, enum_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_range_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, oneof_decl_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, reserved_range_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, reserved_name_), - 0, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - 1, - ~0u, - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionRangeOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionRangeOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionRangeOptions, _extensions_), - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionRangeOptions, uninterpreted_option_), - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, number_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, label_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, extendee_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, default_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, oneof_index_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, json_name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, options_), - 0, - 6, - 8, - 9, - 2, - 1, - 3, - 7, - 4, - 5, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, options_), - 0, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, options_), - 0, - ~0u, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, number_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, options_), - 0, - 2, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, method_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, options_), - 0, - ~0u, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, input_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, output_type_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, options_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, client_streaming_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, server_streaming_), - 0, - 1, - 2, - 3, - 4, - 5, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _extensions_), - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_package_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_outer_classname_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_multiple_files_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generate_equals_and_hash_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_string_check_utf8_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, optimize_for_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, go_package_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_generic_services_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generic_services_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, py_generic_services_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, php_generic_services_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_enable_arenas_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, objc_class_prefix_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, csharp_namespace_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, swift_prefix_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, php_class_prefix_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, php_namespace_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, uninterpreted_option_), - 0, - 1, - 8, - 9, - 10, - 17, - 2, - 11, - 12, - 13, - 14, - 15, - 16, - 3, - 4, - 5, - 6, - 7, - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _extensions_), - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, message_set_wire_format_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, no_standard_descriptor_accessor_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, map_entry_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, uninterpreted_option_), - 0, - 1, - 2, - 3, - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _extensions_), - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, ctype_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, packed_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, jstype_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, lazy_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, weak_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, uninterpreted_option_), - 0, - 1, - 5, - 2, - 3, - 4, - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, _extensions_), - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofOptions, uninterpreted_option_), - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _extensions_), - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, allow_alias_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, uninterpreted_option_), - 0, - 1, - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _extensions_), - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, uninterpreted_option_), - 0, - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _extensions_), - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, uninterpreted_option_), - 0, - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _internal_metadata_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _extensions_), - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, deprecated_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, idempotency_level_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, uninterpreted_option_), - 0, - 1, - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, name_part_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, is_extension_), - 0, - 1, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, identifier_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, positive_int_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, negative_int_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, double_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, string_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, aggregate_value_), - ~0u, - 0, - 3, - 4, - 5, - 1, - 2, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, path_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, span_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, leading_comments_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, trailing_comments_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, leading_detached_comments_), - ~0u, - ~0u, - 0, - 1, - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, location_), - ~0u, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, path_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, source_file_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, begin_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, end_), - ~0u, - 0, - 1, - 2, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, annotation_), - ~0u, -}; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { 0, 6, sizeof(FileDescriptorSet)}, - { 7, 24, sizeof(FileDescriptorProto)}, - { 36, 44, sizeof(DescriptorProto_ExtensionRange)}, - { 47, 54, sizeof(DescriptorProto_ReservedRange)}, - { 56, 71, sizeof(DescriptorProto)}, - { 81, 87, sizeof(ExtensionRangeOptions)}, - { 88, 103, sizeof(FieldDescriptorProto)}, - { 113, 120, sizeof(OneofDescriptorProto)}, - { 122, 130, sizeof(EnumDescriptorProto)}, - { 133, 141, sizeof(EnumValueDescriptorProto)}, - { 144, 152, sizeof(ServiceDescriptorProto)}, - { 155, 166, sizeof(MethodDescriptorProto)}, - { 172, 196, sizeof(FileOptions)}, - { 215, 225, sizeof(MessageOptions)}, - { 230, 242, sizeof(FieldOptions)}, - { 249, 255, sizeof(OneofOptions)}, - { 256, 264, sizeof(EnumOptions)}, - { 267, 274, sizeof(EnumValueOptions)}, - { 276, 283, sizeof(ServiceOptions)}, - { 285, 293, sizeof(MethodOptions)}, - { 296, 303, sizeof(UninterpretedOption_NamePart)}, - { 305, 317, sizeof(UninterpretedOption)}, - { 324, 334, sizeof(SourceCodeInfo_Location)}, - { 339, 345, sizeof(SourceCodeInfo)}, - { 346, 355, sizeof(GeneratedCodeInfo_Annotation)}, - { 359, 365, sizeof(GeneratedCodeInfo)}, -}; + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsExtensionRangeOptions(); + { + void* ptr = &::google::protobuf::_DescriptorProto_ExtensionRange_default_instance_; + new (ptr) ::google::protobuf::DescriptorProto_ExtensionRange(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::DescriptorProto_ExtensionRange::InitAsDefaultInstance(); +} -static ::google::protobuf::Message const * const file_default_instances[] = { - reinterpret_cast(&_FileDescriptorSet_default_instance_), - reinterpret_cast(&_FileDescriptorProto_default_instance_), - reinterpret_cast(&_DescriptorProto_ExtensionRange_default_instance_), - reinterpret_cast(&_DescriptorProto_ReservedRange_default_instance_), - reinterpret_cast(&_DescriptorProto_default_instance_), - reinterpret_cast(&_ExtensionRangeOptions_default_instance_), - reinterpret_cast(&_FieldDescriptorProto_default_instance_), - reinterpret_cast(&_OneofDescriptorProto_default_instance_), - reinterpret_cast(&_EnumDescriptorProto_default_instance_), - reinterpret_cast(&_EnumValueDescriptorProto_default_instance_), - reinterpret_cast(&_ServiceDescriptorProto_default_instance_), - reinterpret_cast(&_MethodDescriptorProto_default_instance_), - reinterpret_cast(&_FileOptions_default_instance_), - reinterpret_cast(&_MessageOptions_default_instance_), - reinterpret_cast(&_FieldOptions_default_instance_), - reinterpret_cast(&_OneofOptions_default_instance_), - reinterpret_cast(&_EnumOptions_default_instance_), - reinterpret_cast(&_EnumValueOptions_default_instance_), - reinterpret_cast(&_ServiceOptions_default_instance_), - reinterpret_cast(&_MethodOptions_default_instance_), - reinterpret_cast(&_UninterpretedOption_NamePart_default_instance_), - reinterpret_cast(&_UninterpretedOption_default_instance_), - reinterpret_cast(&_SourceCodeInfo_Location_default_instance_), - reinterpret_cast(&_SourceCodeInfo_default_instance_), - reinterpret_cast(&_GeneratedCodeInfo_Annotation_default_instance_), - reinterpret_cast(&_GeneratedCodeInfo_default_instance_), -}; +void InitDefaultsDescriptorProto_ExtensionRange() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDescriptorProto_ExtensionRangeImpl); +} -namespace { +void InitDefaultsDescriptorProto_ReservedRangeImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; -void protobuf_AssignDescriptors() { - AddDescriptors(); - ::google::protobuf::MessageFactory* factory = NULL; - AssignDescriptors( - "google/protobuf/descriptor.proto", schemas, file_default_instances, TableStruct::offsets, factory, - file_level_metadata, file_level_enum_descriptors, NULL); + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_DescriptorProto_ReservedRange_default_instance_; + new (ptr) ::google::protobuf::DescriptorProto_ReservedRange(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::DescriptorProto_ReservedRange::InitAsDefaultInstance(); } -void protobuf_AssignDescriptorsOnce() { +void InitDefaultsDescriptorProto_ReservedRange() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDescriptorProto_ReservedRangeImpl); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; -void protobuf_RegisterTypes(const ::std::string&) { - protobuf_AssignDescriptorsOnce(); - ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 26); +void InitDefaultsDescriptorProtoImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ExtensionRange(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofDescriptorProto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMessageOptions(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ReservedRange(); + { + void* ptr = &::google::protobuf::_DescriptorProto_default_instance_; + new (ptr) ::google::protobuf::DescriptorProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::DescriptorProto::InitAsDefaultInstance(); +} + +void InitDefaultsDescriptorProto() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDescriptorProtoImpl); } -} // namespace -void TableStruct::InitDefaultsImpl() { +void InitDefaultsExtensionRangeOptionsImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::internal::InitProtobufDefaults(); - _FileDescriptorSet_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_FileDescriptorSet_default_instance_);_FileDescriptorProto_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_FileDescriptorProto_default_instance_);_DescriptorProto_ExtensionRange_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_DescriptorProto_ExtensionRange_default_instance_);_DescriptorProto_ReservedRange_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_DescriptorProto_ReservedRange_default_instance_);_DescriptorProto_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_DescriptorProto_default_instance_);_ExtensionRangeOptions_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_ExtensionRangeOptions_default_instance_);_FieldDescriptorProto_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_FieldDescriptorProto_default_instance_);_OneofDescriptorProto_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_OneofDescriptorProto_default_instance_);_EnumDescriptorProto_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_EnumDescriptorProto_default_instance_);_EnumValueDescriptorProto_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_EnumValueDescriptorProto_default_instance_);_ServiceDescriptorProto_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_ServiceDescriptorProto_default_instance_);_MethodDescriptorProto_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_MethodDescriptorProto_default_instance_);_FileOptions_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_FileOptions_default_instance_);_MessageOptions_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_MessageOptions_default_instance_);_FieldOptions_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_FieldOptions_default_instance_);_OneofOptions_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_OneofOptions_default_instance_);_EnumOptions_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_EnumOptions_default_instance_);_EnumValueOptions_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_EnumValueOptions_default_instance_);_ServiceOptions_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_ServiceOptions_default_instance_);_MethodOptions_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_MethodOptions_default_instance_);_UninterpretedOption_NamePart_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_UninterpretedOption_NamePart_default_instance_);_UninterpretedOption_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_UninterpretedOption_default_instance_);_SourceCodeInfo_Location_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_SourceCodeInfo_Location_default_instance_);_SourceCodeInfo_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_SourceCodeInfo_default_instance_);_GeneratedCodeInfo_Annotation_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_GeneratedCodeInfo_Annotation_default_instance_);_GeneratedCodeInfo_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_GeneratedCodeInfo_default_instance_);_FileDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::FileOptions*>( - ::google::protobuf::FileOptions::internal_default_instance()); - _FileDescriptorProto_default_instance_._instance.get_mutable()->source_code_info_ = const_cast< ::google::protobuf::SourceCodeInfo*>( - ::google::protobuf::SourceCodeInfo::internal_default_instance()); - _DescriptorProto_ExtensionRange_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::ExtensionRangeOptions*>( - ::google::protobuf::ExtensionRangeOptions::internal_default_instance()); - _DescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::MessageOptions*>( - ::google::protobuf::MessageOptions::internal_default_instance()); - _FieldDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::FieldOptions*>( - ::google::protobuf::FieldOptions::internal_default_instance()); - _OneofDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::OneofOptions*>( - ::google::protobuf::OneofOptions::internal_default_instance()); - _EnumDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::EnumOptions*>( - ::google::protobuf::EnumOptions::internal_default_instance()); - _EnumValueDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::EnumValueOptions*>( - ::google::protobuf::EnumValueOptions::internal_default_instance()); - _ServiceDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::ServiceOptions*>( - ::google::protobuf::ServiceOptions::internal_default_instance()); - _MethodDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::MethodOptions*>( - ::google::protobuf::MethodOptions::internal_default_instance()); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); + { + void* ptr = &::google::protobuf::_ExtensionRangeOptions_default_instance_; + new (ptr) ::google::protobuf::ExtensionRangeOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::ExtensionRangeOptions::InitAsDefaultInstance(); } -void InitDefaults() { +void InitDefaultsExtensionRangeOptions() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsExtensionRangeOptionsImpl); } -namespace { -void AddDescriptorsImpl() { - InitDefaults(); - static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - "\n google/protobuf/descriptor.proto\022\017goog" - "le.protobuf\"G\n\021FileDescriptorSet\0222\n\004file" - "\030\001 \003(\0132$.google.protobuf.FileDescriptorP" - "roto\"\333\003\n\023FileDescriptorProto\022\014\n\004name\030\001 \001" - "(\t\022\017\n\007package\030\002 \001(\t\022\022\n\ndependency\030\003 \003(\t\022" - "\031\n\021public_dependency\030\n \003(\005\022\027\n\017weak_depen" - "dency\030\013 \003(\005\0226\n\014message_type\030\004 \003(\0132 .goog" - "le.protobuf.DescriptorProto\0227\n\tenum_type" - "\030\005 \003(\0132$.google.protobuf.EnumDescriptorP" - "roto\0228\n\007service\030\006 \003(\0132\'.google.protobuf." - "ServiceDescriptorProto\0228\n\textension\030\007 \003(" - "\0132%.google.protobuf.FieldDescriptorProto" - "\022-\n\007options\030\010 \001(\0132\034.google.protobuf.File" - "Options\0229\n\020source_code_info\030\t \001(\0132\037.goog" - "le.protobuf.SourceCodeInfo\022\016\n\006syntax\030\014 \001" - "(\t\"\251\005\n\017DescriptorProto\022\014\n\004name\030\001 \001(\t\0224\n\005" - "field\030\002 \003(\0132%.google.protobuf.FieldDescr" - "iptorProto\0228\n\textension\030\006 \003(\0132%.google.p" - "rotobuf.FieldDescriptorProto\0225\n\013nested_t" - "ype\030\003 \003(\0132 .google.protobuf.DescriptorPr" - "oto\0227\n\tenum_type\030\004 \003(\0132$.google.protobuf" - ".EnumDescriptorProto\022H\n\017extension_range\030" - "\005 \003(\0132/.google.protobuf.DescriptorProto." - "ExtensionRange\0229\n\noneof_decl\030\010 \003(\0132%.goo" - "gle.protobuf.OneofDescriptorProto\0220\n\007opt" - "ions\030\007 \001(\0132\037.google.protobuf.MessageOpti" - "ons\022F\n\016reserved_range\030\t \003(\0132..google.pro" - "tobuf.DescriptorProto.ReservedRange\022\025\n\rr" - "eserved_name\030\n \003(\t\032e\n\016ExtensionRange\022\r\n\005" - "start\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\0227\n\007options\030\003 \001(" - "\0132&.google.protobuf.ExtensionRangeOption" - "s\032+\n\rReservedRange\022\r\n\005start\030\001 \001(\005\022\013\n\003end" - "\030\002 \001(\005\"g\n\025ExtensionRangeOptions\022C\n\024unint" - "erpreted_option\030\347\007 \003(\0132$.google.protobuf" - ".UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\274\005\n\024Fiel" - "dDescriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n\006number" - "\030\003 \001(\005\022:\n\005label\030\004 \001(\0162+.google.protobuf." - "FieldDescriptorProto.Label\0228\n\004type\030\005 \001(\016" - "2*.google.protobuf.FieldDescriptorProto." - "Type\022\021\n\ttype_name\030\006 \001(\t\022\020\n\010extendee\030\002 \001(" - "\t\022\025\n\rdefault_value\030\007 \001(\t\022\023\n\013oneof_index\030" - "\t \001(\005\022\021\n\tjson_name\030\n \001(\t\022.\n\007options\030\010 \001(" - "\0132\035.google.protobuf.FieldOptions\"\266\002\n\004Typ" - "e\022\017\n\013TYPE_DOUBLE\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTY" - "PE_INT64\020\003\022\017\n\013TYPE_UINT64\020\004\022\016\n\nTYPE_INT3" - "2\020\005\022\020\n\014TYPE_FIXED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022" - "\r\n\tTYPE_BOOL\020\010\022\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_" - "GROUP\020\n\022\020\n\014TYPE_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020" - "\014\022\017\n\013TYPE_UINT32\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYP" - "E_SFIXED32\020\017\022\021\n\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_" - "SINT32\020\021\022\017\n\013TYPE_SINT64\020\022\"C\n\005Label\022\022\n\016LA" - "BEL_OPTIONAL\020\001\022\022\n\016LABEL_REQUIRED\020\002\022\022\n\016LA" - "BEL_REPEATED\020\003\"T\n\024OneofDescriptorProto\022\014" - "\n\004name\030\001 \001(\t\022.\n\007options\030\002 \001(\0132\035.google.p" - "rotobuf.OneofOptions\"\214\001\n\023EnumDescriptorP" - "roto\022\014\n\004name\030\001 \001(\t\0228\n\005value\030\002 \003(\0132).goog" - "le.protobuf.EnumValueDescriptorProto\022-\n\007" - "options\030\003 \001(\0132\034.google.protobuf.EnumOpti" - "ons\"l\n\030EnumValueDescriptorProto\022\014\n\004name\030" - "\001 \001(\t\022\016\n\006number\030\002 \001(\005\0222\n\007options\030\003 \001(\0132!" - ".google.protobuf.EnumValueOptions\"\220\001\n\026Se" - "rviceDescriptorProto\022\014\n\004name\030\001 \001(\t\0226\n\006me" - "thod\030\002 \003(\0132&.google.protobuf.MethodDescr" - "iptorProto\0220\n\007options\030\003 \001(\0132\037.google.pro" - "tobuf.ServiceOptions\"\301\001\n\025MethodDescripto" - "rProto\022\014\n\004name\030\001 \001(\t\022\022\n\ninput_type\030\002 \001(\t" - "\022\023\n\013output_type\030\003 \001(\t\022/\n\007options\030\004 \001(\0132\036" - ".google.protobuf.MethodOptions\022\037\n\020client" - "_streaming\030\005 \001(\010:\005false\022\037\n\020server_stream" - "ing\030\006 \001(\010:\005false\"\360\005\n\013FileOptions\022\024\n\014java" - "_package\030\001 \001(\t\022\034\n\024java_outer_classname\030\010" - " \001(\t\022\"\n\023java_multiple_files\030\n \001(\010:\005false" - "\022)\n\035java_generate_equals_and_hash\030\024 \001(\010B" - "\002\030\001\022%\n\026java_string_check_utf8\030\033 \001(\010:\005fal" - "se\022F\n\014optimize_for\030\t \001(\0162).google.protob" - "uf.FileOptions.OptimizeMode:\005SPEED\022\022\n\ngo" - "_package\030\013 \001(\t\022\"\n\023cc_generic_services\030\020 " - "\001(\010:\005false\022$\n\025java_generic_services\030\021 \001(" - "\010:\005false\022\"\n\023py_generic_services\030\022 \001(\010:\005f" - "alse\022#\n\024php_generic_services\030\023 \001(\010:\005fals" - "e\022\031\n\ndeprecated\030\027 \001(\010:\005false\022\037\n\020cc_enabl" - "e_arenas\030\037 \001(\010:\005false\022\031\n\021objc_class_pref" - "ix\030$ \001(\t\022\030\n\020csharp_namespace\030% \001(\t\022\024\n\014sw" - "ift_prefix\030\' \001(\t\022\030\n\020php_class_prefix\030( \001" - "(\t\022\025\n\rphp_namespace\030) \001(\t\022C\n\024uninterpret" - "ed_option\030\347\007 \003(\0132$.google.protobuf.Unint" - "erpretedOption\":\n\014OptimizeMode\022\t\n\005SPEED\020" - "\001\022\r\n\tCODE_SIZE\020\002\022\020\n\014LITE_RUNTIME\020\003*\t\010\350\007\020" - "\200\200\200\200\002J\004\010&\020\'\"\362\001\n\016MessageOptions\022&\n\027messag" - "e_set_wire_format\030\001 \001(\010:\005false\022.\n\037no_sta" - "ndard_descriptor_accessor\030\002 \001(\010:\005false\022\031" - "\n\ndeprecated\030\003 \001(\010:\005false\022\021\n\tmap_entry\030\007" - " \001(\010\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.go" - "ogle.protobuf.UninterpretedOption*\t\010\350\007\020\200" - "\200\200\200\002J\004\010\010\020\tJ\004\010\t\020\n\"\236\003\n\014FieldOptions\022:\n\005cty" - "pe\030\001 \001(\0162#.google.protobuf.FieldOptions." - "CType:\006STRING\022\016\n\006packed\030\002 \001(\010\022\?\n\006jstype\030" - "\006 \001(\0162$.google.protobuf.FieldOptions.JST" - "ype:\tJS_NORMAL\022\023\n\004lazy\030\005 \001(\010:\005false\022\031\n\nd" - "eprecated\030\003 \001(\010:\005false\022\023\n\004weak\030\n \001(\010:\005fa" - "lse\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.goo" - "gle.protobuf.UninterpretedOption\"/\n\005CTyp" - "e\022\n\n\006STRING\020\000\022\010\n\004CORD\020\001\022\020\n\014STRING_PIECE\020" - "\002\"5\n\006JSType\022\r\n\tJS_NORMAL\020\000\022\r\n\tJS_STRING\020" - "\001\022\r\n\tJS_NUMBER\020\002*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005\"^\n\014One" - "ofOptions\022C\n\024uninterpreted_option\030\347\007 \003(\013" - "2$.google.protobuf.UninterpretedOption*\t" - "\010\350\007\020\200\200\200\200\002\"\223\001\n\013EnumOptions\022\023\n\013allow_alias" - "\030\002 \001(\010\022\031\n\ndeprecated\030\003 \001(\010:\005false\022C\n\024uni" - "nterpreted_option\030\347\007 \003(\0132$.google.protob" - "uf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\005\020\006\"" - "}\n\020EnumValueOptions\022\031\n\ndeprecated\030\001 \001(\010:" - "\005false\022C\n\024uninterpreted_option\030\347\007 \003(\0132$." - "google.protobuf.UninterpretedOption*\t\010\350\007" - "\020\200\200\200\200\002\"{\n\016ServiceOptions\022\031\n\ndeprecated\030!" - " \001(\010:\005false\022C\n\024uninterpreted_option\030\347\007 \003" - "(\0132$.google.protobuf.UninterpretedOption" - "*\t\010\350\007\020\200\200\200\200\002\"\255\002\n\rMethodOptions\022\031\n\ndepreca" - "ted\030! \001(\010:\005false\022_\n\021idempotency_level\030\" " - "\001(\0162/.google.protobuf.MethodOptions.Idem" - "potencyLevel:\023IDEMPOTENCY_UNKNOWN\022C\n\024uni" - "nterpreted_option\030\347\007 \003(\0132$.google.protob" - "uf.UninterpretedOption\"P\n\020IdempotencyLev" - "el\022\027\n\023IDEMPOTENCY_UNKNOWN\020\000\022\023\n\017NO_SIDE_E" - "FFECTS\020\001\022\016\n\nIDEMPOTENT\020\002*\t\010\350\007\020\200\200\200\200\002\"\236\002\n\023" - "UninterpretedOption\022;\n\004name\030\002 \003(\0132-.goog" - "le.protobuf.UninterpretedOption.NamePart" - "\022\030\n\020identifier_value\030\003 \001(\t\022\032\n\022positive_i" - "nt_value\030\004 \001(\004\022\032\n\022negative_int_value\030\005 \001" - "(\003\022\024\n\014double_value\030\006 \001(\001\022\024\n\014string_value" - "\030\007 \001(\014\022\027\n\017aggregate_value\030\010 \001(\t\0323\n\010NameP" - "art\022\021\n\tname_part\030\001 \002(\t\022\024\n\014is_extension\030\002" - " \002(\010\"\325\001\n\016SourceCodeInfo\022:\n\010location\030\001 \003(" - "\0132(.google.protobuf.SourceCodeInfo.Locat" - "ion\032\206\001\n\010Location\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004sp" - "an\030\002 \003(\005B\002\020\001\022\030\n\020leading_comments\030\003 \001(\t\022\031" - "\n\021trailing_comments\030\004 \001(\t\022!\n\031leading_det" - "ached_comments\030\006 \003(\t\"\247\001\n\021GeneratedCodeIn" - "fo\022A\n\nannotation\030\001 \003(\0132-.google.protobuf" - ".GeneratedCodeInfo.Annotation\032O\n\nAnnotat" - "ion\022\020\n\004path\030\001 \003(\005B\002\020\001\022\023\n\013source_file\030\002 \001" - "(\t\022\r\n\005begin\030\003 \001(\005\022\013\n\003end\030\004 \001(\005B\214\001\n\023com.g" - "oogle.protobufB\020DescriptorProtosH\001Z>gith" - "ub.com/golang/protobuf/protoc-gen-go/des" - "criptor;descriptor\242\002\003GPB\252\002\032Google.Protob" - "uf.Reflection" - }; - ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( - descriptor, 5813); - ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( - "google/protobuf/descriptor.proto", &protobuf_RegisterTypes); + +void InitDefaultsFieldDescriptorProtoImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldOptions(); + { + void* ptr = &::google::protobuf::_FieldDescriptorProto_default_instance_; + new (ptr) ::google::protobuf::FieldDescriptorProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::FieldDescriptorProto::InitAsDefaultInstance(); } -} // anonymous namespace -void AddDescriptors() { +void InitDefaultsFieldDescriptorProto() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFieldDescriptorProtoImpl); } -// Force AddDescriptors() to be called at dynamic initialization time. -struct StaticDescriptorInitializer { - StaticDescriptorInitializer() { - AddDescriptors(); - } -} static_descriptor_initializer; -} // namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto +void InitDefaultsOneofDescriptorProtoImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; -const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[0]; + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofOptions(); + { + void* ptr = &::google::protobuf::_OneofDescriptorProto_default_instance_; + new (ptr) ::google::protobuf::OneofDescriptorProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::OneofDescriptorProto::InitAsDefaultInstance(); } -bool FieldDescriptorProto_Type_IsValid(int value) { - switch (value) { - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - return true; - default: - return false; + +void InitDefaultsOneofDescriptorProto() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsOneofDescriptorProtoImpl); +} + +void InitDefaultsEnumDescriptorProto_EnumReservedRangeImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_EnumDescriptorProto_EnumReservedRange_default_instance_; + new (ptr) ::google::protobuf::EnumDescriptorProto_EnumReservedRange(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } + ::google::protobuf::EnumDescriptorProto_EnumReservedRange::InitAsDefaultInstance(); } -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_DOUBLE; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FLOAT; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT64; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT64; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT32; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED64; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED32; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BOOL; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_STRING; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_GROUP; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_MESSAGE; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BYTES; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT32; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_ENUM; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED32; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED64; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT32; -const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT64; -const FieldDescriptorProto_Type FieldDescriptorProto::Type_MIN; -const FieldDescriptorProto_Type FieldDescriptorProto::Type_MAX; -const int FieldDescriptorProto::Type_ARRAYSIZE; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[1]; +void InitDefaultsEnumDescriptorProto_EnumReservedRange() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumDescriptorProto_EnumReservedRangeImpl); } -bool FieldDescriptorProto_Label_IsValid(int value) { - switch (value) { - case 1: - case 2: - case 3: - return true; - default: - return false; + +void InitDefaultsEnumDescriptorProtoImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueDescriptorProto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumOptions(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto_EnumReservedRange(); + { + void* ptr = &::google::protobuf::_EnumDescriptorProto_default_instance_; + new (ptr) ::google::protobuf::EnumDescriptorProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } + ::google::protobuf::EnumDescriptorProto::InitAsDefaultInstance(); } -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_OPTIONAL; -const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REQUIRED; -const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REPEATED; -const FieldDescriptorProto_Label FieldDescriptorProto::Label_MIN; -const FieldDescriptorProto_Label FieldDescriptorProto::Label_MAX; -const int FieldDescriptorProto::Label_ARRAYSIZE; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[2]; +void InitDefaultsEnumDescriptorProto() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumDescriptorProtoImpl); } -bool FileOptions_OptimizeMode_IsValid(int value) { - switch (value) { - case 1: - case 2: - case 3: - return true; - default: - return false; + +void InitDefaultsEnumValueDescriptorProtoImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueOptions(); + { + void* ptr = &::google::protobuf::_EnumValueDescriptorProto_default_instance_; + new (ptr) ::google::protobuf::EnumValueDescriptorProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } + ::google::protobuf::EnumValueDescriptorProto::InitAsDefaultInstance(); } -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const FileOptions_OptimizeMode FileOptions::SPEED; -const FileOptions_OptimizeMode FileOptions::CODE_SIZE; -const FileOptions_OptimizeMode FileOptions::LITE_RUNTIME; -const FileOptions_OptimizeMode FileOptions::OptimizeMode_MIN; -const FileOptions_OptimizeMode FileOptions::OptimizeMode_MAX; -const int FileOptions::OptimizeMode_ARRAYSIZE; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[3]; +void InitDefaultsEnumValueDescriptorProto() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumValueDescriptorProtoImpl); } -bool FieldOptions_CType_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - return true; - default: - return false; + +void InitDefaultsServiceDescriptorProtoImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodDescriptorProto(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceOptions(); + { + void* ptr = &::google::protobuf::_ServiceDescriptorProto_default_instance_; + new (ptr) ::google::protobuf::ServiceDescriptorProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } + ::google::protobuf::ServiceDescriptorProto::InitAsDefaultInstance(); } -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const FieldOptions_CType FieldOptions::STRING; -const FieldOptions_CType FieldOptions::CORD; -const FieldOptions_CType FieldOptions::STRING_PIECE; -const FieldOptions_CType FieldOptions::CType_MIN; -const FieldOptions_CType FieldOptions::CType_MAX; -const int FieldOptions::CType_ARRAYSIZE; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -const ::google::protobuf::EnumDescriptor* FieldOptions_JSType_descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[4]; +void InitDefaultsServiceDescriptorProto() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsServiceDescriptorProtoImpl); } -bool FieldOptions_JSType_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - return true; - default: - return false; + +void InitDefaultsMethodDescriptorProtoImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodOptions(); + { + void* ptr = &::google::protobuf::_MethodDescriptorProto_default_instance_; + new (ptr) ::google::protobuf::MethodDescriptorProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } + ::google::protobuf::MethodDescriptorProto::InitAsDefaultInstance(); } -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const FieldOptions_JSType FieldOptions::JS_NORMAL; -const FieldOptions_JSType FieldOptions::JS_STRING; -const FieldOptions_JSType FieldOptions::JS_NUMBER; -const FieldOptions_JSType FieldOptions::JSType_MIN; -const FieldOptions_JSType FieldOptions::JSType_MAX; -const int FieldOptions::JSType_ARRAYSIZE; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -const ::google::protobuf::EnumDescriptor* MethodOptions_IdempotencyLevel_descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[5]; +void InitDefaultsMethodDescriptorProto() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMethodDescriptorProtoImpl); } -bool MethodOptions_IdempotencyLevel_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - return true; - default: - return false; + +void InitDefaultsFileOptionsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); + { + void* ptr = &::google::protobuf::_FileOptions_default_instance_; + new (ptr) ::google::protobuf::FileOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } + ::google::protobuf::FileOptions::InitAsDefaultInstance(); } -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const MethodOptions_IdempotencyLevel MethodOptions::IDEMPOTENCY_UNKNOWN; -const MethodOptions_IdempotencyLevel MethodOptions::NO_SIDE_EFFECTS; -const MethodOptions_IdempotencyLevel MethodOptions::IDEMPOTENT; -const MethodOptions_IdempotencyLevel MethodOptions::IdempotencyLevel_MIN; -const MethodOptions_IdempotencyLevel MethodOptions::IdempotencyLevel_MAX; -const int MethodOptions::IdempotencyLevel_ARRAYSIZE; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +void InitDefaultsFileOptions() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFileOptionsImpl); +} -// =================================================================== +void InitDefaultsMessageOptionsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int FileDescriptorSet::kFileFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); + { + void* ptr = &::google::protobuf::_MessageOptions_default_instance_; + new (ptr) ::google::protobuf::MessageOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::MessageOptions::InitAsDefaultInstance(); +} -FileDescriptorSet::FileDescriptorSet() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); +void InitDefaultsMessageOptions() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMessageOptionsImpl); +} + +void InitDefaultsFieldOptionsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); + { + void* ptr = &::google::protobuf::_FieldOptions_default_instance_; + new (ptr) ::google::protobuf::FieldOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } - SharedCtor(); - // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorSet) + ::google::protobuf::FieldOptions::InitAsDefaultInstance(); } -FileDescriptorSet::FileDescriptorSet(const FileDescriptorSet& from) - : ::google::protobuf::Message(), - _internal_metadata_(NULL), - _has_bits_(from._has_bits_), - _cached_size_(0), - file_(from.file_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:google.protobuf.FileDescriptorSet) + +void InitDefaultsFieldOptions() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFieldOptionsImpl); } -void FileDescriptorSet::SharedCtor() { - _cached_size_ = 0; +void InitDefaultsOneofOptionsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); + { + void* ptr = &::google::protobuf::_OneofOptions_default_instance_; + new (ptr) ::google::protobuf::OneofOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::OneofOptions::InitAsDefaultInstance(); } -FileDescriptorSet::~FileDescriptorSet() { - // @@protoc_insertion_point(destructor:google.protobuf.FileDescriptorSet) - SharedDtor(); +void InitDefaultsOneofOptions() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsOneofOptionsImpl); } -void FileDescriptorSet::SharedDtor() { +void InitDefaultsEnumOptionsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); + { + void* ptr = &::google::protobuf::_EnumOptions_default_instance_; + new (ptr) ::google::protobuf::EnumOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::EnumOptions::InitAsDefaultInstance(); } -void FileDescriptorSet::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); +void InitDefaultsEnumOptions() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumOptionsImpl); } -const ::google::protobuf::Descriptor* FileDescriptorSet::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + +void InitDefaultsEnumValueOptionsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); + { + void* ptr = &::google::protobuf::_EnumValueOptions_default_instance_; + new (ptr) ::google::protobuf::EnumValueOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::EnumValueOptions::InitAsDefaultInstance(); } -const FileDescriptorSet& FileDescriptorSet::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); - return *internal_default_instance(); +void InitDefaultsEnumValueOptions() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumValueOptionsImpl); } -FileDescriptorSet* FileDescriptorSet::New(::google::protobuf::Arena* arena) const { - FileDescriptorSet* n = new FileDescriptorSet; - if (arena != NULL) { - arena->Own(n); +void InitDefaultsServiceOptionsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); + { + void* ptr = &::google::protobuf::_ServiceOptions_default_instance_; + new (ptr) ::google::protobuf::ServiceOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } - return n; + ::google::protobuf::ServiceOptions::InitAsDefaultInstance(); } -void FileDescriptorSet::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.FileDescriptorSet) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; +void InitDefaultsServiceOptions() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsServiceOptionsImpl); +} - file_.Clear(); - _has_bits_.Clear(); - _internal_metadata_.Clear(); +void InitDefaultsMethodOptionsImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); + { + void* ptr = &::google::protobuf::_MethodOptions_default_instance_; + new (ptr) ::google::protobuf::MethodOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::MethodOptions::InitAsDefaultInstance(); } -bool FileDescriptorSet::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure - ::google::protobuf::uint32 tag; - // @@protoc_insertion_point(parse_start:google.protobuf.FileDescriptorSet) - for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .google.protobuf.FileDescriptorProto file = 1; - case 1: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_file())); - } else { - goto handle_unusual; - } - break; - } +void InitDefaultsMethodOptions() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMethodOptionsImpl); +} - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } +void InitDefaultsUninterpretedOption_NamePartImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_UninterpretedOption_NamePart_default_instance_; + new (ptr) ::google::protobuf::UninterpretedOption_NamePart(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } -success: - // @@protoc_insertion_point(parse_success:google.protobuf.FileDescriptorSet) - return true; -failure: - // @@protoc_insertion_point(parse_failure:google.protobuf.FileDescriptorSet) - return false; -#undef DO_ + ::google::protobuf::UninterpretedOption_NamePart::InitAsDefaultInstance(); } -void FileDescriptorSet::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:google.protobuf.FileDescriptorSet) - ::google::protobuf::uint32 cached_has_bits = 0; - (void) cached_has_bits; +void InitDefaultsUninterpretedOption_NamePart() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsUninterpretedOption_NamePartImpl); +} - // repeated .google.protobuf.FileDescriptorProto file = 1; - for (unsigned int i = 0, - n = static_cast(this->file_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, this->file(static_cast(i)), output); +void InitDefaultsUninterpretedOptionImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption_NamePart(); + { + void* ptr = &::google::protobuf::_UninterpretedOption_default_instance_; + new (ptr) ::google::protobuf::UninterpretedOption(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } + ::google::protobuf::UninterpretedOption::InitAsDefaultInstance(); +} - if (_internal_metadata_.have_unknown_fields()) { - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); +void InitDefaultsUninterpretedOption() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsUninterpretedOptionImpl); +} + +void InitDefaultsSourceCodeInfo_LocationImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_SourceCodeInfo_Location_default_instance_; + new (ptr) ::google::protobuf::SourceCodeInfo_Location(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } - // @@protoc_insertion_point(serialize_end:google.protobuf.FileDescriptorSet) + ::google::protobuf::SourceCodeInfo_Location::InitAsDefaultInstance(); } -::google::protobuf::uint8* FileDescriptorSet::InternalSerializeWithCachedSizesToArray( - bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorSet) - ::google::protobuf::uint32 cached_has_bits = 0; - (void) cached_has_bits; +void InitDefaultsSourceCodeInfo_Location() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSourceCodeInfo_LocationImpl); +} - // repeated .google.protobuf.FileDescriptorProto file = 1; - for (unsigned int i = 0, - n = static_cast(this->file_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 1, this->file(static_cast(i)), deterministic, target); +void InitDefaultsSourceCodeInfoImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo_Location(); + { + void* ptr = &::google::protobuf::_SourceCodeInfo_default_instance_; + new (ptr) ::google::protobuf::SourceCodeInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } + ::google::protobuf::SourceCodeInfo::InitAsDefaultInstance(); +} - if (_internal_metadata_.have_unknown_fields()) { - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); +void InitDefaultsSourceCodeInfo() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSourceCodeInfoImpl); +} + +void InitDefaultsGeneratedCodeInfo_AnnotationImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_GeneratedCodeInfo_Annotation_default_instance_; + new (ptr) ::google::protobuf::GeneratedCodeInfo_Annotation(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileDescriptorSet) - return target; + ::google::protobuf::GeneratedCodeInfo_Annotation::InitAsDefaultInstance(); +} + +void InitDefaultsGeneratedCodeInfo_Annotation() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsGeneratedCodeInfo_AnnotationImpl); +} + +void InitDefaultsGeneratedCodeInfoImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo_Annotation(); + { + void* ptr = &::google::protobuf::_GeneratedCodeInfo_default_instance_; + new (ptr) ::google::protobuf::GeneratedCodeInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::GeneratedCodeInfo::InitAsDefaultInstance(); } -size_t FileDescriptorSet::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FileDescriptorSet) - size_t total_size = 0; +void InitDefaultsGeneratedCodeInfo() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsGeneratedCodeInfoImpl); +} + +::google::protobuf::Metadata file_level_metadata[27]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[6]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorSet, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorSet, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorSet, file_), + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, package_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, dependency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, public_dependency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, weak_dependency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, message_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, enum_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, service_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, extension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, source_code_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorProto, syntax_), + 0, + 1, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + 3, + 4, + 2, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ExtensionRange, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ExtensionRange, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ExtensionRange, start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ExtensionRange, end_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ExtensionRange, options_), + 1, + 2, + 0, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ReservedRange, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ReservedRange, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ReservedRange, start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto_ReservedRange, end_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, field_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, extension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, nested_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, enum_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, extension_range_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, oneof_decl_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, reserved_range_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DescriptorProto, reserved_name_), + 0, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + 1, + ~0u, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, _extensions_), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, uninterpreted_option_), + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, label_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, type_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, extendee_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, default_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, oneof_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, json_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, options_), + 0, + 6, + 8, + 9, + 2, + 1, + 3, + 7, + 4, + 5, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofDescriptorProto, options_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto_EnumReservedRange, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto_EnumReservedRange, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto_EnumReservedRange, start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto_EnumReservedRange, end_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto, value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto, reserved_range_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumDescriptorProto, reserved_name_), + 0, + ~0u, + 1, + ~0u, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueDescriptorProto, number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueDescriptorProto, options_), + 0, + 2, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceDescriptorProto, method_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceDescriptorProto, options_), + 0, + ~0u, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, input_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, output_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, client_streaming_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodDescriptorProto, server_streaming_), + 0, + 1, + 2, + 3, + 4, + 5, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, _extensions_), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_package_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_outer_classname_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_multiple_files_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_generate_equals_and_hash_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_string_check_utf8_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, optimize_for_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, go_package_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, cc_generic_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, java_generic_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, py_generic_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, php_generic_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, cc_enable_arenas_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, objc_class_prefix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, csharp_namespace_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, swift_prefix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, php_class_prefix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, php_namespace_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileOptions, uninterpreted_option_), + 0, + 1, + 9, + 10, + 11, + 17, + 2, + 12, + 13, + 14, + 15, + 16, + 8, + 3, + 4, + 5, + 6, + 7, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, _extensions_), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, message_set_wire_format_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, no_standard_descriptor_accessor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, map_entry_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MessageOptions, uninterpreted_option_), + 0, + 1, + 2, + 3, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, _extensions_), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, ctype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, packed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, jstype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, lazy_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, weak_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldOptions, uninterpreted_option_), + 0, + 1, + 5, + 2, + 3, + 4, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofOptions, _extensions_), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::OneofOptions, uninterpreted_option_), + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, _extensions_), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, allow_alias_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumOptions, uninterpreted_option_), + 0, + 1, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _extensions_), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValueOptions, uninterpreted_option_), + 0, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceOptions, _extensions_), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ServiceOptions, uninterpreted_option_), + 0, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, _extensions_), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, idempotency_level_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::MethodOptions, uninterpreted_option_), + 0, + 1, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption_NamePart, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption_NamePart, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption_NamePart, name_part_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption_NamePart, is_extension_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, identifier_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, positive_int_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, negative_int_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, double_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, string_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UninterpretedOption, aggregate_value_), + ~0u, + 0, + 3, + 4, + 5, + 1, + 2, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, span_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, leading_comments_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, trailing_comments_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, leading_detached_comments_), + ~0u, + ~0u, + 0, + 1, + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo, location_), + ~0u, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, source_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, begin_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo_Annotation, end_), + ~0u, + 0, + 1, + 2, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::GeneratedCodeInfo, annotation_), + ~0u, +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 6, sizeof(::google::protobuf::FileDescriptorSet)}, + { 7, 24, sizeof(::google::protobuf::FileDescriptorProto)}, + { 36, 44, sizeof(::google::protobuf::DescriptorProto_ExtensionRange)}, + { 47, 54, sizeof(::google::protobuf::DescriptorProto_ReservedRange)}, + { 56, 71, sizeof(::google::protobuf::DescriptorProto)}, + { 81, 87, sizeof(::google::protobuf::ExtensionRangeOptions)}, + { 88, 103, sizeof(::google::protobuf::FieldDescriptorProto)}, + { 113, 120, sizeof(::google::protobuf::OneofDescriptorProto)}, + { 122, 129, sizeof(::google::protobuf::EnumDescriptorProto_EnumReservedRange)}, + { 131, 141, sizeof(::google::protobuf::EnumDescriptorProto)}, + { 146, 154, sizeof(::google::protobuf::EnumValueDescriptorProto)}, + { 157, 165, sizeof(::google::protobuf::ServiceDescriptorProto)}, + { 168, 179, sizeof(::google::protobuf::MethodDescriptorProto)}, + { 185, 209, sizeof(::google::protobuf::FileOptions)}, + { 228, 238, sizeof(::google::protobuf::MessageOptions)}, + { 243, 255, sizeof(::google::protobuf::FieldOptions)}, + { 262, 268, sizeof(::google::protobuf::OneofOptions)}, + { 269, 277, sizeof(::google::protobuf::EnumOptions)}, + { 280, 287, sizeof(::google::protobuf::EnumValueOptions)}, + { 289, 296, sizeof(::google::protobuf::ServiceOptions)}, + { 298, 306, sizeof(::google::protobuf::MethodOptions)}, + { 309, 316, sizeof(::google::protobuf::UninterpretedOption_NamePart)}, + { 318, 330, sizeof(::google::protobuf::UninterpretedOption)}, + { 337, 347, sizeof(::google::protobuf::SourceCodeInfo_Location)}, + { 352, 358, sizeof(::google::protobuf::SourceCodeInfo)}, + { 359, 368, sizeof(::google::protobuf::GeneratedCodeInfo_Annotation)}, + { 372, 378, sizeof(::google::protobuf::GeneratedCodeInfo)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::google::protobuf::_FileDescriptorSet_default_instance_), + reinterpret_cast(&::google::protobuf::_FileDescriptorProto_default_instance_), + reinterpret_cast(&::google::protobuf::_DescriptorProto_ExtensionRange_default_instance_), + reinterpret_cast(&::google::protobuf::_DescriptorProto_ReservedRange_default_instance_), + reinterpret_cast(&::google::protobuf::_DescriptorProto_default_instance_), + reinterpret_cast(&::google::protobuf::_ExtensionRangeOptions_default_instance_), + reinterpret_cast(&::google::protobuf::_FieldDescriptorProto_default_instance_), + reinterpret_cast(&::google::protobuf::_OneofDescriptorProto_default_instance_), + reinterpret_cast(&::google::protobuf::_EnumDescriptorProto_EnumReservedRange_default_instance_), + reinterpret_cast(&::google::protobuf::_EnumDescriptorProto_default_instance_), + reinterpret_cast(&::google::protobuf::_EnumValueDescriptorProto_default_instance_), + reinterpret_cast(&::google::protobuf::_ServiceDescriptorProto_default_instance_), + reinterpret_cast(&::google::protobuf::_MethodDescriptorProto_default_instance_), + reinterpret_cast(&::google::protobuf::_FileOptions_default_instance_), + reinterpret_cast(&::google::protobuf::_MessageOptions_default_instance_), + reinterpret_cast(&::google::protobuf::_FieldOptions_default_instance_), + reinterpret_cast(&::google::protobuf::_OneofOptions_default_instance_), + reinterpret_cast(&::google::protobuf::_EnumOptions_default_instance_), + reinterpret_cast(&::google::protobuf::_EnumValueOptions_default_instance_), + reinterpret_cast(&::google::protobuf::_ServiceOptions_default_instance_), + reinterpret_cast(&::google::protobuf::_MethodOptions_default_instance_), + reinterpret_cast(&::google::protobuf::_UninterpretedOption_NamePart_default_instance_), + reinterpret_cast(&::google::protobuf::_UninterpretedOption_default_instance_), + reinterpret_cast(&::google::protobuf::_SourceCodeInfo_Location_default_instance_), + reinterpret_cast(&::google::protobuf::_SourceCodeInfo_default_instance_), + reinterpret_cast(&::google::protobuf::_GeneratedCodeInfo_Annotation_default_instance_), + reinterpret_cast(&::google::protobuf::_GeneratedCodeInfo_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + ::google::protobuf::MessageFactory* factory = NULL; + AssignDescriptors( + "google/protobuf/descriptor.proto", schemas, file_default_instances, TableStruct::offsets, factory, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 27); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n google/protobuf/descriptor.proto\022\017goog" + "le.protobuf\"G\n\021FileDescriptorSet\0222\n\004file" + "\030\001 \003(\0132$.google.protobuf.FileDescriptorP" + "roto\"\333\003\n\023FileDescriptorProto\022\014\n\004name\030\001 \001" + "(\t\022\017\n\007package\030\002 \001(\t\022\022\n\ndependency\030\003 \003(\t\022" + "\031\n\021public_dependency\030\n \003(\005\022\027\n\017weak_depen" + "dency\030\013 \003(\005\0226\n\014message_type\030\004 \003(\0132 .goog" + "le.protobuf.DescriptorProto\0227\n\tenum_type" + "\030\005 \003(\0132$.google.protobuf.EnumDescriptorP" + "roto\0228\n\007service\030\006 \003(\0132\'.google.protobuf." + "ServiceDescriptorProto\0228\n\textension\030\007 \003(" + "\0132%.google.protobuf.FieldDescriptorProto" + "\022-\n\007options\030\010 \001(\0132\034.google.protobuf.File" + "Options\0229\n\020source_code_info\030\t \001(\0132\037.goog" + "le.protobuf.SourceCodeInfo\022\016\n\006syntax\030\014 \001" + "(\t\"\251\005\n\017DescriptorProto\022\014\n\004name\030\001 \001(\t\0224\n\005" + "field\030\002 \003(\0132%.google.protobuf.FieldDescr" + "iptorProto\0228\n\textension\030\006 \003(\0132%.google.p" + "rotobuf.FieldDescriptorProto\0225\n\013nested_t" + "ype\030\003 \003(\0132 .google.protobuf.DescriptorPr" + "oto\0227\n\tenum_type\030\004 \003(\0132$.google.protobuf" + ".EnumDescriptorProto\022H\n\017extension_range\030" + "\005 \003(\0132/.google.protobuf.DescriptorProto." + "ExtensionRange\0229\n\noneof_decl\030\010 \003(\0132%.goo" + "gle.protobuf.OneofDescriptorProto\0220\n\007opt" + "ions\030\007 \001(\0132\037.google.protobuf.MessageOpti" + "ons\022F\n\016reserved_range\030\t \003(\0132..google.pro" + "tobuf.DescriptorProto.ReservedRange\022\025\n\rr" + "eserved_name\030\n \003(\t\032e\n\016ExtensionRange\022\r\n\005" + "start\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\0227\n\007options\030\003 \001(" + "\0132&.google.protobuf.ExtensionRangeOption" + "s\032+\n\rReservedRange\022\r\n\005start\030\001 \001(\005\022\013\n\003end" + "\030\002 \001(\005\"g\n\025ExtensionRangeOptions\022C\n\024unint" + "erpreted_option\030\347\007 \003(\0132$.google.protobuf" + ".UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\274\005\n\024Fiel" + "dDescriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n\006number" + "\030\003 \001(\005\022:\n\005label\030\004 \001(\0162+.google.protobuf." + "FieldDescriptorProto.Label\0228\n\004type\030\005 \001(\016" + "2*.google.protobuf.FieldDescriptorProto." + "Type\022\021\n\ttype_name\030\006 \001(\t\022\020\n\010extendee\030\002 \001(" + "\t\022\025\n\rdefault_value\030\007 \001(\t\022\023\n\013oneof_index\030" + "\t \001(\005\022\021\n\tjson_name\030\n \001(\t\022.\n\007options\030\010 \001(" + "\0132\035.google.protobuf.FieldOptions\"\266\002\n\004Typ" + "e\022\017\n\013TYPE_DOUBLE\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTY" + "PE_INT64\020\003\022\017\n\013TYPE_UINT64\020\004\022\016\n\nTYPE_INT3" + "2\020\005\022\020\n\014TYPE_FIXED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022" + "\r\n\tTYPE_BOOL\020\010\022\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_" + "GROUP\020\n\022\020\n\014TYPE_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020" + "\014\022\017\n\013TYPE_UINT32\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYP" + "E_SFIXED32\020\017\022\021\n\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_" + "SINT32\020\021\022\017\n\013TYPE_SINT64\020\022\"C\n\005Label\022\022\n\016LA" + "BEL_OPTIONAL\020\001\022\022\n\016LABEL_REQUIRED\020\002\022\022\n\016LA" + "BEL_REPEATED\020\003\"T\n\024OneofDescriptorProto\022\014" + "\n\004name\030\001 \001(\t\022.\n\007options\030\002 \001(\0132\035.google.p" + "rotobuf.OneofOptions\"\244\002\n\023EnumDescriptorP" + "roto\022\014\n\004name\030\001 \001(\t\0228\n\005value\030\002 \003(\0132).goog" + "le.protobuf.EnumValueDescriptorProto\022-\n\007" + "options\030\003 \001(\0132\034.google.protobuf.EnumOpti" + "ons\022N\n\016reserved_range\030\004 \003(\01326.google.pro" + "tobuf.EnumDescriptorProto.EnumReservedRa" + "nge\022\025\n\rreserved_name\030\005 \003(\t\032/\n\021EnumReserv" + "edRange\022\r\n\005start\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\"l\n\030E" + "numValueDescriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n" + "\006number\030\002 \001(\005\0222\n\007options\030\003 \001(\0132!.google." + "protobuf.EnumValueOptions\"\220\001\n\026ServiceDes" + "criptorProto\022\014\n\004name\030\001 \001(\t\0226\n\006method\030\002 \003" + "(\0132&.google.protobuf.MethodDescriptorPro" + "to\0220\n\007options\030\003 \001(\0132\037.google.protobuf.Se" + "rviceOptions\"\301\001\n\025MethodDescriptorProto\022\014" + "\n\004name\030\001 \001(\t\022\022\n\ninput_type\030\002 \001(\t\022\023\n\013outp" + "ut_type\030\003 \001(\t\022/\n\007options\030\004 \001(\0132\036.google." + "protobuf.MethodOptions\022\037\n\020client_streami" + "ng\030\005 \001(\010:\005false\022\037\n\020server_streaming\030\006 \001(" + "\010:\005false\"\360\005\n\013FileOptions\022\024\n\014java_package" + "\030\001 \001(\t\022\034\n\024java_outer_classname\030\010 \001(\t\022\"\n\023" + "java_multiple_files\030\n \001(\010:\005false\022)\n\035java" + "_generate_equals_and_hash\030\024 \001(\010B\002\030\001\022%\n\026j" + "ava_string_check_utf8\030\033 \001(\010:\005false\022F\n\014op" + "timize_for\030\t \001(\0162).google.protobuf.FileO" + "ptions.OptimizeMode:\005SPEED\022\022\n\ngo_package" + "\030\013 \001(\t\022\"\n\023cc_generic_services\030\020 \001(\010:\005fal" + "se\022$\n\025java_generic_services\030\021 \001(\010:\005false" + "\022\"\n\023py_generic_services\030\022 \001(\010:\005false\022#\n\024" + "php_generic_services\030* \001(\010:\005false\022\031\n\ndep" + "recated\030\027 \001(\010:\005false\022\037\n\020cc_enable_arenas" + "\030\037 \001(\010:\005false\022\031\n\021objc_class_prefix\030$ \001(\t" + "\022\030\n\020csharp_namespace\030% \001(\t\022\024\n\014swift_pref" + "ix\030\' \001(\t\022\030\n\020php_class_prefix\030( \001(\t\022\025\n\rph" + "p_namespace\030) \001(\t\022C\n\024uninterpreted_optio" + "n\030\347\007 \003(\0132$.google.protobuf.Uninterpreted" + "Option\":\n\014OptimizeMode\022\t\n\005SPEED\020\001\022\r\n\tCOD" + "E_SIZE\020\002\022\020\n\014LITE_RUNTIME\020\003*\t\010\350\007\020\200\200\200\200\002J\004\010" + "&\020\'\"\362\001\n\016MessageOptions\022&\n\027message_set_wi" + "re_format\030\001 \001(\010:\005false\022.\n\037no_standard_de" + "scriptor_accessor\030\002 \001(\010:\005false\022\031\n\ndeprec" + "ated\030\003 \001(\010:\005false\022\021\n\tmap_entry\030\007 \001(\010\022C\n\024" + "uninterpreted_option\030\347\007 \003(\0132$.google.pro" + "tobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\010" + "\020\tJ\004\010\t\020\n\"\236\003\n\014FieldOptions\022:\n\005ctype\030\001 \001(\016" + "2#.google.protobuf.FieldOptions.CType:\006S" + "TRING\022\016\n\006packed\030\002 \001(\010\022\?\n\006jstype\030\006 \001(\0162$." + "google.protobuf.FieldOptions.JSType:\tJS_" + "NORMAL\022\023\n\004lazy\030\005 \001(\010:\005false\022\031\n\ndeprecate" + "d\030\003 \001(\010:\005false\022\023\n\004weak\030\n \001(\010:\005false\022C\n\024u" + "ninterpreted_option\030\347\007 \003(\0132$.google.prot" + "obuf.UninterpretedOption\"/\n\005CType\022\n\n\006STR" + "ING\020\000\022\010\n\004CORD\020\001\022\020\n\014STRING_PIECE\020\002\"5\n\006JST" + "ype\022\r\n\tJS_NORMAL\020\000\022\r\n\tJS_STRING\020\001\022\r\n\tJS_" + "NUMBER\020\002*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005\"^\n\014OneofOption" + "s\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.googl" + "e.protobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200" + "\002\"\223\001\n\013EnumOptions\022\023\n\013allow_alias\030\002 \001(\010\022\031" + "\n\ndeprecated\030\003 \001(\010:\005false\022C\n\024uninterpret" + "ed_option\030\347\007 \003(\0132$.google.protobuf.Unint" + "erpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\005\020\006\"}\n\020EnumV" + "alueOptions\022\031\n\ndeprecated\030\001 \001(\010:\005false\022C" + "\n\024uninterpreted_option\030\347\007 \003(\0132$.google.p" + "rotobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"{" + "\n\016ServiceOptions\022\031\n\ndeprecated\030! \001(\010:\005fa" + "lse\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.goo" + "gle.protobuf.UninterpretedOption*\t\010\350\007\020\200\200" + "\200\200\002\"\255\002\n\rMethodOptions\022\031\n\ndeprecated\030! \001(" + "\010:\005false\022_\n\021idempotency_level\030\" \001(\0162/.go" + "ogle.protobuf.MethodOptions.IdempotencyL" + "evel:\023IDEMPOTENCY_UNKNOWN\022C\n\024uninterpret" + "ed_option\030\347\007 \003(\0132$.google.protobuf.Unint" + "erpretedOption\"P\n\020IdempotencyLevel\022\027\n\023ID" + "EMPOTENCY_UNKNOWN\020\000\022\023\n\017NO_SIDE_EFFECTS\020\001" + "\022\016\n\nIDEMPOTENT\020\002*\t\010\350\007\020\200\200\200\200\002\"\236\002\n\023Uninterp" + "retedOption\022;\n\004name\030\002 \003(\0132-.google.proto" + "buf.UninterpretedOption.NamePart\022\030\n\020iden" + "tifier_value\030\003 \001(\t\022\032\n\022positive_int_value" + "\030\004 \001(\004\022\032\n\022negative_int_value\030\005 \001(\003\022\024\n\014do" + "uble_value\030\006 \001(\001\022\024\n\014string_value\030\007 \001(\014\022\027" + "\n\017aggregate_value\030\010 \001(\t\0323\n\010NamePart\022\021\n\tn" + "ame_part\030\001 \002(\t\022\024\n\014is_extension\030\002 \002(\010\"\325\001\n" + "\016SourceCodeInfo\022:\n\010location\030\001 \003(\0132(.goog" + "le.protobuf.SourceCodeInfo.Location\032\206\001\n\010" + "Location\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005" + "B\002\020\001\022\030\n\020leading_comments\030\003 \001(\t\022\031\n\021traili" + "ng_comments\030\004 \001(\t\022!\n\031leading_detached_co" + "mments\030\006 \003(\t\"\247\001\n\021GeneratedCodeInfo\022A\n\nan" + "notation\030\001 \003(\0132-.google.protobuf.Generat" + "edCodeInfo.Annotation\032O\n\nAnnotation\022\020\n\004p" + "ath\030\001 \003(\005B\002\020\001\022\023\n\013source_file\030\002 \001(\t\022\r\n\005be" + "gin\030\003 \001(\005\022\013\n\003end\030\004 \001(\005B\217\001\n\023com.google.pr" + "otobufB\020DescriptorProtosH\001Z>github.com/g" + "olang/protobuf/protoc-gen-go/descriptor;" + "descriptor\370\001\001\242\002\003GPB\252\002\032Google.Protobuf.Re" + "flection" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 5968); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "google/protobuf/descriptor.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto +namespace google { +namespace protobuf { +const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor() { + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[0]; +} +bool FieldDescriptorProto_Type_IsValid(int value) { + switch (value) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_DOUBLE; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FLOAT; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT64; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT64; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT32; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED64; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED32; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BOOL; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_STRING; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_GROUP; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_MESSAGE; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BYTES; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT32; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_ENUM; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED32; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED64; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT32; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT64; +const FieldDescriptorProto_Type FieldDescriptorProto::Type_MIN; +const FieldDescriptorProto_Type FieldDescriptorProto::Type_MAX; +const int FieldDescriptorProto::Type_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor() { + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[1]; +} +bool FieldDescriptorProto_Label_IsValid(int value) { + switch (value) { + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_OPTIONAL; +const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REQUIRED; +const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REPEATED; +const FieldDescriptorProto_Label FieldDescriptorProto::Label_MIN; +const FieldDescriptorProto_Label FieldDescriptorProto::Label_MAX; +const int FieldDescriptorProto::Label_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor() { + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[2]; +} +bool FileOptions_OptimizeMode_IsValid(int value) { + switch (value) { + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FileOptions_OptimizeMode FileOptions::SPEED; +const FileOptions_OptimizeMode FileOptions::CODE_SIZE; +const FileOptions_OptimizeMode FileOptions::LITE_RUNTIME; +const FileOptions_OptimizeMode FileOptions::OptimizeMode_MIN; +const FileOptions_OptimizeMode FileOptions::OptimizeMode_MAX; +const int FileOptions::OptimizeMode_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor() { + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[3]; +} +bool FieldOptions_CType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FieldOptions_CType FieldOptions::STRING; +const FieldOptions_CType FieldOptions::CORD; +const FieldOptions_CType FieldOptions::STRING_PIECE; +const FieldOptions_CType FieldOptions::CType_MIN; +const FieldOptions_CType FieldOptions::CType_MAX; +const int FieldOptions::CType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* FieldOptions_JSType_descriptor() { + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[4]; +} +bool FieldOptions_JSType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FieldOptions_JSType FieldOptions::JS_NORMAL; +const FieldOptions_JSType FieldOptions::JS_STRING; +const FieldOptions_JSType FieldOptions::JS_NUMBER; +const FieldOptions_JSType FieldOptions::JSType_MIN; +const FieldOptions_JSType FieldOptions::JSType_MAX; +const int FieldOptions::JSType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* MethodOptions_IdempotencyLevel_descriptor() { + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_enum_descriptors[5]; +} +bool MethodOptions_IdempotencyLevel_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const MethodOptions_IdempotencyLevel MethodOptions::IDEMPOTENCY_UNKNOWN; +const MethodOptions_IdempotencyLevel MethodOptions::NO_SIDE_EFFECTS; +const MethodOptions_IdempotencyLevel MethodOptions::IDEMPOTENT; +const MethodOptions_IdempotencyLevel MethodOptions::IdempotencyLevel_MIN; +const MethodOptions_IdempotencyLevel MethodOptions::IdempotencyLevel_MAX; +const int MethodOptions::IdempotencyLevel_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void FileDescriptorSet::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FileDescriptorSet::kFileFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FileDescriptorSet::FileDescriptorSet() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorSet(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorSet) +} +FileDescriptorSet::FileDescriptorSet(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + file_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorSet(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.FileDescriptorSet) +} +FileDescriptorSet::FileDescriptorSet(const FileDescriptorSet& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), + file_(from.file_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:google.protobuf.FileDescriptorSet) +} + +void FileDescriptorSet::SharedCtor() { + _cached_size_ = 0; +} + +FileDescriptorSet::~FileDescriptorSet() { + // @@protoc_insertion_point(destructor:google.protobuf.FileDescriptorSet) + SharedDtor(); +} + +void FileDescriptorSet::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + +} + +void FileDescriptorSet::ArenaDtor(void* object) { + FileDescriptorSet* _this = reinterpret_cast< FileDescriptorSet* >(object); + (void)_this; +} +void FileDescriptorSet::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FileDescriptorSet::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FileDescriptorSet::descriptor() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FileDescriptorSet& FileDescriptorSet::default_instance() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorSet(); + return *internal_default_instance(); +} + +FileDescriptorSet* FileDescriptorSet::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void FileDescriptorSet::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.FileDescriptorSet) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + file_.Clear(); + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool FileDescriptorSet::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.FileDescriptorSet) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .google.protobuf.FileDescriptorProto file = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_file())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.FileDescriptorSet) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.FileDescriptorSet) + return false; +#undef DO_ +} + +void FileDescriptorSet::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.FileDescriptorSet) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .google.protobuf.FileDescriptorProto file = 1; + for (unsigned int i = 0, + n = static_cast(this->file_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->file(static_cast(i)), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.FileDescriptorSet) +} + +::google::protobuf::uint8* FileDescriptorSet::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorSet) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .google.protobuf.FileDescriptorProto file = 1; + for (unsigned int i = 0, + n = static_cast(this->file_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, this->file(static_cast(i)), deterministic, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileDescriptorSet) + return target; +} + +size_t FileDescriptorSet::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FileDescriptorSet) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + // repeated .google.protobuf.FileDescriptorProto file = 1; + { + unsigned int count = static_cast(this->file_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->file(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FileDescriptorSet::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FileDescriptorSet) + GOOGLE_DCHECK_NE(&from, this); + const FileDescriptorSet* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileDescriptorSet) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FileDescriptorSet) + MergeFrom(*source); + } +} + +void FileDescriptorSet::MergeFrom(const FileDescriptorSet& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FileDescriptorSet) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + file_.MergeFrom(from.file_); +} + +void FileDescriptorSet::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FileDescriptorSet) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FileDescriptorSet::CopyFrom(const FileDescriptorSet& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FileDescriptorSet) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FileDescriptorSet::IsInitialized() const { + if (!::google::protobuf::internal::AllAreInitialized(this->file())) return false; + return true; +} + +void FileDescriptorSet::Swap(FileDescriptorSet* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FileDescriptorSet* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FileDescriptorSet::UnsafeArenaSwap(FileDescriptorSet* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FileDescriptorSet::InternalSwap(FileDescriptorSet* other) { + using std::swap; + file_.InternalSwap(&other->file_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata FileDescriptorSet::GetMetadata() const { + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void FileDescriptorProto::InitAsDefaultInstance() { + ::google::protobuf::_FileDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::FileOptions*>( + ::google::protobuf::FileOptions::internal_default_instance()); + ::google::protobuf::_FileDescriptorProto_default_instance_._instance.get_mutable()->source_code_info_ = const_cast< ::google::protobuf::SourceCodeInfo*>( + ::google::protobuf::SourceCodeInfo::internal_default_instance()); +} +void FileDescriptorProto::_slow_mutable_options() { + options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::FileOptions >( + GetArenaNoVirtual()); +} +::google::protobuf::FileOptions* FileDescriptorProto::_slow_release_options() { + if (options_ == NULL) { + return NULL; + } else { + ::google::protobuf::FileOptions* temp = new ::google::protobuf::FileOptions(*options_); + options_ = NULL; + return temp; + } +} +void FileDescriptorProto::_slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::FileOptions** options) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*options) == NULL) { + message_arena->Own(*options); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*options)) { + ::google::protobuf::FileOptions* new_options = + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::FileOptions >( + message_arena); + new_options->CopyFrom(**options); + *options = new_options; + } +} +void FileDescriptorProto::unsafe_arena_set_allocated_options( + ::google::protobuf::FileOptions* options) { + if (GetArenaNoVirtual() == NULL) { + delete options_; + } + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.options) +} +void FileDescriptorProto::_slow_mutable_source_code_info() { + source_code_info_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::SourceCodeInfo >( + GetArenaNoVirtual()); +} +::google::protobuf::SourceCodeInfo* FileDescriptorProto::_slow_release_source_code_info() { + if (source_code_info_ == NULL) { + return NULL; + } else { + ::google::protobuf::SourceCodeInfo* temp = new ::google::protobuf::SourceCodeInfo(*source_code_info_); + source_code_info_ = NULL; + return temp; + } +} +void FileDescriptorProto::_slow_set_allocated_source_code_info( + ::google::protobuf::Arena* message_arena, ::google::protobuf::SourceCodeInfo** source_code_info) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*source_code_info) == NULL) { + message_arena->Own(*source_code_info); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*source_code_info)) { + ::google::protobuf::SourceCodeInfo* new_source_code_info = + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::SourceCodeInfo >( + message_arena); + new_source_code_info->CopyFrom(**source_code_info); + *source_code_info = new_source_code_info; + } +} +void FileDescriptorProto::unsafe_arena_set_allocated_source_code_info( + ::google::protobuf::SourceCodeInfo* source_code_info) { + if (GetArenaNoVirtual() == NULL) { + delete source_code_info_; + } + source_code_info_ = source_code_info; + if (source_code_info) { + set_has_source_code_info(); + } else { + clear_has_source_code_info(); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.source_code_info) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FileDescriptorProto::kNameFieldNumber; +const int FileDescriptorProto::kPackageFieldNumber; +const int FileDescriptorProto::kDependencyFieldNumber; +const int FileDescriptorProto::kPublicDependencyFieldNumber; +const int FileDescriptorProto::kWeakDependencyFieldNumber; +const int FileDescriptorProto::kMessageTypeFieldNumber; +const int FileDescriptorProto::kEnumTypeFieldNumber; +const int FileDescriptorProto::kServiceFieldNumber; +const int FileDescriptorProto::kExtensionFieldNumber; +const int FileDescriptorProto::kOptionsFieldNumber; +const int FileDescriptorProto::kSourceCodeInfoFieldNumber; +const int FileDescriptorProto::kSyntaxFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FileDescriptorProto::FileDescriptorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProto(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorProto) +} +FileDescriptorProto::FileDescriptorProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + dependency_(arena), + message_type_(arena), + enum_type_(arena), + service_(arena), + extension_(arena), + public_dependency_(arena), + weak_dependency_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProto(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.FileDescriptorProto) +} +FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), + dependency_(from.dependency_), + message_type_(from.message_type_), + enum_type_(from.enum_type_), + service_(from.service_), + extension_(from.extension_), + public_dependency_(from.public_dependency_), + weak_dependency_(from.weak_dependency_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_name()) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_package()) { + package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.package(), + GetArenaNoVirtual()); + } + syntax_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_syntax()) { + syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.syntax(), + GetArenaNoVirtual()); + } + if (from.has_options()) { + options_ = new ::google::protobuf::FileOptions(*from.options_); + } else { + options_ = NULL; + } + if (from.has_source_code_info()) { + source_code_info_ = new ::google::protobuf::SourceCodeInfo(*from.source_code_info_); + } else { + source_code_info_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:google.protobuf.FileDescriptorProto) +} + +void FileDescriptorProto::SharedCtor() { + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + syntax_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&options_, 0, static_cast( + reinterpret_cast(&source_code_info_) - + reinterpret_cast(&options_)) + sizeof(source_code_info_)); +} + +FileDescriptorProto::~FileDescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.FileDescriptorProto) + SharedDtor(); +} + +void FileDescriptorProto::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + package_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + syntax_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + if (this != internal_default_instance()) delete options_; + if (this != internal_default_instance()) delete source_code_info_; +} + +void FileDescriptorProto::ArenaDtor(void* object) { + FileDescriptorProto* _this = reinterpret_cast< FileDescriptorProto* >(object); + (void)_this; +} +void FileDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FileDescriptorProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FileDescriptorProto::descriptor() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FileDescriptorProto& FileDescriptorProto::default_instance() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProto(); + return *internal_default_instance(); +} + +FileDescriptorProto* FileDescriptorProto::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void FileDescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.FileDescriptorProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + dependency_.Clear(); + message_type_.Clear(); + enum_type_.Clear(); + service_.Clear(); + extension_.Clear(); + public_dependency_.Clear(); + weak_dependency_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 31u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(!package_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(!syntax_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + syntax_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000008u) { + GOOGLE_DCHECK(options_ != NULL); + options_->::google::protobuf::FileOptions::Clear(); + } + if (cached_has_bits & 0x00000010u) { + GOOGLE_DCHECK(source_code_info_ != NULL); + source_code_info_->::google::protobuf::SourceCodeInfo::Clear(); + } + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool FileDescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.FileDescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileDescriptorProto.name"); + } else { + goto handle_unusual; + } + break; + } + + // optional string package = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_package())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->package().data(), static_cast(this->package().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileDescriptorProto.package"); + } else { + goto handle_unusual; + } + break; + } + + // repeated string dependency = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_dependency())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->dependency(this->dependency_size() - 1).data(), + static_cast(this->dependency(this->dependency_size() - 1).length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileDescriptorProto.dependency"); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.DescriptorProto message_type = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_message_type())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_enum_type())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.ServiceDescriptorProto service = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_service())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_extension())); + } else { + goto handle_unusual; + } + break; + } + + // optional .google.protobuf.FileOptions options = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_options())); + } else { + goto handle_unusual; + } + break; + } + + // optional .google.protobuf.SourceCodeInfo source_code_info = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_source_code_info())); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 public_dependency = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 80u, input, this->mutable_public_dependency()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_public_dependency()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 weak_dependency = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 88u, input, this->mutable_weak_dependency()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_weak_dependency()))); + } else { + goto handle_unusual; + } + break; + } + + // optional string syntax = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_syntax())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->syntax().data(), static_cast(this->syntax().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileDescriptorProto.syntax"); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.FileDescriptorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.FileDescriptorProto) + return false; +#undef DO_ +} + +void FileDescriptorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.FileDescriptorProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string package = 2; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->package().data(), static_cast(this->package().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.package"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->package(), output); + } + + // repeated string dependency = 3; + for (int i = 0, n = this->dependency_size(); i < n; i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->dependency(i).data(), static_cast(this->dependency(i).length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.dependency"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->dependency(i), output); + } + + // repeated .google.protobuf.DescriptorProto message_type = 4; + for (unsigned int i = 0, + n = static_cast(this->message_type_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->message_type(static_cast(i)), output); + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + for (unsigned int i = 0, + n = static_cast(this->enum_type_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->enum_type(static_cast(i)), output); + } + + // repeated .google.protobuf.ServiceDescriptorProto service = 6; + for (unsigned int i = 0, + n = static_cast(this->service_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->service(static_cast(i)), output); + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 7; + for (unsigned int i = 0, + n = static_cast(this->extension_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->extension(static_cast(i)), output); + } + + // optional .google.protobuf.FileOptions options = 8; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *this->options_, output); + } + + // optional .google.protobuf.SourceCodeInfo source_code_info = 9; + if (cached_has_bits & 0x00000010u) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, *this->source_code_info_, output); + } + + // repeated int32 public_dependency = 10; + for (int i = 0, n = this->public_dependency_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 10, this->public_dependency(i), output); + } + + // repeated int32 weak_dependency = 11; + for (int i = 0, n = this->weak_dependency_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 11, this->weak_dependency(i), output); + } + + // optional string syntax = 12; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->syntax().data(), static_cast(this->syntax().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.syntax"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 12, this->syntax(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.FileDescriptorProto) +} + +::google::protobuf::uint8* FileDescriptorProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional string package = 2; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->package().data(), static_cast(this->package().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.package"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->package(), target); + } + + // repeated string dependency = 3; + for (int i = 0, n = this->dependency_size(); i < n; i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->dependency(i).data(), static_cast(this->dependency(i).length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.dependency"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->dependency(i), target); + } + + // repeated .google.protobuf.DescriptorProto message_type = 4; + for (unsigned int i = 0, + n = static_cast(this->message_type_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, this->message_type(static_cast(i)), deterministic, target); + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + for (unsigned int i = 0, + n = static_cast(this->enum_type_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, this->enum_type(static_cast(i)), deterministic, target); + } + + // repeated .google.protobuf.ServiceDescriptorProto service = 6; + for (unsigned int i = 0, + n = static_cast(this->service_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, this->service(static_cast(i)), deterministic, target); + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 7; + for (unsigned int i = 0, + n = static_cast(this->extension_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, this->extension(static_cast(i)), deterministic, target); + } + + // optional .google.protobuf.FileOptions options = 8; + if (cached_has_bits & 0x00000008u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, *this->options_, deterministic, target); + } + + // optional .google.protobuf.SourceCodeInfo source_code_info = 9; + if (cached_has_bits & 0x00000010u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 9, *this->source_code_info_, deterministic, target); + } + + // repeated int32 public_dependency = 10; + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArray(10, this->public_dependency_, target); + + // repeated int32 weak_dependency = 11; + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArray(11, this->weak_dependency_, target); + + // optional string syntax = 12; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->syntax().data(), static_cast(this->syntax().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.syntax"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 12, this->syntax(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileDescriptorProto) + return target; +} + +size_t FileDescriptorProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FileDescriptorProto) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + // repeated string dependency = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->dependency_size()); + for (int i = 0, n = this->dependency_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->dependency(i)); + } + + // repeated .google.protobuf.DescriptorProto message_type = 4; + { + unsigned int count = static_cast(this->message_type_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->message_type(static_cast(i))); + } + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + { + unsigned int count = static_cast(this->enum_type_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->enum_type(static_cast(i))); + } + } + + // repeated .google.protobuf.ServiceDescriptorProto service = 6; + { + unsigned int count = static_cast(this->service_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->service(static_cast(i))); + } + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 7; + { + unsigned int count = static_cast(this->extension_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->extension(static_cast(i))); + } + } + + // repeated int32 public_dependency = 10; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->public_dependency_); + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->public_dependency_size()); + total_size += data_size; + } + + // repeated int32 weak_dependency = 11; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->weak_dependency_); + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->weak_dependency_size()); + total_size += data_size; + } + + if (_has_bits_[0 / 32] & 31u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional string package = 2; + if (has_package()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->package()); + } + + // optional string syntax = 12; + if (has_syntax()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->syntax()); + } + + // optional .google.protobuf.FileOptions options = 8; + if (has_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->options_); + } - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - // repeated .google.protobuf.FileDescriptorProto file = 1; - { - unsigned int count = static_cast(this->file_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += + // optional .google.protobuf.SourceCodeInfo source_code_info = 9; + if (has_source_code_info()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->file(static_cast(i))); + *this->source_code_info_); } - } + } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = cached_size; @@ -1251,362 +2540,318 @@ size_t FileDescriptorSet::ByteSizeLong() const { return total_size; } -void FileDescriptorSet::MergeFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FileDescriptorSet) +void FileDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FileDescriptorProto) GOOGLE_DCHECK_NE(&from, this); - const FileDescriptorSet* source = - ::google::protobuf::internal::DynamicCastToGenerated( + const FileDescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( &from); if (source == NULL) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileDescriptorSet) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileDescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FileDescriptorSet) + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FileDescriptorProto) MergeFrom(*source); } } -void FileDescriptorSet::MergeFrom(const FileDescriptorSet& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FileDescriptorSet) +void FileDescriptorProto::MergeFrom(const FileDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FileDescriptorProto) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; - file_.MergeFrom(from.file_); + dependency_.MergeFrom(from.dependency_); + message_type_.MergeFrom(from.message_type_); + enum_type_.MergeFrom(from.enum_type_); + service_.MergeFrom(from.service_); + extension_.MergeFrom(from.extension_); + public_dependency_.MergeFrom(from.public_dependency_); + weak_dependency_.MergeFrom(from.weak_dependency_); + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 31u) { + if (cached_has_bits & 0x00000001u) { + set_name(from.name()); + } + if (cached_has_bits & 0x00000002u) { + set_package(from.package()); + } + if (cached_has_bits & 0x00000004u) { + set_syntax(from.syntax()); + } + if (cached_has_bits & 0x00000008u) { + mutable_options()->::google::protobuf::FileOptions::MergeFrom(from.options()); + } + if (cached_has_bits & 0x00000010u) { + mutable_source_code_info()->::google::protobuf::SourceCodeInfo::MergeFrom(from.source_code_info()); + } + } } -void FileDescriptorSet::CopyFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FileDescriptorSet) +void FileDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FileDescriptorProto) if (&from == this) return; Clear(); MergeFrom(from); } -void FileDescriptorSet::CopyFrom(const FileDescriptorSet& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FileDescriptorSet) +void FileDescriptorProto::CopyFrom(const FileDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FileDescriptorProto) if (&from == this) return; Clear(); MergeFrom(from); } -bool FileDescriptorSet::IsInitialized() const { - if (!::google::protobuf::internal::AllAreInitialized(this->file())) return false; +bool FileDescriptorProto::IsInitialized() const { + if (!::google::protobuf::internal::AllAreInitialized(this->message_type())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->enum_type())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->service())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->extension())) return false; + if (has_options()) { + if (!this->options_->IsInitialized()) return false; + } return true; } -void FileDescriptorSet::Swap(FileDescriptorSet* other) { +void FileDescriptorProto::Swap(FileDescriptorProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FileDescriptorProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FileDescriptorProto::UnsafeArenaSwap(FileDescriptorProto* other) { if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } -void FileDescriptorSet::InternalSwap(FileDescriptorSet* other) { +void FileDescriptorProto::InternalSwap(FileDescriptorProto* other) { using std::swap; - file_.InternalSwap(&other->file_); + dependency_.InternalSwap(&other->dependency_); + message_type_.InternalSwap(&other->message_type_); + enum_type_.InternalSwap(&other->enum_type_); + service_.InternalSwap(&other->service_); + extension_.InternalSwap(&other->extension_); + public_dependency_.InternalSwap(&other->public_dependency_); + weak_dependency_.InternalSwap(&other->weak_dependency_); + name_.Swap(&other->name_); + package_.Swap(&other->package_); + syntax_.Swap(&other->syntax_); + swap(options_, other->options_); + swap(source_code_info_, other->source_code_info_); swap(_has_bits_[0], other->_has_bits_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); swap(_cached_size_, other->_cached_size_); } -::google::protobuf::Metadata FileDescriptorSet::GetMetadata() const { +::google::protobuf::Metadata FileDescriptorProto::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// FileDescriptorSet -// repeated .google.protobuf.FileDescriptorProto file = 1; -int FileDescriptorSet::file_size() const { - return file_.size(); -} -void FileDescriptorSet::clear_file() { - file_.Clear(); -} -const ::google::protobuf::FileDescriptorProto& FileDescriptorSet::file(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorSet.file) - return file_.Get(index); +// =================================================================== + +void DescriptorProto_ExtensionRange::InitAsDefaultInstance() { + ::google::protobuf::_DescriptorProto_ExtensionRange_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::ExtensionRangeOptions*>( + ::google::protobuf::ExtensionRangeOptions::internal_default_instance()); } -::google::protobuf::FileDescriptorProto* FileDescriptorSet::mutable_file(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorSet.file) - return file_.Mutable(index); +void DescriptorProto_ExtensionRange::_slow_mutable_options() { + options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ExtensionRangeOptions >( + GetArenaNoVirtual()); } -::google::protobuf::FileDescriptorProto* FileDescriptorSet::add_file() { - // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorSet.file) - return file_.Add(); +::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::_slow_release_options() { + if (options_ == NULL) { + return NULL; + } else { + ::google::protobuf::ExtensionRangeOptions* temp = new ::google::protobuf::ExtensionRangeOptions(*options_); + options_ = NULL; + return temp; + } } -::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >* -FileDescriptorSet::mutable_file() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorSet.file) - return &file_; +void DescriptorProto_ExtensionRange::_slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::ExtensionRangeOptions** options) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*options) == NULL) { + message_arena->Own(*options); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*options)) { + ::google::protobuf::ExtensionRangeOptions* new_options = + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ExtensionRangeOptions >( + message_arena); + new_options->CopyFrom(**options); + *options = new_options; + } } -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >& -FileDescriptorSet::file() const { - // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorSet.file) - return file_; +void DescriptorProto_ExtensionRange::unsafe_arena_set_allocated_options( + ::google::protobuf::ExtensionRangeOptions* options) { + if (GetArenaNoVirtual() == NULL) { + delete options_; + } + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options) } - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// =================================================================== - #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int FileDescriptorProto::kNameFieldNumber; -const int FileDescriptorProto::kPackageFieldNumber; -const int FileDescriptorProto::kDependencyFieldNumber; -const int FileDescriptorProto::kPublicDependencyFieldNumber; -const int FileDescriptorProto::kWeakDependencyFieldNumber; -const int FileDescriptorProto::kMessageTypeFieldNumber; -const int FileDescriptorProto::kEnumTypeFieldNumber; -const int FileDescriptorProto::kServiceFieldNumber; -const int FileDescriptorProto::kExtensionFieldNumber; -const int FileDescriptorProto::kOptionsFieldNumber; -const int FileDescriptorProto::kSourceCodeInfoFieldNumber; -const int FileDescriptorProto::kSyntaxFieldNumber; +const int DescriptorProto_ExtensionRange::kStartFieldNumber; +const int DescriptorProto_ExtensionRange::kEndFieldNumber; +const int DescriptorProto_ExtensionRange::kOptionsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -FileDescriptorProto::FileDescriptorProto() +DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ExtensionRange(); } SharedCtor(); - // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorProto) + // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ExtensionRange) } -FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from) +DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ExtensionRange(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.DescriptorProto.ExtensionRange) +} +DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), - _cached_size_(0), - dependency_(from.dependency_), - message_type_(from.message_type_), - enum_type_(from.enum_type_), - service_(from.service_), - extension_(from.extension_), - public_dependency_(from.public_dependency_), - weak_dependency_(from.weak_dependency_) { + _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); - name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_name()) { - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); - } - package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_package()) { - package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.package_); - } - syntax_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_syntax()) { - syntax_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.syntax_); - } if (from.has_options()) { - options_ = new ::google::protobuf::FileOptions(*from.options_); + options_ = new ::google::protobuf::ExtensionRangeOptions(*from.options_); } else { options_ = NULL; } - if (from.has_source_code_info()) { - source_code_info_ = new ::google::protobuf::SourceCodeInfo(*from.source_code_info_); - } else { - source_code_info_ = NULL; - } - // @@protoc_insertion_point(copy_constructor:google.protobuf.FileDescriptorProto) + ::memcpy(&start_, &from.start_, + static_cast(reinterpret_cast(&end_) - + reinterpret_cast(&start_)) + sizeof(end_)); + // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto.ExtensionRange) } -void FileDescriptorProto::SharedCtor() { +void DescriptorProto_ExtensionRange::SharedCtor() { _cached_size_ = 0; - name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - syntax_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(&options_, 0, static_cast( - reinterpret_cast(&source_code_info_) - - reinterpret_cast(&options_)) + sizeof(source_code_info_)); + reinterpret_cast(&end_) - + reinterpret_cast(&options_)) + sizeof(end_)); } -FileDescriptorProto::~FileDescriptorProto() { - // @@protoc_insertion_point(destructor:google.protobuf.FileDescriptorProto) +DescriptorProto_ExtensionRange::~DescriptorProto_ExtensionRange() { + // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto.ExtensionRange) SharedDtor(); } -void FileDescriptorProto::SharedDtor() { - name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - syntax_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +void DescriptorProto_ExtensionRange::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + if (this != internal_default_instance()) delete options_; - if (this != internal_default_instance()) delete source_code_info_; } -void FileDescriptorProto::SetCachedSize(int size) const { +void DescriptorProto_ExtensionRange::ArenaDtor(void* object) { + DescriptorProto_ExtensionRange* _this = reinterpret_cast< DescriptorProto_ExtensionRange* >(object); + (void)_this; +} +void DescriptorProto_ExtensionRange::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DescriptorProto_ExtensionRange::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } -const ::google::protobuf::Descriptor* FileDescriptorProto::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +const ::google::protobuf::Descriptor* DescriptorProto_ExtensionRange::descriptor() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } -const FileDescriptorProto& FileDescriptorProto::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); +const DescriptorProto_ExtensionRange& DescriptorProto_ExtensionRange::default_instance() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ExtensionRange(); return *internal_default_instance(); } -FileDescriptorProto* FileDescriptorProto::New(::google::protobuf::Arena* arena) const { - FileDescriptorProto* n = new FileDescriptorProto; - if (arena != NULL) { - arena->Own(n); - } - return n; +DescriptorProto_ExtensionRange* DescriptorProto_ExtensionRange::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); } -void FileDescriptorProto::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.FileDescriptorProto) +void DescriptorProto_ExtensionRange::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto.ExtensionRange) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - dependency_.Clear(); - message_type_.Clear(); - enum_type_.Clear(); - service_.Clear(); - extension_.Clear(); - public_dependency_.Clear(); - weak_dependency_.Clear(); + if (has_options()) { + GOOGLE_DCHECK(options_ != NULL); + options_->::google::protobuf::ExtensionRangeOptions::Clear(); + } cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 31u) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(!package_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*package_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(!syntax_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*syntax_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(options_ != NULL); - options_->::google::protobuf::FileOptions::Clear(); - } - if (cached_has_bits & 0x00000010u) { - GOOGLE_DCHECK(source_code_info_ != NULL); - source_code_info_->::google::protobuf::SourceCodeInfo::Clear(); - } + if (cached_has_bits & 6u) { + ::memset(&start_, 0, static_cast( + reinterpret_cast(&end_) - + reinterpret_cast(&start_)) + sizeof(end_)); } _has_bits_.Clear(); _internal_metadata_.Clear(); } -bool FileDescriptorProto::MergePartialFromCodedStream( +bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - // @@protoc_insertion_point(parse_start:google.protobuf.FileDescriptorProto) + // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto.ExtensionRange) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // optional string name = 1; + // optional int32 start = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.FileDescriptorProto.name"); + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + set_has_start(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &start_))); } else { goto handle_unusual; } break; } - // optional string package = 2; + // optional int32 end = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_package())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->package().data(), static_cast(this->package().length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.FileDescriptorProto.package"); + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + set_has_end(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &end_))); } else { goto handle_unusual; } break; } - // repeated string dependency = 3; + // optional .google.protobuf.ExtensionRangeOptions options = 3; case 3: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->add_dependency())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->dependency(this->dependency_size() - 1).data(), - static_cast(this->dependency(this->dependency_size() - 1).length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.FileDescriptorProto.dependency"); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.DescriptorProto message_type = 4; - case 4: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_message_type())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; - case 5: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_enum_type())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.ServiceDescriptorProto service = 6; - case 6: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_service())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.FieldDescriptorProto extension = 7; - case 7: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_extension())); - } else { - goto handle_unusual; - } - break; - } - - // optional .google.protobuf.FileOptions options = 8; - case 8: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_options())); } else { @@ -1615,72 +2860,6 @@ bool FileDescriptorProto::MergePartialFromCodedStream( break; } - // optional .google.protobuf.SourceCodeInfo source_code_info = 9; - case 9: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_source_code_info())); - } else { - goto handle_unusual; - } - break; - } - - // repeated int32 public_dependency = 10; - case 10: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< - ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - 1, 80u, input, this->mutable_public_dependency()))); - } else if ( - static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< - ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, this->mutable_public_dependency()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated int32 weak_dependency = 11; - case 11: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< - ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - 1, 88u, input, this->mutable_weak_dependency()))); - } else if ( - static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< - ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, this->mutable_weak_dependency()))); - } else { - goto handle_unusual; - } - break; - } - - // optional string syntax = 12; - case 12: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_syntax())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->syntax().data(), static_cast(this->syntax().length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.FileDescriptorProto.syntax"); - } else { - goto handle_unusual; - } - break; - } - default: { handle_unusual: if (tag == 0) { @@ -1693,235 +2872,79 @@ bool FileDescriptorProto::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:google.protobuf.FileDescriptorProto) + // @@protoc_insertion_point(parse_success:google.protobuf.DescriptorProto.ExtensionRange) return true; failure: - // @@protoc_insertion_point(parse_failure:google.protobuf.FileDescriptorProto) + // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto.ExtensionRange) return false; #undef DO_ } -void FileDescriptorProto::SerializeWithCachedSizes( +void DescriptorProto_ExtensionRange::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:google.protobuf.FileDescriptorProto) + // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto.ExtensionRange) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; - // optional string name = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FileDescriptorProto.name"); - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->name(), output); - } - - // optional string package = 2; + // optional int32 start = 1; if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->package().data(), static_cast(this->package().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FileDescriptorProto.package"); - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->package(), output); - } - - // repeated string dependency = 3; - for (int i = 0, n = this->dependency_size(); i < n; i++) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->dependency(i).data(), static_cast(this->dependency(i).length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FileDescriptorProto.dependency"); - ::google::protobuf::internal::WireFormatLite::WriteString( - 3, this->dependency(i), output); - } - - // repeated .google.protobuf.DescriptorProto message_type = 4; - for (unsigned int i = 0, - n = static_cast(this->message_type_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 4, this->message_type(static_cast(i)), output); - } - - // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; - for (unsigned int i = 0, - n = static_cast(this->enum_type_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 5, this->enum_type(static_cast(i)), output); - } - - // repeated .google.protobuf.ServiceDescriptorProto service = 6; - for (unsigned int i = 0, - n = static_cast(this->service_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 6, this->service(static_cast(i)), output); - } - - // repeated .google.protobuf.FieldDescriptorProto extension = 7; - for (unsigned int i = 0, - n = static_cast(this->extension_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 7, this->extension(static_cast(i)), output); - } - - // optional .google.protobuf.FileOptions options = 8; - if (cached_has_bits & 0x00000008u) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 8, *this->options_, output); - } - - // optional .google.protobuf.SourceCodeInfo source_code_info = 9; - if (cached_has_bits & 0x00000010u) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 9, *this->source_code_info_, output); - } - - // repeated int32 public_dependency = 10; - for (int i = 0, n = this->public_dependency_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteInt32( - 10, this->public_dependency(i), output); + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->start(), output); } - // repeated int32 weak_dependency = 11; - for (int i = 0, n = this->weak_dependency_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteInt32( - 11, this->weak_dependency(i), output); + // optional int32 end = 2; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->end(), output); } - // optional string syntax = 12; - if (cached_has_bits & 0x00000004u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->syntax().data(), static_cast(this->syntax().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FileDescriptorProto.syntax"); - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 12, this->syntax(), output); + // optional .google.protobuf.ExtensionRangeOptions options = 3; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *this->options_, output); } if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } - // @@protoc_insertion_point(serialize_end:google.protobuf.FileDescriptorProto) + // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto.ExtensionRange) } -::google::protobuf::uint8* FileDescriptorProto::InternalSerializeWithCachedSizesToArray( +::google::protobuf::uint8* DescriptorProto_ExtensionRange::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorProto) + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ExtensionRange) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; - // optional string name = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FileDescriptorProto.name"); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 1, this->name(), target); - } - - // optional string package = 2; + // optional int32 start = 1; if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->package().data(), static_cast(this->package().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FileDescriptorProto.package"); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 2, this->package(), target); - } - - // repeated string dependency = 3; - for (int i = 0, n = this->dependency_size(); i < n; i++) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->dependency(i).data(), static_cast(this->dependency(i).length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FileDescriptorProto.dependency"); - target = ::google::protobuf::internal::WireFormatLite:: - WriteStringToArray(3, this->dependency(i), target); - } - - // repeated .google.protobuf.DescriptorProto message_type = 4; - for (unsigned int i = 0, - n = static_cast(this->message_type_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 4, this->message_type(static_cast(i)), deterministic, target); - } - - // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; - for (unsigned int i = 0, - n = static_cast(this->enum_type_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 5, this->enum_type(static_cast(i)), deterministic, target); - } - - // repeated .google.protobuf.ServiceDescriptorProto service = 6; - for (unsigned int i = 0, - n = static_cast(this->service_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 6, this->service(static_cast(i)), deterministic, target); - } - - // repeated .google.protobuf.FieldDescriptorProto extension = 7; - for (unsigned int i = 0, - n = static_cast(this->extension_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 7, this->extension(static_cast(i)), deterministic, target); + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->start(), target); } - // optional .google.protobuf.FileOptions options = 8; - if (cached_has_bits & 0x00000008u) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 8, *this->options_, deterministic, target); + // optional int32 end = 2; + if (cached_has_bits & 0x00000004u) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target); } - // optional .google.protobuf.SourceCodeInfo source_code_info = 9; - if (cached_has_bits & 0x00000010u) { + // optional .google.protobuf.ExtensionRangeOptions options = 3; + if (cached_has_bits & 0x00000001u) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( - 9, *this->source_code_info_, deterministic, target); - } - - // repeated int32 public_dependency = 10; - target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArray(10, this->public_dependency_, target); - - // repeated int32 weak_dependency = 11; - target = ::google::protobuf::internal::WireFormatLite:: - WriteInt32ToArray(11, this->weak_dependency_, target); - - // optional string syntax = 12; - if (cached_has_bits & 0x00000004u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->syntax().data(), static_cast(this->syntax().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FileDescriptorProto.syntax"); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 12, this->syntax(), target); + 3, *this->options_, deterministic, target); } if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileDescriptorProto) + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto.ExtensionRange) return target; } -size_t FileDescriptorProto::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FileDescriptorProto) +size_t DescriptorProto_ExtensionRange::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto.ExtensionRange) size_t total_size = 0; if (_internal_metadata_.have_unknown_fields()) { @@ -1929,110 +2952,26 @@ size_t FileDescriptorProto::ByteSizeLong() const { ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( _internal_metadata_.unknown_fields()); } - // repeated string dependency = 3; - total_size += 1 * - ::google::protobuf::internal::FromIntSize(this->dependency_size()); - for (int i = 0, n = this->dependency_size(); i < n; i++) { - total_size += ::google::protobuf::internal::WireFormatLite::StringSize( - this->dependency(i)); - } - - // repeated .google.protobuf.DescriptorProto message_type = 4; - { - unsigned int count = static_cast(this->message_type_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->message_type(static_cast(i))); - } - } - - // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; - { - unsigned int count = static_cast(this->enum_type_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->enum_type(static_cast(i))); - } - } - - // repeated .google.protobuf.ServiceDescriptorProto service = 6; - { - unsigned int count = static_cast(this->service_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->service(static_cast(i))); - } - } - - // repeated .google.protobuf.FieldDescriptorProto extension = 7; - { - unsigned int count = static_cast(this->extension_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->extension(static_cast(i))); - } - } - - // repeated int32 public_dependency = 10; - { - size_t data_size = ::google::protobuf::internal::WireFormatLite:: - Int32Size(this->public_dependency_); - total_size += 1 * - ::google::protobuf::internal::FromIntSize(this->public_dependency_size()); - total_size += data_size; - } - - // repeated int32 weak_dependency = 11; - { - size_t data_size = ::google::protobuf::internal::WireFormatLite:: - Int32Size(this->weak_dependency_); - total_size += 1 * - ::google::protobuf::internal::FromIntSize(this->weak_dependency_size()); - total_size += data_size; - } - - if (_has_bits_[0 / 32] & 31u) { - // optional string name = 1; - if (has_name()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); - } - - // optional string package = 2; - if (has_package()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->package()); - } - - // optional string syntax = 12; - if (has_syntax()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->syntax()); - } - - // optional .google.protobuf.FileOptions options = 8; + if (_has_bits_[0 / 32] & 7u) { + // optional .google.protobuf.ExtensionRangeOptions options = 3; if (has_options()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( *this->options_); } - // optional .google.protobuf.SourceCodeInfo source_code_info = 9; - if (has_source_code_info()) { + // optional int32 start = 1; + if (has_start()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - *this->source_code_info_); + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->start()); + } + + // optional int32 end = 2; + if (has_end()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->end()); } } @@ -2043,730 +2982,190 @@ size_t FileDescriptorProto::ByteSizeLong() const { return total_size; } -void FileDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FileDescriptorProto) +void DescriptorProto_ExtensionRange::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto.ExtensionRange) GOOGLE_DCHECK_NE(&from, this); - const FileDescriptorProto* source = - ::google::protobuf::internal::DynamicCastToGenerated( + const DescriptorProto_ExtensionRange* source = + ::google::protobuf::internal::DynamicCastToGenerated( &from); if (source == NULL) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileDescriptorProto) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto.ExtensionRange) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FileDescriptorProto) + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto.ExtensionRange) MergeFrom(*source); } } -void FileDescriptorProto::MergeFrom(const FileDescriptorProto& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FileDescriptorProto) +void DescriptorProto_ExtensionRange::MergeFrom(const DescriptorProto_ExtensionRange& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto.ExtensionRange) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; - dependency_.MergeFrom(from.dependency_); - message_type_.MergeFrom(from.message_type_); - enum_type_.MergeFrom(from.enum_type_); - service_.MergeFrom(from.service_); - extension_.MergeFrom(from.extension_); - public_dependency_.MergeFrom(from.public_dependency_); - weak_dependency_.MergeFrom(from.weak_dependency_); cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 31u) { + if (cached_has_bits & 7u) { if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + mutable_options()->::google::protobuf::ExtensionRangeOptions::MergeFrom(from.options()); } if (cached_has_bits & 0x00000002u) { - set_has_package(); - package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.package_); + start_ = from.start_; } if (cached_has_bits & 0x00000004u) { - set_has_syntax(); - syntax_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.syntax_); - } - if (cached_has_bits & 0x00000008u) { - mutable_options()->::google::protobuf::FileOptions::MergeFrom(from.options()); - } - if (cached_has_bits & 0x00000010u) { - mutable_source_code_info()->::google::protobuf::SourceCodeInfo::MergeFrom(from.source_code_info()); + end_ = from.end_; } + _has_bits_[0] |= cached_has_bits; } } -void FileDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FileDescriptorProto) +void DescriptorProto_ExtensionRange::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto.ExtensionRange) if (&from == this) return; Clear(); MergeFrom(from); } -void FileDescriptorProto::CopyFrom(const FileDescriptorProto& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FileDescriptorProto) +void DescriptorProto_ExtensionRange::CopyFrom(const DescriptorProto_ExtensionRange& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.DescriptorProto.ExtensionRange) if (&from == this) return; Clear(); MergeFrom(from); } -bool FileDescriptorProto::IsInitialized() const { - if (!::google::protobuf::internal::AllAreInitialized(this->message_type())) return false; - if (!::google::protobuf::internal::AllAreInitialized(this->enum_type())) return false; - if (!::google::protobuf::internal::AllAreInitialized(this->service())) return false; - if (!::google::protobuf::internal::AllAreInitialized(this->extension())) return false; +bool DescriptorProto_ExtensionRange::IsInitialized() const { if (has_options()) { if (!this->options_->IsInitialized()) return false; } return true; } -void FileDescriptorProto::Swap(FileDescriptorProto* other) { +void DescriptorProto_ExtensionRange::Swap(DescriptorProto_ExtensionRange* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DescriptorProto_ExtensionRange* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DescriptorProto_ExtensionRange::UnsafeArenaSwap(DescriptorProto_ExtensionRange* other) { if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } -void FileDescriptorProto::InternalSwap(FileDescriptorProto* other) { +void DescriptorProto_ExtensionRange::InternalSwap(DescriptorProto_ExtensionRange* other) { using std::swap; - dependency_.InternalSwap(&other->dependency_); - message_type_.InternalSwap(&other->message_type_); - enum_type_.InternalSwap(&other->enum_type_); - service_.InternalSwap(&other->service_); - extension_.InternalSwap(&other->extension_); - public_dependency_.InternalSwap(&other->public_dependency_); - weak_dependency_.InternalSwap(&other->weak_dependency_); - name_.Swap(&other->name_); - package_.Swap(&other->package_); - syntax_.Swap(&other->syntax_); swap(options_, other->options_); - swap(source_code_info_, other->source_code_info_); + swap(start_, other->start_); + swap(end_, other->end_); swap(_has_bits_[0], other->_has_bits_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); swap(_cached_size_, other->_cached_size_); } -::google::protobuf::Metadata FileDescriptorProto::GetMetadata() const { +::google::protobuf::Metadata DescriptorProto_ExtensionRange::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// FileDescriptorProto - -// optional string name = 1; -bool FileDescriptorProto::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void FileDescriptorProto::set_has_name() { - _has_bits_[0] |= 0x00000001u; -} -void FileDescriptorProto::clear_has_name() { - _has_bits_[0] &= ~0x00000001u; -} -void FileDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); -} -const ::std::string& FileDescriptorProto::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.name) - return name_.GetNoArena(); -} -void FileDescriptorProto::set_name(const ::std::string& value) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.name) -} -#if LANG_CXX11 -void FileDescriptorProto::set_name(::std::string&& value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileDescriptorProto.name) -} -#endif -void FileDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.name) -} -void FileDescriptorProto::set_name(const char* value, size_t size) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.name) -} -::std::string* FileDescriptorProto::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileDescriptorProto::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.name) - clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { - set_has_name(); - } else { - clear_has_name(); - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.name) -} - -// optional string package = 2; -bool FileDescriptorProto::has_package() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void FileDescriptorProto::set_has_package() { - _has_bits_[0] |= 0x00000002u; -} -void FileDescriptorProto::clear_has_package() { - _has_bits_[0] &= ~0x00000002u; -} -void FileDescriptorProto::clear_package() { - package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_package(); -} -const ::std::string& FileDescriptorProto::package() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.package) - return package_.GetNoArena(); -} -void FileDescriptorProto::set_package(const ::std::string& value) { - set_has_package(); - package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.package) -} -#if LANG_CXX11 -void FileDescriptorProto::set_package(::std::string&& value) { - set_has_package(); - package_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileDescriptorProto.package) -} -#endif -void FileDescriptorProto::set_package(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_package(); - package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.package) -} -void FileDescriptorProto::set_package(const char* value, size_t size) { - set_has_package(); - package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.package) -} -::std::string* FileDescriptorProto::mutable_package() { - set_has_package(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.package) - return package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileDescriptorProto::release_package() { - // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.package) - clear_has_package(); - return package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileDescriptorProto::set_allocated_package(::std::string* package) { - if (package != NULL) { - set_has_package(); - } else { - clear_has_package(); - } - package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), package); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.package) -} - -// repeated string dependency = 3; -int FileDescriptorProto::dependency_size() const { - return dependency_.size(); -} -void FileDescriptorProto::clear_dependency() { - dependency_.Clear(); -} -const ::std::string& FileDescriptorProto::dependency(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.dependency) - return dependency_.Get(index); -} -::std::string* FileDescriptorProto::mutable_dependency(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.dependency) - return dependency_.Mutable(index); -} -void FileDescriptorProto::set_dependency(int index, const ::std::string& value) { - // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency) - dependency_.Mutable(index)->assign(value); -} -#if LANG_CXX11 -void FileDescriptorProto::set_dependency(int index, ::std::string&& value) { - // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency) - dependency_.Mutable(index)->assign(std::move(value)); -} -#endif -void FileDescriptorProto::set_dependency(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); - dependency_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.dependency) -} -void FileDescriptorProto::set_dependency(int index, const char* value, size_t size) { - dependency_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.dependency) -} -::std::string* FileDescriptorProto::add_dependency() { - // @@protoc_insertion_point(field_add_mutable:google.protobuf.FileDescriptorProto.dependency) - return dependency_.Add(); -} -void FileDescriptorProto::add_dependency(const ::std::string& value) { - dependency_.Add()->assign(value); - // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency) -} -#if LANG_CXX11 -void FileDescriptorProto::add_dependency(::std::string&& value) { - dependency_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency) -} -#endif -void FileDescriptorProto::add_dependency(const char* value) { - GOOGLE_DCHECK(value != NULL); - dependency_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:google.protobuf.FileDescriptorProto.dependency) -} -void FileDescriptorProto::add_dependency(const char* value, size_t size) { - dependency_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:google.protobuf.FileDescriptorProto.dependency) -} -const ::google::protobuf::RepeatedPtrField< ::std::string>& -FileDescriptorProto::dependency() const { - // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.dependency) - return dependency_; -} -::google::protobuf::RepeatedPtrField< ::std::string>* -FileDescriptorProto::mutable_dependency() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.dependency) - return &dependency_; -} - -// repeated int32 public_dependency = 10; -int FileDescriptorProto::public_dependency_size() const { - return public_dependency_.size(); -} -void FileDescriptorProto::clear_public_dependency() { - public_dependency_.Clear(); -} -::google::protobuf::int32 FileDescriptorProto::public_dependency(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.public_dependency) - return public_dependency_.Get(index); -} -void FileDescriptorProto::set_public_dependency(int index, ::google::protobuf::int32 value) { - public_dependency_.Set(index, value); - // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.public_dependency) -} -void FileDescriptorProto::add_public_dependency(::google::protobuf::int32 value) { - public_dependency_.Add(value); - // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.public_dependency) -} -const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& -FileDescriptorProto::public_dependency() const { - // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.public_dependency) - return public_dependency_; -} -::google::protobuf::RepeatedField< ::google::protobuf::int32 >* -FileDescriptorProto::mutable_public_dependency() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.public_dependency) - return &public_dependency_; -} - -// repeated int32 weak_dependency = 11; -int FileDescriptorProto::weak_dependency_size() const { - return weak_dependency_.size(); -} -void FileDescriptorProto::clear_weak_dependency() { - weak_dependency_.Clear(); -} -::google::protobuf::int32 FileDescriptorProto::weak_dependency(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.weak_dependency) - return weak_dependency_.Get(index); -} -void FileDescriptorProto::set_weak_dependency(int index, ::google::protobuf::int32 value) { - weak_dependency_.Set(index, value); - // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.weak_dependency) -} -void FileDescriptorProto::add_weak_dependency(::google::protobuf::int32 value) { - weak_dependency_.Add(value); - // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.weak_dependency) -} -const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& -FileDescriptorProto::weak_dependency() const { - // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.weak_dependency) - return weak_dependency_; -} -::google::protobuf::RepeatedField< ::google::protobuf::int32 >* -FileDescriptorProto::mutable_weak_dependency() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.weak_dependency) - return &weak_dependency_; -} - -// repeated .google.protobuf.DescriptorProto message_type = 4; -int FileDescriptorProto::message_type_size() const { - return message_type_.size(); -} -void FileDescriptorProto::clear_message_type() { - message_type_.Clear(); -} -const ::google::protobuf::DescriptorProto& FileDescriptorProto::message_type(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.message_type) - return message_type_.Get(index); -} -::google::protobuf::DescriptorProto* FileDescriptorProto::mutable_message_type(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.message_type) - return message_type_.Mutable(index); -} -::google::protobuf::DescriptorProto* FileDescriptorProto::add_message_type() { - // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.message_type) - return message_type_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >* -FileDescriptorProto::mutable_message_type() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.message_type) - return &message_type_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >& -FileDescriptorProto::message_type() const { - // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.message_type) - return message_type_; -} - -// repeated .google.protobuf.EnumDescriptorProto enum_type = 5; -int FileDescriptorProto::enum_type_size() const { - return enum_type_.size(); -} -void FileDescriptorProto::clear_enum_type() { - enum_type_.Clear(); -} -const ::google::protobuf::EnumDescriptorProto& FileDescriptorProto::enum_type(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.enum_type) - return enum_type_.Get(index); -} -::google::protobuf::EnumDescriptorProto* FileDescriptorProto::mutable_enum_type(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.enum_type) - return enum_type_.Mutable(index); -} -::google::protobuf::EnumDescriptorProto* FileDescriptorProto::add_enum_type() { - // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.enum_type) - return enum_type_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >* -FileDescriptorProto::mutable_enum_type() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.enum_type) - return &enum_type_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >& -FileDescriptorProto::enum_type() const { - // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.enum_type) - return enum_type_; -} - -// repeated .google.protobuf.ServiceDescriptorProto service = 6; -int FileDescriptorProto::service_size() const { - return service_.size(); -} -void FileDescriptorProto::clear_service() { - service_.Clear(); -} -const ::google::protobuf::ServiceDescriptorProto& FileDescriptorProto::service(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.service) - return service_.Get(index); -} -::google::protobuf::ServiceDescriptorProto* FileDescriptorProto::mutable_service(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.service) - return service_.Mutable(index); -} -::google::protobuf::ServiceDescriptorProto* FileDescriptorProto::add_service() { - // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.service) - return service_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >* -FileDescriptorProto::mutable_service() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.service) - return &service_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >& -FileDescriptorProto::service() const { - // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.service) - return service_; -} - -// repeated .google.protobuf.FieldDescriptorProto extension = 7; -int FileDescriptorProto::extension_size() const { - return extension_.size(); -} -void FileDescriptorProto::clear_extension() { - extension_.Clear(); -} -const ::google::protobuf::FieldDescriptorProto& FileDescriptorProto::extension(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.extension) - return extension_.Get(index); -} -::google::protobuf::FieldDescriptorProto* FileDescriptorProto::mutable_extension(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.extension) - return extension_.Mutable(index); -} -::google::protobuf::FieldDescriptorProto* FileDescriptorProto::add_extension() { - // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.extension) - return extension_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* -FileDescriptorProto::mutable_extension() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.extension) - return &extension_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& -FileDescriptorProto::extension() const { - // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.extension) - return extension_; -} - -// optional .google.protobuf.FileOptions options = 8; -bool FileDescriptorProto::has_options() const { - return (_has_bits_[0] & 0x00000008u) != 0; -} -void FileDescriptorProto::set_has_options() { - _has_bits_[0] |= 0x00000008u; -} -void FileDescriptorProto::clear_has_options() { - _has_bits_[0] &= ~0x00000008u; -} -void FileDescriptorProto::clear_options() { - if (options_ != NULL) options_->::google::protobuf::FileOptions::Clear(); - clear_has_options(); -} -const ::google::protobuf::FileOptions& FileDescriptorProto::options() const { - const ::google::protobuf::FileOptions* p = options_; - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_FileOptions_default_instance_); -} -::google::protobuf::FileOptions* FileDescriptorProto::mutable_options() { - set_has_options(); - if (options_ == NULL) { - options_ = new ::google::protobuf::FileOptions; - } - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.options) - return options_; -} -::google::protobuf::FileOptions* FileDescriptorProto::release_options() { - // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.options) - clear_has_options(); - ::google::protobuf::FileOptions* temp = options_; - options_ = NULL; - return temp; -} -void FileDescriptorProto::set_allocated_options(::google::protobuf::FileOptions* options) { - delete options_; - options_ = options; - if (options) { - set_has_options(); - } else { - clear_has_options(); - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.options) -} - -// optional .google.protobuf.SourceCodeInfo source_code_info = 9; -bool FileDescriptorProto::has_source_code_info() const { - return (_has_bits_[0] & 0x00000010u) != 0; -} -void FileDescriptorProto::set_has_source_code_info() { - _has_bits_[0] |= 0x00000010u; -} -void FileDescriptorProto::clear_has_source_code_info() { - _has_bits_[0] &= ~0x00000010u; -} -void FileDescriptorProto::clear_source_code_info() { - if (source_code_info_ != NULL) source_code_info_->::google::protobuf::SourceCodeInfo::Clear(); - clear_has_source_code_info(); -} -const ::google::protobuf::SourceCodeInfo& FileDescriptorProto::source_code_info() const { - const ::google::protobuf::SourceCodeInfo* p = source_code_info_; - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.source_code_info) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_SourceCodeInfo_default_instance_); -} -::google::protobuf::SourceCodeInfo* FileDescriptorProto::mutable_source_code_info() { - set_has_source_code_info(); - if (source_code_info_ == NULL) { - source_code_info_ = new ::google::protobuf::SourceCodeInfo; - } - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.source_code_info) - return source_code_info_; -} -::google::protobuf::SourceCodeInfo* FileDescriptorProto::release_source_code_info() { - // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.source_code_info) - clear_has_source_code_info(); - ::google::protobuf::SourceCodeInfo* temp = source_code_info_; - source_code_info_ = NULL; - return temp; -} -void FileDescriptorProto::set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info) { - delete source_code_info_; - source_code_info_ = source_code_info; - if (source_code_info) { - set_has_source_code_info(); - } else { - clear_has_source_code_info(); - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.source_code_info) -} - -// optional string syntax = 12; -bool FileDescriptorProto::has_syntax() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void FileDescriptorProto::set_has_syntax() { - _has_bits_[0] |= 0x00000004u; -} -void FileDescriptorProto::clear_has_syntax() { - _has_bits_[0] &= ~0x00000004u; -} -void FileDescriptorProto::clear_syntax() { - syntax_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_syntax(); -} -const ::std::string& FileDescriptorProto::syntax() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.syntax) - return syntax_.GetNoArena(); -} -void FileDescriptorProto::set_syntax(const ::std::string& value) { - set_has_syntax(); - syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.syntax) -} -#if LANG_CXX11 -void FileDescriptorProto::set_syntax(::std::string&& value) { - set_has_syntax(); - syntax_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileDescriptorProto.syntax) -} -#endif -void FileDescriptorProto::set_syntax(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_syntax(); - syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.syntax) -} -void FileDescriptorProto::set_syntax(const char* value, size_t size) { - set_has_syntax(); - syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.syntax) -} -::std::string* FileDescriptorProto::mutable_syntax() { - set_has_syntax(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.syntax) - return syntax_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileDescriptorProto::release_syntax() { - // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.syntax) - clear_has_syntax(); - return syntax_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileDescriptorProto::set_allocated_syntax(::std::string* syntax) { - if (syntax != NULL) { - set_has_syntax(); - } else { - clear_has_syntax(); - } - syntax_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), syntax); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.syntax) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void DescriptorProto_ReservedRange::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int DescriptorProto_ExtensionRange::kStartFieldNumber; -const int DescriptorProto_ExtensionRange::kEndFieldNumber; -const int DescriptorProto_ExtensionRange::kOptionsFieldNumber; +const int DescriptorProto_ReservedRange::kStartFieldNumber; +const int DescriptorProto_ReservedRange::kEndFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange() +DescriptorProto_ReservedRange::DescriptorProto_ReservedRange() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ReservedRange(); } SharedCtor(); - // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ReservedRange) } -DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from) +DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ReservedRange(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.DescriptorProto.ReservedRange) +} +DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_options()) { - options_ = new ::google::protobuf::ExtensionRangeOptions(*from.options_); - } else { - options_ = NULL; - } ::memcpy(&start_, &from.start_, static_cast(reinterpret_cast(&end_) - reinterpret_cast(&start_)) + sizeof(end_)); - // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto.ReservedRange) } -void DescriptorProto_ExtensionRange::SharedCtor() { +void DescriptorProto_ReservedRange::SharedCtor() { _cached_size_ = 0; - ::memset(&options_, 0, static_cast( + ::memset(&start_, 0, static_cast( reinterpret_cast(&end_) - - reinterpret_cast(&options_)) + sizeof(end_)); + reinterpret_cast(&start_)) + sizeof(end_)); } -DescriptorProto_ExtensionRange::~DescriptorProto_ExtensionRange() { - // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto.ExtensionRange) +DescriptorProto_ReservedRange::~DescriptorProto_ReservedRange() { + // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto.ReservedRange) SharedDtor(); } -void DescriptorProto_ExtensionRange::SharedDtor() { - if (this != internal_default_instance()) delete options_; +void DescriptorProto_ReservedRange::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } -void DescriptorProto_ExtensionRange::SetCachedSize(int size) const { +void DescriptorProto_ReservedRange::ArenaDtor(void* object) { + DescriptorProto_ReservedRange* _this = reinterpret_cast< DescriptorProto_ReservedRange* >(object); + (void)_this; +} +void DescriptorProto_ReservedRange::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DescriptorProto_ReservedRange::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } -const ::google::protobuf::Descriptor* DescriptorProto_ExtensionRange::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +const ::google::protobuf::Descriptor* DescriptorProto_ReservedRange::descriptor() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } -const DescriptorProto_ExtensionRange& DescriptorProto_ExtensionRange::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); +const DescriptorProto_ReservedRange& DescriptorProto_ReservedRange::default_instance() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ReservedRange(); return *internal_default_instance(); } -DescriptorProto_ExtensionRange* DescriptorProto_ExtensionRange::New(::google::protobuf::Arena* arena) const { - DescriptorProto_ExtensionRange* n = new DescriptorProto_ExtensionRange; - if (arena != NULL) { - arena->Own(n); - } - return n; +DescriptorProto_ReservedRange* DescriptorProto_ReservedRange::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); } -void DescriptorProto_ExtensionRange::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto.ExtensionRange) +void DescriptorProto_ReservedRange::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto.ReservedRange) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (has_options()) { - GOOGLE_DCHECK(options_ != NULL); - options_->::google::protobuf::ExtensionRangeOptions::Clear(); - } cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 6u) { + if (cached_has_bits & 3u) { ::memset(&start_, 0, static_cast( reinterpret_cast(&end_) - reinterpret_cast(&start_)) + sizeof(end_)); @@ -2775,11 +3174,11 @@ void DescriptorProto_ExtensionRange::Clear() { _internal_metadata_.Clear(); } -bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream( +bool DescriptorProto_ReservedRange::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto.ReservedRange) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; @@ -2813,18 +3212,6 @@ bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream( break; } - // optional .google.protobuf.ExtensionRangeOptions options = 3; - case 3: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_options())); - } else { - goto handle_unusual; - } - break; - } - default: { handle_unusual: if (tag == 0) { @@ -2837,79 +3224,66 @@ bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(parse_success:google.protobuf.DescriptorProto.ReservedRange) return true; failure: - // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto.ReservedRange) return false; #undef DO_ } -void DescriptorProto_ExtensionRange::SerializeWithCachedSizes( +void DescriptorProto_ReservedRange::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto.ReservedRange) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; // optional int32 start = 1; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000001u) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->start(), output); } // optional int32 end = 2; - if (cached_has_bits & 0x00000004u) { + if (cached_has_bits & 0x00000002u) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->end(), output); } - // optional .google.protobuf.ExtensionRangeOptions options = 3; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, *this->options_, output); - } - if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } - // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto.ReservedRange) } -::google::protobuf::uint8* DescriptorProto_ExtensionRange::InternalSerializeWithCachedSizesToArray( +::google::protobuf::uint8* DescriptorProto_ReservedRange::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ReservedRange) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; // optional int32 start = 1; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000001u) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->start(), target); } - // optional int32 end = 2; - if (cached_has_bits & 0x00000004u) { - target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target); - } - - // optional .google.protobuf.ExtensionRangeOptions options = 3; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 3, *this->options_, deterministic, target); + // optional int32 end = 2; + if (cached_has_bits & 0x00000002u) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target); } if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto.ReservedRange) return target; } -size_t DescriptorProto_ExtensionRange::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto.ExtensionRange) +size_t DescriptorProto_ReservedRange::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto.ReservedRange) size_t total_size = 0; if (_internal_metadata_.have_unknown_fields()) { @@ -2917,14 +3291,7 @@ size_t DescriptorProto_ExtensionRange::ByteSizeLong() const { ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( _internal_metadata_.unknown_fields()); } - if (_has_bits_[0 / 32] & 7u) { - // optional .google.protobuf.ExtensionRangeOptions options = 3; - if (has_options()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - *this->options_); - } - + if (_has_bits_[0 / 32] & 3u) { // optional int32 start = 1; if (has_start()) { total_size += 1 + @@ -2947,71 +3314,79 @@ size_t DescriptorProto_ExtensionRange::ByteSizeLong() const { return total_size; } -void DescriptorProto_ExtensionRange::MergeFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto.ExtensionRange) +void DescriptorProto_ReservedRange::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto.ReservedRange) GOOGLE_DCHECK_NE(&from, this); - const DescriptorProto_ExtensionRange* source = - ::google::protobuf::internal::DynamicCastToGenerated( + const DescriptorProto_ReservedRange* source = + ::google::protobuf::internal::DynamicCastToGenerated( &from); if (source == NULL) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto.ReservedRange) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto.ExtensionRange) + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto.ReservedRange) MergeFrom(*source); } } -void DescriptorProto_ExtensionRange::MergeFrom(const DescriptorProto_ExtensionRange& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto.ExtensionRange) +void DescriptorProto_ReservedRange::MergeFrom(const DescriptorProto_ReservedRange& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto.ReservedRange) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 7u) { + if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { - mutable_options()->::google::protobuf::ExtensionRangeOptions::MergeFrom(from.options()); - } - if (cached_has_bits & 0x00000002u) { start_ = from.start_; } - if (cached_has_bits & 0x00000004u) { + if (cached_has_bits & 0x00000002u) { end_ = from.end_; } _has_bits_[0] |= cached_has_bits; } } -void DescriptorProto_ExtensionRange::CopyFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto.ExtensionRange) +void DescriptorProto_ReservedRange::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto.ReservedRange) if (&from == this) return; Clear(); MergeFrom(from); } -void DescriptorProto_ExtensionRange::CopyFrom(const DescriptorProto_ExtensionRange& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.DescriptorProto.ExtensionRange) +void DescriptorProto_ReservedRange::CopyFrom(const DescriptorProto_ReservedRange& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.DescriptorProto.ReservedRange) if (&from == this) return; Clear(); MergeFrom(from); } -bool DescriptorProto_ExtensionRange::IsInitialized() const { - if (has_options()) { - if (!this->options_->IsInitialized()) return false; - } +bool DescriptorProto_ReservedRange::IsInitialized() const { return true; } -void DescriptorProto_ExtensionRange::Swap(DescriptorProto_ExtensionRange* other) { +void DescriptorProto_ReservedRange::Swap(DescriptorProto_ReservedRange* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DescriptorProto_ReservedRange* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DescriptorProto_ReservedRange::UnsafeArenaSwap(DescriptorProto_ReservedRange* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } -void DescriptorProto_ExtensionRange::InternalSwap(DescriptorProto_ExtensionRange* other) { +void DescriptorProto_ReservedRange::InternalSwap(DescriptorProto_ReservedRange* other) { using std::swap; - swap(options_, other->options_); swap(start_, other->start_); swap(end_, other->end_); swap(_has_bits_[0], other->_has_bits_[0]); @@ -3019,223 +3394,331 @@ void DescriptorProto_ExtensionRange::InternalSwap(DescriptorProto_ExtensionRange swap(_cached_size_, other->_cached_size_); } -::google::protobuf::Metadata DescriptorProto_ExtensionRange::GetMetadata() const { +::google::protobuf::Metadata DescriptorProto_ReservedRange::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// DescriptorProto_ExtensionRange - -// optional int32 start = 1; -bool DescriptorProto_ExtensionRange::has_start() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void DescriptorProto_ExtensionRange::set_has_start() { - _has_bits_[0] |= 0x00000002u; -} -void DescriptorProto_ExtensionRange::clear_has_start() { - _has_bits_[0] &= ~0x00000002u; -} -void DescriptorProto_ExtensionRange::clear_start() { - start_ = 0; - clear_has_start(); -} -::google::protobuf::int32 DescriptorProto_ExtensionRange::start() const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.start) - return start_; -} -void DescriptorProto_ExtensionRange::set_start(::google::protobuf::int32 value) { - set_has_start(); - start_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ExtensionRange.start) -} -// optional int32 end = 2; -bool DescriptorProto_ExtensionRange::has_end() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void DescriptorProto_ExtensionRange::set_has_end() { - _has_bits_[0] |= 0x00000004u; -} -void DescriptorProto_ExtensionRange::clear_has_end() { - _has_bits_[0] &= ~0x00000004u; -} -void DescriptorProto_ExtensionRange::clear_end() { - end_ = 0; - clear_has_end(); -} -::google::protobuf::int32 DescriptorProto_ExtensionRange::end() const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.end) - return end_; -} -void DescriptorProto_ExtensionRange::set_end(::google::protobuf::int32 value) { - set_has_end(); - end_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ExtensionRange.end) -} +// =================================================================== -// optional .google.protobuf.ExtensionRangeOptions options = 3; -bool DescriptorProto_ExtensionRange::has_options() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void DescriptorProto_ExtensionRange::set_has_options() { - _has_bits_[0] |= 0x00000001u; -} -void DescriptorProto_ExtensionRange::clear_has_options() { - _has_bits_[0] &= ~0x00000001u; -} -void DescriptorProto_ExtensionRange::clear_options() { - if (options_ != NULL) options_->::google::protobuf::ExtensionRangeOptions::Clear(); - clear_has_options(); +void DescriptorProto::InitAsDefaultInstance() { + ::google::protobuf::_DescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::MessageOptions*>( + ::google::protobuf::MessageOptions::internal_default_instance()); } -const ::google::protobuf::ExtensionRangeOptions& DescriptorProto_ExtensionRange::options() const { - const ::google::protobuf::ExtensionRangeOptions* p = options_; - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.options) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_ExtensionRangeOptions_default_instance_); +void DescriptorProto::_slow_mutable_options() { + options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::MessageOptions >( + GetArenaNoVirtual()); } -::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::mutable_options() { - set_has_options(); +::google::protobuf::MessageOptions* DescriptorProto::_slow_release_options() { if (options_ == NULL) { - options_ = new ::google::protobuf::ExtensionRangeOptions; + return NULL; + } else { + ::google::protobuf::MessageOptions* temp = new ::google::protobuf::MessageOptions(*options_); + options_ = NULL; + return temp; } - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.ExtensionRange.options) - return options_; } -::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::release_options() { - // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.ExtensionRange.options) - clear_has_options(); - ::google::protobuf::ExtensionRangeOptions* temp = options_; - options_ = NULL; - return temp; +void DescriptorProto::_slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::MessageOptions** options) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*options) == NULL) { + message_arena->Own(*options); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*options)) { + ::google::protobuf::MessageOptions* new_options = + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::MessageOptions >( + message_arena); + new_options->CopyFrom(**options); + *options = new_options; + } } -void DescriptorProto_ExtensionRange::set_allocated_options(::google::protobuf::ExtensionRangeOptions* options) { - delete options_; +void DescriptorProto::unsafe_arena_set_allocated_options( + ::google::protobuf::MessageOptions* options) { + if (GetArenaNoVirtual() == NULL) { + delete options_; + } options_ = options; if (options) { set_has_options(); } else { clear_has_options(); } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.options) } - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// =================================================================== - #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int DescriptorProto_ReservedRange::kStartFieldNumber; -const int DescriptorProto_ReservedRange::kEndFieldNumber; +const int DescriptorProto::kNameFieldNumber; +const int DescriptorProto::kFieldFieldNumber; +const int DescriptorProto::kExtensionFieldNumber; +const int DescriptorProto::kNestedTypeFieldNumber; +const int DescriptorProto::kEnumTypeFieldNumber; +const int DescriptorProto::kExtensionRangeFieldNumber; +const int DescriptorProto::kOneofDeclFieldNumber; +const int DescriptorProto::kOptionsFieldNumber; +const int DescriptorProto::kReservedRangeFieldNumber; +const int DescriptorProto::kReservedNameFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -DescriptorProto_ReservedRange::DescriptorProto_ReservedRange() +DescriptorProto::DescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto(); } SharedCtor(); - // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ReservedRange) + // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto) } -DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange& from) +DescriptorProto::DescriptorProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + field_(arena), + nested_type_(arena), + enum_type_(arena), + extension_range_(arena), + extension_(arena), + oneof_decl_(arena), + reserved_range_(arena), + reserved_name_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.DescriptorProto) +} +DescriptorProto::DescriptorProto(const DescriptorProto& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), - _cached_size_(0) { + _cached_size_(0), + field_(from.field_), + nested_type_(from.nested_type_), + enum_type_(from.enum_type_), + extension_range_(from.extension_range_), + extension_(from.extension_), + oneof_decl_(from.oneof_decl_), + reserved_range_(from.reserved_range_), + reserved_name_(from.reserved_name_) { _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&start_, &from.start_, - static_cast(reinterpret_cast(&end_) - - reinterpret_cast(&start_)) + sizeof(end_)); - // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto.ReservedRange) + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_name()) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + if (from.has_options()) { + options_ = new ::google::protobuf::MessageOptions(*from.options_); + } else { + options_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto) } -void DescriptorProto_ReservedRange::SharedCtor() { +void DescriptorProto::SharedCtor() { _cached_size_ = 0; - ::memset(&start_, 0, static_cast( - reinterpret_cast(&end_) - - reinterpret_cast(&start_)) + sizeof(end_)); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + options_ = NULL; } -DescriptorProto_ReservedRange::~DescriptorProto_ReservedRange() { - // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto.ReservedRange) +DescriptorProto::~DescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto) SharedDtor(); } -void DescriptorProto_ReservedRange::SharedDtor() { +void DescriptorProto::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + if (this != internal_default_instance()) delete options_; } -void DescriptorProto_ReservedRange::SetCachedSize(int size) const { +void DescriptorProto::ArenaDtor(void* object) { + DescriptorProto* _this = reinterpret_cast< DescriptorProto* >(object); + (void)_this; +} +void DescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } -const ::google::protobuf::Descriptor* DescriptorProto_ReservedRange::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +const ::google::protobuf::Descriptor* DescriptorProto::descriptor() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } -const DescriptorProto_ReservedRange& DescriptorProto_ReservedRange::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); +const DescriptorProto& DescriptorProto::default_instance() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto(); return *internal_default_instance(); } -DescriptorProto_ReservedRange* DescriptorProto_ReservedRange::New(::google::protobuf::Arena* arena) const { - DescriptorProto_ReservedRange* n = new DescriptorProto_ReservedRange; - if (arena != NULL) { - arena->Own(n); - } - return n; -} +DescriptorProto* DescriptorProto::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void DescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + field_.Clear(); + nested_type_.Clear(); + enum_type_.Clear(); + extension_range_.Clear(); + extension_.Clear(); + oneof_decl_.Clear(); + reserved_range_.Clear(); + reserved_name_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(options_ != NULL); + options_->::google::protobuf::MessageOptions::Clear(); + } + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool DescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.DescriptorProto.name"); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.FieldDescriptorProto field = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_field())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.DescriptorProto nested_type = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_nested_type())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_enum_type())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_extension_range())); + } else { + goto handle_unusual; + } + break; + } -void DescriptorProto_ReservedRange::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto.ReservedRange) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; + // repeated .google.protobuf.FieldDescriptorProto extension = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_extension())); + } else { + goto handle_unusual; + } + break; + } - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 3u) { - ::memset(&start_, 0, static_cast( - reinterpret_cast(&end_) - - reinterpret_cast(&start_)) + sizeof(end_)); - } - _has_bits_.Clear(); - _internal_metadata_.Clear(); -} + // optional .google.protobuf.MessageOptions options = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_options())); + } else { + goto handle_unusual; + } + break; + } -bool DescriptorProto_ReservedRange::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure - ::google::protobuf::uint32 tag; - // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto.ReservedRange) - for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // optional int32 start = 1; - case 1: { + // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + case 8: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - set_has_start(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, &start_))); + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_oneof_decl())); } else { goto handle_unusual; } break; } - // optional int32 end = 2; - case 2: { + // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + case 9: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - set_has_end(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, &end_))); + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_reserved_range())); + } else { + goto handle_unusual; + } + break; + } + + // repeated string reserved_name = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_reserved_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->reserved_name(this->reserved_name_size() - 1).data(), + static_cast(this->reserved_name(this->reserved_name_size() - 1).length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.DescriptorProto.reserved_name"); } else { goto handle_unusual; } @@ -3254,66 +3737,205 @@ bool DescriptorProto_ReservedRange::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:google.protobuf.DescriptorProto.ReservedRange) + // @@protoc_insertion_point(parse_success:google.protobuf.DescriptorProto) return true; failure: - // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto.ReservedRange) + // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto) return false; #undef DO_ } -void DescriptorProto_ReservedRange::SerializeWithCachedSizes( +void DescriptorProto::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto.ReservedRange) + // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; - // optional int32 start = 1; + // optional string name = 1; if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->start(), output); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.DescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); } - // optional int32 end = 2; + // repeated .google.protobuf.FieldDescriptorProto field = 2; + for (unsigned int i = 0, + n = static_cast(this->field_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->field(static_cast(i)), output); + } + + // repeated .google.protobuf.DescriptorProto nested_type = 3; + for (unsigned int i = 0, + n = static_cast(this->nested_type_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->nested_type(static_cast(i)), output); + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + for (unsigned int i = 0, + n = static_cast(this->enum_type_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->enum_type(static_cast(i)), output); + } + + // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + for (unsigned int i = 0, + n = static_cast(this->extension_range_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->extension_range(static_cast(i)), output); + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 6; + for (unsigned int i = 0, + n = static_cast(this->extension_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->extension(static_cast(i)), output); + } + + // optional .google.protobuf.MessageOptions options = 7; if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->end(), output); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *this->options_, output); + } + + // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + for (unsigned int i = 0, + n = static_cast(this->oneof_decl_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->oneof_decl(static_cast(i)), output); + } + + // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + for (unsigned int i = 0, + n = static_cast(this->reserved_range_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->reserved_range(static_cast(i)), output); + } + + // repeated string reserved_name = 10; + for (int i = 0, n = this->reserved_name_size(); i < n; i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->reserved_name(i).data(), static_cast(this->reserved_name(i).length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.DescriptorProto.reserved_name"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 10, this->reserved_name(i), output); } if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } - // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto.ReservedRange) + // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto) } -::google::protobuf::uint8* DescriptorProto_ReservedRange::InternalSerializeWithCachedSizesToArray( +::google::protobuf::uint8* DescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ReservedRange) + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; - cached_has_bits = _has_bits_[0]; - // optional int32 start = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->start(), target); + cached_has_bits = _has_bits_[0]; + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.DescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .google.protobuf.FieldDescriptorProto field = 2; + for (unsigned int i = 0, + n = static_cast(this->field_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, this->field(static_cast(i)), deterministic, target); + } + + // repeated .google.protobuf.DescriptorProto nested_type = 3; + for (unsigned int i = 0, + n = static_cast(this->nested_type_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, this->nested_type(static_cast(i)), deterministic, target); + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + for (unsigned int i = 0, + n = static_cast(this->enum_type_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, this->enum_type(static_cast(i)), deterministic, target); + } + + // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + for (unsigned int i = 0, + n = static_cast(this->extension_range_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, this->extension_range(static_cast(i)), deterministic, target); + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 6; + for (unsigned int i = 0, + n = static_cast(this->extension_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, this->extension(static_cast(i)), deterministic, target); + } + + // optional .google.protobuf.MessageOptions options = 7; + if (cached_has_bits & 0x00000002u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, *this->options_, deterministic, target); + } + + // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + for (unsigned int i = 0, + n = static_cast(this->oneof_decl_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, this->oneof_decl(static_cast(i)), deterministic, target); + } + + // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + for (unsigned int i = 0, + n = static_cast(this->reserved_range_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 9, this->reserved_range(static_cast(i)), deterministic, target); } - // optional int32 end = 2; - if (cached_has_bits & 0x00000002u) { - target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target); + // repeated string reserved_name = 10; + for (int i = 0, n = this->reserved_name_size(); i < n; i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->reserved_name(i).data(), static_cast(this->reserved_name(i).length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.DescriptorProto.reserved_name"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(10, this->reserved_name(i), target); } if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto.ReservedRange) + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto) return target; } -size_t DescriptorProto_ReservedRange::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto.ReservedRange) +size_t DescriptorProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto) size_t total_size = 0; if (_internal_metadata_.have_unknown_fields()) { @@ -3321,19 +3943,104 @@ size_t DescriptorProto_ReservedRange::ByteSizeLong() const { ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( _internal_metadata_.unknown_fields()); } + // repeated .google.protobuf.FieldDescriptorProto field = 2; + { + unsigned int count = static_cast(this->field_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->field(static_cast(i))); + } + } + + // repeated .google.protobuf.DescriptorProto nested_type = 3; + { + unsigned int count = static_cast(this->nested_type_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->nested_type(static_cast(i))); + } + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + { + unsigned int count = static_cast(this->enum_type_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->enum_type(static_cast(i))); + } + } + + // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + { + unsigned int count = static_cast(this->extension_range_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->extension_range(static_cast(i))); + } + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 6; + { + unsigned int count = static_cast(this->extension_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->extension(static_cast(i))); + } + } + + // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + { + unsigned int count = static_cast(this->oneof_decl_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->oneof_decl(static_cast(i))); + } + } + + // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + { + unsigned int count = static_cast(this->reserved_range_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->reserved_range(static_cast(i))); + } + } + + // repeated string reserved_name = 10; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->reserved_name_size()); + for (int i = 0, n = this->reserved_name_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->reserved_name(i)); + } + if (_has_bits_[0 / 32] & 3u) { - // optional int32 start = 1; - if (has_start()) { + // optional string name = 1; + if (has_name()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::Int32Size( - this->start()); + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); } - // optional int32 end = 2; - if (has_end()) { + // optional .google.protobuf.MessageOptions options = 7; + if (has_options()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::Int32Size( - this->end()); + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->options_); } } @@ -3344,379 +4051,224 @@ size_t DescriptorProto_ReservedRange::ByteSizeLong() const { return total_size; } -void DescriptorProto_ReservedRange::MergeFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto.ReservedRange) +void DescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto) GOOGLE_DCHECK_NE(&from, this); - const DescriptorProto_ReservedRange* source = - ::google::protobuf::internal::DynamicCastToGenerated( + const DescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( &from); if (source == NULL) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto.ReservedRange) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto.ReservedRange) + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto) MergeFrom(*source); } } -void DescriptorProto_ReservedRange::MergeFrom(const DescriptorProto_ReservedRange& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto.ReservedRange) +void DescriptorProto::MergeFrom(const DescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; + field_.MergeFrom(from.field_); + nested_type_.MergeFrom(from.nested_type_); + enum_type_.MergeFrom(from.enum_type_); + extension_range_.MergeFrom(from.extension_range_); + extension_.MergeFrom(from.extension_); + oneof_decl_.MergeFrom(from.oneof_decl_); + reserved_range_.MergeFrom(from.reserved_range_); + reserved_name_.MergeFrom(from.reserved_name_); cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { - start_ = from.start_; + set_name(from.name()); } if (cached_has_bits & 0x00000002u) { - end_ = from.end_; + mutable_options()->::google::protobuf::MessageOptions::MergeFrom(from.options()); } - _has_bits_[0] |= cached_has_bits; } } -void DescriptorProto_ReservedRange::CopyFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto.ReservedRange) +void DescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto) if (&from == this) return; Clear(); MergeFrom(from); } -void DescriptorProto_ReservedRange::CopyFrom(const DescriptorProto_ReservedRange& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.DescriptorProto.ReservedRange) +void DescriptorProto::CopyFrom(const DescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.DescriptorProto) if (&from == this) return; Clear(); MergeFrom(from); } -bool DescriptorProto_ReservedRange::IsInitialized() const { +bool DescriptorProto::IsInitialized() const { + if (!::google::protobuf::internal::AllAreInitialized(this->field())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->nested_type())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->enum_type())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->extension_range())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->extension())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->oneof_decl())) return false; + if (has_options()) { + if (!this->options_->IsInitialized()) return false; + } return true; } -void DescriptorProto_ReservedRange::Swap(DescriptorProto_ReservedRange* other) { +void DescriptorProto::Swap(DescriptorProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DescriptorProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DescriptorProto::UnsafeArenaSwap(DescriptorProto* other) { if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } -void DescriptorProto_ReservedRange::InternalSwap(DescriptorProto_ReservedRange* other) { +void DescriptorProto::InternalSwap(DescriptorProto* other) { using std::swap; - swap(start_, other->start_); - swap(end_, other->end_); + field_.InternalSwap(&other->field_); + nested_type_.InternalSwap(&other->nested_type_); + enum_type_.InternalSwap(&other->enum_type_); + extension_range_.InternalSwap(&other->extension_range_); + extension_.InternalSwap(&other->extension_); + oneof_decl_.InternalSwap(&other->oneof_decl_); + reserved_range_.InternalSwap(&other->reserved_range_); + reserved_name_.InternalSwap(&other->reserved_name_); + name_.Swap(&other->name_); + swap(options_, other->options_); swap(_has_bits_[0], other->_has_bits_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); swap(_cached_size_, other->_cached_size_); } -::google::protobuf::Metadata DescriptorProto_ReservedRange::GetMetadata() const { +::google::protobuf::Metadata DescriptorProto::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// DescriptorProto_ReservedRange - -// optional int32 start = 1; -bool DescriptorProto_ReservedRange::has_start() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void DescriptorProto_ReservedRange::set_has_start() { - _has_bits_[0] |= 0x00000001u; -} -void DescriptorProto_ReservedRange::clear_has_start() { - _has_bits_[0] &= ~0x00000001u; -} -void DescriptorProto_ReservedRange::clear_start() { - start_ = 0; - clear_has_start(); -} -::google::protobuf::int32 DescriptorProto_ReservedRange::start() const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.start) - return start_; -} -void DescriptorProto_ReservedRange::set_start(::google::protobuf::int32 value) { - set_has_start(); - start_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.start) -} - -// optional int32 end = 2; -bool DescriptorProto_ReservedRange::has_end() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void DescriptorProto_ReservedRange::set_has_end() { - _has_bits_[0] |= 0x00000002u; -} -void DescriptorProto_ReservedRange::clear_has_end() { - _has_bits_[0] &= ~0x00000002u; -} -void DescriptorProto_ReservedRange::clear_end() { - end_ = 0; - clear_has_end(); -} -::google::protobuf::int32 DescriptorProto_ReservedRange::end() const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.end) - return end_; -} -void DescriptorProto_ReservedRange::set_end(::google::protobuf::int32 value) { - set_has_end(); - end_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.end) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void ExtensionRangeOptions::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int DescriptorProto::kNameFieldNumber; -const int DescriptorProto::kFieldFieldNumber; -const int DescriptorProto::kExtensionFieldNumber; -const int DescriptorProto::kNestedTypeFieldNumber; -const int DescriptorProto::kEnumTypeFieldNumber; -const int DescriptorProto::kExtensionRangeFieldNumber; -const int DescriptorProto::kOneofDeclFieldNumber; -const int DescriptorProto::kOptionsFieldNumber; -const int DescriptorProto::kReservedRangeFieldNumber; -const int DescriptorProto::kReservedNameFieldNumber; +const int ExtensionRangeOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -DescriptorProto::DescriptorProto() +ExtensionRangeOptions::ExtensionRangeOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsExtensionRangeOptions(); } SharedCtor(); - // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto) + // @@protoc_insertion_point(constructor:google.protobuf.ExtensionRangeOptions) } -DescriptorProto::DescriptorProto(const DescriptorProto& from) +ExtensionRangeOptions::ExtensionRangeOptions(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _extensions_(arena), + _internal_metadata_(arena), + uninterpreted_option_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsExtensionRangeOptions(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.ExtensionRangeOptions) +} +ExtensionRangeOptions::ExtensionRangeOptions(const ExtensionRangeOptions& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), - field_(from.field_), - nested_type_(from.nested_type_), - enum_type_(from.enum_type_), - extension_range_(from.extension_range_), - extension_(from.extension_), - oneof_decl_(from.oneof_decl_), - reserved_range_(from.reserved_range_), - reserved_name_(from.reserved_name_) { + uninterpreted_option_(from.uninterpreted_option_) { _internal_metadata_.MergeFrom(from._internal_metadata_); - name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_name()) { - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); - } - if (from.has_options()) { - options_ = new ::google::protobuf::MessageOptions(*from.options_); - } else { - options_ = NULL; - } - // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto) + _extensions_.MergeFrom(from._extensions_); + // @@protoc_insertion_point(copy_constructor:google.protobuf.ExtensionRangeOptions) } -void DescriptorProto::SharedCtor() { +void ExtensionRangeOptions::SharedCtor() { _cached_size_ = 0; - name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - options_ = NULL; } -DescriptorProto::~DescriptorProto() { - // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto) +ExtensionRangeOptions::~ExtensionRangeOptions() { + // @@protoc_insertion_point(destructor:google.protobuf.ExtensionRangeOptions) SharedDtor(); } -void DescriptorProto::SharedDtor() { - name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete options_; +void ExtensionRangeOptions::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } -void DescriptorProto::SetCachedSize(int size) const { +void ExtensionRangeOptions::ArenaDtor(void* object) { + ExtensionRangeOptions* _this = reinterpret_cast< ExtensionRangeOptions* >(object); + (void)_this; +} +void ExtensionRangeOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ExtensionRangeOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } -const ::google::protobuf::Descriptor* DescriptorProto::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +const ::google::protobuf::Descriptor* ExtensionRangeOptions::descriptor() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } -const DescriptorProto& DescriptorProto::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); +const ExtensionRangeOptions& ExtensionRangeOptions::default_instance() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsExtensionRangeOptions(); return *internal_default_instance(); } -DescriptorProto* DescriptorProto::New(::google::protobuf::Arena* arena) const { - DescriptorProto* n = new DescriptorProto; - if (arena != NULL) { - arena->Own(n); - } - return n; +ExtensionRangeOptions* ExtensionRangeOptions::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); } -void DescriptorProto::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto) +void ExtensionRangeOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.ExtensionRangeOptions) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - field_.Clear(); - nested_type_.Clear(); - enum_type_.Clear(); - extension_range_.Clear(); - extension_.Clear(); - oneof_decl_.Clear(); - reserved_range_.Clear(); - reserved_name_.Clear(); - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(options_ != NULL); - options_->::google::protobuf::MessageOptions::Clear(); - } - } + _extensions_.Clear(); + uninterpreted_option_.Clear(); _has_bits_.Clear(); _internal_metadata_.Clear(); } -bool DescriptorProto::MergePartialFromCodedStream( +bool ExtensionRangeOptions::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto) + // @@protoc_insertion_point(parse_start:google.protobuf.ExtensionRangeOptions) for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // optional string name = 1; - case 1: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.DescriptorProto.name"); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.FieldDescriptorProto field = 2; - case 2: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_field())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.DescriptorProto nested_type = 3; - case 3: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_nested_type())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; - case 4: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_enum_type())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; - case 5: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_extension_range())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.FieldDescriptorProto extension = 6; - case 6: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_extension())); - } else { - goto handle_unusual; - } - break; - } - - // optional .google.protobuf.MessageOptions options = 7; - case 7: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_options())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; - case 8: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_oneof_decl())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; - case 9: { + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + case 999: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_reserved_range())); - } else { - goto handle_unusual; - } - break; - } - - // repeated string reserved_name = 10; - case 10: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->add_reserved_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->reserved_name(this->reserved_name_size() - 1).data(), - static_cast(this->reserved_name(this->reserved_name_size() - 1).length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.DescriptorProto.reserved_name"); + input, add_uninterpreted_option())); } else { goto handle_unusual; } @@ -3728,6 +4280,12 @@ bool DescriptorProto::MergePartialFromCodedStream( if (tag == 0) { goto success; } + if ((8000u <= tag)) { + DO_(_extensions_.ParseField(tag, input, + internal_default_instance(), + _internal_metadata_.mutable_unknown_fields())); + continue; + } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.mutable_unknown_fields())); break; @@ -3735,313 +4293,87 @@ bool DescriptorProto::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:google.protobuf.DescriptorProto) + // @@protoc_insertion_point(parse_success:google.protobuf.ExtensionRangeOptions) return true; failure: - // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto) + // @@protoc_insertion_point(parse_failure:google.protobuf.ExtensionRangeOptions) return false; #undef DO_ -} - -void DescriptorProto::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto) - ::google::protobuf::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // optional string name = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.DescriptorProto.name"); - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->name(), output); - } - - // repeated .google.protobuf.FieldDescriptorProto field = 2; - for (unsigned int i = 0, - n = static_cast(this->field_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, this->field(static_cast(i)), output); - } - - // repeated .google.protobuf.DescriptorProto nested_type = 3; - for (unsigned int i = 0, - n = static_cast(this->nested_type_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, this->nested_type(static_cast(i)), output); - } - - // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; - for (unsigned int i = 0, - n = static_cast(this->enum_type_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 4, this->enum_type(static_cast(i)), output); - } - - // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; - for (unsigned int i = 0, - n = static_cast(this->extension_range_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 5, this->extension_range(static_cast(i)), output); - } - - // repeated .google.protobuf.FieldDescriptorProto extension = 6; - for (unsigned int i = 0, - n = static_cast(this->extension_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 6, this->extension(static_cast(i)), output); - } - - // optional .google.protobuf.MessageOptions options = 7; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 7, *this->options_, output); - } - - // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; - for (unsigned int i = 0, - n = static_cast(this->oneof_decl_size()); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 8, this->oneof_decl(static_cast(i)), output); - } +} - // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; +void ExtensionRangeOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.ExtensionRangeOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned int i = 0, - n = static_cast(this->reserved_range_size()); i < n; i++) { + n = static_cast(this->uninterpreted_option_size()); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 9, this->reserved_range(static_cast(i)), output); + 999, this->uninterpreted_option(static_cast(i)), output); } - // repeated string reserved_name = 10; - for (int i = 0, n = this->reserved_name_size(); i < n; i++) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->reserved_name(i).data(), static_cast(this->reserved_name(i).length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.DescriptorProto.reserved_name"); - ::google::protobuf::internal::WireFormatLite::WriteString( - 10, this->reserved_name(i), output); - } + // Extension range [1000, 536870912) + _extensions_.SerializeWithCachedSizes( + 1000, 536870912, output); if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } - // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto) + // @@protoc_insertion_point(serialize_end:google.protobuf.ExtensionRangeOptions) } -::google::protobuf::uint8* DescriptorProto::InternalSerializeWithCachedSizesToArray( +::google::protobuf::uint8* ExtensionRangeOptions::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto) + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ExtensionRangeOptions) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; - cached_has_bits = _has_bits_[0]; - // optional string name = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.DescriptorProto.name"); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 1, this->name(), target); - } - - // repeated .google.protobuf.FieldDescriptorProto field = 2; - for (unsigned int i = 0, - n = static_cast(this->field_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 2, this->field(static_cast(i)), deterministic, target); - } - - // repeated .google.protobuf.DescriptorProto nested_type = 3; - for (unsigned int i = 0, - n = static_cast(this->nested_type_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 3, this->nested_type(static_cast(i)), deterministic, target); - } - - // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; - for (unsigned int i = 0, - n = static_cast(this->enum_type_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 4, this->enum_type(static_cast(i)), deterministic, target); - } - - // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; - for (unsigned int i = 0, - n = static_cast(this->extension_range_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 5, this->extension_range(static_cast(i)), deterministic, target); - } - - // repeated .google.protobuf.FieldDescriptorProto extension = 6; - for (unsigned int i = 0, - n = static_cast(this->extension_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 6, this->extension(static_cast(i)), deterministic, target); - } - - // optional .google.protobuf.MessageOptions options = 7; - if (cached_has_bits & 0x00000002u) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 7, *this->options_, deterministic, target); - } - - // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; - for (unsigned int i = 0, - n = static_cast(this->oneof_decl_size()); i < n; i++) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 8, this->oneof_decl(static_cast(i)), deterministic, target); - } - - // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned int i = 0, - n = static_cast(this->reserved_range_size()); i < n; i++) { + n = static_cast(this->uninterpreted_option_size()); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( - 9, this->reserved_range(static_cast(i)), deterministic, target); + 999, this->uninterpreted_option(static_cast(i)), deterministic, target); } - // repeated string reserved_name = 10; - for (int i = 0, n = this->reserved_name_size(); i < n; i++) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->reserved_name(i).data(), static_cast(this->reserved_name(i).length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.DescriptorProto.reserved_name"); - target = ::google::protobuf::internal::WireFormatLite:: - WriteStringToArray(10, this->reserved_name(i), target); - } + // Extension range [1000, 536870912) + target = _extensions_.InternalSerializeWithCachedSizesToArray( + 1000, 536870912, deterministic, target); if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto) + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ExtensionRangeOptions) return target; } -size_t DescriptorProto::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto) +size_t ExtensionRangeOptions::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.ExtensionRangeOptions) size_t total_size = 0; + total_size += _extensions_.ByteSize(); + if (_internal_metadata_.have_unknown_fields()) { total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( _internal_metadata_.unknown_fields()); } - // repeated .google.protobuf.FieldDescriptorProto field = 2; - { - unsigned int count = static_cast(this->field_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->field(static_cast(i))); - } - } - - // repeated .google.protobuf.DescriptorProto nested_type = 3; - { - unsigned int count = static_cast(this->nested_type_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->nested_type(static_cast(i))); - } - } - - // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; - { - unsigned int count = static_cast(this->enum_type_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->enum_type(static_cast(i))); - } - } - - // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; - { - unsigned int count = static_cast(this->extension_range_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->extension_range(static_cast(i))); - } - } - - // repeated .google.protobuf.FieldDescriptorProto extension = 6; - { - unsigned int count = static_cast(this->extension_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->extension(static_cast(i))); - } - } - - // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; - { - unsigned int count = static_cast(this->oneof_decl_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->oneof_decl(static_cast(i))); - } - } - - // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; { - unsigned int count = static_cast(this->reserved_range_size()); - total_size += 1UL * count; + unsigned int count = static_cast(this->uninterpreted_option_size()); + total_size += 2UL * count; for (unsigned int i = 0; i < count; i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->reserved_range(static_cast(i))); + this->uninterpreted_option(static_cast(i))); } } - // repeated string reserved_name = 10; - total_size += 1 * - ::google::protobuf::internal::FromIntSize(this->reserved_name_size()); - for (int i = 0, n = this->reserved_name_size(); i < n; i++) { - total_size += ::google::protobuf::internal::WireFormatLite::StringSize( - this->reserved_name(i)); - } - - if (_has_bits_[0 / 32] & 3u) { - // optional string name = 1; - if (has_name()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); - } - - // optional .google.protobuf.MessageOptions options = 7; - if (has_options()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - *this->options_); - } - - } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = cached_size; @@ -4049,582 +4381,475 @@ size_t DescriptorProto::ByteSizeLong() const { return total_size; } -void DescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto) +void ExtensionRangeOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ExtensionRangeOptions) GOOGLE_DCHECK_NE(&from, this); - const DescriptorProto* source = - ::google::protobuf::internal::DynamicCastToGenerated( + const ExtensionRangeOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( &from); if (source == NULL) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ExtensionRangeOptions) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto) + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ExtensionRangeOptions) MergeFrom(*source); } } -void DescriptorProto::MergeFrom(const DescriptorProto& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto) +void ExtensionRangeOptions::MergeFrom(const ExtensionRangeOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ExtensionRangeOptions) GOOGLE_DCHECK_NE(&from, this); + _extensions_.MergeFrom(from._extensions_); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; - field_.MergeFrom(from.field_); - nested_type_.MergeFrom(from.nested_type_); - enum_type_.MergeFrom(from.enum_type_); - extension_range_.MergeFrom(from.extension_range_); - extension_.MergeFrom(from.extension_); - oneof_decl_.MergeFrom(from.oneof_decl_); - reserved_range_.MergeFrom(from.reserved_range_); - reserved_name_.MergeFrom(from.reserved_name_); - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); - } - if (cached_has_bits & 0x00000002u) { - mutable_options()->::google::protobuf::MessageOptions::MergeFrom(from.options()); - } - } + uninterpreted_option_.MergeFrom(from.uninterpreted_option_); } -void DescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto) +void ExtensionRangeOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ExtensionRangeOptions) if (&from == this) return; Clear(); MergeFrom(from); } -void DescriptorProto::CopyFrom(const DescriptorProto& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.DescriptorProto) +void ExtensionRangeOptions::CopyFrom(const ExtensionRangeOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.ExtensionRangeOptions) if (&from == this) return; Clear(); MergeFrom(from); } -bool DescriptorProto::IsInitialized() const { - if (!::google::protobuf::internal::AllAreInitialized(this->field())) return false; - if (!::google::protobuf::internal::AllAreInitialized(this->nested_type())) return false; - if (!::google::protobuf::internal::AllAreInitialized(this->enum_type())) return false; - if (!::google::protobuf::internal::AllAreInitialized(this->extension_range())) return false; - if (!::google::protobuf::internal::AllAreInitialized(this->extension())) return false; - if (!::google::protobuf::internal::AllAreInitialized(this->oneof_decl())) return false; - if (has_options()) { - if (!this->options_->IsInitialized()) return false; +bool ExtensionRangeOptions::IsInitialized() const { + if (!_extensions_.IsInitialized()) { + return false; } + + if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; return true; } -void DescriptorProto::Swap(DescriptorProto* other) { +void ExtensionRangeOptions::Swap(ExtensionRangeOptions* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ExtensionRangeOptions* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ExtensionRangeOptions::UnsafeArenaSwap(ExtensionRangeOptions* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } -void DescriptorProto::InternalSwap(DescriptorProto* other) { +void ExtensionRangeOptions::InternalSwap(ExtensionRangeOptions* other) { using std::swap; - field_.InternalSwap(&other->field_); - nested_type_.InternalSwap(&other->nested_type_); - enum_type_.InternalSwap(&other->enum_type_); - extension_range_.InternalSwap(&other->extension_range_); - extension_.InternalSwap(&other->extension_); - oneof_decl_.InternalSwap(&other->oneof_decl_); - reserved_range_.InternalSwap(&other->reserved_range_); - reserved_name_.InternalSwap(&other->reserved_name_); - name_.Swap(&other->name_); - swap(options_, other->options_); + uninterpreted_option_.InternalSwap(&other->uninterpreted_option_); swap(_has_bits_[0], other->_has_bits_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); swap(_cached_size_, other->_cached_size_); + _extensions_.Swap(&other->_extensions_); } -::google::protobuf::Metadata DescriptorProto::GetMetadata() const { +::google::protobuf::Metadata ExtensionRangeOptions::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// DescriptorProto - -// optional string name = 1; -bool DescriptorProto::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void DescriptorProto::set_has_name() { - _has_bits_[0] |= 0x00000001u; -} -void DescriptorProto::clear_has_name() { - _has_bits_[0] &= ~0x00000001u; -} -void DescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); -} -const ::std::string& DescriptorProto::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.name) - return name_.GetNoArena(); -} -void DescriptorProto::set_name(const ::std::string& value) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.name) -} -#if LANG_CXX11 -void DescriptorProto::set_name(::std::string&& value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.DescriptorProto.name) -} -#endif -void DescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.name) -} -void DescriptorProto::set_name(const char* value, size_t size) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.name) -} -::std::string* DescriptorProto::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* DescriptorProto::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.name) - clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void DescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { - set_has_name(); - } else { - clear_has_name(); - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.name) -} - -// repeated .google.protobuf.FieldDescriptorProto field = 2; -int DescriptorProto::field_size() const { - return field_.size(); -} -void DescriptorProto::clear_field() { - field_.Clear(); -} -const ::google::protobuf::FieldDescriptorProto& DescriptorProto::field(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.field) - return field_.Get(index); -} -::google::protobuf::FieldDescriptorProto* DescriptorProto::mutable_field(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.field) - return field_.Mutable(index); -} -::google::protobuf::FieldDescriptorProto* DescriptorProto::add_field() { - // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.field) - return field_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* -DescriptorProto::mutable_field() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.field) - return &field_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& -DescriptorProto::field() const { - // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.field) - return field_; -} - -// repeated .google.protobuf.FieldDescriptorProto extension = 6; -int DescriptorProto::extension_size() const { - return extension_.size(); -} -void DescriptorProto::clear_extension() { - extension_.Clear(); -} -const ::google::protobuf::FieldDescriptorProto& DescriptorProto::extension(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension) - return extension_.Get(index); -} -::google::protobuf::FieldDescriptorProto* DescriptorProto::mutable_extension(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension) - return extension_.Mutable(index); -} -::google::protobuf::FieldDescriptorProto* DescriptorProto::add_extension() { - // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension) - return extension_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* -DescriptorProto::mutable_extension() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension) - return &extension_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& -DescriptorProto::extension() const { - // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension) - return extension_; -} - -// repeated .google.protobuf.DescriptorProto nested_type = 3; -int DescriptorProto::nested_type_size() const { - return nested_type_.size(); -} -void DescriptorProto::clear_nested_type() { - nested_type_.Clear(); -} -const ::google::protobuf::DescriptorProto& DescriptorProto::nested_type(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.nested_type) - return nested_type_.Get(index); -} -::google::protobuf::DescriptorProto* DescriptorProto::mutable_nested_type(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.nested_type) - return nested_type_.Mutable(index); -} -::google::protobuf::DescriptorProto* DescriptorProto::add_nested_type() { - // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.nested_type) - return nested_type_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >* -DescriptorProto::mutable_nested_type() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.nested_type) - return &nested_type_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >& -DescriptorProto::nested_type() const { - // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.nested_type) - return nested_type_; -} - -// repeated .google.protobuf.EnumDescriptorProto enum_type = 4; -int DescriptorProto::enum_type_size() const { - return enum_type_.size(); -} -void DescriptorProto::clear_enum_type() { - enum_type_.Clear(); -} -const ::google::protobuf::EnumDescriptorProto& DescriptorProto::enum_type(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.enum_type) - return enum_type_.Get(index); -} -::google::protobuf::EnumDescriptorProto* DescriptorProto::mutable_enum_type(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.enum_type) - return enum_type_.Mutable(index); -} -::google::protobuf::EnumDescriptorProto* DescriptorProto::add_enum_type() { - // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.enum_type) - return enum_type_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >* -DescriptorProto::mutable_enum_type() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.enum_type) - return &enum_type_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >& -DescriptorProto::enum_type() const { - // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.enum_type) - return enum_type_; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -// repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; -int DescriptorProto::extension_range_size() const { - return extension_range_.size(); -} -void DescriptorProto::clear_extension_range() { - extension_range_.Clear(); -} -const ::google::protobuf::DescriptorProto_ExtensionRange& DescriptorProto::extension_range(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension_range) - return extension_range_.Get(index); -} -::google::protobuf::DescriptorProto_ExtensionRange* DescriptorProto::mutable_extension_range(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension_range) - return extension_range_.Mutable(index); -} -::google::protobuf::DescriptorProto_ExtensionRange* DescriptorProto::add_extension_range() { - // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension_range) - return extension_range_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >* -DescriptorProto::mutable_extension_range() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension_range) - return &extension_range_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >& -DescriptorProto::extension_range() const { - // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension_range) - return extension_range_; -} -// repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; -int DescriptorProto::oneof_decl_size() const { - return oneof_decl_.size(); -} -void DescriptorProto::clear_oneof_decl() { - oneof_decl_.Clear(); -} -const ::google::protobuf::OneofDescriptorProto& DescriptorProto::oneof_decl(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.oneof_decl) - return oneof_decl_.Get(index); -} -::google::protobuf::OneofDescriptorProto* DescriptorProto::mutable_oneof_decl(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.oneof_decl) - return oneof_decl_.Mutable(index); -} -::google::protobuf::OneofDescriptorProto* DescriptorProto::add_oneof_decl() { - // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.oneof_decl) - return oneof_decl_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >* -DescriptorProto::mutable_oneof_decl() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.oneof_decl) - return &oneof_decl_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >& -DescriptorProto::oneof_decl() const { - // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.oneof_decl) - return oneof_decl_; -} +// =================================================================== -// optional .google.protobuf.MessageOptions options = 7; -bool DescriptorProto::has_options() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void DescriptorProto::set_has_options() { - _has_bits_[0] |= 0x00000002u; -} -void DescriptorProto::clear_has_options() { - _has_bits_[0] &= ~0x00000002u; -} -void DescriptorProto::clear_options() { - if (options_ != NULL) options_->::google::protobuf::MessageOptions::Clear(); - clear_has_options(); +void FieldDescriptorProto::InitAsDefaultInstance() { + ::google::protobuf::_FieldDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::FieldOptions*>( + ::google::protobuf::FieldOptions::internal_default_instance()); } -const ::google::protobuf::MessageOptions& DescriptorProto::options() const { - const ::google::protobuf::MessageOptions* p = options_; - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_MessageOptions_default_instance_); +void FieldDescriptorProto::_slow_mutable_options() { + options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::FieldOptions >( + GetArenaNoVirtual()); } -::google::protobuf::MessageOptions* DescriptorProto::mutable_options() { - set_has_options(); +::google::protobuf::FieldOptions* FieldDescriptorProto::_slow_release_options() { if (options_ == NULL) { - options_ = new ::google::protobuf::MessageOptions; + return NULL; + } else { + ::google::protobuf::FieldOptions* temp = new ::google::protobuf::FieldOptions(*options_); + options_ = NULL; + return temp; } - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.options) - return options_; } -::google::protobuf::MessageOptions* DescriptorProto::release_options() { - // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.options) - clear_has_options(); - ::google::protobuf::MessageOptions* temp = options_; - options_ = NULL; - return temp; +void FieldDescriptorProto::_slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::FieldOptions** options) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*options) == NULL) { + message_arena->Own(*options); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*options)) { + ::google::protobuf::FieldOptions* new_options = + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::FieldOptions >( + message_arena); + new_options->CopyFrom(**options); + *options = new_options; + } } -void DescriptorProto::set_allocated_options(::google::protobuf::MessageOptions* options) { - delete options_; +void FieldDescriptorProto::unsafe_arena_set_allocated_options( + ::google::protobuf::FieldOptions* options) { + if (GetArenaNoVirtual() == NULL) { + delete options_; + } options_ = options; if (options) { set_has_options(); } else { clear_has_options(); } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.options) -} - -// repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; -int DescriptorProto::reserved_range_size() const { - return reserved_range_.size(); -} -void DescriptorProto::clear_reserved_range() { - reserved_range_.Clear(); -} -const ::google::protobuf::DescriptorProto_ReservedRange& DescriptorProto::reserved_range(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_range) - return reserved_range_.Get(index); -} -::google::protobuf::DescriptorProto_ReservedRange* DescriptorProto::mutable_reserved_range(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_range) - return reserved_range_.Mutable(index); -} -::google::protobuf::DescriptorProto_ReservedRange* DescriptorProto::add_reserved_range() { - // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_range) - return reserved_range_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >* -DescriptorProto::mutable_reserved_range() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_range) - return &reserved_range_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >& -DescriptorProto::reserved_range() const { - // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_range) - return reserved_range_; -} - -// repeated string reserved_name = 10; -int DescriptorProto::reserved_name_size() const { - return reserved_name_.size(); -} -void DescriptorProto::clear_reserved_name() { - reserved_name_.Clear(); -} -const ::std::string& DescriptorProto::reserved_name(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_name) - return reserved_name_.Get(index); -} -::std::string* DescriptorProto::mutable_reserved_name(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_name) - return reserved_name_.Mutable(index); -} -void DescriptorProto::set_reserved_name(int index, const ::std::string& value) { - // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name) - reserved_name_.Mutable(index)->assign(value); -} -#if LANG_CXX11 -void DescriptorProto::set_reserved_name(int index, ::std::string&& value) { - // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name) - reserved_name_.Mutable(index)->assign(std::move(value)); -} -#endif -void DescriptorProto::set_reserved_name(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); - reserved_name_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.reserved_name) -} -void DescriptorProto::set_reserved_name(int index, const char* value, size_t size) { - reserved_name_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.reserved_name) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.options) } -::std::string* DescriptorProto::add_reserved_name() { - // @@protoc_insertion_point(field_add_mutable:google.protobuf.DescriptorProto.reserved_name) - return reserved_name_.Add(); -} -void DescriptorProto::add_reserved_name(const ::std::string& value) { - reserved_name_.Add()->assign(value); - // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name) -} -#if LANG_CXX11 -void DescriptorProto::add_reserved_name(::std::string&& value) { - reserved_name_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name) -} -#endif -void DescriptorProto::add_reserved_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - reserved_name_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:google.protobuf.DescriptorProto.reserved_name) -} -void DescriptorProto::add_reserved_name(const char* value, size_t size) { - reserved_name_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:google.protobuf.DescriptorProto.reserved_name) -} -const ::google::protobuf::RepeatedPtrField< ::std::string>& -DescriptorProto::reserved_name() const { - // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_name) - return reserved_name_; -} -::google::protobuf::RepeatedPtrField< ::std::string>* -DescriptorProto::mutable_reserved_name() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_name) - return &reserved_name_; -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// =================================================================== - #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int ExtensionRangeOptions::kUninterpretedOptionFieldNumber; +const int FieldDescriptorProto::kNameFieldNumber; +const int FieldDescriptorProto::kNumberFieldNumber; +const int FieldDescriptorProto::kLabelFieldNumber; +const int FieldDescriptorProto::kTypeFieldNumber; +const int FieldDescriptorProto::kTypeNameFieldNumber; +const int FieldDescriptorProto::kExtendeeFieldNumber; +const int FieldDescriptorProto::kDefaultValueFieldNumber; +const int FieldDescriptorProto::kOneofIndexFieldNumber; +const int FieldDescriptorProto::kJsonNameFieldNumber; +const int FieldDescriptorProto::kOptionsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -ExtensionRangeOptions::ExtensionRangeOptions() +FieldDescriptorProto::FieldDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProto(); } SharedCtor(); - // @@protoc_insertion_point(constructor:google.protobuf.ExtensionRangeOptions) + // @@protoc_insertion_point(constructor:google.protobuf.FieldDescriptorProto) } -ExtensionRangeOptions::ExtensionRangeOptions(const ExtensionRangeOptions& from) +FieldDescriptorProto::FieldDescriptorProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProto(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.FieldDescriptorProto) +} +FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), - _cached_size_(0), - uninterpreted_option_(from.uninterpreted_option_) { + _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); - _extensions_.MergeFrom(from._extensions_); - // @@protoc_insertion_point(copy_constructor:google.protobuf.ExtensionRangeOptions) + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_name()) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + extendee_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_extendee()) { + extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.extendee(), + GetArenaNoVirtual()); + } + type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_type_name()) { + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_name(), + GetArenaNoVirtual()); + } + default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_default_value()) { + default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.default_value(), + GetArenaNoVirtual()); + } + json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_json_name()) { + json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.json_name(), + GetArenaNoVirtual()); + } + if (from.has_options()) { + options_ = new ::google::protobuf::FieldOptions(*from.options_); + } else { + options_ = NULL; + } + ::memcpy(&number_, &from.number_, + static_cast(reinterpret_cast(&type_) - + reinterpret_cast(&number_)) + sizeof(type_)); + // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldDescriptorProto) } -void ExtensionRangeOptions::SharedCtor() { +void FieldDescriptorProto::SharedCtor() { _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + extendee_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&options_, 0, static_cast( + reinterpret_cast(&oneof_index_) - + reinterpret_cast(&options_)) + sizeof(oneof_index_)); + label_ = 1; + type_ = 1; } -ExtensionRangeOptions::~ExtensionRangeOptions() { - // @@protoc_insertion_point(destructor:google.protobuf.ExtensionRangeOptions) +FieldDescriptorProto::~FieldDescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.FieldDescriptorProto) SharedDtor(); } -void ExtensionRangeOptions::SharedDtor() { +void FieldDescriptorProto::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + extendee_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + type_name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + default_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + json_name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + if (this != internal_default_instance()) delete options_; } -void ExtensionRangeOptions::SetCachedSize(int size) const { +void FieldDescriptorProto::ArenaDtor(void* object) { + FieldDescriptorProto* _this = reinterpret_cast< FieldDescriptorProto* >(object); + (void)_this; +} +void FieldDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FieldDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } -const ::google::protobuf::Descriptor* ExtensionRangeOptions::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +const ::google::protobuf::Descriptor* FieldDescriptorProto::descriptor() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } -const ExtensionRangeOptions& ExtensionRangeOptions::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); +const FieldDescriptorProto& FieldDescriptorProto::default_instance() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProto(); return *internal_default_instance(); } -ExtensionRangeOptions* ExtensionRangeOptions::New(::google::protobuf::Arena* arena) const { - ExtensionRangeOptions* n = new ExtensionRangeOptions; - if (arena != NULL) { - arena->Own(n); - } - return n; +FieldDescriptorProto* FieldDescriptorProto::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); } -void ExtensionRangeOptions::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.ExtensionRangeOptions) +void FieldDescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.FieldDescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _extensions_.Clear(); - uninterpreted_option_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 63u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(!extendee_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + extendee_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(!type_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000008u) { + GOOGLE_DCHECK(!default_value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000010u) { + GOOGLE_DCHECK(!json_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000020u) { + GOOGLE_DCHECK(options_ != NULL); + options_->::google::protobuf::FieldOptions::Clear(); + } + } + if (cached_has_bits & 192u) { + ::memset(&number_, 0, static_cast( + reinterpret_cast(&oneof_index_) - + reinterpret_cast(&number_)) + sizeof(oneof_index_)); + } + if (cached_has_bits & 768u) { + label_ = 1; + type_ = 1; + } _has_bits_.Clear(); _internal_metadata_.Clear(); } -bool ExtensionRangeOptions::MergePartialFromCodedStream( +bool FieldDescriptorProto::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - // @@protoc_insertion_point(parse_start:google.protobuf.ExtensionRangeOptions) + // @@protoc_insertion_point(parse_start:google.protobuf.FieldDescriptorProto) for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - case 999: { + // optional string name = 1; + case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(58u /* 7994 & 0xFF */)) { + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FieldDescriptorProto.name"); + } else { + goto handle_unusual; + } + break; + } + + // optional string extendee = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_extendee())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->extendee().data(), static_cast(this->extendee().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FieldDescriptorProto.extendee"); + } else { + goto handle_unusual; + } + break; + } + + // optional int32 number = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + set_has_number(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &number_))); + } else { + goto handle_unusual; + } + break; + } + + // optional .google.protobuf.FieldDescriptorProto.Label label = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::google::protobuf::FieldDescriptorProto_Label_IsValid(value)) { + set_label(static_cast< ::google::protobuf::FieldDescriptorProto_Label >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 4, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // optional .google.protobuf.FieldDescriptorProto.Type type = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::google::protobuf::FieldDescriptorProto_Type_IsValid(value)) { + set_type(static_cast< ::google::protobuf::FieldDescriptorProto_Type >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 5, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // optional string type_name = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type_name().data(), static_cast(this->type_name().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FieldDescriptorProto.type_name"); + } else { + goto handle_unusual; + } + break; + } + + // optional string default_value = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_default_value())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->default_value().data(), static_cast(this->default_value().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FieldDescriptorProto.default_value"); + } else { + goto handle_unusual; + } + break; + } + + // optional .google.protobuf.FieldOptions options = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_uninterpreted_option())); + input, mutable_options())); + } else { + goto handle_unusual; + } + break; + } + + // optional int32 oneof_index = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { + set_has_oneof_index(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &oneof_index_))); + } else { + goto handle_unusual; + } + break; + } + + // optional string json_name = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_json_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->json_name().data(), static_cast(this->json_name().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FieldDescriptorProto.json_name"); } else { goto handle_unusual; } @@ -4636,12 +4861,6 @@ bool ExtensionRangeOptions::MergePartialFromCodedStream( if (tag == 0) { goto success; } - if ((8000u <= tag)) { - DO_(_extensions_.ParseField(tag, input, - internal_default_instance(), - _internal_metadata_.mutable_unknown_fields())); - continue; - } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.mutable_unknown_fields())); break; @@ -4649,87 +4868,287 @@ bool ExtensionRangeOptions::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:google.protobuf.ExtensionRangeOptions) + // @@protoc_insertion_point(parse_success:google.protobuf.FieldDescriptorProto) return true; failure: - // @@protoc_insertion_point(parse_failure:google.protobuf.ExtensionRangeOptions) + // @@protoc_insertion_point(parse_failure:google.protobuf.FieldDescriptorProto) return false; #undef DO_ } -void ExtensionRangeOptions::SerializeWithCachedSizes( +void FieldDescriptorProto::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:google.protobuf.ExtensionRangeOptions) + // @@protoc_insertion_point(serialize_start:google.protobuf.FieldDescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - for (unsigned int i = 0, - n = static_cast(this->uninterpreted_option_size()); i < n; i++) { + cached_has_bits = _has_bits_[0]; + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string extendee = 2; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->extendee().data(), static_cast(this->extendee().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.extendee"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->extendee(), output); + } + + // optional int32 number = 3; + if (cached_has_bits & 0x00000040u) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->number(), output); + } + + // optional .google.protobuf.FieldDescriptorProto.Label label = 4; + if (cached_has_bits & 0x00000100u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->label(), output); + } + + // optional .google.protobuf.FieldDescriptorProto.Type type = 5; + if (cached_has_bits & 0x00000200u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->type(), output); + } + + // optional string type_name = 6; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type_name().data(), static_cast(this->type_name().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.type_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->type_name(), output); + } + + // optional string default_value = 7; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->default_value().data(), static_cast(this->default_value().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.default_value"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->default_value(), output); + } + + // optional .google.protobuf.FieldOptions options = 8; + if (cached_has_bits & 0x00000020u) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 999, this->uninterpreted_option(static_cast(i)), output); + 8, *this->options_, output); + } + + // optional int32 oneof_index = 9; + if (cached_has_bits & 0x00000080u) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->oneof_index(), output); + } + + // optional string json_name = 10; + if (cached_has_bits & 0x00000010u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->json_name().data(), static_cast(this->json_name().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.json_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 10, this->json_name(), output); } - // Extension range [1000, 536870912) - _extensions_.SerializeWithCachedSizes( - 1000, 536870912, output); - if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } - // @@protoc_insertion_point(serialize_end:google.protobuf.ExtensionRangeOptions) + // @@protoc_insertion_point(serialize_end:google.protobuf.FieldDescriptorProto) } -::google::protobuf::uint8* ExtensionRangeOptions::InternalSerializeWithCachedSizesToArray( +::google::protobuf::uint8* FieldDescriptorProto::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ExtensionRangeOptions) + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldDescriptorProto) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - for (unsigned int i = 0, - n = static_cast(this->uninterpreted_option_size()); i < n; i++) { + cached_has_bits = _has_bits_[0]; + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional string extendee = 2; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->extendee().data(), static_cast(this->extendee().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.extendee"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->extendee(), target); + } + + // optional int32 number = 3; + if (cached_has_bits & 0x00000040u) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->number(), target); + } + + // optional .google.protobuf.FieldDescriptorProto.Label label = 4; + if (cached_has_bits & 0x00000100u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->label(), target); + } + + // optional .google.protobuf.FieldDescriptorProto.Type type = 5; + if (cached_has_bits & 0x00000200u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 5, this->type(), target); + } + + // optional string type_name = 6; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type_name().data(), static_cast(this->type_name().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.type_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->type_name(), target); + } + + // optional string default_value = 7; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->default_value().data(), static_cast(this->default_value().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.default_value"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 7, this->default_value(), target); + } + + // optional .google.protobuf.FieldOptions options = 8; + if (cached_has_bits & 0x00000020u) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageNoVirtualToArray( - 999, this->uninterpreted_option(static_cast(i)), deterministic, target); + 8, *this->options_, deterministic, target); } - // Extension range [1000, 536870912) - target = _extensions_.InternalSerializeWithCachedSizesToArray( - 1000, 536870912, deterministic, target); + // optional int32 oneof_index = 9; + if (cached_has_bits & 0x00000080u) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->oneof_index(), target); + } + + // optional string json_name = 10; + if (cached_has_bits & 0x00000010u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->json_name().data(), static_cast(this->json_name().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.json_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 10, this->json_name(), target); + } if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ExtensionRangeOptions) + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldDescriptorProto) return target; } -size_t ExtensionRangeOptions::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.ExtensionRangeOptions) +size_t FieldDescriptorProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FieldDescriptorProto) size_t total_size = 0; - total_size += _extensions_.ByteSize(); - if (_internal_metadata_.have_unknown_fields()) { total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( _internal_metadata_.unknown_fields()); } - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - { - unsigned int count = static_cast(this->uninterpreted_option_size()); - total_size += 2UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += + if (_has_bits_[0 / 32] & 255u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional string extendee = 2; + if (has_extendee()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->extendee()); + } + + // optional string type_name = 6; + if (has_type_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type_name()); + } + + // optional string default_value = 7; + if (has_default_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->default_value()); + } + + // optional string json_name = 10; + if (has_json_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->json_name()); + } + + // optional .google.protobuf.FieldOptions options = 8; + if (has_options()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->uninterpreted_option(static_cast(i))); + *this->options_); + } + + // optional int32 number = 3; + if (has_number()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->number()); + } + + // optional int32 oneof_index = 9; + if (has_oneof_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->oneof_index()); } + } + if (_has_bits_[8 / 32] & 768u) { + // optional .google.protobuf.FieldDescriptorProto.Label label = 4; + if (has_label()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->label()); + } + + // optional .google.protobuf.FieldDescriptorProto.Type type = 5; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = cached_size; @@ -4737,132 +5156,198 @@ size_t ExtensionRangeOptions::ByteSizeLong() const { return total_size; } -void ExtensionRangeOptions::MergeFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ExtensionRangeOptions) +void FieldDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FieldDescriptorProto) GOOGLE_DCHECK_NE(&from, this); - const ExtensionRangeOptions* source = - ::google::protobuf::internal::DynamicCastToGenerated( + const FieldDescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( &from); if (source == NULL) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ExtensionRangeOptions) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldDescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ExtensionRangeOptions) + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FieldDescriptorProto) MergeFrom(*source); } } -void ExtensionRangeOptions::MergeFrom(const ExtensionRangeOptions& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ExtensionRangeOptions) +void FieldDescriptorProto::MergeFrom(const FieldDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldDescriptorProto) GOOGLE_DCHECK_NE(&from, this); - _extensions_.MergeFrom(from._extensions_); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; - uninterpreted_option_.MergeFrom(from.uninterpreted_option_); + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 255u) { + if (cached_has_bits & 0x00000001u) { + set_name(from.name()); + } + if (cached_has_bits & 0x00000002u) { + set_extendee(from.extendee()); + } + if (cached_has_bits & 0x00000004u) { + set_type_name(from.type_name()); + } + if (cached_has_bits & 0x00000008u) { + set_default_value(from.default_value()); + } + if (cached_has_bits & 0x00000010u) { + set_json_name(from.json_name()); + } + if (cached_has_bits & 0x00000020u) { + mutable_options()->::google::protobuf::FieldOptions::MergeFrom(from.options()); + } + if (cached_has_bits & 0x00000040u) { + number_ = from.number_; + } + if (cached_has_bits & 0x00000080u) { + oneof_index_ = from.oneof_index_; + } + _has_bits_[0] |= cached_has_bits; + } + if (cached_has_bits & 768u) { + if (cached_has_bits & 0x00000100u) { + label_ = from.label_; + } + if (cached_has_bits & 0x00000200u) { + type_ = from.type_; + } + _has_bits_[0] |= cached_has_bits; + } } -void ExtensionRangeOptions::CopyFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ExtensionRangeOptions) +void FieldDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FieldDescriptorProto) if (&from == this) return; Clear(); MergeFrom(from); } -void ExtensionRangeOptions::CopyFrom(const ExtensionRangeOptions& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.ExtensionRangeOptions) +void FieldDescriptorProto::CopyFrom(const FieldDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FieldDescriptorProto) if (&from == this) return; Clear(); MergeFrom(from); } -bool ExtensionRangeOptions::IsInitialized() const { - if (!_extensions_.IsInitialized()) { - return false; +bool FieldDescriptorProto::IsInitialized() const { + if (has_options()) { + if (!this->options_->IsInitialized()) return false; } - - if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; return true; } - -void ExtensionRangeOptions::Swap(ExtensionRangeOptions* other) { + +void FieldDescriptorProto::Swap(FieldDescriptorProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FieldDescriptorProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FieldDescriptorProto::UnsafeArenaSwap(FieldDescriptorProto* other) { if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } -void ExtensionRangeOptions::InternalSwap(ExtensionRangeOptions* other) { +void FieldDescriptorProto::InternalSwap(FieldDescriptorProto* other) { using std::swap; - uninterpreted_option_.InternalSwap(&other->uninterpreted_option_); + name_.Swap(&other->name_); + extendee_.Swap(&other->extendee_); + type_name_.Swap(&other->type_name_); + default_value_.Swap(&other->default_value_); + json_name_.Swap(&other->json_name_); + swap(options_, other->options_); + swap(number_, other->number_); + swap(oneof_index_, other->oneof_index_); + swap(label_, other->label_); + swap(type_, other->type_); swap(_has_bits_[0], other->_has_bits_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); swap(_cached_size_, other->_cached_size_); - _extensions_.Swap(&other->_extensions_); } -::google::protobuf::Metadata ExtensionRangeOptions::GetMetadata() const { +::google::protobuf::Metadata FieldDescriptorProto::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// ExtensionRangeOptions -// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; -int ExtensionRangeOptions::uninterpreted_option_size() const { - return uninterpreted_option_.size(); -} -void ExtensionRangeOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); -} -const ::google::protobuf::UninterpretedOption& ExtensionRangeOptions::uninterpreted_option(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.ExtensionRangeOptions.uninterpreted_option) - return uninterpreted_option_.Get(index); +// =================================================================== + +void OneofDescriptorProto::InitAsDefaultInstance() { + ::google::protobuf::_OneofDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::OneofOptions*>( + ::google::protobuf::OneofOptions::internal_default_instance()); } -::google::protobuf::UninterpretedOption* ExtensionRangeOptions::mutable_uninterpreted_option(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.ExtensionRangeOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); +void OneofDescriptorProto::_slow_mutable_options() { + options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::OneofOptions >( + GetArenaNoVirtual()); } -::google::protobuf::UninterpretedOption* ExtensionRangeOptions::add_uninterpreted_option() { - // @@protoc_insertion_point(field_add:google.protobuf.ExtensionRangeOptions.uninterpreted_option) - return uninterpreted_option_.Add(); +::google::protobuf::OneofOptions* OneofDescriptorProto::_slow_release_options() { + if (options_ == NULL) { + return NULL; + } else { + ::google::protobuf::OneofOptions* temp = new ::google::protobuf::OneofOptions(*options_); + options_ = NULL; + return temp; + } } -::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* -ExtensionRangeOptions::mutable_uninterpreted_option() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.ExtensionRangeOptions.uninterpreted_option) - return &uninterpreted_option_; +void OneofDescriptorProto::_slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::OneofOptions** options) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*options) == NULL) { + message_arena->Own(*options); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*options)) { + ::google::protobuf::OneofOptions* new_options = + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::OneofOptions >( + message_arena); + new_options->CopyFrom(**options); + *options = new_options; + } } -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& -ExtensionRangeOptions::uninterpreted_option() const { - // @@protoc_insertion_point(field_list:google.protobuf.ExtensionRangeOptions.uninterpreted_option) - return uninterpreted_option_; +void OneofDescriptorProto::unsafe_arena_set_allocated_options( + ::google::protobuf::OneofOptions* options) { + if (GetArenaNoVirtual() == NULL) { + delete options_; + } + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.OneofDescriptorProto.options) } - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// =================================================================== - #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int FieldDescriptorProto::kNameFieldNumber; -const int FieldDescriptorProto::kNumberFieldNumber; -const int FieldDescriptorProto::kLabelFieldNumber; -const int FieldDescriptorProto::kTypeFieldNumber; -const int FieldDescriptorProto::kTypeNameFieldNumber; -const int FieldDescriptorProto::kExtendeeFieldNumber; -const int FieldDescriptorProto::kDefaultValueFieldNumber; -const int FieldDescriptorProto::kOneofIndexFieldNumber; -const int FieldDescriptorProto::kJsonNameFieldNumber; -const int FieldDescriptorProto::kOptionsFieldNumber; +const int OneofDescriptorProto::kNameFieldNumber; +const int OneofDescriptorProto::kOptionsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -FieldDescriptorProto::FieldDescriptorProto() +OneofDescriptorProto::OneofDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofDescriptorProto(); } SharedCtor(); - // @@protoc_insertion_point(constructor:google.protobuf.FieldDescriptorProto) + // @@protoc_insertion_point(constructor:google.protobuf.OneofDescriptorProto) } -FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from) +OneofDescriptorProto::OneofDescriptorProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofDescriptorProto(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.OneofDescriptorProto) +} +OneofDescriptorProto::OneofDescriptorProto(const OneofDescriptorProto& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), @@ -4870,264 +5355,115 @@ FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from) _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_name()) { - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); - } - extendee_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_extendee()) { - extendee_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.extendee_); - } - type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_type_name()) { - type_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_name_); - } - default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_default_value()) { - default_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.default_value_); - } - json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_json_name()) { - json_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.json_name_); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); } if (from.has_options()) { - options_ = new ::google::protobuf::FieldOptions(*from.options_); + options_ = new ::google::protobuf::OneofOptions(*from.options_); } else { options_ = NULL; } - ::memcpy(&number_, &from.number_, - static_cast(reinterpret_cast(&type_) - - reinterpret_cast(&number_)) + sizeof(type_)); - // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldDescriptorProto) + // @@protoc_insertion_point(copy_constructor:google.protobuf.OneofDescriptorProto) } -void FieldDescriptorProto::SharedCtor() { +void OneofDescriptorProto::SharedCtor() { _cached_size_ = 0; name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - extendee_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - ::memset(&options_, 0, static_cast( - reinterpret_cast(&oneof_index_) - - reinterpret_cast(&options_)) + sizeof(oneof_index_)); - label_ = 1; - type_ = 1; + options_ = NULL; } -FieldDescriptorProto::~FieldDescriptorProto() { - // @@protoc_insertion_point(destructor:google.protobuf.FieldDescriptorProto) +OneofDescriptorProto::~OneofDescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.OneofDescriptorProto) SharedDtor(); } -void FieldDescriptorProto::SharedDtor() { - name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - extendee_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - type_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - default_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - json_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +void OneofDescriptorProto::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); if (this != internal_default_instance()) delete options_; } -void FieldDescriptorProto::SetCachedSize(int size) const { +void OneofDescriptorProto::ArenaDtor(void* object) { + OneofDescriptorProto* _this = reinterpret_cast< OneofDescriptorProto* >(object); + (void)_this; +} +void OneofDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OneofDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); -} -const ::google::protobuf::Descriptor* FieldDescriptorProto::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; -} - -const FieldDescriptorProto& FieldDescriptorProto::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); - return *internal_default_instance(); -} - -FieldDescriptorProto* FieldDescriptorProto::New(::google::protobuf::Arena* arena) const { - FieldDescriptorProto* n = new FieldDescriptorProto; - if (arena != NULL) { - arena->Own(n); - } - return n; -} - -void FieldDescriptorProto::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.FieldDescriptorProto) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 63u) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(!extendee_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*extendee_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(!type_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*type_name_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(!default_value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*default_value_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000010u) { - GOOGLE_DCHECK(!json_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*json_name_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000020u) { - GOOGLE_DCHECK(options_ != NULL); - options_->::google::protobuf::FieldOptions::Clear(); - } - } - if (cached_has_bits & 192u) { - ::memset(&number_, 0, static_cast( - reinterpret_cast(&oneof_index_) - - reinterpret_cast(&number_)) + sizeof(oneof_index_)); - } - if (cached_has_bits & 768u) { - label_ = 1; - type_ = 1; - } - _has_bits_.Clear(); - _internal_metadata_.Clear(); -} - -bool FieldDescriptorProto::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure - ::google::protobuf::uint32 tag; - // @@protoc_insertion_point(parse_start:google.protobuf.FieldDescriptorProto) - for (;;) { - ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // optional string name = 1; - case 1: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.FieldDescriptorProto.name"); - } else { - goto handle_unusual; - } - break; - } - - // optional string extendee = 2; - case 2: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_extendee())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->extendee().data(), static_cast(this->extendee().length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.FieldDescriptorProto.extendee"); - } else { - goto handle_unusual; - } - break; - } - - // optional int32 number = 3; - case 3: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { - set_has_number(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, &number_))); - } else { - goto handle_unusual; - } - break; - } - - // optional .google.protobuf.FieldDescriptorProto.Label label = 4; - case 4: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::google::protobuf::FieldDescriptorProto_Label_IsValid(value)) { - set_label(static_cast< ::google::protobuf::FieldDescriptorProto_Label >(value)); - } else { - mutable_unknown_fields()->AddVarint( - 4, static_cast< ::google::protobuf::uint64>(value)); - } - } else { - goto handle_unusual; - } - break; - } - - // optional .google.protobuf.FieldDescriptorProto.Type type = 5; - case 5: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::google::protobuf::FieldDescriptorProto_Type_IsValid(value)) { - set_type(static_cast< ::google::protobuf::FieldDescriptorProto_Type >(value)); - } else { - mutable_unknown_fields()->AddVarint( - 5, static_cast< ::google::protobuf::uint64>(value)); - } - } else { - goto handle_unusual; - } - break; - } +} +const ::google::protobuf::Descriptor* OneofDescriptorProto::descriptor() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} - // optional string type_name = 6; - case 6: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_type_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->type_name().data(), static_cast(this->type_name().length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.FieldDescriptorProto.type_name"); - } else { - goto handle_unusual; - } - break; - } +const OneofDescriptorProto& OneofDescriptorProto::default_instance() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofDescriptorProto(); + return *internal_default_instance(); +} - // optional string default_value = 7; - case 7: { +OneofDescriptorProto* OneofDescriptorProto::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void OneofDescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.OneofDescriptorProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(options_ != NULL); + options_->::google::protobuf::OneofOptions::Clear(); + } + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool OneofDescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.OneofDescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_default_value())); + input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->default_value().data(), static_cast(this->default_value().length()), + this->name().data(), static_cast(this->name().length()), ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.FieldDescriptorProto.default_value"); + "google.protobuf.OneofDescriptorProto.name"); } else { goto handle_unusual; } break; } - // optional .google.protobuf.FieldOptions options = 8; - case 8: { + // optional .google.protobuf.OneofOptions options = 2; + case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_options())); } else { @@ -5136,36 +5472,6 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( break; } - // optional int32 oneof_index = 9; - case 9: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { - set_has_oneof_index(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, &oneof_index_))); - } else { - goto handle_unusual; - } - break; - } - - // optional string json_name = 10; - case 10: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_json_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->json_name().data(), static_cast(this->json_name().length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.FieldDescriptorProto.json_name"); - } else { - goto handle_unusual; - } - break; - } - default: { handle_unusual: if (tag == 0) { @@ -5178,208 +5484,80 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:google.protobuf.FieldDescriptorProto) + // @@protoc_insertion_point(parse_success:google.protobuf.OneofDescriptorProto) return true; failure: - // @@protoc_insertion_point(parse_failure:google.protobuf.FieldDescriptorProto) + // @@protoc_insertion_point(parse_failure:google.protobuf.OneofDescriptorProto) return false; #undef DO_ } -void FieldDescriptorProto::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:google.protobuf.FieldDescriptorProto) - ::google::protobuf::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // optional string name = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FieldDescriptorProto.name"); - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->name(), output); - } - - // optional string extendee = 2; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->extendee().data(), static_cast(this->extendee().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FieldDescriptorProto.extendee"); - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->extendee(), output); - } - - // optional int32 number = 3; - if (cached_has_bits & 0x00000040u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->number(), output); - } - - // optional .google.protobuf.FieldDescriptorProto.Label label = 4; - if (cached_has_bits & 0x00000100u) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 4, this->label(), output); - } - - // optional .google.protobuf.FieldDescriptorProto.Type type = 5; - if (cached_has_bits & 0x00000200u) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 5, this->type(), output); - } - - // optional string type_name = 6; - if (cached_has_bits & 0x00000004u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->type_name().data(), static_cast(this->type_name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FieldDescriptorProto.type_name"); - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 6, this->type_name(), output); - } - - // optional string default_value = 7; - if (cached_has_bits & 0x00000008u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->default_value().data(), static_cast(this->default_value().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FieldDescriptorProto.default_value"); - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 7, this->default_value(), output); - } - - // optional .google.protobuf.FieldOptions options = 8; - if (cached_has_bits & 0x00000020u) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 8, *this->options_, output); - } - - // optional int32 oneof_index = 9; - if (cached_has_bits & 0x00000080u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->oneof_index(), output); - } - - // optional string json_name = 10; - if (cached_has_bits & 0x00000010u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->json_name().data(), static_cast(this->json_name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FieldDescriptorProto.json_name"); - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 10, this->json_name(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:google.protobuf.FieldDescriptorProto) -} - -::google::protobuf::uint8* FieldDescriptorProto::InternalSerializeWithCachedSizesToArray( - bool deterministic, ::google::protobuf::uint8* target) const { - (void)deterministic; // Unused - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldDescriptorProto) - ::google::protobuf::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // optional string name = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FieldDescriptorProto.name"); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 1, this->name(), target); - } - - // optional string extendee = 2; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->extendee().data(), static_cast(this->extendee().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FieldDescriptorProto.extendee"); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 2, this->extendee(), target); - } - - // optional int32 number = 3; - if (cached_has_bits & 0x00000040u) { - target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->number(), target); - } - - // optional .google.protobuf.FieldDescriptorProto.Label label = 4; - if (cached_has_bits & 0x00000100u) { - target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( - 4, this->label(), target); - } - - // optional .google.protobuf.FieldDescriptorProto.Type type = 5; - if (cached_has_bits & 0x00000200u) { - target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( - 5, this->type(), target); - } - - // optional string type_name = 6; - if (cached_has_bits & 0x00000004u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->type_name().data(), static_cast(this->type_name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FieldDescriptorProto.type_name"); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 6, this->type_name(), target); - } +void OneofDescriptorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.OneofDescriptorProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; - // optional string default_value = 7; - if (cached_has_bits & 0x00000008u) { + cached_has_bits = _has_bits_[0]; + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->default_value().data(), static_cast(this->default_value().length()), + this->name().data(), static_cast(this->name().length()), ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FieldDescriptorProto.default_value"); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 7, this->default_value(), target); + "google.protobuf.OneofDescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); } - // optional .google.protobuf.FieldOptions options = 8; - if (cached_has_bits & 0x00000020u) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 8, *this->options_, deterministic, target); + // optional .google.protobuf.OneofOptions options = 2; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *this->options_, output); } - // optional int32 oneof_index = 9; - if (cached_has_bits & 0x00000080u) { - target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->oneof_index(), target); + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); } + // @@protoc_insertion_point(serialize_end:google.protobuf.OneofDescriptorProto) +} - // optional string json_name = 10; - if (cached_has_bits & 0x00000010u) { +::google::protobuf::uint8* OneofDescriptorProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofDescriptorProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->json_name().data(), static_cast(this->json_name().length()), + this->name().data(), static_cast(this->name().length()), ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.FieldDescriptorProto.json_name"); + "google.protobuf.OneofDescriptorProto.name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 10, this->json_name(), target); + 1, this->name(), target); + } + + // optional .google.protobuf.OneofOptions options = 2; + if (cached_has_bits & 0x00000002u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *this->options_, deterministic, target); } if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldDescriptorProto) + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.OneofDescriptorProto) return target; } -size_t FieldDescriptorProto::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FieldDescriptorProto) +size_t OneofDescriptorProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.OneofDescriptorProto) size_t total_size = 0; if (_internal_metadata_.have_unknown_fields()) { @@ -5387,7 +5565,7 @@ size_t FieldDescriptorProto::ByteSizeLong() const { ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( _internal_metadata_.unknown_fields()); } - if (_has_bits_[0 / 32] & 255u) { + if (_has_bits_[0 / 32] & 3u) { // optional string name = 1; if (has_name()) { total_size += 1 + @@ -5395,69 +5573,13 @@ size_t FieldDescriptorProto::ByteSizeLong() const { this->name()); } - // optional string extendee = 2; - if (has_extendee()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->extendee()); - } - - // optional string type_name = 6; - if (has_type_name()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->type_name()); - } - - // optional string default_value = 7; - if (has_default_value()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->default_value()); - } - - // optional string json_name = 10; - if (has_json_name()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->json_name()); - } - - // optional .google.protobuf.FieldOptions options = 8; + // optional .google.protobuf.OneofOptions options = 2; if (has_options()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( *this->options_); } - // optional int32 number = 3; - if (has_number()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::Int32Size( - this->number()); - } - - // optional int32 oneof_index = 9; - if (has_oneof_index()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::Int32Size( - this->oneof_index()); - } - - } - if (_has_bits_[8 / 32] & 768u) { - // optional .google.protobuf.FieldDescriptorProto.Label label = 4; - if (has_label()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::EnumSize(this->label()); - } - - // optional .google.protobuf.FieldDescriptorProto.Type type = 5; - if (has_type()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); - } - } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); @@ -5466,708 +5588,225 @@ size_t FieldDescriptorProto::ByteSizeLong() const { return total_size; } -void FieldDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FieldDescriptorProto) +void OneofDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.OneofDescriptorProto) GOOGLE_DCHECK_NE(&from, this); - const FieldDescriptorProto* source = - ::google::protobuf::internal::DynamicCastToGenerated( + const OneofDescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( &from); if (source == NULL) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldDescriptorProto) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.OneofDescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FieldDescriptorProto) + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.OneofDescriptorProto) MergeFrom(*source); } } -void FieldDescriptorProto::MergeFrom(const FieldDescriptorProto& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldDescriptorProto) +void OneofDescriptorProto::MergeFrom(const OneofDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.OneofDescriptorProto) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 255u) { + if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + set_name(from.name()); } if (cached_has_bits & 0x00000002u) { - set_has_extendee(); - extendee_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.extendee_); - } - if (cached_has_bits & 0x00000004u) { - set_has_type_name(); - type_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_name_); - } - if (cached_has_bits & 0x00000008u) { - set_has_default_value(); - default_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.default_value_); - } - if (cached_has_bits & 0x00000010u) { - set_has_json_name(); - json_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.json_name_); - } - if (cached_has_bits & 0x00000020u) { - mutable_options()->::google::protobuf::FieldOptions::MergeFrom(from.options()); - } - if (cached_has_bits & 0x00000040u) { - number_ = from.number_; - } - if (cached_has_bits & 0x00000080u) { - oneof_index_ = from.oneof_index_; - } - _has_bits_[0] |= cached_has_bits; - } - if (cached_has_bits & 768u) { - if (cached_has_bits & 0x00000100u) { - label_ = from.label_; - } - if (cached_has_bits & 0x00000200u) { - type_ = from.type_; + mutable_options()->::google::protobuf::OneofOptions::MergeFrom(from.options()); } - _has_bits_[0] |= cached_has_bits; } } -void FieldDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FieldDescriptorProto) +void OneofDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.OneofDescriptorProto) if (&from == this) return; Clear(); MergeFrom(from); } -void FieldDescriptorProto::CopyFrom(const FieldDescriptorProto& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FieldDescriptorProto) +void OneofDescriptorProto::CopyFrom(const OneofDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.OneofDescriptorProto) if (&from == this) return; Clear(); MergeFrom(from); } -bool FieldDescriptorProto::IsInitialized() const { +bool OneofDescriptorProto::IsInitialized() const { if (has_options()) { if (!this->options_->IsInitialized()) return false; } - return true; -} - -void FieldDescriptorProto::Swap(FieldDescriptorProto* other) { - if (other == this) return; - InternalSwap(other); -} -void FieldDescriptorProto::InternalSwap(FieldDescriptorProto* other) { - using std::swap; - name_.Swap(&other->name_); - extendee_.Swap(&other->extendee_); - type_name_.Swap(&other->type_name_); - default_value_.Swap(&other->default_value_); - json_name_.Swap(&other->json_name_); - swap(options_, other->options_); - swap(number_, other->number_); - swap(oneof_index_, other->oneof_index_); - swap(label_, other->label_); - swap(type_, other->type_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); -} - -::google::protobuf::Metadata FieldDescriptorProto::GetMetadata() const { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// FieldDescriptorProto - -// optional string name = 1; -bool FieldDescriptorProto::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void FieldDescriptorProto::set_has_name() { - _has_bits_[0] |= 0x00000001u; -} -void FieldDescriptorProto::clear_has_name() { - _has_bits_[0] &= ~0x00000001u; -} -void FieldDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); -} -const ::std::string& FieldDescriptorProto::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.name) - return name_.GetNoArena(); -} -void FieldDescriptorProto::set_name(const ::std::string& value) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.name) -} -#if LANG_CXX11 -void FieldDescriptorProto::set_name(::std::string&& value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.name) -} -#endif -void FieldDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.name) -} -void FieldDescriptorProto::set_name(const char* value, size_t size) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.name) -} -::std::string* FieldDescriptorProto::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FieldDescriptorProto::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.name) - clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FieldDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { - set_has_name(); - } else { - clear_has_name(); - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.name) -} - -// optional int32 number = 3; -bool FieldDescriptorProto::has_number() const { - return (_has_bits_[0] & 0x00000040u) != 0; -} -void FieldDescriptorProto::set_has_number() { - _has_bits_[0] |= 0x00000040u; -} -void FieldDescriptorProto::clear_has_number() { - _has_bits_[0] &= ~0x00000040u; -} -void FieldDescriptorProto::clear_number() { - number_ = 0; - clear_has_number(); -} -::google::protobuf::int32 FieldDescriptorProto::number() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.number) - return number_; -} -void FieldDescriptorProto::set_number(::google::protobuf::int32 value) { - set_has_number(); - number_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.number) -} - -// optional .google.protobuf.FieldDescriptorProto.Label label = 4; -bool FieldDescriptorProto::has_label() const { - return (_has_bits_[0] & 0x00000100u) != 0; -} -void FieldDescriptorProto::set_has_label() { - _has_bits_[0] |= 0x00000100u; -} -void FieldDescriptorProto::clear_has_label() { - _has_bits_[0] &= ~0x00000100u; -} -void FieldDescriptorProto::clear_label() { - label_ = 1; - clear_has_label(); -} -::google::protobuf::FieldDescriptorProto_Label FieldDescriptorProto::label() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.label) - return static_cast< ::google::protobuf::FieldDescriptorProto_Label >(label_); -} -void FieldDescriptorProto::set_label(::google::protobuf::FieldDescriptorProto_Label value) { - assert(::google::protobuf::FieldDescriptorProto_Label_IsValid(value)); - set_has_label(); - label_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.label) -} - -// optional .google.protobuf.FieldDescriptorProto.Type type = 5; -bool FieldDescriptorProto::has_type() const { - return (_has_bits_[0] & 0x00000200u) != 0; -} -void FieldDescriptorProto::set_has_type() { - _has_bits_[0] |= 0x00000200u; -} -void FieldDescriptorProto::clear_has_type() { - _has_bits_[0] &= ~0x00000200u; -} -void FieldDescriptorProto::clear_type() { - type_ = 1; - clear_has_type(); -} -::google::protobuf::FieldDescriptorProto_Type FieldDescriptorProto::type() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type) - return static_cast< ::google::protobuf::FieldDescriptorProto_Type >(type_); -} -void FieldDescriptorProto::set_type(::google::protobuf::FieldDescriptorProto_Type value) { - assert(::google::protobuf::FieldDescriptorProto_Type_IsValid(value)); - set_has_type(); - type_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type) -} - -// optional string type_name = 6; -bool FieldDescriptorProto::has_type_name() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void FieldDescriptorProto::set_has_type_name() { - _has_bits_[0] |= 0x00000004u; -} -void FieldDescriptorProto::clear_has_type_name() { - _has_bits_[0] &= ~0x00000004u; -} -void FieldDescriptorProto::clear_type_name() { - type_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_type_name(); -} -const ::std::string& FieldDescriptorProto::type_name() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type_name) - return type_name_.GetNoArena(); -} -void FieldDescriptorProto::set_type_name(const ::std::string& value) { - set_has_type_name(); - type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type_name) -} -#if LANG_CXX11 -void FieldDescriptorProto::set_type_name(::std::string&& value) { - set_has_type_name(); - type_name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.type_name) -} -#endif -void FieldDescriptorProto::set_type_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_type_name(); - type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.type_name) -} -void FieldDescriptorProto::set_type_name(const char* value, size_t size) { - set_has_type_name(); - type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.type_name) -} -::std::string* FieldDescriptorProto::mutable_type_name() { - set_has_type_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.type_name) - return type_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FieldDescriptorProto::release_type_name() { - // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.type_name) - clear_has_type_name(); - return type_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FieldDescriptorProto::set_allocated_type_name(::std::string* type_name) { - if (type_name != NULL) { - set_has_type_name(); - } else { - clear_has_type_name(); - } - type_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.type_name) -} - -// optional string extendee = 2; -bool FieldDescriptorProto::has_extendee() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void FieldDescriptorProto::set_has_extendee() { - _has_bits_[0] |= 0x00000002u; -} -void FieldDescriptorProto::clear_has_extendee() { - _has_bits_[0] &= ~0x00000002u; -} -void FieldDescriptorProto::clear_extendee() { - extendee_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_extendee(); -} -const ::std::string& FieldDescriptorProto::extendee() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.extendee) - return extendee_.GetNoArena(); -} -void FieldDescriptorProto::set_extendee(const ::std::string& value) { - set_has_extendee(); - extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.extendee) -} -#if LANG_CXX11 -void FieldDescriptorProto::set_extendee(::std::string&& value) { - set_has_extendee(); - extendee_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.extendee) -} -#endif -void FieldDescriptorProto::set_extendee(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_extendee(); - extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.extendee) -} -void FieldDescriptorProto::set_extendee(const char* value, size_t size) { - set_has_extendee(); - extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.extendee) -} -::std::string* FieldDescriptorProto::mutable_extendee() { - set_has_extendee(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.extendee) - return extendee_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FieldDescriptorProto::release_extendee() { - // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.extendee) - clear_has_extendee(); - return extendee_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee) { - if (extendee != NULL) { - set_has_extendee(); - } else { - clear_has_extendee(); - } - extendee_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), extendee); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.extendee) -} - -// optional string default_value = 7; -bool FieldDescriptorProto::has_default_value() const { - return (_has_bits_[0] & 0x00000008u) != 0; -} -void FieldDescriptorProto::set_has_default_value() { - _has_bits_[0] |= 0x00000008u; -} -void FieldDescriptorProto::clear_has_default_value() { - _has_bits_[0] &= ~0x00000008u; -} -void FieldDescriptorProto::clear_default_value() { - default_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_default_value(); -} -const ::std::string& FieldDescriptorProto::default_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.default_value) - return default_value_.GetNoArena(); -} -void FieldDescriptorProto::set_default_value(const ::std::string& value) { - set_has_default_value(); - default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.default_value) -} -#if LANG_CXX11 -void FieldDescriptorProto::set_default_value(::std::string&& value) { - set_has_default_value(); - default_value_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.default_value) -} -#endif -void FieldDescriptorProto::set_default_value(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_default_value(); - default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.default_value) -} -void FieldDescriptorProto::set_default_value(const char* value, size_t size) { - set_has_default_value(); - default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.default_value) -} -::std::string* FieldDescriptorProto::mutable_default_value() { - set_has_default_value(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.default_value) - return default_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FieldDescriptorProto::release_default_value() { - // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.default_value) - clear_has_default_value(); - return default_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FieldDescriptorProto::set_allocated_default_value(::std::string* default_value) { - if (default_value != NULL) { - set_has_default_value(); - } else { - clear_has_default_value(); - } - default_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.default_value) -} - -// optional int32 oneof_index = 9; -bool FieldDescriptorProto::has_oneof_index() const { - return (_has_bits_[0] & 0x00000080u) != 0; -} -void FieldDescriptorProto::set_has_oneof_index() { - _has_bits_[0] |= 0x00000080u; -} -void FieldDescriptorProto::clear_has_oneof_index() { - _has_bits_[0] &= ~0x00000080u; -} -void FieldDescriptorProto::clear_oneof_index() { - oneof_index_ = 0; - clear_has_oneof_index(); -} -::google::protobuf::int32 FieldDescriptorProto::oneof_index() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.oneof_index) - return oneof_index_; -} -void FieldDescriptorProto::set_oneof_index(::google::protobuf::int32 value) { - set_has_oneof_index(); - oneof_index_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.oneof_index) -} - -// optional string json_name = 10; -bool FieldDescriptorProto::has_json_name() const { - return (_has_bits_[0] & 0x00000010u) != 0; -} -void FieldDescriptorProto::set_has_json_name() { - _has_bits_[0] |= 0x00000010u; -} -void FieldDescriptorProto::clear_has_json_name() { - _has_bits_[0] &= ~0x00000010u; -} -void FieldDescriptorProto::clear_json_name() { - json_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_json_name(); -} -const ::std::string& FieldDescriptorProto::json_name() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.json_name) - return json_name_.GetNoArena(); -} -void FieldDescriptorProto::set_json_name(const ::std::string& value) { - set_has_json_name(); - json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.json_name) -} -#if LANG_CXX11 -void FieldDescriptorProto::set_json_name(::std::string&& value) { - set_has_json_name(); - json_name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.json_name) -} -#endif -void FieldDescriptorProto::set_json_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_json_name(); - json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.json_name) -} -void FieldDescriptorProto::set_json_name(const char* value, size_t size) { - set_has_json_name(); - json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.json_name) -} -::std::string* FieldDescriptorProto::mutable_json_name() { - set_has_json_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.json_name) - return json_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FieldDescriptorProto::release_json_name() { - // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.json_name) - clear_has_json_name(); - return json_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FieldDescriptorProto::set_allocated_json_name(::std::string* json_name) { - if (json_name != NULL) { - set_has_json_name(); - } else { - clear_has_json_name(); - } - json_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.json_name) + return true; } -// optional .google.protobuf.FieldOptions options = 8; -bool FieldDescriptorProto::has_options() const { - return (_has_bits_[0] & 0x00000020u) != 0; -} -void FieldDescriptorProto::set_has_options() { - _has_bits_[0] |= 0x00000020u; -} -void FieldDescriptorProto::clear_has_options() { - _has_bits_[0] &= ~0x00000020u; -} -void FieldDescriptorProto::clear_options() { - if (options_ != NULL) options_->::google::protobuf::FieldOptions::Clear(); - clear_has_options(); -} -const ::google::protobuf::FieldOptions& FieldDescriptorProto::options() const { - const ::google::protobuf::FieldOptions* p = options_; - // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_FieldOptions_default_instance_); -} -::google::protobuf::FieldOptions* FieldDescriptorProto::mutable_options() { - set_has_options(); - if (options_ == NULL) { - options_ = new ::google::protobuf::FieldOptions; +void OneofDescriptorProto::Swap(OneofDescriptorProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OneofDescriptorProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } } - // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.options) - return options_; } -::google::protobuf::FieldOptions* FieldDescriptorProto::release_options() { - // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.options) - clear_has_options(); - ::google::protobuf::FieldOptions* temp = options_; - options_ = NULL; - return temp; +void OneofDescriptorProto::UnsafeArenaSwap(OneofDescriptorProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); } -void FieldDescriptorProto::set_allocated_options(::google::protobuf::FieldOptions* options) { - delete options_; - options_ = options; - if (options) { - set_has_options(); - } else { - clear_has_options(); - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.options) +void OneofDescriptorProto::InternalSwap(OneofDescriptorProto* other) { + using std::swap; + name_.Swap(&other->name_); + swap(options_, other->options_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata OneofDescriptorProto::GetMetadata() const { + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void EnumDescriptorProto_EnumReservedRange::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int OneofDescriptorProto::kNameFieldNumber; -const int OneofDescriptorProto::kOptionsFieldNumber; +const int EnumDescriptorProto_EnumReservedRange::kStartFieldNumber; +const int EnumDescriptorProto_EnumReservedRange::kEndFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -OneofDescriptorProto::OneofDescriptorProto() +EnumDescriptorProto_EnumReservedRange::EnumDescriptorProto_EnumReservedRange() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto_EnumReservedRange(); } SharedCtor(); - // @@protoc_insertion_point(constructor:google.protobuf.OneofDescriptorProto) + // @@protoc_insertion_point(constructor:google.protobuf.EnumDescriptorProto.EnumReservedRange) } -OneofDescriptorProto::OneofDescriptorProto(const OneofDescriptorProto& from) +EnumDescriptorProto_EnumReservedRange::EnumDescriptorProto_EnumReservedRange(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto_EnumReservedRange(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumDescriptorProto.EnumReservedRange) +} +EnumDescriptorProto_EnumReservedRange::EnumDescriptorProto_EnumReservedRange(const EnumDescriptorProto_EnumReservedRange& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); - name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_name()) { - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); - } - if (from.has_options()) { - options_ = new ::google::protobuf::OneofOptions(*from.options_); - } else { - options_ = NULL; - } - // @@protoc_insertion_point(copy_constructor:google.protobuf.OneofDescriptorProto) + ::memcpy(&start_, &from.start_, + static_cast(reinterpret_cast(&end_) - + reinterpret_cast(&start_)) + sizeof(end_)); + // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumDescriptorProto.EnumReservedRange) } -void OneofDescriptorProto::SharedCtor() { +void EnumDescriptorProto_EnumReservedRange::SharedCtor() { _cached_size_ = 0; - name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - options_ = NULL; + ::memset(&start_, 0, static_cast( + reinterpret_cast(&end_) - + reinterpret_cast(&start_)) + sizeof(end_)); } -OneofDescriptorProto::~OneofDescriptorProto() { - // @@protoc_insertion_point(destructor:google.protobuf.OneofDescriptorProto) +EnumDescriptorProto_EnumReservedRange::~EnumDescriptorProto_EnumReservedRange() { + // @@protoc_insertion_point(destructor:google.protobuf.EnumDescriptorProto.EnumReservedRange) SharedDtor(); } -void OneofDescriptorProto::SharedDtor() { - name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete options_; +void EnumDescriptorProto_EnumReservedRange::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } -void OneofDescriptorProto::SetCachedSize(int size) const { +void EnumDescriptorProto_EnumReservedRange::ArenaDtor(void* object) { + EnumDescriptorProto_EnumReservedRange* _this = reinterpret_cast< EnumDescriptorProto_EnumReservedRange* >(object); + (void)_this; +} +void EnumDescriptorProto_EnumReservedRange::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void EnumDescriptorProto_EnumReservedRange::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } -const ::google::protobuf::Descriptor* OneofDescriptorProto::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +const ::google::protobuf::Descriptor* EnumDescriptorProto_EnumReservedRange::descriptor() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } -const OneofDescriptorProto& OneofDescriptorProto::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); +const EnumDescriptorProto_EnumReservedRange& EnumDescriptorProto_EnumReservedRange::default_instance() { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto_EnumReservedRange(); return *internal_default_instance(); } -OneofDescriptorProto* OneofDescriptorProto::New(::google::protobuf::Arena* arena) const { - OneofDescriptorProto* n = new OneofDescriptorProto; - if (arena != NULL) { - arena->Own(n); - } - return n; +EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto_EnumReservedRange::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); } -void OneofDescriptorProto::Clear() { -// @@protoc_insertion_point(message_clear_start:google.protobuf.OneofDescriptorProto) +void EnumDescriptorProto_EnumReservedRange::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.EnumDescriptorProto.EnumReservedRange) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _has_bits_[0]; if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(options_ != NULL); - options_->::google::protobuf::OneofOptions::Clear(); - } + ::memset(&start_, 0, static_cast( + reinterpret_cast(&end_) - + reinterpret_cast(&start_)) + sizeof(end_)); } _has_bits_.Clear(); _internal_metadata_.Clear(); } -bool OneofDescriptorProto::MergePartialFromCodedStream( +bool EnumDescriptorProto_EnumReservedRange::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; - // @@protoc_insertion_point(parse_start:google.protobuf.OneofDescriptorProto) + // @@protoc_insertion_point(parse_start:google.protobuf.EnumDescriptorProto.EnumReservedRange) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // optional string name = 1; + // optional int32 start = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::PARSE, - "google.protobuf.OneofDescriptorProto.name"); + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + set_has_start(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &start_))); } else { goto handle_unusual; } break; } - // optional .google.protobuf.OneofOptions options = 2; + // optional int32 end = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_options())); + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + set_has_end(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &end_))); } else { goto handle_unusual; } @@ -6186,80 +5825,66 @@ bool OneofDescriptorProto::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:google.protobuf.OneofDescriptorProto) + // @@protoc_insertion_point(parse_success:google.protobuf.EnumDescriptorProto.EnumReservedRange) return true; failure: - // @@protoc_insertion_point(parse_failure:google.protobuf.OneofDescriptorProto) + // @@protoc_insertion_point(parse_failure:google.protobuf.EnumDescriptorProto.EnumReservedRange) return false; #undef DO_ } -void OneofDescriptorProto::SerializeWithCachedSizes( +void EnumDescriptorProto_EnumReservedRange::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:google.protobuf.OneofDescriptorProto) + // @@protoc_insertion_point(serialize_start:google.protobuf.EnumDescriptorProto.EnumReservedRange) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; - // optional string name = 1; + // optional int32 start = 1; if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.OneofDescriptorProto.name"); - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->name(), output); + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->start(), output); } - // optional .google.protobuf.OneofOptions options = 2; + // optional int32 end = 2; if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, *this->options_, output); + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->end(), output); } if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } - // @@protoc_insertion_point(serialize_end:google.protobuf.OneofDescriptorProto) + // @@protoc_insertion_point(serialize_end:google.protobuf.EnumDescriptorProto.EnumReservedRange) } -::google::protobuf::uint8* OneofDescriptorProto::InternalSerializeWithCachedSizesToArray( +::google::protobuf::uint8* EnumDescriptorProto_EnumReservedRange::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused - // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofDescriptorProto) + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumDescriptorProto.EnumReservedRange) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; - // optional string name = 1; + // optional int32 start = 1; if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( - this->name().data(), static_cast(this->name().length()), - ::google::protobuf::internal::WireFormat::SERIALIZE, - "google.protobuf.OneofDescriptorProto.name"); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 1, this->name(), target); + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->start(), target); } - // optional .google.protobuf.OneofOptions options = 2; + // optional int32 end = 2; if (cached_has_bits & 0x00000002u) { - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessageNoVirtualToArray( - 2, *this->options_, deterministic, target); + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target); } if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); } - // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.OneofDescriptorProto) + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumDescriptorProto.EnumReservedRange) return target; } -size_t OneofDescriptorProto::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.protobuf.OneofDescriptorProto) +size_t EnumDescriptorProto_EnumReservedRange::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.EnumDescriptorProto.EnumReservedRange) size_t total_size = 0; if (_internal_metadata_.have_unknown_fields()) { @@ -6268,18 +5893,18 @@ size_t OneofDescriptorProto::ByteSizeLong() const { _internal_metadata_.unknown_fields()); } if (_has_bits_[0 / 32] & 3u) { - // optional string name = 1; - if (has_name()) { + // optional int32 start = 1; + if (has_start()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->start()); } - // optional .google.protobuf.OneofOptions options = 2; - if (has_options()) { + // optional int32 end = 2; + if (has_end()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - *this->options_); + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->end()); } } @@ -6290,23 +5915,23 @@ size_t OneofDescriptorProto::ByteSizeLong() const { return total_size; } -void OneofDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.OneofDescriptorProto) +void EnumDescriptorProto_EnumReservedRange::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumDescriptorProto.EnumReservedRange) GOOGLE_DCHECK_NE(&from, this); - const OneofDescriptorProto* source = - ::google::protobuf::internal::DynamicCastToGenerated( + const EnumDescriptorProto_EnumReservedRange* source = + ::google::protobuf::internal::DynamicCastToGenerated( &from); if (source == NULL) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.OneofDescriptorProto) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumDescriptorProto.EnumReservedRange) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.OneofDescriptorProto) + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumDescriptorProto.EnumReservedRange) MergeFrom(*source); } } -void OneofDescriptorProto::MergeFrom(const OneofDescriptorProto& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.OneofDescriptorProto) +void EnumDescriptorProto_EnumReservedRange::MergeFrom(const EnumDescriptorProto_EnumReservedRange& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumDescriptorProto.EnumReservedRange) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; @@ -6315,194 +5940,153 @@ void OneofDescriptorProto::MergeFrom(const OneofDescriptorProto& from) { cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + start_ = from.start_; } if (cached_has_bits & 0x00000002u) { - mutable_options()->::google::protobuf::OneofOptions::MergeFrom(from.options()); + end_ = from.end_; } + _has_bits_[0] |= cached_has_bits; } } -void OneofDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.OneofDescriptorProto) +void EnumDescriptorProto_EnumReservedRange::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumDescriptorProto.EnumReservedRange) if (&from == this) return; Clear(); MergeFrom(from); } -void OneofDescriptorProto::CopyFrom(const OneofDescriptorProto& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.OneofDescriptorProto) +void EnumDescriptorProto_EnumReservedRange::CopyFrom(const EnumDescriptorProto_EnumReservedRange& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.EnumDescriptorProto.EnumReservedRange) if (&from == this) return; Clear(); MergeFrom(from); } -bool OneofDescriptorProto::IsInitialized() const { - if (has_options()) { - if (!this->options_->IsInitialized()) return false; - } +bool EnumDescriptorProto_EnumReservedRange::IsInitialized() const { return true; } -void OneofDescriptorProto::Swap(OneofDescriptorProto* other) { +void EnumDescriptorProto_EnumReservedRange::Swap(EnumDescriptorProto_EnumReservedRange* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + EnumDescriptorProto_EnumReservedRange* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void EnumDescriptorProto_EnumReservedRange::UnsafeArenaSwap(EnumDescriptorProto_EnumReservedRange* other) { if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } -void OneofDescriptorProto::InternalSwap(OneofDescriptorProto* other) { +void EnumDescriptorProto_EnumReservedRange::InternalSwap(EnumDescriptorProto_EnumReservedRange* other) { using std::swap; - name_.Swap(&other->name_); - swap(options_, other->options_); + swap(start_, other->start_); + swap(end_, other->end_); swap(_has_bits_[0], other->_has_bits_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); swap(_cached_size_, other->_cached_size_); } -::google::protobuf::Metadata OneofDescriptorProto::GetMetadata() const { +::google::protobuf::Metadata EnumDescriptorProto_EnumReservedRange::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// OneofDescriptorProto - -// optional string name = 1; -bool OneofDescriptorProto::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void OneofDescriptorProto::set_has_name() { - _has_bits_[0] |= 0x00000001u; -} -void OneofDescriptorProto::clear_has_name() { - _has_bits_[0] &= ~0x00000001u; -} -void OneofDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); -} -const ::std::string& OneofDescriptorProto::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.name) - return name_.GetNoArena(); -} -void OneofDescriptorProto::set_name(const ::std::string& value) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.OneofDescriptorProto.name) -} -#if LANG_CXX11 -void OneofDescriptorProto::set_name(::std::string&& value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.OneofDescriptorProto.name) -} -#endif -void OneofDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.OneofDescriptorProto.name) -} -void OneofDescriptorProto::set_name(const char* value, size_t size) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.OneofDescriptorProto.name) -} -::std::string* OneofDescriptorProto::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* OneofDescriptorProto::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.name) - clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void OneofDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { - set_has_name(); - } else { - clear_has_name(); - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.name) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -// optional .google.protobuf.OneofOptions options = 2; -bool OneofDescriptorProto::has_options() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void OneofDescriptorProto::set_has_options() { - _has_bits_[0] |= 0x00000002u; -} -void OneofDescriptorProto::clear_has_options() { - _has_bits_[0] &= ~0x00000002u; -} -void OneofDescriptorProto::clear_options() { - if (options_ != NULL) options_->::google::protobuf::OneofOptions::Clear(); - clear_has_options(); + +// =================================================================== + +void EnumDescriptorProto::InitAsDefaultInstance() { + ::google::protobuf::_EnumDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::EnumOptions*>( + ::google::protobuf::EnumOptions::internal_default_instance()); } -const ::google::protobuf::OneofOptions& OneofDescriptorProto::options() const { - const ::google::protobuf::OneofOptions* p = options_; - // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_OneofOptions_default_instance_); +void EnumDescriptorProto::_slow_mutable_options() { + options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::EnumOptions >( + GetArenaNoVirtual()); } -::google::protobuf::OneofOptions* OneofDescriptorProto::mutable_options() { - set_has_options(); +::google::protobuf::EnumOptions* EnumDescriptorProto::_slow_release_options() { if (options_ == NULL) { - options_ = new ::google::protobuf::OneofOptions; + return NULL; + } else { + ::google::protobuf::EnumOptions* temp = new ::google::protobuf::EnumOptions(*options_); + options_ = NULL; + return temp; } - // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.options) - return options_; } -::google::protobuf::OneofOptions* OneofDescriptorProto::release_options() { - // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.options) - clear_has_options(); - ::google::protobuf::OneofOptions* temp = options_; - options_ = NULL; - return temp; +void EnumDescriptorProto::_slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::EnumOptions** options) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*options) == NULL) { + message_arena->Own(*options); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*options)) { + ::google::protobuf::EnumOptions* new_options = + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::EnumOptions >( + message_arena); + new_options->CopyFrom(**options); + *options = new_options; + } } -void OneofDescriptorProto::set_allocated_options(::google::protobuf::OneofOptions* options) { - delete options_; +void EnumDescriptorProto::unsafe_arena_set_allocated_options( + ::google::protobuf::EnumOptions* options) { + if (GetArenaNoVirtual() == NULL) { + delete options_; + } options_ = options; if (options) { set_has_options(); } else { clear_has_options(); } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.options) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumDescriptorProto.options) } - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// =================================================================== - #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int EnumDescriptorProto::kNameFieldNumber; const int EnumDescriptorProto::kValueFieldNumber; const int EnumDescriptorProto::kOptionsFieldNumber; +const int EnumDescriptorProto::kReservedRangeFieldNumber; +const int EnumDescriptorProto::kReservedNameFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 EnumDescriptorProto::EnumDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumDescriptorProto) } +EnumDescriptorProto::EnumDescriptorProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena), + reserved_range_(arena), + reserved_name_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumDescriptorProto) +} EnumDescriptorProto::EnumDescriptorProto(const EnumDescriptorProto& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), - value_(from.value_) { + value_(from.value_), + reserved_range_(from.reserved_range_), + reserved_name_(from.reserved_name_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_name()) { - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); } if (from.has_options()) { options_ = new ::google::protobuf::EnumOptions(*from.options_); @@ -6524,31 +6108,39 @@ EnumDescriptorProto::~EnumDescriptorProto() { } void EnumDescriptorProto::SharedDtor() { - name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); if (this != internal_default_instance()) delete options_; } +void EnumDescriptorProto::ArenaDtor(void* object) { + EnumDescriptorProto* _this = reinterpret_cast< EnumDescriptorProto* >(object); + (void)_this; +} +void EnumDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void EnumDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EnumDescriptorProto::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const EnumDescriptorProto& EnumDescriptorProto::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto(); return *internal_default_instance(); } EnumDescriptorProto* EnumDescriptorProto::New(::google::protobuf::Arena* arena) const { - EnumDescriptorProto* n = new EnumDescriptorProto; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void EnumDescriptorProto::Clear() { @@ -6558,11 +6150,13 @@ void EnumDescriptorProto::Clear() { (void) cached_has_bits; value_.Clear(); + reserved_range_.Clear(); + reserved_name_.Clear(); cached_has_bits = _has_bits_[0]; if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000002u) { GOOGLE_DCHECK(options_ != NULL); @@ -6599,24 +6193,53 @@ bool EnumDescriptorProto::MergePartialFromCodedStream( break; } - // repeated .google.protobuf.EnumValueDescriptorProto value = 2; - case 2: { + // repeated .google.protobuf.EnumValueDescriptorProto value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_value())); + } else { + goto handle_unusual; + } + break; + } + + // optional .google.protobuf.EnumOptions options = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_options())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + case 4: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_value())); + input, add_reserved_range())); } else { goto handle_unusual; } break; } - // optional .google.protobuf.EnumOptions options = 3; - case 3: { + // repeated string reserved_name = 5; + case 5: { if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_options())); + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_reserved_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->reserved_name(this->reserved_name_size() - 1).data(), + static_cast(this->reserved_name(this->reserved_name_size() - 1).length()), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.EnumDescriptorProto.reserved_name"); } else { goto handle_unusual; } @@ -6673,6 +6296,23 @@ void EnumDescriptorProto::SerializeWithCachedSizes( 3, *this->options_, output); } + // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + for (unsigned int i = 0, + n = static_cast(this->reserved_range_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->reserved_range(static_cast(i)), output); + } + + // repeated string reserved_name = 5; + for (int i = 0, n = this->reserved_name_size(); i < n; i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->reserved_name(i).data(), static_cast(this->reserved_name(i).length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.EnumDescriptorProto.reserved_name"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 5, this->reserved_name(i), output); + } + if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); @@ -6714,6 +6354,24 @@ void EnumDescriptorProto::SerializeWithCachedSizes( 3, *this->options_, deterministic, target); } + // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + for (unsigned int i = 0, + n = static_cast(this->reserved_range_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, this->reserved_range(static_cast(i)), deterministic, target); + } + + // repeated string reserved_name = 5; + for (int i = 0, n = this->reserved_name_size(); i < n; i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->reserved_name(i).data(), static_cast(this->reserved_name(i).length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.EnumDescriptorProto.reserved_name"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(5, this->reserved_name(i), target); + } + if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); @@ -6742,6 +6400,25 @@ size_t EnumDescriptorProto::ByteSizeLong() const { } } + // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + { + unsigned int count = static_cast(this->reserved_range_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->reserved_range(static_cast(i))); + } + } + + // repeated string reserved_name = 5; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->reserved_name_size()); + for (int i = 0, n = this->reserved_name_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->reserved_name(i)); + } + if (_has_bits_[0 / 32] & 3u) { // optional string name = 1; if (has_name()) { @@ -6788,11 +6465,12 @@ void EnumDescriptorProto::MergeFrom(const EnumDescriptorProto& from) { (void) cached_has_bits; value_.MergeFrom(from.value_); + reserved_range_.MergeFrom(from.reserved_range_); + reserved_name_.MergeFrom(from.reserved_name_); cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + set_name(from.name()); } if (cached_has_bits & 0x00000002u) { mutable_options()->::google::protobuf::EnumOptions::MergeFrom(from.options()); @@ -6824,11 +6502,28 @@ bool EnumDescriptorProto::IsInitialized() const { void EnumDescriptorProto::Swap(EnumDescriptorProto* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + EnumDescriptorProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void EnumDescriptorProto::UnsafeArenaSwap(EnumDescriptorProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void EnumDescriptorProto::InternalSwap(EnumDescriptorProto* other) { using std::swap; value_.InternalSwap(&other->value_); + reserved_range_.InternalSwap(&other->reserved_range_); + reserved_name_.InternalSwap(&other->reserved_name_); name_.Swap(&other->name_); swap(options_, other->options_); swap(_has_bits_[0], other->_has_bits_[0]); @@ -6838,155 +6533,56 @@ void EnumDescriptorProto::InternalSwap(EnumDescriptorProto* other) { ::google::protobuf::Metadata EnumDescriptorProto::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// EnumDescriptorProto - -// optional string name = 1; -bool EnumDescriptorProto::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void EnumDescriptorProto::set_has_name() { - _has_bits_[0] |= 0x00000001u; -} -void EnumDescriptorProto::clear_has_name() { - _has_bits_[0] &= ~0x00000001u; -} -void EnumDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); -} -const ::std::string& EnumDescriptorProto::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.name) - return name_.GetNoArena(); -} -void EnumDescriptorProto::set_name(const ::std::string& value) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.name) -} -#if LANG_CXX11 -void EnumDescriptorProto::set_name(::std::string&& value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.EnumDescriptorProto.name) -} -#endif -void EnumDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.EnumDescriptorProto.name) -} -void EnumDescriptorProto::set_name(const char* value, size_t size) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumDescriptorProto.name) -} -::std::string* EnumDescriptorProto::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* EnumDescriptorProto::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.name) - clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void EnumDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { - set_has_name(); - } else { - clear_has_name(); - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.name) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -// repeated .google.protobuf.EnumValueDescriptorProto value = 2; -int EnumDescriptorProto::value_size() const { - return value_.size(); -} -void EnumDescriptorProto::clear_value() { - value_.Clear(); -} -const ::google::protobuf::EnumValueDescriptorProto& EnumDescriptorProto::value(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.value) - return value_.Get(index); -} -::google::protobuf::EnumValueDescriptorProto* EnumDescriptorProto::mutable_value(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.value) - return value_.Mutable(index); -} -::google::protobuf::EnumValueDescriptorProto* EnumDescriptorProto::add_value() { - // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.value) - return value_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >* -EnumDescriptorProto::mutable_value() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.value) - return &value_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >& -EnumDescriptorProto::value() const { - // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.value) - return value_; -} -// optional .google.protobuf.EnumOptions options = 3; -bool EnumDescriptorProto::has_options() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void EnumDescriptorProto::set_has_options() { - _has_bits_[0] |= 0x00000002u; -} -void EnumDescriptorProto::clear_has_options() { - _has_bits_[0] &= ~0x00000002u; -} -void EnumDescriptorProto::clear_options() { - if (options_ != NULL) options_->::google::protobuf::EnumOptions::Clear(); - clear_has_options(); +// =================================================================== + +void EnumValueDescriptorProto::InitAsDefaultInstance() { + ::google::protobuf::_EnumValueDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::EnumValueOptions*>( + ::google::protobuf::EnumValueOptions::internal_default_instance()); } -const ::google::protobuf::EnumOptions& EnumDescriptorProto::options() const { - const ::google::protobuf::EnumOptions* p = options_; - // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_EnumOptions_default_instance_); +void EnumValueDescriptorProto::_slow_mutable_options() { + options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::EnumValueOptions >( + GetArenaNoVirtual()); } -::google::protobuf::EnumOptions* EnumDescriptorProto::mutable_options() { - set_has_options(); +::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::_slow_release_options() { if (options_ == NULL) { - options_ = new ::google::protobuf::EnumOptions; + return NULL; + } else { + ::google::protobuf::EnumValueOptions* temp = new ::google::protobuf::EnumValueOptions(*options_); + options_ = NULL; + return temp; } - // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.options) - return options_; } -::google::protobuf::EnumOptions* EnumDescriptorProto::release_options() { - // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.options) - clear_has_options(); - ::google::protobuf::EnumOptions* temp = options_; - options_ = NULL; - return temp; +void EnumValueDescriptorProto::_slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::EnumValueOptions** options) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*options) == NULL) { + message_arena->Own(*options); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*options)) { + ::google::protobuf::EnumValueOptions* new_options = + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::EnumValueOptions >( + message_arena); + new_options->CopyFrom(**options); + *options = new_options; + } } -void EnumDescriptorProto::set_allocated_options(::google::protobuf::EnumOptions* options) { - delete options_; +void EnumValueDescriptorProto::unsafe_arena_set_allocated_options( + ::google::protobuf::EnumValueOptions* options) { + if (GetArenaNoVirtual() == NULL) { + delete options_; + } options_ = options; if (options) { set_has_options(); } else { clear_has_options(); } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.options) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValueDescriptorProto.options) } - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// =================================================================== - #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int EnumValueDescriptorProto::kNameFieldNumber; const int EnumValueDescriptorProto::kNumberFieldNumber; @@ -6996,11 +6592,19 @@ const int EnumValueDescriptorProto::kOptionsFieldNumber; EnumValueDescriptorProto::EnumValueDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueDescriptorProto(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumValueDescriptorProto) } +EnumValueDescriptorProto::EnumValueDescriptorProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueDescriptorProto(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumValueDescriptorProto) +} EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProto& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -7009,7 +6613,8 @@ EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProt _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_name()) { - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); } if (from.has_options()) { options_ = new ::google::protobuf::EnumValueOptions(*from.options_); @@ -7034,31 +6639,39 @@ EnumValueDescriptorProto::~EnumValueDescriptorProto() { } void EnumValueDescriptorProto::SharedDtor() { - name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); if (this != internal_default_instance()) delete options_; } +void EnumValueDescriptorProto::ArenaDtor(void* object) { + EnumValueDescriptorProto* _this = reinterpret_cast< EnumValueDescriptorProto* >(object); + (void)_this; +} +void EnumValueDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void EnumValueDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EnumValueDescriptorProto::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const EnumValueDescriptorProto& EnumValueDescriptorProto::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueDescriptorProto(); return *internal_default_instance(); } EnumValueDescriptorProto* EnumValueDescriptorProto::New(::google::protobuf::Arena* arena) const { - EnumValueDescriptorProto* n = new EnumValueDescriptorProto; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void EnumValueDescriptorProto::Clear() { @@ -7071,7 +6684,7 @@ void EnumValueDescriptorProto::Clear() { if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000002u) { GOOGLE_DCHECK(options_ != NULL); @@ -7293,8 +6906,7 @@ void EnumValueDescriptorProto::MergeFrom(const EnumValueDescriptorProto& from) { cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 7u) { if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + set_name(from.name()); } if (cached_has_bits & 0x00000002u) { mutable_options()->::google::protobuf::EnumValueOptions::MergeFrom(from.options()); @@ -7329,6 +6941,21 @@ bool EnumValueDescriptorProto::IsInitialized() const { void EnumValueDescriptorProto::Swap(EnumValueDescriptorProto* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + EnumValueDescriptorProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void EnumValueDescriptorProto::UnsafeArenaSwap(EnumValueDescriptorProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void EnumValueDescriptorProto::InternalSwap(EnumValueDescriptorProto* other) { @@ -7343,149 +6970,56 @@ void EnumValueDescriptorProto::InternalSwap(EnumValueDescriptorProto* other) { ::google::protobuf::Metadata EnumValueDescriptorProto::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// EnumValueDescriptorProto - -// optional string name = 1; -bool EnumValueDescriptorProto::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void EnumValueDescriptorProto::set_has_name() { - _has_bits_[0] |= 0x00000001u; -} -void EnumValueDescriptorProto::clear_has_name() { - _has_bits_[0] &= ~0x00000001u; -} -void EnumValueDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); -} -const ::std::string& EnumValueDescriptorProto::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.name) - return name_.GetNoArena(); -} -void EnumValueDescriptorProto::set_name(const ::std::string& value) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.name) -} -#if LANG_CXX11 -void EnumValueDescriptorProto::set_name(::std::string&& value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.EnumValueDescriptorProto.name) -} -#endif -void EnumValueDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.EnumValueDescriptorProto.name) -} -void EnumValueDescriptorProto::set_name(const char* value, size_t size) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumValueDescriptorProto.name) -} -::std::string* EnumValueDescriptorProto::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* EnumValueDescriptorProto::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.name) - clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void EnumValueDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { - set_has_name(); - } else { - clear_has_name(); - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.name) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -// optional int32 number = 2; -bool EnumValueDescriptorProto::has_number() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void EnumValueDescriptorProto::set_has_number() { - _has_bits_[0] |= 0x00000004u; -} -void EnumValueDescriptorProto::clear_has_number() { - _has_bits_[0] &= ~0x00000004u; -} -void EnumValueDescriptorProto::clear_number() { - number_ = 0; - clear_has_number(); -} -::google::protobuf::int32 EnumValueDescriptorProto::number() const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.number) - return number_; -} -void EnumValueDescriptorProto::set_number(::google::protobuf::int32 value) { - set_has_number(); - number_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.number) -} -// optional .google.protobuf.EnumValueOptions options = 3; -bool EnumValueDescriptorProto::has_options() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void EnumValueDescriptorProto::set_has_options() { - _has_bits_[0] |= 0x00000002u; -} -void EnumValueDescriptorProto::clear_has_options() { - _has_bits_[0] &= ~0x00000002u; -} -void EnumValueDescriptorProto::clear_options() { - if (options_ != NULL) options_->::google::protobuf::EnumValueOptions::Clear(); - clear_has_options(); +// =================================================================== + +void ServiceDescriptorProto::InitAsDefaultInstance() { + ::google::protobuf::_ServiceDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::ServiceOptions*>( + ::google::protobuf::ServiceOptions::internal_default_instance()); } -const ::google::protobuf::EnumValueOptions& EnumValueDescriptorProto::options() const { - const ::google::protobuf::EnumValueOptions* p = options_; - // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_EnumValueOptions_default_instance_); +void ServiceDescriptorProto::_slow_mutable_options() { + options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ServiceOptions >( + GetArenaNoVirtual()); } -::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::mutable_options() { - set_has_options(); +::google::protobuf::ServiceOptions* ServiceDescriptorProto::_slow_release_options() { if (options_ == NULL) { - options_ = new ::google::protobuf::EnumValueOptions; + return NULL; + } else { + ::google::protobuf::ServiceOptions* temp = new ::google::protobuf::ServiceOptions(*options_); + options_ = NULL; + return temp; } - // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.options) - return options_; } -::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::release_options() { - // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.options) - clear_has_options(); - ::google::protobuf::EnumValueOptions* temp = options_; - options_ = NULL; - return temp; +void ServiceDescriptorProto::_slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::ServiceOptions** options) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*options) == NULL) { + message_arena->Own(*options); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*options)) { + ::google::protobuf::ServiceOptions* new_options = + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ServiceOptions >( + message_arena); + new_options->CopyFrom(**options); + *options = new_options; + } } -void EnumValueDescriptorProto::set_allocated_options(::google::protobuf::EnumValueOptions* options) { - delete options_; +void ServiceDescriptorProto::unsafe_arena_set_allocated_options( + ::google::protobuf::ServiceOptions* options) { + if (GetArenaNoVirtual() == NULL) { + delete options_; + } options_ = options; if (options) { set_has_options(); } else { clear_has_options(); } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.options) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.ServiceDescriptorProto.options) } - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// =================================================================== - #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int ServiceDescriptorProto::kNameFieldNumber; const int ServiceDescriptorProto::kMethodFieldNumber; @@ -7495,11 +7029,20 @@ const int ServiceDescriptorProto::kOptionsFieldNumber; ServiceDescriptorProto::ServiceDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceDescriptorProto(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ServiceDescriptorProto) } +ServiceDescriptorProto::ServiceDescriptorProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + method_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceDescriptorProto(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.ServiceDescriptorProto) +} ServiceDescriptorProto::ServiceDescriptorProto(const ServiceDescriptorProto& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -7509,7 +7052,8 @@ ServiceDescriptorProto::ServiceDescriptorProto(const ServiceDescriptorProto& fro _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_name()) { - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); } if (from.has_options()) { options_ = new ::google::protobuf::ServiceOptions(*from.options_); @@ -7531,31 +7075,39 @@ ServiceDescriptorProto::~ServiceDescriptorProto() { } void ServiceDescriptorProto::SharedDtor() { - name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); if (this != internal_default_instance()) delete options_; } +void ServiceDescriptorProto::ArenaDtor(void* object) { + ServiceDescriptorProto* _this = reinterpret_cast< ServiceDescriptorProto* >(object); + (void)_this; +} +void ServiceDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void ServiceDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ServiceDescriptorProto::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const ServiceDescriptorProto& ServiceDescriptorProto::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceDescriptorProto(); return *internal_default_instance(); } ServiceDescriptorProto* ServiceDescriptorProto::New(::google::protobuf::Arena* arena) const { - ServiceDescriptorProto* n = new ServiceDescriptorProto; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void ServiceDescriptorProto::Clear() { @@ -7569,7 +7121,7 @@ void ServiceDescriptorProto::Clear() { if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000002u) { GOOGLE_DCHECK(options_ != NULL); @@ -7798,8 +7350,7 @@ void ServiceDescriptorProto::MergeFrom(const ServiceDescriptorProto& from) { cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + set_name(from.name()); } if (cached_has_bits & 0x00000002u) { mutable_options()->::google::protobuf::ServiceOptions::MergeFrom(from.options()); @@ -7831,6 +7382,21 @@ bool ServiceDescriptorProto::IsInitialized() const { void ServiceDescriptorProto::Swap(ServiceDescriptorProto* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ServiceDescriptorProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ServiceDescriptorProto::UnsafeArenaSwap(ServiceDescriptorProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void ServiceDescriptorProto::InternalSwap(ServiceDescriptorProto* other) { @@ -7845,155 +7411,56 @@ void ServiceDescriptorProto::InternalSwap(ServiceDescriptorProto* other) { ::google::protobuf::Metadata ServiceDescriptorProto::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// ServiceDescriptorProto - -// optional string name = 1; -bool ServiceDescriptorProto::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void ServiceDescriptorProto::set_has_name() { - _has_bits_[0] |= 0x00000001u; -} -void ServiceDescriptorProto::clear_has_name() { - _has_bits_[0] &= ~0x00000001u; -} -void ServiceDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); -} -const ::std::string& ServiceDescriptorProto::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.name) - return name_.GetNoArena(); -} -void ServiceDescriptorProto::set_name(const ::std::string& value) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.ServiceDescriptorProto.name) -} -#if LANG_CXX11 -void ServiceDescriptorProto::set_name(::std::string&& value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.ServiceDescriptorProto.name) -} -#endif -void ServiceDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.ServiceDescriptorProto.name) -} -void ServiceDescriptorProto::set_name(const char* value, size_t size) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.ServiceDescriptorProto.name) -} -::std::string* ServiceDescriptorProto::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* ServiceDescriptorProto::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.name) - clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void ServiceDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { - set_has_name(); - } else { - clear_has_name(); - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.name) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -// repeated .google.protobuf.MethodDescriptorProto method = 2; -int ServiceDescriptorProto::method_size() const { - return method_.size(); -} -void ServiceDescriptorProto::clear_method() { - method_.Clear(); -} -const ::google::protobuf::MethodDescriptorProto& ServiceDescriptorProto::method(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.method) - return method_.Get(index); -} -::google::protobuf::MethodDescriptorProto* ServiceDescriptorProto::mutable_method(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.method) - return method_.Mutable(index); -} -::google::protobuf::MethodDescriptorProto* ServiceDescriptorProto::add_method() { - // @@protoc_insertion_point(field_add:google.protobuf.ServiceDescriptorProto.method) - return method_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >* -ServiceDescriptorProto::mutable_method() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceDescriptorProto.method) - return &method_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >& -ServiceDescriptorProto::method() const { - // @@protoc_insertion_point(field_list:google.protobuf.ServiceDescriptorProto.method) - return method_; -} -// optional .google.protobuf.ServiceOptions options = 3; -bool ServiceDescriptorProto::has_options() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void ServiceDescriptorProto::set_has_options() { - _has_bits_[0] |= 0x00000002u; -} -void ServiceDescriptorProto::clear_has_options() { - _has_bits_[0] &= ~0x00000002u; -} -void ServiceDescriptorProto::clear_options() { - if (options_ != NULL) options_->::google::protobuf::ServiceOptions::Clear(); - clear_has_options(); +// =================================================================== + +void MethodDescriptorProto::InitAsDefaultInstance() { + ::google::protobuf::_MethodDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::MethodOptions*>( + ::google::protobuf::MethodOptions::internal_default_instance()); } -const ::google::protobuf::ServiceOptions& ServiceDescriptorProto::options() const { - const ::google::protobuf::ServiceOptions* p = options_; - // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_ServiceOptions_default_instance_); +void MethodDescriptorProto::_slow_mutable_options() { + options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::MethodOptions >( + GetArenaNoVirtual()); } -::google::protobuf::ServiceOptions* ServiceDescriptorProto::mutable_options() { - set_has_options(); +::google::protobuf::MethodOptions* MethodDescriptorProto::_slow_release_options() { if (options_ == NULL) { - options_ = new ::google::protobuf::ServiceOptions; + return NULL; + } else { + ::google::protobuf::MethodOptions* temp = new ::google::protobuf::MethodOptions(*options_); + options_ = NULL; + return temp; } - // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.options) - return options_; } -::google::protobuf::ServiceOptions* ServiceDescriptorProto::release_options() { - // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.options) - clear_has_options(); - ::google::protobuf::ServiceOptions* temp = options_; - options_ = NULL; - return temp; +void MethodDescriptorProto::_slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::MethodOptions** options) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*options) == NULL) { + message_arena->Own(*options); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*options)) { + ::google::protobuf::MethodOptions* new_options = + ::google::protobuf::Arena::CreateMessage< ::google::protobuf::MethodOptions >( + message_arena); + new_options->CopyFrom(**options); + *options = new_options; + } } -void ServiceDescriptorProto::set_allocated_options(::google::protobuf::ServiceOptions* options) { - delete options_; +void MethodDescriptorProto::unsafe_arena_set_allocated_options( + ::google::protobuf::MethodOptions* options) { + if (GetArenaNoVirtual() == NULL) { + delete options_; + } options_ = options; if (options) { set_has_options(); } else { clear_has_options(); } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.options) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.options) } - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS - -// =================================================================== - #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int MethodDescriptorProto::kNameFieldNumber; const int MethodDescriptorProto::kInputTypeFieldNumber; @@ -8006,11 +7473,19 @@ const int MethodDescriptorProto::kServerStreamingFieldNumber; MethodDescriptorProto::MethodDescriptorProto() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodDescriptorProto(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.MethodDescriptorProto) } +MethodDescriptorProto::MethodDescriptorProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodDescriptorProto(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.MethodDescriptorProto) +} MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -8019,15 +7494,18 @@ MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from) _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_name()) { - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); } input_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_input_type()) { - input_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.input_type_); + input_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.input_type(), + GetArenaNoVirtual()); } output_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_output_type()) { - output_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_type_); + output_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_type(), + GetArenaNoVirtual()); } if (from.has_options()) { options_ = new ::google::protobuf::MethodOptions(*from.options_); @@ -8056,33 +7534,41 @@ MethodDescriptorProto::~MethodDescriptorProto() { } void MethodDescriptorProto::SharedDtor() { - name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - input_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - output_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + input_type_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + output_type_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); if (this != internal_default_instance()) delete options_; } +void MethodDescriptorProto::ArenaDtor(void* object) { + MethodDescriptorProto* _this = reinterpret_cast< MethodDescriptorProto* >(object); + (void)_this; +} +void MethodDescriptorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void MethodDescriptorProto::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* MethodDescriptorProto::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const MethodDescriptorProto& MethodDescriptorProto::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodDescriptorProto(); return *internal_default_instance(); } MethodDescriptorProto* MethodDescriptorProto::New(::google::protobuf::Arena* arena) const { - MethodDescriptorProto* n = new MethodDescriptorProto; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void MethodDescriptorProto::Clear() { @@ -8095,26 +7581,24 @@ void MethodDescriptorProto::Clear() { if (cached_has_bits & 15u) { if (cached_has_bits & 0x00000001u) { GOOGLE_DCHECK(!name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000002u) { GOOGLE_DCHECK(!input_type_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*input_type_.UnsafeRawStringPointer())->clear(); + input_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000004u) { GOOGLE_DCHECK(!output_type_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*output_type_.UnsafeRawStringPointer())->clear(); + output_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000008u) { GOOGLE_DCHECK(options_ != NULL); options_->::google::protobuf::MethodOptions::Clear(); } } - if (cached_has_bits & 48u) { - ::memset(&client_streaming_, 0, static_cast( - reinterpret_cast(&server_streaming_) - - reinterpret_cast(&client_streaming_)) + sizeof(server_streaming_)); - } + ::memset(&client_streaming_, 0, static_cast( + reinterpret_cast(&server_streaming_) - + reinterpret_cast(&client_streaming_)) + sizeof(server_streaming_)); _has_bits_.Clear(); _internal_metadata_.Clear(); } @@ -8444,16 +7928,13 @@ void MethodDescriptorProto::MergeFrom(const MethodDescriptorProto& from) { cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 63u) { if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + set_name(from.name()); } if (cached_has_bits & 0x00000002u) { - set_has_input_type(); - input_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.input_type_); + set_input_type(from.input_type()); } if (cached_has_bits & 0x00000004u) { - set_has_output_type(); - output_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_type_); + set_output_type(from.output_type()); } if (cached_has_bits & 0x00000008u) { mutable_options()->::google::protobuf::MethodOptions::MergeFrom(from.options()); @@ -8491,6 +7972,21 @@ bool MethodDescriptorProto::IsInitialized() const { void MethodDescriptorProto::Swap(MethodDescriptorProto* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MethodDescriptorProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MethodDescriptorProto::UnsafeArenaSwap(MethodDescriptorProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void MethodDescriptorProto::InternalSwap(MethodDescriptorProto* other) { @@ -8508,299 +8004,14 @@ void MethodDescriptorProto::InternalSwap(MethodDescriptorProto* other) { ::google::protobuf::Metadata MethodDescriptorProto::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// MethodDescriptorProto - -// optional string name = 1; -bool MethodDescriptorProto::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void MethodDescriptorProto::set_has_name() { - _has_bits_[0] |= 0x00000001u; -} -void MethodDescriptorProto::clear_has_name() { - _has_bits_[0] &= ~0x00000001u; -} -void MethodDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); -} -const ::std::string& MethodDescriptorProto::name() const { - // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.name) - return name_.GetNoArena(); -} -void MethodDescriptorProto::set_name(const ::std::string& value) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.name) -} -#if LANG_CXX11 -void MethodDescriptorProto::set_name(::std::string&& value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.MethodDescriptorProto.name) -} -#endif -void MethodDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.name) -} -void MethodDescriptorProto::set_name(const char* value, size_t size) { - set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.name) -} -::std::string* MethodDescriptorProto::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* MethodDescriptorProto::release_name() { - // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.name) - clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void MethodDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { - set_has_name(); - } else { - clear_has_name(); - } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.name) -} - -// optional string input_type = 2; -bool MethodDescriptorProto::has_input_type() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void MethodDescriptorProto::set_has_input_type() { - _has_bits_[0] |= 0x00000002u; -} -void MethodDescriptorProto::clear_has_input_type() { - _has_bits_[0] &= ~0x00000002u; -} -void MethodDescriptorProto::clear_input_type() { - input_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_input_type(); -} -const ::std::string& MethodDescriptorProto::input_type() const { - // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.input_type) - return input_type_.GetNoArena(); -} -void MethodDescriptorProto::set_input_type(const ::std::string& value) { - set_has_input_type(); - input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.input_type) -} -#if LANG_CXX11 -void MethodDescriptorProto::set_input_type(::std::string&& value) { - set_has_input_type(); - input_type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.MethodDescriptorProto.input_type) -} -#endif -void MethodDescriptorProto::set_input_type(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_input_type(); - input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.input_type) -} -void MethodDescriptorProto::set_input_type(const char* value, size_t size) { - set_has_input_type(); - input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.input_type) -} -::std::string* MethodDescriptorProto::mutable_input_type() { - set_has_input_type(); - // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.input_type) - return input_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* MethodDescriptorProto::release_input_type() { - // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.input_type) - clear_has_input_type(); - return input_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void MethodDescriptorProto::set_allocated_input_type(::std::string* input_type) { - if (input_type != NULL) { - set_has_input_type(); - } else { - clear_has_input_type(); - } - input_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), input_type); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.input_type) -} - -// optional string output_type = 3; -bool MethodDescriptorProto::has_output_type() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void MethodDescriptorProto::set_has_output_type() { - _has_bits_[0] |= 0x00000004u; -} -void MethodDescriptorProto::clear_has_output_type() { - _has_bits_[0] &= ~0x00000004u; -} -void MethodDescriptorProto::clear_output_type() { - output_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_output_type(); -} -const ::std::string& MethodDescriptorProto::output_type() const { - // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.output_type) - return output_type_.GetNoArena(); -} -void MethodDescriptorProto::set_output_type(const ::std::string& value) { - set_has_output_type(); - output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.output_type) -} -#if LANG_CXX11 -void MethodDescriptorProto::set_output_type(::std::string&& value) { - set_has_output_type(); - output_type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.MethodDescriptorProto.output_type) -} -#endif -void MethodDescriptorProto::set_output_type(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_output_type(); - output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.output_type) -} -void MethodDescriptorProto::set_output_type(const char* value, size_t size) { - set_has_output_type(); - output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.output_type) -} -::std::string* MethodDescriptorProto::mutable_output_type() { - set_has_output_type(); - // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.output_type) - return output_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* MethodDescriptorProto::release_output_type() { - // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.output_type) - clear_has_output_type(); - return output_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void MethodDescriptorProto::set_allocated_output_type(::std::string* output_type) { - if (output_type != NULL) { - set_has_output_type(); - } else { - clear_has_output_type(); - } - output_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_type); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.output_type) -} - -// optional .google.protobuf.MethodOptions options = 4; -bool MethodDescriptorProto::has_options() const { - return (_has_bits_[0] & 0x00000008u) != 0; -} -void MethodDescriptorProto::set_has_options() { - _has_bits_[0] |= 0x00000008u; -} -void MethodDescriptorProto::clear_has_options() { - _has_bits_[0] &= ~0x00000008u; -} -void MethodDescriptorProto::clear_options() { - if (options_ != NULL) options_->::google::protobuf::MethodOptions::Clear(); - clear_has_options(); -} -const ::google::protobuf::MethodOptions& MethodDescriptorProto::options() const { - const ::google::protobuf::MethodOptions* p = options_; - // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( - &::google::protobuf::_MethodOptions_default_instance_); -} -::google::protobuf::MethodOptions* MethodDescriptorProto::mutable_options() { - set_has_options(); - if (options_ == NULL) { - options_ = new ::google::protobuf::MethodOptions; - } - // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.options) - return options_; -} -::google::protobuf::MethodOptions* MethodDescriptorProto::release_options() { - // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.options) - clear_has_options(); - ::google::protobuf::MethodOptions* temp = options_; - options_ = NULL; - return temp; -} -void MethodDescriptorProto::set_allocated_options(::google::protobuf::MethodOptions* options) { - delete options_; - options_ = options; - if (options) { - set_has_options(); - } else { - clear_has_options(); - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.options) -} - -// optional bool client_streaming = 5 [default = false]; -bool MethodDescriptorProto::has_client_streaming() const { - return (_has_bits_[0] & 0x00000010u) != 0; -} -void MethodDescriptorProto::set_has_client_streaming() { - _has_bits_[0] |= 0x00000010u; -} -void MethodDescriptorProto::clear_has_client_streaming() { - _has_bits_[0] &= ~0x00000010u; -} -void MethodDescriptorProto::clear_client_streaming() { - client_streaming_ = false; - clear_has_client_streaming(); -} -bool MethodDescriptorProto::client_streaming() const { - // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.client_streaming) - return client_streaming_; -} -void MethodDescriptorProto::set_client_streaming(bool value) { - set_has_client_streaming(); - client_streaming_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.client_streaming) -} - -// optional bool server_streaming = 6 [default = false]; -bool MethodDescriptorProto::has_server_streaming() const { - return (_has_bits_[0] & 0x00000020u) != 0; -} -void MethodDescriptorProto::set_has_server_streaming() { - _has_bits_[0] |= 0x00000020u; -} -void MethodDescriptorProto::clear_has_server_streaming() { - _has_bits_[0] &= ~0x00000020u; -} -void MethodDescriptorProto::clear_server_streaming() { - server_streaming_ = false; - clear_has_server_streaming(); -} -bool MethodDescriptorProto::server_streaming() const { - // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.server_streaming) - return server_streaming_; -} -void MethodDescriptorProto::set_server_streaming(bool value) { - set_has_server_streaming(); - server_streaming_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.server_streaming) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void FileOptions::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int FileOptions::kJavaPackageFieldNumber; const int FileOptions::kJavaOuterClassnameFieldNumber; @@ -8826,11 +8037,21 @@ const int FileOptions::kUninterpretedOptionFieldNumber; FileOptions::FileOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileOptions(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FileOptions) } +FileOptions::FileOptions(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _extensions_(arena), + _internal_metadata_(arena), + uninterpreted_option_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileOptions(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.FileOptions) +} FileOptions::FileOptions(const FileOptions& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -8841,39 +8062,47 @@ FileOptions::FileOptions(const FileOptions& from) _extensions_.MergeFrom(from._extensions_); java_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_java_package()) { - java_package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.java_package_); + java_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.java_package(), + GetArenaNoVirtual()); } java_outer_classname_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_java_outer_classname()) { - java_outer_classname_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.java_outer_classname_); + java_outer_classname_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.java_outer_classname(), + GetArenaNoVirtual()); } go_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_go_package()) { - go_package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.go_package_); + go_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.go_package(), + GetArenaNoVirtual()); } objc_class_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_objc_class_prefix()) { - objc_class_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.objc_class_prefix_); + objc_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.objc_class_prefix(), + GetArenaNoVirtual()); } csharp_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_csharp_namespace()) { - csharp_namespace_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.csharp_namespace_); + csharp_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.csharp_namespace(), + GetArenaNoVirtual()); } swift_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_swift_prefix()) { - swift_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.swift_prefix_); + swift_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.swift_prefix(), + GetArenaNoVirtual()); } php_class_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_php_class_prefix()) { - php_class_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.php_class_prefix_); + php_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.php_class_prefix(), + GetArenaNoVirtual()); } php_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_php_namespace()) { - php_namespace_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.php_namespace_); + php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.php_namespace(), + GetArenaNoVirtual()); } - ::memcpy(&java_multiple_files_, &from.java_multiple_files_, + ::memcpy(&cc_enable_arenas_, &from.cc_enable_arenas_, static_cast(reinterpret_cast(&optimize_for_) - - reinterpret_cast(&java_multiple_files_)) + sizeof(optimize_for_)); + reinterpret_cast(&cc_enable_arenas_)) + sizeof(optimize_for_)); // @@protoc_insertion_point(copy_constructor:google.protobuf.FileOptions) } @@ -8887,9 +8116,9 @@ void FileOptions::SharedCtor() { swift_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); php_class_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); php_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - ::memset(&java_multiple_files_, 0, static_cast( - reinterpret_cast(&cc_enable_arenas_) - - reinterpret_cast(&java_multiple_files_)) + sizeof(cc_enable_arenas_)); + ::memset(&cc_enable_arenas_, 0, static_cast( + reinterpret_cast(&deprecated_) - + reinterpret_cast(&cc_enable_arenas_)) + sizeof(deprecated_)); optimize_for_ = 1; } @@ -8899,37 +8128,45 @@ FileOptions::~FileOptions() { } void FileOptions::SharedDtor() { - java_package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - java_outer_classname_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - go_package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - objc_class_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - csharp_namespace_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - swift_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - php_class_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - php_namespace_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + java_package_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + java_outer_classname_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + go_package_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + objc_class_prefix_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + csharp_namespace_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + swift_prefix_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + php_class_prefix_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + php_namespace_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); } +void FileOptions::ArenaDtor(void* object) { + FileOptions* _this = reinterpret_cast< FileOptions* >(object); + (void)_this; +} +void FileOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void FileOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* FileOptions::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const FileOptions& FileOptions::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileOptions(); return *internal_default_instance(); } FileOptions* FileOptions::New(::google::protobuf::Arena* arena) const { - FileOptions* n = new FileOptions; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void FileOptions::Clear() { @@ -8944,44 +8181,44 @@ void FileOptions::Clear() { if (cached_has_bits & 255u) { if (cached_has_bits & 0x00000001u) { GOOGLE_DCHECK(!java_package_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*java_package_.UnsafeRawStringPointer())->clear(); + java_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000002u) { GOOGLE_DCHECK(!java_outer_classname_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*java_outer_classname_.UnsafeRawStringPointer())->clear(); + java_outer_classname_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000004u) { GOOGLE_DCHECK(!go_package_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*go_package_.UnsafeRawStringPointer())->clear(); + go_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000008u) { GOOGLE_DCHECK(!objc_class_prefix_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*objc_class_prefix_.UnsafeRawStringPointer())->clear(); + objc_class_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000010u) { GOOGLE_DCHECK(!csharp_namespace_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*csharp_namespace_.UnsafeRawStringPointer())->clear(); + csharp_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000020u) { GOOGLE_DCHECK(!swift_prefix_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*swift_prefix_.UnsafeRawStringPointer())->clear(); + swift_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000040u) { GOOGLE_DCHECK(!php_class_prefix_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*php_class_prefix_.UnsafeRawStringPointer())->clear(); + php_class_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000080u) { GOOGLE_DCHECK(!php_namespace_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*php_namespace_.UnsafeRawStringPointer())->clear(); + php_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } } if (cached_has_bits & 65280u) { - ::memset(&java_multiple_files_, 0, static_cast( - reinterpret_cast(&deprecated_) - - reinterpret_cast(&java_multiple_files_)) + sizeof(deprecated_)); + ::memset(&cc_enable_arenas_, 0, static_cast( + reinterpret_cast(&php_generic_services_) - + reinterpret_cast(&cc_enable_arenas_)) + sizeof(php_generic_services_)); } if (cached_has_bits & 196608u) { - cc_enable_arenas_ = false; + deprecated_ = false; optimize_for_ = 1; } _has_bits_.Clear(); @@ -9115,21 +8352,7 @@ bool FileOptions::MergePartialFromCodedStream( set_has_py_generic_services(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &py_generic_services_))); - } else { - goto handle_unusual; - } - break; - } - - // optional bool php_generic_services = 19 [default = false]; - case 19: { - if (static_cast< ::google::protobuf::uint8>(tag) == - static_cast< ::google::protobuf::uint8>(152u /* 152 & 0xFF */)) { - set_has_php_generic_services(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &php_generic_services_))); + input, &py_generic_services_))); } else { goto handle_unusual; } @@ -9272,6 +8495,20 @@ bool FileOptions::MergePartialFromCodedStream( break; } + // optional bool php_generic_services = 42 [default = false]; + case 42: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 336 & 0xFF */)) { + set_has_php_generic_services(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &php_generic_services_))); + } else { + goto handle_unusual; + } + break; + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; case 999: { if (static_cast< ::google::protobuf::uint8>(tag) == @@ -9344,7 +8581,7 @@ void FileOptions::SerializeWithCachedSizes( } // optional bool java_multiple_files = 10 [default = false]; - if (cached_has_bits & 0x00000100u) { + if (cached_has_bits & 0x00000200u) { ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->java_multiple_files(), output); } @@ -9359,42 +8596,37 @@ void FileOptions::SerializeWithCachedSizes( } // optional bool cc_generic_services = 16 [default = false]; - if (cached_has_bits & 0x00000800u) { + if (cached_has_bits & 0x00001000u) { ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->cc_generic_services(), output); } // optional bool java_generic_services = 17 [default = false]; - if (cached_has_bits & 0x00001000u) { + if (cached_has_bits & 0x00002000u) { ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->java_generic_services(), output); } // optional bool py_generic_services = 18 [default = false]; - if (cached_has_bits & 0x00002000u) { - ::google::protobuf::internal::WireFormatLite::WriteBool(18, this->py_generic_services(), output); - } - - // optional bool php_generic_services = 19 [default = false]; if (cached_has_bits & 0x00004000u) { - ::google::protobuf::internal::WireFormatLite::WriteBool(19, this->php_generic_services(), output); + ::google::protobuf::internal::WireFormatLite::WriteBool(18, this->py_generic_services(), output); } // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; - if (cached_has_bits & 0x00000200u) { + if (cached_has_bits & 0x00000400u) { ::google::protobuf::internal::WireFormatLite::WriteBool(20, this->java_generate_equals_and_hash(), output); } // optional bool deprecated = 23 [default = false]; - if (cached_has_bits & 0x00008000u) { + if (cached_has_bits & 0x00010000u) { ::google::protobuf::internal::WireFormatLite::WriteBool(23, this->deprecated(), output); } // optional bool java_string_check_utf8 = 27 [default = false]; - if (cached_has_bits & 0x00000400u) { + if (cached_has_bits & 0x00000800u) { ::google::protobuf::internal::WireFormatLite::WriteBool(27, this->java_string_check_utf8(), output); } // optional bool cc_enable_arenas = 31 [default = false]; - if (cached_has_bits & 0x00010000u) { + if (cached_has_bits & 0x00000100u) { ::google::protobuf::internal::WireFormatLite::WriteBool(31, this->cc_enable_arenas(), output); } @@ -9448,6 +8680,11 @@ void FileOptions::SerializeWithCachedSizes( 41, this->php_namespace(), output); } + // optional bool php_generic_services = 42 [default = false]; + if (cached_has_bits & 0x00008000u) { + ::google::protobuf::internal::WireFormatLite::WriteBool(42, this->php_generic_services(), output); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned int i = 0, n = static_cast(this->uninterpreted_option_size()); i < n; i++) { @@ -9503,7 +8740,7 @@ void FileOptions::SerializeWithCachedSizes( } // optional bool java_multiple_files = 10 [default = false]; - if (cached_has_bits & 0x00000100u) { + if (cached_has_bits & 0x00000200u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->java_multiple_files(), target); } @@ -9519,42 +8756,37 @@ void FileOptions::SerializeWithCachedSizes( } // optional bool cc_generic_services = 16 [default = false]; - if (cached_has_bits & 0x00000800u) { + if (cached_has_bits & 0x00001000u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->cc_generic_services(), target); } // optional bool java_generic_services = 17 [default = false]; - if (cached_has_bits & 0x00001000u) { + if (cached_has_bits & 0x00002000u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(17, this->java_generic_services(), target); } // optional bool py_generic_services = 18 [default = false]; - if (cached_has_bits & 0x00002000u) { - target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(18, this->py_generic_services(), target); - } - - // optional bool php_generic_services = 19 [default = false]; if (cached_has_bits & 0x00004000u) { - target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(19, this->php_generic_services(), target); + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(18, this->py_generic_services(), target); } // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; - if (cached_has_bits & 0x00000200u) { + if (cached_has_bits & 0x00000400u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(20, this->java_generate_equals_and_hash(), target); } // optional bool deprecated = 23 [default = false]; - if (cached_has_bits & 0x00008000u) { + if (cached_has_bits & 0x00010000u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(23, this->deprecated(), target); } // optional bool java_string_check_utf8 = 27 [default = false]; - if (cached_has_bits & 0x00000400u) { + if (cached_has_bits & 0x00000800u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(27, this->java_string_check_utf8(), target); } // optional bool cc_enable_arenas = 31 [default = false]; - if (cached_has_bits & 0x00010000u) { + if (cached_has_bits & 0x00000100u) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(31, this->cc_enable_arenas(), target); } @@ -9613,6 +8845,11 @@ void FileOptions::SerializeWithCachedSizes( 41, this->php_namespace(), target); } + // optional bool php_generic_services = 42 [default = false]; + if (cached_has_bits & 0x00008000u) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(42, this->php_generic_services(), target); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned int i = 0, n = static_cast(this->uninterpreted_option_size()); i < n; i++) { @@ -9714,6 +8951,11 @@ size_t FileOptions::ByteSizeLong() const { } if (_has_bits_[8 / 32] & 65280u) { + // optional bool cc_enable_arenas = 31 [default = false]; + if (has_cc_enable_arenas()) { + total_size += 2 + 1; + } + // optional bool java_multiple_files = 10 [default = false]; if (has_java_multiple_files()) { total_size += 1 + 1; @@ -9744,20 +8986,15 @@ size_t FileOptions::ByteSizeLong() const { total_size += 2 + 1; } - // optional bool php_generic_services = 19 [default = false]; + // optional bool php_generic_services = 42 [default = false]; if (has_php_generic_services()) { total_size += 2 + 1; } - // optional bool deprecated = 23 [default = false]; - if (has_deprecated()) { - total_size += 2 + 1; - } - } if (_has_bits_[16 / 32] & 196608u) { - // optional bool cc_enable_arenas = 31 [default = false]; - if (has_cc_enable_arenas()) { + // optional bool deprecated = 23 [default = false]; + if (has_deprecated()) { total_size += 2 + 1; } @@ -9802,68 +9039,60 @@ void FileOptions::MergeFrom(const FileOptions& from) { cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 255u) { if (cached_has_bits & 0x00000001u) { - set_has_java_package(); - java_package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.java_package_); + set_java_package(from.java_package()); } if (cached_has_bits & 0x00000002u) { - set_has_java_outer_classname(); - java_outer_classname_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.java_outer_classname_); + set_java_outer_classname(from.java_outer_classname()); } if (cached_has_bits & 0x00000004u) { - set_has_go_package(); - go_package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.go_package_); + set_go_package(from.go_package()); } if (cached_has_bits & 0x00000008u) { - set_has_objc_class_prefix(); - objc_class_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.objc_class_prefix_); + set_objc_class_prefix(from.objc_class_prefix()); } if (cached_has_bits & 0x00000010u) { - set_has_csharp_namespace(); - csharp_namespace_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.csharp_namespace_); + set_csharp_namespace(from.csharp_namespace()); } if (cached_has_bits & 0x00000020u) { - set_has_swift_prefix(); - swift_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.swift_prefix_); + set_swift_prefix(from.swift_prefix()); } if (cached_has_bits & 0x00000040u) { - set_has_php_class_prefix(); - php_class_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.php_class_prefix_); + set_php_class_prefix(from.php_class_prefix()); } if (cached_has_bits & 0x00000080u) { - set_has_php_namespace(); - php_namespace_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.php_namespace_); + set_php_namespace(from.php_namespace()); } } if (cached_has_bits & 65280u) { if (cached_has_bits & 0x00000100u) { - java_multiple_files_ = from.java_multiple_files_; + cc_enable_arenas_ = from.cc_enable_arenas_; } if (cached_has_bits & 0x00000200u) { - java_generate_equals_and_hash_ = from.java_generate_equals_and_hash_; + java_multiple_files_ = from.java_multiple_files_; } if (cached_has_bits & 0x00000400u) { - java_string_check_utf8_ = from.java_string_check_utf8_; + java_generate_equals_and_hash_ = from.java_generate_equals_and_hash_; } if (cached_has_bits & 0x00000800u) { - cc_generic_services_ = from.cc_generic_services_; + java_string_check_utf8_ = from.java_string_check_utf8_; } if (cached_has_bits & 0x00001000u) { - java_generic_services_ = from.java_generic_services_; + cc_generic_services_ = from.cc_generic_services_; } if (cached_has_bits & 0x00002000u) { - py_generic_services_ = from.py_generic_services_; + java_generic_services_ = from.java_generic_services_; } if (cached_has_bits & 0x00004000u) { - php_generic_services_ = from.php_generic_services_; + py_generic_services_ = from.py_generic_services_; } if (cached_has_bits & 0x00008000u) { - deprecated_ = from.deprecated_; + php_generic_services_ = from.php_generic_services_; } _has_bits_[0] |= cached_has_bits; } if (cached_has_bits & 196608u) { if (cached_has_bits & 0x00010000u) { - cc_enable_arenas_ = from.cc_enable_arenas_; + deprecated_ = from.deprecated_; } if (cached_has_bits & 0x00020000u) { optimize_for_ = from.optimize_for_; @@ -9897,6 +9126,21 @@ bool FileOptions::IsInitialized() const { void FileOptions::Swap(FileOptions* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FileOptions* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FileOptions::UnsafeArenaSwap(FileOptions* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void FileOptions::InternalSwap(FileOptions* other) { @@ -9910,6 +9154,7 @@ void FileOptions::InternalSwap(FileOptions* other) { swift_prefix_.Swap(&other->swift_prefix_); php_class_prefix_.Swap(&other->php_class_prefix_); php_namespace_.Swap(&other->php_namespace_); + swap(cc_enable_arenas_, other->cc_enable_arenas_); swap(java_multiple_files_, other->java_multiple_files_); swap(java_generate_equals_and_hash_, other->java_generate_equals_and_hash_); swap(java_string_check_utf8_, other->java_string_check_utf8_); @@ -9918,7 +9163,6 @@ void FileOptions::InternalSwap(FileOptions* other) { swap(py_generic_services_, other->py_generic_services_); swap(php_generic_services_, other->php_generic_services_); swap(deprecated_, other->deprecated_); - swap(cc_enable_arenas_, other->cc_enable_arenas_); swap(optimize_for_, other->optimize_for_); swap(_has_bits_[0], other->_has_bits_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); @@ -9928,791 +9172,14 @@ void FileOptions::InternalSwap(FileOptions* other) { ::google::protobuf::Metadata FileOptions::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// FileOptions - -// optional string java_package = 1; -bool FileOptions::has_java_package() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void FileOptions::set_has_java_package() { - _has_bits_[0] |= 0x00000001u; -} -void FileOptions::clear_has_java_package() { - _has_bits_[0] &= ~0x00000001u; -} -void FileOptions::clear_java_package() { - java_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_java_package(); -} -const ::std::string& FileOptions::java_package() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_package) - return java_package_.GetNoArena(); -} -void FileOptions::set_java_package(const ::std::string& value) { - set_has_java_package(); - java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_package) -} -#if LANG_CXX11 -void FileOptions::set_java_package(::std::string&& value) { - set_has_java_package(); - java_package_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.java_package) -} -#endif -void FileOptions::set_java_package(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_java_package(); - java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.java_package) -} -void FileOptions::set_java_package(const char* value, size_t size) { - set_has_java_package(); - java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.java_package) -} -::std::string* FileOptions::mutable_java_package() { - set_has_java_package(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_package) - return java_package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileOptions::release_java_package() { - // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_package) - clear_has_java_package(); - return java_package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileOptions::set_allocated_java_package(::std::string* java_package) { - if (java_package != NULL) { - set_has_java_package(); - } else { - clear_has_java_package(); - } - java_package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_package); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_package) -} - -// optional string java_outer_classname = 8; -bool FileOptions::has_java_outer_classname() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void FileOptions::set_has_java_outer_classname() { - _has_bits_[0] |= 0x00000002u; -} -void FileOptions::clear_has_java_outer_classname() { - _has_bits_[0] &= ~0x00000002u; -} -void FileOptions::clear_java_outer_classname() { - java_outer_classname_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_java_outer_classname(); -} -const ::std::string& FileOptions::java_outer_classname() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_outer_classname) - return java_outer_classname_.GetNoArena(); -} -void FileOptions::set_java_outer_classname(const ::std::string& value) { - set_has_java_outer_classname(); - java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_outer_classname) -} -#if LANG_CXX11 -void FileOptions::set_java_outer_classname(::std::string&& value) { - set_has_java_outer_classname(); - java_outer_classname_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.java_outer_classname) -} -#endif -void FileOptions::set_java_outer_classname(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_java_outer_classname(); - java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.java_outer_classname) -} -void FileOptions::set_java_outer_classname(const char* value, size_t size) { - set_has_java_outer_classname(); - java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.java_outer_classname) -} -::std::string* FileOptions::mutable_java_outer_classname() { - set_has_java_outer_classname(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_outer_classname) - return java_outer_classname_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileOptions::release_java_outer_classname() { - // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_outer_classname) - clear_has_java_outer_classname(); - return java_outer_classname_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileOptions::set_allocated_java_outer_classname(::std::string* java_outer_classname) { - if (java_outer_classname != NULL) { - set_has_java_outer_classname(); - } else { - clear_has_java_outer_classname(); - } - java_outer_classname_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_outer_classname); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_outer_classname) -} - -// optional bool java_multiple_files = 10 [default = false]; -bool FileOptions::has_java_multiple_files() const { - return (_has_bits_[0] & 0x00000100u) != 0; -} -void FileOptions::set_has_java_multiple_files() { - _has_bits_[0] |= 0x00000100u; -} -void FileOptions::clear_has_java_multiple_files() { - _has_bits_[0] &= ~0x00000100u; -} -void FileOptions::clear_java_multiple_files() { - java_multiple_files_ = false; - clear_has_java_multiple_files(); -} -bool FileOptions::java_multiple_files() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_multiple_files) - return java_multiple_files_; -} -void FileOptions::set_java_multiple_files(bool value) { - set_has_java_multiple_files(); - java_multiple_files_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_multiple_files) -} - -// optional bool java_generate_equals_and_hash = 20 [deprecated = true]; -bool FileOptions::has_java_generate_equals_and_hash() const { - return (_has_bits_[0] & 0x00000200u) != 0; -} -void FileOptions::set_has_java_generate_equals_and_hash() { - _has_bits_[0] |= 0x00000200u; -} -void FileOptions::clear_has_java_generate_equals_and_hash() { - _has_bits_[0] &= ~0x00000200u; -} -void FileOptions::clear_java_generate_equals_and_hash() { - java_generate_equals_and_hash_ = false; - clear_has_java_generate_equals_and_hash(); -} -bool FileOptions::java_generate_equals_and_hash() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generate_equals_and_hash) - return java_generate_equals_and_hash_; -} -void FileOptions::set_java_generate_equals_and_hash(bool value) { - set_has_java_generate_equals_and_hash(); - java_generate_equals_and_hash_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_generate_equals_and_hash) -} - -// optional bool java_string_check_utf8 = 27 [default = false]; -bool FileOptions::has_java_string_check_utf8() const { - return (_has_bits_[0] & 0x00000400u) != 0; -} -void FileOptions::set_has_java_string_check_utf8() { - _has_bits_[0] |= 0x00000400u; -} -void FileOptions::clear_has_java_string_check_utf8() { - _has_bits_[0] &= ~0x00000400u; -} -void FileOptions::clear_java_string_check_utf8() { - java_string_check_utf8_ = false; - clear_has_java_string_check_utf8(); -} -bool FileOptions::java_string_check_utf8() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_string_check_utf8) - return java_string_check_utf8_; -} -void FileOptions::set_java_string_check_utf8(bool value) { - set_has_java_string_check_utf8(); - java_string_check_utf8_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_string_check_utf8) -} - -// optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; -bool FileOptions::has_optimize_for() const { - return (_has_bits_[0] & 0x00020000u) != 0; -} -void FileOptions::set_has_optimize_for() { - _has_bits_[0] |= 0x00020000u; -} -void FileOptions::clear_has_optimize_for() { - _has_bits_[0] &= ~0x00020000u; -} -void FileOptions::clear_optimize_for() { - optimize_for_ = 1; - clear_has_optimize_for(); -} -::google::protobuf::FileOptions_OptimizeMode FileOptions::optimize_for() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.optimize_for) - return static_cast< ::google::protobuf::FileOptions_OptimizeMode >(optimize_for_); -} -void FileOptions::set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value) { - assert(::google::protobuf::FileOptions_OptimizeMode_IsValid(value)); - set_has_optimize_for(); - optimize_for_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.optimize_for) -} - -// optional string go_package = 11; -bool FileOptions::has_go_package() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void FileOptions::set_has_go_package() { - _has_bits_[0] |= 0x00000004u; -} -void FileOptions::clear_has_go_package() { - _has_bits_[0] &= ~0x00000004u; -} -void FileOptions::clear_go_package() { - go_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_go_package(); -} -const ::std::string& FileOptions::go_package() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.go_package) - return go_package_.GetNoArena(); -} -void FileOptions::set_go_package(const ::std::string& value) { - set_has_go_package(); - go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.go_package) -} -#if LANG_CXX11 -void FileOptions::set_go_package(::std::string&& value) { - set_has_go_package(); - go_package_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.go_package) -} -#endif -void FileOptions::set_go_package(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_go_package(); - go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.go_package) -} -void FileOptions::set_go_package(const char* value, size_t size) { - set_has_go_package(); - go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.go_package) -} -::std::string* FileOptions::mutable_go_package() { - set_has_go_package(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.go_package) - return go_package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileOptions::release_go_package() { - // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.go_package) - clear_has_go_package(); - return go_package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileOptions::set_allocated_go_package(::std::string* go_package) { - if (go_package != NULL) { - set_has_go_package(); - } else { - clear_has_go_package(); - } - go_package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), go_package); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.go_package) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -// optional bool cc_generic_services = 16 [default = false]; -bool FileOptions::has_cc_generic_services() const { - return (_has_bits_[0] & 0x00000800u) != 0; -} -void FileOptions::set_has_cc_generic_services() { - _has_bits_[0] |= 0x00000800u; -} -void FileOptions::clear_has_cc_generic_services() { - _has_bits_[0] &= ~0x00000800u; -} -void FileOptions::clear_cc_generic_services() { - cc_generic_services_ = false; - clear_has_cc_generic_services(); -} -bool FileOptions::cc_generic_services() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_generic_services) - return cc_generic_services_; -} -void FileOptions::set_cc_generic_services(bool value) { - set_has_cc_generic_services(); - cc_generic_services_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.cc_generic_services) -} - -// optional bool java_generic_services = 17 [default = false]; -bool FileOptions::has_java_generic_services() const { - return (_has_bits_[0] & 0x00001000u) != 0; -} -void FileOptions::set_has_java_generic_services() { - _has_bits_[0] |= 0x00001000u; -} -void FileOptions::clear_has_java_generic_services() { - _has_bits_[0] &= ~0x00001000u; -} -void FileOptions::clear_java_generic_services() { - java_generic_services_ = false; - clear_has_java_generic_services(); -} -bool FileOptions::java_generic_services() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generic_services) - return java_generic_services_; -} -void FileOptions::set_java_generic_services(bool value) { - set_has_java_generic_services(); - java_generic_services_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_generic_services) -} - -// optional bool py_generic_services = 18 [default = false]; -bool FileOptions::has_py_generic_services() const { - return (_has_bits_[0] & 0x00002000u) != 0; -} -void FileOptions::set_has_py_generic_services() { - _has_bits_[0] |= 0x00002000u; -} -void FileOptions::clear_has_py_generic_services() { - _has_bits_[0] &= ~0x00002000u; -} -void FileOptions::clear_py_generic_services() { - py_generic_services_ = false; - clear_has_py_generic_services(); -} -bool FileOptions::py_generic_services() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.py_generic_services) - return py_generic_services_; -} -void FileOptions::set_py_generic_services(bool value) { - set_has_py_generic_services(); - py_generic_services_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.py_generic_services) -} - -// optional bool php_generic_services = 19 [default = false]; -bool FileOptions::has_php_generic_services() const { - return (_has_bits_[0] & 0x00004000u) != 0; -} -void FileOptions::set_has_php_generic_services() { - _has_bits_[0] |= 0x00004000u; -} -void FileOptions::clear_has_php_generic_services() { - _has_bits_[0] &= ~0x00004000u; -} -void FileOptions::clear_php_generic_services() { - php_generic_services_ = false; - clear_has_php_generic_services(); -} -bool FileOptions::php_generic_services() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_generic_services) - return php_generic_services_; -} -void FileOptions::set_php_generic_services(bool value) { - set_has_php_generic_services(); - php_generic_services_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_generic_services) -} - -// optional bool deprecated = 23 [default = false]; -bool FileOptions::has_deprecated() const { - return (_has_bits_[0] & 0x00008000u) != 0; -} -void FileOptions::set_has_deprecated() { - _has_bits_[0] |= 0x00008000u; -} -void FileOptions::clear_has_deprecated() { - _has_bits_[0] &= ~0x00008000u; -} -void FileOptions::clear_deprecated() { - deprecated_ = false; - clear_has_deprecated(); -} -bool FileOptions::deprecated() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.deprecated) - return deprecated_; -} -void FileOptions::set_deprecated(bool value) { - set_has_deprecated(); - deprecated_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.deprecated) -} - -// optional bool cc_enable_arenas = 31 [default = false]; -bool FileOptions::has_cc_enable_arenas() const { - return (_has_bits_[0] & 0x00010000u) != 0; -} -void FileOptions::set_has_cc_enable_arenas() { - _has_bits_[0] |= 0x00010000u; -} -void FileOptions::clear_has_cc_enable_arenas() { - _has_bits_[0] &= ~0x00010000u; -} -void FileOptions::clear_cc_enable_arenas() { - cc_enable_arenas_ = false; - clear_has_cc_enable_arenas(); -} -bool FileOptions::cc_enable_arenas() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_enable_arenas) - return cc_enable_arenas_; -} -void FileOptions::set_cc_enable_arenas(bool value) { - set_has_cc_enable_arenas(); - cc_enable_arenas_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.cc_enable_arenas) -} - -// optional string objc_class_prefix = 36; -bool FileOptions::has_objc_class_prefix() const { - return (_has_bits_[0] & 0x00000008u) != 0; -} -void FileOptions::set_has_objc_class_prefix() { - _has_bits_[0] |= 0x00000008u; -} -void FileOptions::clear_has_objc_class_prefix() { - _has_bits_[0] &= ~0x00000008u; -} -void FileOptions::clear_objc_class_prefix() { - objc_class_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_objc_class_prefix(); -} -const ::std::string& FileOptions::objc_class_prefix() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.objc_class_prefix) - return objc_class_prefix_.GetNoArena(); -} -void FileOptions::set_objc_class_prefix(const ::std::string& value) { - set_has_objc_class_prefix(); - objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.objc_class_prefix) -} -#if LANG_CXX11 -void FileOptions::set_objc_class_prefix(::std::string&& value) { - set_has_objc_class_prefix(); - objc_class_prefix_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.objc_class_prefix) -} -#endif -void FileOptions::set_objc_class_prefix(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_objc_class_prefix(); - objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.objc_class_prefix) -} -void FileOptions::set_objc_class_prefix(const char* value, size_t size) { - set_has_objc_class_prefix(); - objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.objc_class_prefix) -} -::std::string* FileOptions::mutable_objc_class_prefix() { - set_has_objc_class_prefix(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.objc_class_prefix) - return objc_class_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileOptions::release_objc_class_prefix() { - // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.objc_class_prefix) - clear_has_objc_class_prefix(); - return objc_class_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileOptions::set_allocated_objc_class_prefix(::std::string* objc_class_prefix) { - if (objc_class_prefix != NULL) { - set_has_objc_class_prefix(); - } else { - clear_has_objc_class_prefix(); - } - objc_class_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), objc_class_prefix); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.objc_class_prefix) -} - -// optional string csharp_namespace = 37; -bool FileOptions::has_csharp_namespace() const { - return (_has_bits_[0] & 0x00000010u) != 0; -} -void FileOptions::set_has_csharp_namespace() { - _has_bits_[0] |= 0x00000010u; -} -void FileOptions::clear_has_csharp_namespace() { - _has_bits_[0] &= ~0x00000010u; -} -void FileOptions::clear_csharp_namespace() { - csharp_namespace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_csharp_namespace(); -} -const ::std::string& FileOptions::csharp_namespace() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.csharp_namespace) - return csharp_namespace_.GetNoArena(); -} -void FileOptions::set_csharp_namespace(const ::std::string& value) { - set_has_csharp_namespace(); - csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.csharp_namespace) -} -#if LANG_CXX11 -void FileOptions::set_csharp_namespace(::std::string&& value) { - set_has_csharp_namespace(); - csharp_namespace_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.csharp_namespace) -} -#endif -void FileOptions::set_csharp_namespace(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_csharp_namespace(); - csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.csharp_namespace) -} -void FileOptions::set_csharp_namespace(const char* value, size_t size) { - set_has_csharp_namespace(); - csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.csharp_namespace) -} -::std::string* FileOptions::mutable_csharp_namespace() { - set_has_csharp_namespace(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.csharp_namespace) - return csharp_namespace_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileOptions::release_csharp_namespace() { - // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.csharp_namespace) - clear_has_csharp_namespace(); - return csharp_namespace_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileOptions::set_allocated_csharp_namespace(::std::string* csharp_namespace) { - if (csharp_namespace != NULL) { - set_has_csharp_namespace(); - } else { - clear_has_csharp_namespace(); - } - csharp_namespace_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), csharp_namespace); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.csharp_namespace) -} - -// optional string swift_prefix = 39; -bool FileOptions::has_swift_prefix() const { - return (_has_bits_[0] & 0x00000020u) != 0; -} -void FileOptions::set_has_swift_prefix() { - _has_bits_[0] |= 0x00000020u; -} -void FileOptions::clear_has_swift_prefix() { - _has_bits_[0] &= ~0x00000020u; -} -void FileOptions::clear_swift_prefix() { - swift_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_swift_prefix(); -} -const ::std::string& FileOptions::swift_prefix() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.swift_prefix) - return swift_prefix_.GetNoArena(); -} -void FileOptions::set_swift_prefix(const ::std::string& value) { - set_has_swift_prefix(); - swift_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.swift_prefix) -} -#if LANG_CXX11 -void FileOptions::set_swift_prefix(::std::string&& value) { - set_has_swift_prefix(); - swift_prefix_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.swift_prefix) -} -#endif -void FileOptions::set_swift_prefix(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_swift_prefix(); - swift_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.swift_prefix) -} -void FileOptions::set_swift_prefix(const char* value, size_t size) { - set_has_swift_prefix(); - swift_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.swift_prefix) -} -::std::string* FileOptions::mutable_swift_prefix() { - set_has_swift_prefix(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.swift_prefix) - return swift_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileOptions::release_swift_prefix() { - // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.swift_prefix) - clear_has_swift_prefix(); - return swift_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileOptions::set_allocated_swift_prefix(::std::string* swift_prefix) { - if (swift_prefix != NULL) { - set_has_swift_prefix(); - } else { - clear_has_swift_prefix(); - } - swift_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), swift_prefix); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.swift_prefix) -} - -// optional string php_class_prefix = 40; -bool FileOptions::has_php_class_prefix() const { - return (_has_bits_[0] & 0x00000040u) != 0; -} -void FileOptions::set_has_php_class_prefix() { - _has_bits_[0] |= 0x00000040u; -} -void FileOptions::clear_has_php_class_prefix() { - _has_bits_[0] &= ~0x00000040u; -} -void FileOptions::clear_php_class_prefix() { - php_class_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_php_class_prefix(); -} -const ::std::string& FileOptions::php_class_prefix() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_class_prefix) - return php_class_prefix_.GetNoArena(); -} -void FileOptions::set_php_class_prefix(const ::std::string& value) { - set_has_php_class_prefix(); - php_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_class_prefix) -} -#if LANG_CXX11 -void FileOptions::set_php_class_prefix(::std::string&& value) { - set_has_php_class_prefix(); - php_class_prefix_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.php_class_prefix) -} -#endif -void FileOptions::set_php_class_prefix(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_php_class_prefix(); - php_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.php_class_prefix) -} -void FileOptions::set_php_class_prefix(const char* value, size_t size) { - set_has_php_class_prefix(); - php_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.php_class_prefix) -} -::std::string* FileOptions::mutable_php_class_prefix() { - set_has_php_class_prefix(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_class_prefix) - return php_class_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileOptions::release_php_class_prefix() { - // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_class_prefix) - clear_has_php_class_prefix(); - return php_class_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileOptions::set_allocated_php_class_prefix(::std::string* php_class_prefix) { - if (php_class_prefix != NULL) { - set_has_php_class_prefix(); - } else { - clear_has_php_class_prefix(); - } - php_class_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_class_prefix); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_class_prefix) -} - -// optional string php_namespace = 41; -bool FileOptions::has_php_namespace() const { - return (_has_bits_[0] & 0x00000080u) != 0; -} -void FileOptions::set_has_php_namespace() { - _has_bits_[0] |= 0x00000080u; -} -void FileOptions::clear_has_php_namespace() { - _has_bits_[0] &= ~0x00000080u; -} -void FileOptions::clear_php_namespace() { - php_namespace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_php_namespace(); -} -const ::std::string& FileOptions::php_namespace() const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_namespace) - return php_namespace_.GetNoArena(); -} -void FileOptions::set_php_namespace(const ::std::string& value) { - set_has_php_namespace(); - php_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_namespace) -} -#if LANG_CXX11 -void FileOptions::set_php_namespace(::std::string&& value) { - set_has_php_namespace(); - php_namespace_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.php_namespace) -} -#endif -void FileOptions::set_php_namespace(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_php_namespace(); - php_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.php_namespace) -} -void FileOptions::set_php_namespace(const char* value, size_t size) { - set_has_php_namespace(); - php_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.php_namespace) -} -::std::string* FileOptions::mutable_php_namespace() { - set_has_php_namespace(); - // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_namespace) - return php_namespace_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* FileOptions::release_php_namespace() { - // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_namespace) - clear_has_php_namespace(); - return php_namespace_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void FileOptions::set_allocated_php_namespace(::std::string* php_namespace) { - if (php_namespace != NULL) { - set_has_php_namespace(); - } else { - clear_has_php_namespace(); - } - php_namespace_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_namespace); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_namespace) -} - -// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; -int FileOptions::uninterpreted_option_size() const { - return uninterpreted_option_.size(); -} -void FileOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); -} -const ::google::protobuf::UninterpretedOption& FileOptions::uninterpreted_option(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.uninterpreted_option) - return uninterpreted_option_.Get(index); -} -::google::protobuf::UninterpretedOption* FileOptions::mutable_uninterpreted_option(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); -} -::google::protobuf::UninterpretedOption* FileOptions::add_uninterpreted_option() { - // @@protoc_insertion_point(field_add:google.protobuf.FileOptions.uninterpreted_option) - return uninterpreted_option_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* -FileOptions::mutable_uninterpreted_option() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileOptions.uninterpreted_option) - return &uninterpreted_option_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& -FileOptions::uninterpreted_option() const { - // @@protoc_insertion_point(field_list:google.protobuf.FileOptions.uninterpreted_option) - return uninterpreted_option_; -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void MessageOptions::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int MessageOptions::kMessageSetWireFormatFieldNumber; const int MessageOptions::kNoStandardDescriptorAccessorFieldNumber; @@ -10724,11 +9191,21 @@ const int MessageOptions::kUninterpretedOptionFieldNumber; MessageOptions::MessageOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMessageOptions(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.MessageOptions) } +MessageOptions::MessageOptions(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _extensions_(arena), + _internal_metadata_(arena), + uninterpreted_option_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMessageOptions(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.MessageOptions) +} MessageOptions::MessageOptions(const MessageOptions& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -10756,29 +9233,37 @@ MessageOptions::~MessageOptions() { } void MessageOptions::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } +void MessageOptions::ArenaDtor(void* object) { + MessageOptions* _this = reinterpret_cast< MessageOptions* >(object); + (void)_this; +} +void MessageOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void MessageOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* MessageOptions::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const MessageOptions& MessageOptions::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMessageOptions(); return *internal_default_instance(); } MessageOptions* MessageOptions::New(::google::protobuf::Arena* arena) const { - MessageOptions* n = new MessageOptions; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void MessageOptions::Clear() { @@ -10789,12 +9274,9 @@ void MessageOptions::Clear() { _extensions_.Clear(); uninterpreted_option_.Clear(); - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 15u) { - ::memset(&message_set_wire_format_, 0, static_cast( - reinterpret_cast(&map_entry_) - - reinterpret_cast(&message_set_wire_format_)) + sizeof(map_entry_)); - } + ::memset(&message_set_wire_format_, 0, static_cast( + reinterpret_cast(&map_entry_) - + reinterpret_cast(&message_set_wire_format_)) + sizeof(map_entry_)); _has_bits_.Clear(); _internal_metadata_.Clear(); } @@ -11114,6 +9596,21 @@ bool MessageOptions::IsInitialized() const { void MessageOptions::Swap(MessageOptions* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MessageOptions* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MessageOptions::UnsafeArenaSwap(MessageOptions* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void MessageOptions::InternalSwap(MessageOptions* other) { @@ -11131,142 +9628,14 @@ void MessageOptions::InternalSwap(MessageOptions* other) { ::google::protobuf::Metadata MessageOptions::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// MessageOptions - -// optional bool message_set_wire_format = 1 [default = false]; -bool MessageOptions::has_message_set_wire_format() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void MessageOptions::set_has_message_set_wire_format() { - _has_bits_[0] |= 0x00000001u; -} -void MessageOptions::clear_has_message_set_wire_format() { - _has_bits_[0] &= ~0x00000001u; -} -void MessageOptions::clear_message_set_wire_format() { - message_set_wire_format_ = false; - clear_has_message_set_wire_format(); -} -bool MessageOptions::message_set_wire_format() const { - // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.message_set_wire_format) - return message_set_wire_format_; -} -void MessageOptions::set_message_set_wire_format(bool value) { - set_has_message_set_wire_format(); - message_set_wire_format_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.message_set_wire_format) -} - -// optional bool no_standard_descriptor_accessor = 2 [default = false]; -bool MessageOptions::has_no_standard_descriptor_accessor() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void MessageOptions::set_has_no_standard_descriptor_accessor() { - _has_bits_[0] |= 0x00000002u; -} -void MessageOptions::clear_has_no_standard_descriptor_accessor() { - _has_bits_[0] &= ~0x00000002u; -} -void MessageOptions::clear_no_standard_descriptor_accessor() { - no_standard_descriptor_accessor_ = false; - clear_has_no_standard_descriptor_accessor(); -} -bool MessageOptions::no_standard_descriptor_accessor() const { - // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.no_standard_descriptor_accessor) - return no_standard_descriptor_accessor_; -} -void MessageOptions::set_no_standard_descriptor_accessor(bool value) { - set_has_no_standard_descriptor_accessor(); - no_standard_descriptor_accessor_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.no_standard_descriptor_accessor) -} - -// optional bool deprecated = 3 [default = false]; -bool MessageOptions::has_deprecated() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void MessageOptions::set_has_deprecated() { - _has_bits_[0] |= 0x00000004u; -} -void MessageOptions::clear_has_deprecated() { - _has_bits_[0] &= ~0x00000004u; -} -void MessageOptions::clear_deprecated() { - deprecated_ = false; - clear_has_deprecated(); -} -bool MessageOptions::deprecated() const { - // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.deprecated) - return deprecated_; -} -void MessageOptions::set_deprecated(bool value) { - set_has_deprecated(); - deprecated_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.deprecated) -} - -// optional bool map_entry = 7; -bool MessageOptions::has_map_entry() const { - return (_has_bits_[0] & 0x00000008u) != 0; -} -void MessageOptions::set_has_map_entry() { - _has_bits_[0] |= 0x00000008u; -} -void MessageOptions::clear_has_map_entry() { - _has_bits_[0] &= ~0x00000008u; -} -void MessageOptions::clear_map_entry() { - map_entry_ = false; - clear_has_map_entry(); -} -bool MessageOptions::map_entry() const { - // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.map_entry) - return map_entry_; -} -void MessageOptions::set_map_entry(bool value) { - set_has_map_entry(); - map_entry_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.map_entry) -} - -// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; -int MessageOptions::uninterpreted_option_size() const { - return uninterpreted_option_.size(); -} -void MessageOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); -} -const ::google::protobuf::UninterpretedOption& MessageOptions::uninterpreted_option(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.uninterpreted_option) - return uninterpreted_option_.Get(index); -} -::google::protobuf::UninterpretedOption* MessageOptions::mutable_uninterpreted_option(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.MessageOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); -} -::google::protobuf::UninterpretedOption* MessageOptions::add_uninterpreted_option() { - // @@protoc_insertion_point(field_add:google.protobuf.MessageOptions.uninterpreted_option) - return uninterpreted_option_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* -MessageOptions::mutable_uninterpreted_option() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.MessageOptions.uninterpreted_option) - return &uninterpreted_option_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& -MessageOptions::uninterpreted_option() const { - // @@protoc_insertion_point(field_list:google.protobuf.MessageOptions.uninterpreted_option) - return uninterpreted_option_; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void FieldOptions::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int FieldOptions::kCtypeFieldNumber; const int FieldOptions::kPackedFieldNumber; @@ -11280,11 +9649,21 @@ const int FieldOptions::kUninterpretedOptionFieldNumber; FieldOptions::FieldOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldOptions(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FieldOptions) } +FieldOptions::FieldOptions(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _extensions_(arena), + _internal_metadata_(arena), + uninterpreted_option_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldOptions(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.FieldOptions) +} FieldOptions::FieldOptions(const FieldOptions& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -11312,29 +9691,37 @@ FieldOptions::~FieldOptions() { } void FieldOptions::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } +void FieldOptions::ArenaDtor(void* object) { + FieldOptions* _this = reinterpret_cast< FieldOptions* >(object); + (void)_this; +} +void FieldOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void FieldOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* FieldOptions::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const FieldOptions& FieldOptions::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldOptions(); return *internal_default_instance(); } FieldOptions* FieldOptions::New(::google::protobuf::Arena* arena) const { - FieldOptions* n = new FieldOptions; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void FieldOptions::Clear() { @@ -11749,9 +10136,24 @@ bool FieldOptions::IsInitialized() const { if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; return true; } - -void FieldOptions::Swap(FieldOptions* other) { + +void FieldOptions::Swap(FieldOptions* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FieldOptions* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FieldOptions::UnsafeArenaSwap(FieldOptions* other) { if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void FieldOptions::InternalSwap(FieldOptions* other) { @@ -11771,192 +10173,14 @@ void FieldOptions::InternalSwap(FieldOptions* other) { ::google::protobuf::Metadata FieldOptions::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// FieldOptions - -// optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; -bool FieldOptions::has_ctype() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void FieldOptions::set_has_ctype() { - _has_bits_[0] |= 0x00000001u; -} -void FieldOptions::clear_has_ctype() { - _has_bits_[0] &= ~0x00000001u; -} -void FieldOptions::clear_ctype() { - ctype_ = 0; - clear_has_ctype(); -} -::google::protobuf::FieldOptions_CType FieldOptions::ctype() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.ctype) - return static_cast< ::google::protobuf::FieldOptions_CType >(ctype_); -} -void FieldOptions::set_ctype(::google::protobuf::FieldOptions_CType value) { - assert(::google::protobuf::FieldOptions_CType_IsValid(value)); - set_has_ctype(); - ctype_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.ctype) -} - -// optional bool packed = 2; -bool FieldOptions::has_packed() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void FieldOptions::set_has_packed() { - _has_bits_[0] |= 0x00000002u; -} -void FieldOptions::clear_has_packed() { - _has_bits_[0] &= ~0x00000002u; -} -void FieldOptions::clear_packed() { - packed_ = false; - clear_has_packed(); -} -bool FieldOptions::packed() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.packed) - return packed_; -} -void FieldOptions::set_packed(bool value) { - set_has_packed(); - packed_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.packed) -} - -// optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; -bool FieldOptions::has_jstype() const { - return (_has_bits_[0] & 0x00000020u) != 0; -} -void FieldOptions::set_has_jstype() { - _has_bits_[0] |= 0x00000020u; -} -void FieldOptions::clear_has_jstype() { - _has_bits_[0] &= ~0x00000020u; -} -void FieldOptions::clear_jstype() { - jstype_ = 0; - clear_has_jstype(); -} -::google::protobuf::FieldOptions_JSType FieldOptions::jstype() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.jstype) - return static_cast< ::google::protobuf::FieldOptions_JSType >(jstype_); -} -void FieldOptions::set_jstype(::google::protobuf::FieldOptions_JSType value) { - assert(::google::protobuf::FieldOptions_JSType_IsValid(value)); - set_has_jstype(); - jstype_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.jstype) -} - -// optional bool lazy = 5 [default = false]; -bool FieldOptions::has_lazy() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void FieldOptions::set_has_lazy() { - _has_bits_[0] |= 0x00000004u; -} -void FieldOptions::clear_has_lazy() { - _has_bits_[0] &= ~0x00000004u; -} -void FieldOptions::clear_lazy() { - lazy_ = false; - clear_has_lazy(); -} -bool FieldOptions::lazy() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.lazy) - return lazy_; -} -void FieldOptions::set_lazy(bool value) { - set_has_lazy(); - lazy_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.lazy) -} - -// optional bool deprecated = 3 [default = false]; -bool FieldOptions::has_deprecated() const { - return (_has_bits_[0] & 0x00000008u) != 0; -} -void FieldOptions::set_has_deprecated() { - _has_bits_[0] |= 0x00000008u; -} -void FieldOptions::clear_has_deprecated() { - _has_bits_[0] &= ~0x00000008u; -} -void FieldOptions::clear_deprecated() { - deprecated_ = false; - clear_has_deprecated(); -} -bool FieldOptions::deprecated() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.deprecated) - return deprecated_; -} -void FieldOptions::set_deprecated(bool value) { - set_has_deprecated(); - deprecated_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.deprecated) -} - -// optional bool weak = 10 [default = false]; -bool FieldOptions::has_weak() const { - return (_has_bits_[0] & 0x00000010u) != 0; -} -void FieldOptions::set_has_weak() { - _has_bits_[0] |= 0x00000010u; -} -void FieldOptions::clear_has_weak() { - _has_bits_[0] &= ~0x00000010u; -} -void FieldOptions::clear_weak() { - weak_ = false; - clear_has_weak(); -} -bool FieldOptions::weak() const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.weak) - return weak_; -} -void FieldOptions::set_weak(bool value) { - set_has_weak(); - weak_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.weak) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; -int FieldOptions::uninterpreted_option_size() const { - return uninterpreted_option_.size(); -} -void FieldOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); -} -const ::google::protobuf::UninterpretedOption& FieldOptions::uninterpreted_option(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.uninterpreted_option) - return uninterpreted_option_.Get(index); -} -::google::protobuf::UninterpretedOption* FieldOptions::mutable_uninterpreted_option(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.FieldOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); -} -::google::protobuf::UninterpretedOption* FieldOptions::add_uninterpreted_option() { - // @@protoc_insertion_point(field_add:google.protobuf.FieldOptions.uninterpreted_option) - return uninterpreted_option_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* -FieldOptions::mutable_uninterpreted_option() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldOptions.uninterpreted_option) - return &uninterpreted_option_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& -FieldOptions::uninterpreted_option() const { - // @@protoc_insertion_point(field_list:google.protobuf.FieldOptions.uninterpreted_option) - return uninterpreted_option_; -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void OneofOptions::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int OneofOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 @@ -11964,11 +10188,21 @@ const int OneofOptions::kUninterpretedOptionFieldNumber; OneofOptions::OneofOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofOptions(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.OneofOptions) } +OneofOptions::OneofOptions(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _extensions_(arena), + _internal_metadata_(arena), + uninterpreted_option_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofOptions(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.OneofOptions) +} OneofOptions::OneofOptions(const OneofOptions& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -11990,29 +10224,37 @@ OneofOptions::~OneofOptions() { } void OneofOptions::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } +void OneofOptions::ArenaDtor(void* object) { + OneofOptions* _this = reinterpret_cast< OneofOptions* >(object); + (void)_this; +} +void OneofOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void OneofOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* OneofOptions::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const OneofOptions& OneofOptions::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofOptions(); return *internal_default_instance(); } OneofOptions* OneofOptions::New(::google::protobuf::Arena* arena) const { - OneofOptions* n = new OneofOptions; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void OneofOptions::Clear() { @@ -12206,6 +10448,21 @@ bool OneofOptions::IsInitialized() const { void OneofOptions::Swap(OneofOptions* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OneofOptions* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OneofOptions::UnsafeArenaSwap(OneofOptions* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void OneofOptions::InternalSwap(OneofOptions* other) { @@ -12219,46 +10476,14 @@ void OneofOptions::InternalSwap(OneofOptions* other) { ::google::protobuf::Metadata OneofOptions::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// OneofOptions - -// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; -int OneofOptions::uninterpreted_option_size() const { - return uninterpreted_option_.size(); -} -void OneofOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); -} -const ::google::protobuf::UninterpretedOption& OneofOptions::uninterpreted_option(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.OneofOptions.uninterpreted_option) - return uninterpreted_option_.Get(index); -} -::google::protobuf::UninterpretedOption* OneofOptions::mutable_uninterpreted_option(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.OneofOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); -} -::google::protobuf::UninterpretedOption* OneofOptions::add_uninterpreted_option() { - // @@protoc_insertion_point(field_add:google.protobuf.OneofOptions.uninterpreted_option) - return uninterpreted_option_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* -OneofOptions::mutable_uninterpreted_option() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.OneofOptions.uninterpreted_option) - return &uninterpreted_option_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& -OneofOptions::uninterpreted_option() const { - // @@protoc_insertion_point(field_list:google.protobuf.OneofOptions.uninterpreted_option) - return uninterpreted_option_; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void EnumOptions::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int EnumOptions::kAllowAliasFieldNumber; const int EnumOptions::kDeprecatedFieldNumber; @@ -12268,11 +10493,21 @@ const int EnumOptions::kUninterpretedOptionFieldNumber; EnumOptions::EnumOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumOptions(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumOptions) } +EnumOptions::EnumOptions(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _extensions_(arena), + _internal_metadata_(arena), + uninterpreted_option_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumOptions(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumOptions) +} EnumOptions::EnumOptions(const EnumOptions& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -12300,29 +10535,37 @@ EnumOptions::~EnumOptions() { } void EnumOptions::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } +void EnumOptions::ArenaDtor(void* object) { + EnumOptions* _this = reinterpret_cast< EnumOptions* >(object); + (void)_this; +} +void EnumOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void EnumOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EnumOptions::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const EnumOptions& EnumOptions::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumOptions(); return *internal_default_instance(); } EnumOptions* EnumOptions::New(::google::protobuf::Arena* arena) const { - EnumOptions* n = new EnumOptions; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void EnumOptions::Clear() { @@ -12333,12 +10576,9 @@ void EnumOptions::Clear() { _extensions_.Clear(); uninterpreted_option_.Clear(); - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 3u) { - ::memset(&allow_alias_, 0, static_cast( - reinterpret_cast(&deprecated_) - - reinterpret_cast(&allow_alias_)) + sizeof(deprecated_)); - } + ::memset(&allow_alias_, 0, static_cast( + reinterpret_cast(&deprecated_) - + reinterpret_cast(&allow_alias_)) + sizeof(deprecated_)); _has_bits_.Clear(); _internal_metadata_.Clear(); } @@ -12594,6 +10834,21 @@ bool EnumOptions::IsInitialized() const { void EnumOptions::Swap(EnumOptions* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + EnumOptions* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void EnumOptions::UnsafeArenaSwap(EnumOptions* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void EnumOptions::InternalSwap(EnumOptions* other) { @@ -12609,94 +10864,14 @@ void EnumOptions::InternalSwap(EnumOptions* other) { ::google::protobuf::Metadata EnumOptions::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// EnumOptions - -// optional bool allow_alias = 2; -bool EnumOptions::has_allow_alias() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void EnumOptions::set_has_allow_alias() { - _has_bits_[0] |= 0x00000001u; -} -void EnumOptions::clear_has_allow_alias() { - _has_bits_[0] &= ~0x00000001u; -} -void EnumOptions::clear_allow_alias() { - allow_alias_ = false; - clear_has_allow_alias(); -} -bool EnumOptions::allow_alias() const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.allow_alias) - return allow_alias_; -} -void EnumOptions::set_allow_alias(bool value) { - set_has_allow_alias(); - allow_alias_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.EnumOptions.allow_alias) -} - -// optional bool deprecated = 3 [default = false]; -bool EnumOptions::has_deprecated() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void EnumOptions::set_has_deprecated() { - _has_bits_[0] |= 0x00000002u; -} -void EnumOptions::clear_has_deprecated() { - _has_bits_[0] &= ~0x00000002u; -} -void EnumOptions::clear_deprecated() { - deprecated_ = false; - clear_has_deprecated(); -} -bool EnumOptions::deprecated() const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.deprecated) - return deprecated_; -} -void EnumOptions::set_deprecated(bool value) { - set_has_deprecated(); - deprecated_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.EnumOptions.deprecated) -} - -// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; -int EnumOptions::uninterpreted_option_size() const { - return uninterpreted_option_.size(); -} -void EnumOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); -} -const ::google::protobuf::UninterpretedOption& EnumOptions::uninterpreted_option(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.uninterpreted_option) - return uninterpreted_option_.Get(index); -} -::google::protobuf::UninterpretedOption* EnumOptions::mutable_uninterpreted_option(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.EnumOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); -} -::google::protobuf::UninterpretedOption* EnumOptions::add_uninterpreted_option() { - // @@protoc_insertion_point(field_add:google.protobuf.EnumOptions.uninterpreted_option) - return uninterpreted_option_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* -EnumOptions::mutable_uninterpreted_option() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumOptions.uninterpreted_option) - return &uninterpreted_option_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& -EnumOptions::uninterpreted_option() const { - // @@protoc_insertion_point(field_list:google.protobuf.EnumOptions.uninterpreted_option) - return uninterpreted_option_; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void EnumValueOptions::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int EnumValueOptions::kDeprecatedFieldNumber; const int EnumValueOptions::kUninterpretedOptionFieldNumber; @@ -12705,11 +10880,21 @@ const int EnumValueOptions::kUninterpretedOptionFieldNumber; EnumValueOptions::EnumValueOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueOptions(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumValueOptions) } +EnumValueOptions::EnumValueOptions(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _extensions_(arena), + _internal_metadata_(arena), + uninterpreted_option_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueOptions(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.EnumValueOptions) +} EnumValueOptions::EnumValueOptions(const EnumValueOptions& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -12733,29 +10918,37 @@ EnumValueOptions::~EnumValueOptions() { } void EnumValueOptions::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } +void EnumValueOptions::ArenaDtor(void* object) { + EnumValueOptions* _this = reinterpret_cast< EnumValueOptions* >(object); + (void)_this; +} +void EnumValueOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void EnumValueOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EnumValueOptions::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const EnumValueOptions& EnumValueOptions::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueOptions(); return *internal_default_instance(); } EnumValueOptions* EnumValueOptions::New(::google::protobuf::Arena* arena) const { - EnumValueOptions* n = new EnumValueOptions; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void EnumValueOptions::Clear() { @@ -12984,6 +11177,21 @@ bool EnumValueOptions::IsInitialized() const { void EnumValueOptions::Swap(EnumValueOptions* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + EnumValueOptions* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void EnumValueOptions::UnsafeArenaSwap(EnumValueOptions* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void EnumValueOptions::InternalSwap(EnumValueOptions* other) { @@ -12998,70 +11206,14 @@ void EnumValueOptions::InternalSwap(EnumValueOptions* other) { ::google::protobuf::Metadata EnumValueOptions::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// EnumValueOptions - -// optional bool deprecated = 1 [default = false]; -bool EnumValueOptions::has_deprecated() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void EnumValueOptions::set_has_deprecated() { - _has_bits_[0] |= 0x00000001u; -} -void EnumValueOptions::clear_has_deprecated() { - _has_bits_[0] &= ~0x00000001u; -} -void EnumValueOptions::clear_deprecated() { - deprecated_ = false; - clear_has_deprecated(); -} -bool EnumValueOptions::deprecated() const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.deprecated) - return deprecated_; -} -void EnumValueOptions::set_deprecated(bool value) { - set_has_deprecated(); - deprecated_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.EnumValueOptions.deprecated) -} - -// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; -int EnumValueOptions::uninterpreted_option_size() const { - return uninterpreted_option_.size(); -} -void EnumValueOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); -} -const ::google::protobuf::UninterpretedOption& EnumValueOptions::uninterpreted_option(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.uninterpreted_option) - return uninterpreted_option_.Get(index); -} -::google::protobuf::UninterpretedOption* EnumValueOptions::mutable_uninterpreted_option(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); -} -::google::protobuf::UninterpretedOption* EnumValueOptions::add_uninterpreted_option() { - // @@protoc_insertion_point(field_add:google.protobuf.EnumValueOptions.uninterpreted_option) - return uninterpreted_option_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* -EnumValueOptions::mutable_uninterpreted_option() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValueOptions.uninterpreted_option) - return &uninterpreted_option_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& -EnumValueOptions::uninterpreted_option() const { - // @@protoc_insertion_point(field_list:google.protobuf.EnumValueOptions.uninterpreted_option) - return uninterpreted_option_; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void ServiceOptions::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int ServiceOptions::kDeprecatedFieldNumber; const int ServiceOptions::kUninterpretedOptionFieldNumber; @@ -13070,11 +11222,21 @@ const int ServiceOptions::kUninterpretedOptionFieldNumber; ServiceOptions::ServiceOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceOptions(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ServiceOptions) } +ServiceOptions::ServiceOptions(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _extensions_(arena), + _internal_metadata_(arena), + uninterpreted_option_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceOptions(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.ServiceOptions) +} ServiceOptions::ServiceOptions(const ServiceOptions& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -13098,29 +11260,37 @@ ServiceOptions::~ServiceOptions() { } void ServiceOptions::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } +void ServiceOptions::ArenaDtor(void* object) { + ServiceOptions* _this = reinterpret_cast< ServiceOptions* >(object); + (void)_this; +} +void ServiceOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void ServiceOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ServiceOptions::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const ServiceOptions& ServiceOptions::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceOptions(); return *internal_default_instance(); } ServiceOptions* ServiceOptions::New(::google::protobuf::Arena* arena) const { - ServiceOptions* n = new ServiceOptions; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void ServiceOptions::Clear() { @@ -13349,6 +11519,21 @@ bool ServiceOptions::IsInitialized() const { void ServiceOptions::Swap(ServiceOptions* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ServiceOptions* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ServiceOptions::UnsafeArenaSwap(ServiceOptions* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void ServiceOptions::InternalSwap(ServiceOptions* other) { @@ -13363,70 +11548,14 @@ void ServiceOptions::InternalSwap(ServiceOptions* other) { ::google::protobuf::Metadata ServiceOptions::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// ServiceOptions - -// optional bool deprecated = 33 [default = false]; -bool ServiceOptions::has_deprecated() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void ServiceOptions::set_has_deprecated() { - _has_bits_[0] |= 0x00000001u; -} -void ServiceOptions::clear_has_deprecated() { - _has_bits_[0] &= ~0x00000001u; -} -void ServiceOptions::clear_deprecated() { - deprecated_ = false; - clear_has_deprecated(); -} -bool ServiceOptions::deprecated() const { - // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.deprecated) - return deprecated_; -} -void ServiceOptions::set_deprecated(bool value) { - set_has_deprecated(); - deprecated_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.ServiceOptions.deprecated) -} - -// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; -int ServiceOptions::uninterpreted_option_size() const { - return uninterpreted_option_.size(); -} -void ServiceOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); -} -const ::google::protobuf::UninterpretedOption& ServiceOptions::uninterpreted_option(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.uninterpreted_option) - return uninterpreted_option_.Get(index); -} -::google::protobuf::UninterpretedOption* ServiceOptions::mutable_uninterpreted_option(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); -} -::google::protobuf::UninterpretedOption* ServiceOptions::add_uninterpreted_option() { - // @@protoc_insertion_point(field_add:google.protobuf.ServiceOptions.uninterpreted_option) - return uninterpreted_option_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* -ServiceOptions::mutable_uninterpreted_option() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceOptions.uninterpreted_option) - return &uninterpreted_option_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& -ServiceOptions::uninterpreted_option() const { - // @@protoc_insertion_point(field_list:google.protobuf.ServiceOptions.uninterpreted_option) - return uninterpreted_option_; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void MethodOptions::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int MethodOptions::kDeprecatedFieldNumber; const int MethodOptions::kIdempotencyLevelFieldNumber; @@ -13436,11 +11565,21 @@ const int MethodOptions::kUninterpretedOptionFieldNumber; MethodOptions::MethodOptions() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodOptions(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.MethodOptions) } +MethodOptions::MethodOptions(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _extensions_(arena), + _internal_metadata_(arena), + uninterpreted_option_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodOptions(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.MethodOptions) +} MethodOptions::MethodOptions(const MethodOptions& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -13468,29 +11607,37 @@ MethodOptions::~MethodOptions() { } void MethodOptions::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } +void MethodOptions::ArenaDtor(void* object) { + MethodOptions* _this = reinterpret_cast< MethodOptions* >(object); + (void)_this; +} +void MethodOptions::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void MethodOptions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* MethodOptions::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const MethodOptions& MethodOptions::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodOptions(); return *internal_default_instance(); } MethodOptions* MethodOptions::New(::google::protobuf::Arena* arena) const { - MethodOptions* n = new MethodOptions; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void MethodOptions::Clear() { @@ -13765,116 +11912,50 @@ bool MethodOptions::IsInitialized() const { return false; } - if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; - return true; -} - -void MethodOptions::Swap(MethodOptions* other) { - if (other == this) return; - InternalSwap(other); -} -void MethodOptions::InternalSwap(MethodOptions* other) { - using std::swap; - uninterpreted_option_.InternalSwap(&other->uninterpreted_option_); - swap(deprecated_, other->deprecated_); - swap(idempotency_level_, other->idempotency_level_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); - _extensions_.Swap(&other->_extensions_); -} - -::google::protobuf::Metadata MethodOptions::GetMetadata() const { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// MethodOptions - -// optional bool deprecated = 33 [default = false]; -bool MethodOptions::has_deprecated() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void MethodOptions::set_has_deprecated() { - _has_bits_[0] |= 0x00000001u; -} -void MethodOptions::clear_has_deprecated() { - _has_bits_[0] &= ~0x00000001u; -} -void MethodOptions::clear_deprecated() { - deprecated_ = false; - clear_has_deprecated(); -} -bool MethodOptions::deprecated() const { - // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.deprecated) - return deprecated_; -} -void MethodOptions::set_deprecated(bool value) { - set_has_deprecated(); - deprecated_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.MethodOptions.deprecated) -} - -// optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; -bool MethodOptions::has_idempotency_level() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void MethodOptions::set_has_idempotency_level() { - _has_bits_[0] |= 0x00000002u; -} -void MethodOptions::clear_has_idempotency_level() { - _has_bits_[0] &= ~0x00000002u; -} -void MethodOptions::clear_idempotency_level() { - idempotency_level_ = 0; - clear_has_idempotency_level(); -} -::google::protobuf::MethodOptions_IdempotencyLevel MethodOptions::idempotency_level() const { - // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.idempotency_level) - return static_cast< ::google::protobuf::MethodOptions_IdempotencyLevel >(idempotency_level_); -} -void MethodOptions::set_idempotency_level(::google::protobuf::MethodOptions_IdempotencyLevel value) { - assert(::google::protobuf::MethodOptions_IdempotencyLevel_IsValid(value)); - set_has_idempotency_level(); - idempotency_level_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.MethodOptions.idempotency_level) -} - -// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; -int MethodOptions::uninterpreted_option_size() const { - return uninterpreted_option_.size(); -} -void MethodOptions::clear_uninterpreted_option() { - uninterpreted_option_.Clear(); -} -const ::google::protobuf::UninterpretedOption& MethodOptions::uninterpreted_option(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.uninterpreted_option) - return uninterpreted_option_.Get(index); + if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; + return true; } -::google::protobuf::UninterpretedOption* MethodOptions::mutable_uninterpreted_option(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.MethodOptions.uninterpreted_option) - return uninterpreted_option_.Mutable(index); + +void MethodOptions::Swap(MethodOptions* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MethodOptions* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } } -::google::protobuf::UninterpretedOption* MethodOptions::add_uninterpreted_option() { - // @@protoc_insertion_point(field_add:google.protobuf.MethodOptions.uninterpreted_option) - return uninterpreted_option_.Add(); +void MethodOptions::UnsafeArenaSwap(MethodOptions* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); } -::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* -MethodOptions::mutable_uninterpreted_option() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.MethodOptions.uninterpreted_option) - return &uninterpreted_option_; +void MethodOptions::InternalSwap(MethodOptions* other) { + using std::swap; + uninterpreted_option_.InternalSwap(&other->uninterpreted_option_); + swap(deprecated_, other->deprecated_); + swap(idempotency_level_, other->idempotency_level_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); + _extensions_.Swap(&other->_extensions_); } -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& -MethodOptions::uninterpreted_option() const { - // @@protoc_insertion_point(field_list:google.protobuf.MethodOptions.uninterpreted_option) - return uninterpreted_option_; + +::google::protobuf::Metadata MethodOptions::GetMetadata() const { + protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void UninterpretedOption_NamePart::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int UninterpretedOption_NamePart::kNamePartFieldNumber; const int UninterpretedOption_NamePart::kIsExtensionFieldNumber; @@ -13883,11 +11964,19 @@ const int UninterpretedOption_NamePart::kIsExtensionFieldNumber; UninterpretedOption_NamePart::UninterpretedOption_NamePart() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption_NamePart(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.UninterpretedOption.NamePart) } +UninterpretedOption_NamePart::UninterpretedOption_NamePart(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption_NamePart(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.UninterpretedOption.NamePart) +} UninterpretedOption_NamePart::UninterpretedOption_NamePart(const UninterpretedOption_NamePart& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -13896,7 +11985,8 @@ UninterpretedOption_NamePart::UninterpretedOption_NamePart(const UninterpretedOp _internal_metadata_.MergeFrom(from._internal_metadata_); name_part_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_name_part()) { - name_part_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_part_); + name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_part(), + GetArenaNoVirtual()); } is_extension_ = from.is_extension_; // @@protoc_insertion_point(copy_constructor:google.protobuf.UninterpretedOption.NamePart) @@ -13914,30 +12004,38 @@ UninterpretedOption_NamePart::~UninterpretedOption_NamePart() { } void UninterpretedOption_NamePart::SharedDtor() { - name_part_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + name_part_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); } +void UninterpretedOption_NamePart::ArenaDtor(void* object) { + UninterpretedOption_NamePart* _this = reinterpret_cast< UninterpretedOption_NamePart* >(object); + (void)_this; +} +void UninterpretedOption_NamePart::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void UninterpretedOption_NamePart::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UninterpretedOption_NamePart::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const UninterpretedOption_NamePart& UninterpretedOption_NamePart::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption_NamePart(); return *internal_default_instance(); } UninterpretedOption_NamePart* UninterpretedOption_NamePart::New(::google::protobuf::Arena* arena) const { - UninterpretedOption_NamePart* n = new UninterpretedOption_NamePart; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void UninterpretedOption_NamePart::Clear() { @@ -13948,7 +12046,7 @@ void UninterpretedOption_NamePart::Clear() { if (has_name_part()) { GOOGLE_DCHECK(!name_part_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_part_.UnsafeRawStringPointer())->clear(); + name_part_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } is_extension_ = false; _has_bits_.Clear(); @@ -14147,8 +12245,7 @@ void UninterpretedOption_NamePart::MergeFrom(const UninterpretedOption_NamePart& cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { - set_has_name_part(); - name_part_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_part_); + set_name_part(from.name_part()); } if (cached_has_bits & 0x00000002u) { is_extension_ = from.is_extension_; @@ -14178,6 +12275,21 @@ bool UninterpretedOption_NamePart::IsInitialized() const { void UninterpretedOption_NamePart::Swap(UninterpretedOption_NamePart* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + UninterpretedOption_NamePart* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void UninterpretedOption_NamePart::UnsafeArenaSwap(UninterpretedOption_NamePart* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void UninterpretedOption_NamePart::InternalSwap(UninterpretedOption_NamePart* other) { @@ -14191,103 +12303,14 @@ void UninterpretedOption_NamePart::InternalSwap(UninterpretedOption_NamePart* ot ::google::protobuf::Metadata UninterpretedOption_NamePart::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// UninterpretedOption_NamePart - -// required string name_part = 1; -bool UninterpretedOption_NamePart::has_name_part() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void UninterpretedOption_NamePart::set_has_name_part() { - _has_bits_[0] |= 0x00000001u; -} -void UninterpretedOption_NamePart::clear_has_name_part() { - _has_bits_[0] &= ~0x00000001u; -} -void UninterpretedOption_NamePart::clear_name_part() { - name_part_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name_part(); -} -const ::std::string& UninterpretedOption_NamePart::name_part() const { - // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.name_part) - return name_part_.GetNoArena(); -} -void UninterpretedOption_NamePart::set_name_part(const ::std::string& value) { - set_has_name_part(); - name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.name_part) -} -#if LANG_CXX11 -void UninterpretedOption_NamePart::set_name_part(::std::string&& value) { - set_has_name_part(); - name_part_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.NamePart.name_part) -} -#endif -void UninterpretedOption_NamePart::set_name_part(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_name_part(); - name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.NamePart.name_part) -} -void UninterpretedOption_NamePart::set_name_part(const char* value, size_t size) { - set_has_name_part(); - name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.NamePart.name_part) -} -::std::string* UninterpretedOption_NamePart::mutable_name_part() { - set_has_name_part(); - // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.NamePart.name_part) - return name_part_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* UninterpretedOption_NamePart::release_name_part() { - // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.NamePart.name_part) - clear_has_name_part(); - return name_part_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* name_part) { - if (name_part != NULL) { - set_has_name_part(); - } else { - clear_has_name_part(); - } - name_part_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name_part); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part) -} - -// required bool is_extension = 2; -bool UninterpretedOption_NamePart::has_is_extension() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void UninterpretedOption_NamePart::set_has_is_extension() { - _has_bits_[0] |= 0x00000002u; -} -void UninterpretedOption_NamePart::clear_has_is_extension() { - _has_bits_[0] &= ~0x00000002u; -} -void UninterpretedOption_NamePart::clear_is_extension() { - is_extension_ = false; - clear_has_is_extension(); -} -bool UninterpretedOption_NamePart::is_extension() const { - // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.is_extension) - return is_extension_; -} -void UninterpretedOption_NamePart::set_is_extension(bool value) { - set_has_is_extension(); - is_extension_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.is_extension) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void UninterpretedOption::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int UninterpretedOption::kNameFieldNumber; const int UninterpretedOption::kIdentifierValueFieldNumber; @@ -14301,11 +12324,20 @@ const int UninterpretedOption::kAggregateValueFieldNumber; UninterpretedOption::UninterpretedOption() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.UninterpretedOption) } +UninterpretedOption::UninterpretedOption(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + name_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.UninterpretedOption) +} UninterpretedOption::UninterpretedOption(const UninterpretedOption& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -14315,15 +12347,18 @@ UninterpretedOption::UninterpretedOption(const UninterpretedOption& from) _internal_metadata_.MergeFrom(from._internal_metadata_); identifier_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_identifier_value()) { - identifier_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.identifier_value_); + identifier_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.identifier_value(), + GetArenaNoVirtual()); } string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_string_value()) { - string_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_value_); + string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_value(), + GetArenaNoVirtual()); } aggregate_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_aggregate_value()) { - aggregate_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.aggregate_value_); + aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.aggregate_value(), + GetArenaNoVirtual()); } ::memcpy(&positive_int_value_, &from.positive_int_value_, static_cast(reinterpret_cast(&double_value_) - @@ -14347,32 +12382,40 @@ UninterpretedOption::~UninterpretedOption() { } void UninterpretedOption::SharedDtor() { - identifier_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - aggregate_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + identifier_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + string_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + aggregate_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); } +void UninterpretedOption::ArenaDtor(void* object) { + UninterpretedOption* _this = reinterpret_cast< UninterpretedOption* >(object); + (void)_this; +} +void UninterpretedOption::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void UninterpretedOption::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UninterpretedOption::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const UninterpretedOption& UninterpretedOption::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption(); return *internal_default_instance(); } UninterpretedOption* UninterpretedOption::New(::google::protobuf::Arena* arena) const { - UninterpretedOption* n = new UninterpretedOption; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void UninterpretedOption::Clear() { @@ -14386,15 +12429,15 @@ void UninterpretedOption::Clear() { if (cached_has_bits & 7u) { if (cached_has_bits & 0x00000001u) { GOOGLE_DCHECK(!identifier_value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*identifier_value_.UnsafeRawStringPointer())->clear(); + identifier_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000002u) { GOOGLE_DCHECK(!string_value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*string_value_.UnsafeRawStringPointer())->clear(); + string_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000004u) { GOOGLE_DCHECK(!aggregate_value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*aggregate_value_.UnsafeRawStringPointer())->clear(); + aggregate_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } } if (cached_has_bits & 56u) { @@ -14759,16 +12802,13 @@ void UninterpretedOption::MergeFrom(const UninterpretedOption& from) { cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 63u) { if (cached_has_bits & 0x00000001u) { - set_has_identifier_value(); - identifier_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.identifier_value_); + set_identifier_value(from.identifier_value()); } if (cached_has_bits & 0x00000002u) { - set_has_string_value(); - string_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_value_); + set_string_value(from.string_value()); } if (cached_has_bits & 0x00000004u) { - set_has_aggregate_value(); - aggregate_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.aggregate_value_); + set_aggregate_value(from.aggregate_value()); } if (cached_has_bits & 0x00000008u) { positive_int_value_ = from.positive_int_value_; @@ -14804,6 +12844,21 @@ bool UninterpretedOption::IsInitialized() const { void UninterpretedOption::Swap(UninterpretedOption* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + UninterpretedOption* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void UninterpretedOption::UnsafeArenaSwap(UninterpretedOption* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void UninterpretedOption::InternalSwap(UninterpretedOption* other) { @@ -14822,307 +12877,14 @@ void UninterpretedOption::InternalSwap(UninterpretedOption* other) { ::google::protobuf::Metadata UninterpretedOption::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// UninterpretedOption - -// repeated .google.protobuf.UninterpretedOption.NamePart name = 2; -int UninterpretedOption::name_size() const { - return name_.size(); -} -void UninterpretedOption::clear_name() { - name_.Clear(); -} -const ::google::protobuf::UninterpretedOption_NamePart& UninterpretedOption::name(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.name) - return name_.Get(index); -} -::google::protobuf::UninterpretedOption_NamePart* UninterpretedOption::mutable_name(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.name) - return name_.Mutable(index); -} -::google::protobuf::UninterpretedOption_NamePart* UninterpretedOption::add_name() { - // @@protoc_insertion_point(field_add:google.protobuf.UninterpretedOption.name) - return name_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >* -UninterpretedOption::mutable_name() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.UninterpretedOption.name) - return &name_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >& -UninterpretedOption::name() const { - // @@protoc_insertion_point(field_list:google.protobuf.UninterpretedOption.name) - return name_; -} - -// optional string identifier_value = 3; -bool UninterpretedOption::has_identifier_value() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void UninterpretedOption::set_has_identifier_value() { - _has_bits_[0] |= 0x00000001u; -} -void UninterpretedOption::clear_has_identifier_value() { - _has_bits_[0] &= ~0x00000001u; -} -void UninterpretedOption::clear_identifier_value() { - identifier_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_identifier_value(); -} -const ::std::string& UninterpretedOption::identifier_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.identifier_value) - return identifier_value_.GetNoArena(); -} -void UninterpretedOption::set_identifier_value(const ::std::string& value) { - set_has_identifier_value(); - identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.identifier_value) -} -#if LANG_CXX11 -void UninterpretedOption::set_identifier_value(::std::string&& value) { - set_has_identifier_value(); - identifier_value_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.identifier_value) -} -#endif -void UninterpretedOption::set_identifier_value(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_identifier_value(); - identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.identifier_value) -} -void UninterpretedOption::set_identifier_value(const char* value, size_t size) { - set_has_identifier_value(); - identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.identifier_value) -} -::std::string* UninterpretedOption::mutable_identifier_value() { - set_has_identifier_value(); - // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.identifier_value) - return identifier_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* UninterpretedOption::release_identifier_value() { - // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.identifier_value) - clear_has_identifier_value(); - return identifier_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void UninterpretedOption::set_allocated_identifier_value(::std::string* identifier_value) { - if (identifier_value != NULL) { - set_has_identifier_value(); - } else { - clear_has_identifier_value(); - } - identifier_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), identifier_value); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.identifier_value) -} - -// optional uint64 positive_int_value = 4; -bool UninterpretedOption::has_positive_int_value() const { - return (_has_bits_[0] & 0x00000008u) != 0; -} -void UninterpretedOption::set_has_positive_int_value() { - _has_bits_[0] |= 0x00000008u; -} -void UninterpretedOption::clear_has_positive_int_value() { - _has_bits_[0] &= ~0x00000008u; -} -void UninterpretedOption::clear_positive_int_value() { - positive_int_value_ = GOOGLE_ULONGLONG(0); - clear_has_positive_int_value(); -} -::google::protobuf::uint64 UninterpretedOption::positive_int_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.positive_int_value) - return positive_int_value_; -} -void UninterpretedOption::set_positive_int_value(::google::protobuf::uint64 value) { - set_has_positive_int_value(); - positive_int_value_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.positive_int_value) -} - -// optional int64 negative_int_value = 5; -bool UninterpretedOption::has_negative_int_value() const { - return (_has_bits_[0] & 0x00000010u) != 0; -} -void UninterpretedOption::set_has_negative_int_value() { - _has_bits_[0] |= 0x00000010u; -} -void UninterpretedOption::clear_has_negative_int_value() { - _has_bits_[0] &= ~0x00000010u; -} -void UninterpretedOption::clear_negative_int_value() { - negative_int_value_ = GOOGLE_LONGLONG(0); - clear_has_negative_int_value(); -} -::google::protobuf::int64 UninterpretedOption::negative_int_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.negative_int_value) - return negative_int_value_; -} -void UninterpretedOption::set_negative_int_value(::google::protobuf::int64 value) { - set_has_negative_int_value(); - negative_int_value_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.negative_int_value) -} - -// optional double double_value = 6; -bool UninterpretedOption::has_double_value() const { - return (_has_bits_[0] & 0x00000020u) != 0; -} -void UninterpretedOption::set_has_double_value() { - _has_bits_[0] |= 0x00000020u; -} -void UninterpretedOption::clear_has_double_value() { - _has_bits_[0] &= ~0x00000020u; -} -void UninterpretedOption::clear_double_value() { - double_value_ = 0; - clear_has_double_value(); -} -double UninterpretedOption::double_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.double_value) - return double_value_; -} -void UninterpretedOption::set_double_value(double value) { - set_has_double_value(); - double_value_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.double_value) -} - -// optional bytes string_value = 7; -bool UninterpretedOption::has_string_value() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void UninterpretedOption::set_has_string_value() { - _has_bits_[0] |= 0x00000002u; -} -void UninterpretedOption::clear_has_string_value() { - _has_bits_[0] &= ~0x00000002u; -} -void UninterpretedOption::clear_string_value() { - string_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_string_value(); -} -const ::std::string& UninterpretedOption::string_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.string_value) - return string_value_.GetNoArena(); -} -void UninterpretedOption::set_string_value(const ::std::string& value) { - set_has_string_value(); - string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.string_value) -} -#if LANG_CXX11 -void UninterpretedOption::set_string_value(::std::string&& value) { - set_has_string_value(); - string_value_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.string_value) -} -#endif -void UninterpretedOption::set_string_value(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_string_value(); - string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.string_value) -} -void UninterpretedOption::set_string_value(const void* value, size_t size) { - set_has_string_value(); - string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.string_value) -} -::std::string* UninterpretedOption::mutable_string_value() { - set_has_string_value(); - // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.string_value) - return string_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* UninterpretedOption::release_string_value() { - // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.string_value) - clear_has_string_value(); - return string_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void UninterpretedOption::set_allocated_string_value(::std::string* string_value) { - if (string_value != NULL) { - set_has_string_value(); - } else { - clear_has_string_value(); - } - string_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.string_value) -} - -// optional string aggregate_value = 8; -bool UninterpretedOption::has_aggregate_value() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void UninterpretedOption::set_has_aggregate_value() { - _has_bits_[0] |= 0x00000004u; -} -void UninterpretedOption::clear_has_aggregate_value() { - _has_bits_[0] &= ~0x00000004u; -} -void UninterpretedOption::clear_aggregate_value() { - aggregate_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_aggregate_value(); -} -const ::std::string& UninterpretedOption::aggregate_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.aggregate_value) - return aggregate_value_.GetNoArena(); -} -void UninterpretedOption::set_aggregate_value(const ::std::string& value) { - set_has_aggregate_value(); - aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.aggregate_value) -} -#if LANG_CXX11 -void UninterpretedOption::set_aggregate_value(::std::string&& value) { - set_has_aggregate_value(); - aggregate_value_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.aggregate_value) -} -#endif -void UninterpretedOption::set_aggregate_value(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_aggregate_value(); - aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.aggregate_value) -} -void UninterpretedOption::set_aggregate_value(const char* value, size_t size) { - set_has_aggregate_value(); - aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.aggregate_value) -} -::std::string* UninterpretedOption::mutable_aggregate_value() { - set_has_aggregate_value(); - // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.aggregate_value) - return aggregate_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* UninterpretedOption::release_aggregate_value() { - // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.aggregate_value) - clear_has_aggregate_value(); - return aggregate_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void UninterpretedOption::set_allocated_aggregate_value(::std::string* aggregate_value) { - if (aggregate_value != NULL) { - set_has_aggregate_value(); - } else { - clear_has_aggregate_value(); - } - aggregate_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), aggregate_value); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.aggregate_value) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void SourceCodeInfo_Location::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int SourceCodeInfo_Location::kPathFieldNumber; const int SourceCodeInfo_Location::kSpanFieldNumber; @@ -15134,11 +12896,22 @@ const int SourceCodeInfo_Location::kLeadingDetachedCommentsFieldNumber; SourceCodeInfo_Location::SourceCodeInfo_Location() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo_Location(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.SourceCodeInfo.Location) } +SourceCodeInfo_Location::SourceCodeInfo_Location(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + path_(arena), + span_(arena), + leading_detached_comments_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo_Location(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.SourceCodeInfo.Location) +} SourceCodeInfo_Location::SourceCodeInfo_Location(const SourceCodeInfo_Location& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -15150,11 +12923,13 @@ SourceCodeInfo_Location::SourceCodeInfo_Location(const SourceCodeInfo_Location& _internal_metadata_.MergeFrom(from._internal_metadata_); leading_comments_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_leading_comments()) { - leading_comments_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.leading_comments_); + leading_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.leading_comments(), + GetArenaNoVirtual()); } trailing_comments_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_trailing_comments()) { - trailing_comments_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.trailing_comments_); + trailing_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.trailing_comments(), + GetArenaNoVirtual()); } // @@protoc_insertion_point(copy_constructor:google.protobuf.SourceCodeInfo.Location) } @@ -15171,31 +12946,39 @@ SourceCodeInfo_Location::~SourceCodeInfo_Location() { } void SourceCodeInfo_Location::SharedDtor() { - leading_comments_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - trailing_comments_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + leading_comments_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + trailing_comments_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); } +void SourceCodeInfo_Location::ArenaDtor(void* object) { + SourceCodeInfo_Location* _this = reinterpret_cast< SourceCodeInfo_Location* >(object); + (void)_this; +} +void SourceCodeInfo_Location::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void SourceCodeInfo_Location::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* SourceCodeInfo_Location::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const SourceCodeInfo_Location& SourceCodeInfo_Location::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo_Location(); return *internal_default_instance(); } SourceCodeInfo_Location* SourceCodeInfo_Location::New(::google::protobuf::Arena* arena) const { - SourceCodeInfo_Location* n = new SourceCodeInfo_Location; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void SourceCodeInfo_Location::Clear() { @@ -15211,11 +12994,11 @@ void SourceCodeInfo_Location::Clear() { if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { GOOGLE_DCHECK(!leading_comments_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*leading_comments_.UnsafeRawStringPointer())->clear(); + leading_comments_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } if (cached_has_bits & 0x00000002u) { GOOGLE_DCHECK(!trailing_comments_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*trailing_comments_.UnsafeRawStringPointer())->clear(); + trailing_comments_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } } _has_bits_.Clear(); @@ -15419,7 +13202,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( - static_cast< ::google::protobuf::uint32>( + static_cast< ::google::protobuf::int32>( _path_cached_byte_size_), target); target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->path_, target); @@ -15432,7 +13215,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( - static_cast< ::google::protobuf::uint32>( + static_cast< ::google::protobuf::int32>( _span_cached_byte_size_), target); target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->span_, target); @@ -15579,12 +13362,10 @@ void SourceCodeInfo_Location::MergeFrom(const SourceCodeInfo_Location& from) { cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { - set_has_leading_comments(); - leading_comments_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.leading_comments_); + set_leading_comments(from.leading_comments()); } if (cached_has_bits & 0x00000002u) { - set_has_trailing_comments(); - trailing_comments_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.trailing_comments_); + set_trailing_comments(from.trailing_comments()); } } } @@ -15609,6 +13390,21 @@ bool SourceCodeInfo_Location::IsInitialized() const { void SourceCodeInfo_Location::Swap(SourceCodeInfo_Location* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SourceCodeInfo_Location* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SourceCodeInfo_Location::UnsafeArenaSwap(SourceCodeInfo_Location* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void SourceCodeInfo_Location::InternalSwap(SourceCodeInfo_Location* other) { @@ -15625,271 +13421,14 @@ void SourceCodeInfo_Location::InternalSwap(SourceCodeInfo_Location* other) { ::google::protobuf::Metadata SourceCodeInfo_Location::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// SourceCodeInfo_Location - -// repeated int32 path = 1 [packed = true]; -int SourceCodeInfo_Location::path_size() const { - return path_.size(); -} -void SourceCodeInfo_Location::clear_path() { - path_.Clear(); -} -::google::protobuf::int32 SourceCodeInfo_Location::path(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.path) - return path_.Get(index); -} -void SourceCodeInfo_Location::set_path(int index, ::google::protobuf::int32 value) { - path_.Set(index, value); - // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.path) -} -void SourceCodeInfo_Location::add_path(::google::protobuf::int32 value) { - path_.Add(value); - // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.path) -} -const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& -SourceCodeInfo_Location::path() const { - // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.path) - return path_; -} -::google::protobuf::RepeatedField< ::google::protobuf::int32 >* -SourceCodeInfo_Location::mutable_path() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.path) - return &path_; -} - -// repeated int32 span = 2 [packed = true]; -int SourceCodeInfo_Location::span_size() const { - return span_.size(); -} -void SourceCodeInfo_Location::clear_span() { - span_.Clear(); -} -::google::protobuf::int32 SourceCodeInfo_Location::span(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.span) - return span_.Get(index); -} -void SourceCodeInfo_Location::set_span(int index, ::google::protobuf::int32 value) { - span_.Set(index, value); - // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.span) -} -void SourceCodeInfo_Location::add_span(::google::protobuf::int32 value) { - span_.Add(value); - // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.span) -} -const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& -SourceCodeInfo_Location::span() const { - // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.span) - return span_; -} -::google::protobuf::RepeatedField< ::google::protobuf::int32 >* -SourceCodeInfo_Location::mutable_span() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.span) - return &span_; -} - -// optional string leading_comments = 3; -bool SourceCodeInfo_Location::has_leading_comments() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void SourceCodeInfo_Location::set_has_leading_comments() { - _has_bits_[0] |= 0x00000001u; -} -void SourceCodeInfo_Location::clear_has_leading_comments() { - _has_bits_[0] &= ~0x00000001u; -} -void SourceCodeInfo_Location::clear_leading_comments() { - leading_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_leading_comments(); -} -const ::std::string& SourceCodeInfo_Location::leading_comments() const { - // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_comments) - return leading_comments_.GetNoArena(); -} -void SourceCodeInfo_Location::set_leading_comments(const ::std::string& value) { - set_has_leading_comments(); - leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_comments) -} -#if LANG_CXX11 -void SourceCodeInfo_Location::set_leading_comments(::std::string&& value) { - set_has_leading_comments(); - leading_comments_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.SourceCodeInfo.Location.leading_comments) -} -#endif -void SourceCodeInfo_Location::set_leading_comments(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_leading_comments(); - leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_comments) -} -void SourceCodeInfo_Location::set_leading_comments(const char* value, size_t size) { - set_has_leading_comments(); - leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_comments) -} -::std::string* SourceCodeInfo_Location::mutable_leading_comments() { - set_has_leading_comments(); - // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_comments) - return leading_comments_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* SourceCodeInfo_Location::release_leading_comments() { - // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.leading_comments) - clear_has_leading_comments(); - return leading_comments_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void SourceCodeInfo_Location::set_allocated_leading_comments(::std::string* leading_comments) { - if (leading_comments != NULL) { - set_has_leading_comments(); - } else { - clear_has_leading_comments(); - } - leading_comments_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), leading_comments); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments) -} - -// optional string trailing_comments = 4; -bool SourceCodeInfo_Location::has_trailing_comments() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void SourceCodeInfo_Location::set_has_trailing_comments() { - _has_bits_[0] |= 0x00000002u; -} -void SourceCodeInfo_Location::clear_has_trailing_comments() { - _has_bits_[0] &= ~0x00000002u; -} -void SourceCodeInfo_Location::clear_trailing_comments() { - trailing_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_trailing_comments(); -} -const ::std::string& SourceCodeInfo_Location::trailing_comments() const { - // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.trailing_comments) - return trailing_comments_.GetNoArena(); -} -void SourceCodeInfo_Location::set_trailing_comments(const ::std::string& value) { - set_has_trailing_comments(); - trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.trailing_comments) -} -#if LANG_CXX11 -void SourceCodeInfo_Location::set_trailing_comments(::std::string&& value) { - set_has_trailing_comments(); - trailing_comments_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.SourceCodeInfo.Location.trailing_comments) -} -#endif -void SourceCodeInfo_Location::set_trailing_comments(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_trailing_comments(); - trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.trailing_comments) -} -void SourceCodeInfo_Location::set_trailing_comments(const char* value, size_t size) { - set_has_trailing_comments(); - trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.trailing_comments) -} -::std::string* SourceCodeInfo_Location::mutable_trailing_comments() { - set_has_trailing_comments(); - // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.trailing_comments) - return trailing_comments_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* SourceCodeInfo_Location::release_trailing_comments() { - // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.trailing_comments) - clear_has_trailing_comments(); - return trailing_comments_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::string* trailing_comments) { - if (trailing_comments != NULL) { - set_has_trailing_comments(); - } else { - clear_has_trailing_comments(); - } - trailing_comments_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), trailing_comments); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments) -} - -// repeated string leading_detached_comments = 6; -int SourceCodeInfo_Location::leading_detached_comments_size() const { - return leading_detached_comments_.size(); -} -void SourceCodeInfo_Location::clear_leading_detached_comments() { - leading_detached_comments_.Clear(); -} -const ::std::string& SourceCodeInfo_Location::leading_detached_comments(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) - return leading_detached_comments_.Get(index); -} -::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); -} -void SourceCodeInfo_Location::set_leading_detached_comments(int index, const ::std::string& value) { - // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) - leading_detached_comments_.Mutable(index)->assign(value); -} -#if LANG_CXX11 -void SourceCodeInfo_Location::set_leading_detached_comments(int index, ::std::string&& value) { - // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) - leading_detached_comments_.Mutable(index)->assign(std::move(value)); -} -#endif -void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); - leading_detached_comments_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) -} -void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value, size_t size) { - leading_detached_comments_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) -} -::std::string* SourceCodeInfo_Location::add_leading_detached_comments() { - // @@protoc_insertion_point(field_add_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) - return leading_detached_comments_.Add(); -} -void SourceCodeInfo_Location::add_leading_detached_comments(const ::std::string& value) { - leading_detached_comments_.Add()->assign(value); - // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) -} -#if LANG_CXX11 -void SourceCodeInfo_Location::add_leading_detached_comments(::std::string&& value) { - leading_detached_comments_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) -} -#endif -void SourceCodeInfo_Location::add_leading_detached_comments(const char* value) { - GOOGLE_DCHECK(value != NULL); - leading_detached_comments_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) -} -void SourceCodeInfo_Location::add_leading_detached_comments(const char* value, size_t size) { - leading_detached_comments_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) -} -const ::google::protobuf::RepeatedPtrField< ::std::string>& -SourceCodeInfo_Location::leading_detached_comments() const { - // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) - return leading_detached_comments_; -} -::google::protobuf::RepeatedPtrField< ::std::string>* -SourceCodeInfo_Location::mutable_leading_detached_comments() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) - return &leading_detached_comments_; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void SourceCodeInfo::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int SourceCodeInfo::kLocationFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 @@ -15897,11 +13436,20 @@ const int SourceCodeInfo::kLocationFieldNumber; SourceCodeInfo::SourceCodeInfo() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.SourceCodeInfo) } +SourceCodeInfo::SourceCodeInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + location_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.SourceCodeInfo) +} SourceCodeInfo::SourceCodeInfo(const SourceCodeInfo& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -15922,29 +13470,37 @@ SourceCodeInfo::~SourceCodeInfo() { } void SourceCodeInfo::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } +void SourceCodeInfo::ArenaDtor(void* object) { + SourceCodeInfo* _this = reinterpret_cast< SourceCodeInfo* >(object); + (void)_this; +} +void SourceCodeInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void SourceCodeInfo::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* SourceCodeInfo::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const SourceCodeInfo& SourceCodeInfo::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo(); return *internal_default_instance(); } SourceCodeInfo* SourceCodeInfo::New(::google::protobuf::Arena* arena) const { - SourceCodeInfo* n = new SourceCodeInfo; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void SourceCodeInfo::Clear() { @@ -16115,6 +13671,21 @@ bool SourceCodeInfo::IsInitialized() const { void SourceCodeInfo::Swap(SourceCodeInfo* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SourceCodeInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SourceCodeInfo::UnsafeArenaSwap(SourceCodeInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void SourceCodeInfo::InternalSwap(SourceCodeInfo* other) { @@ -16127,46 +13698,14 @@ void SourceCodeInfo::InternalSwap(SourceCodeInfo* other) { ::google::protobuf::Metadata SourceCodeInfo::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// SourceCodeInfo - -// repeated .google.protobuf.SourceCodeInfo.Location location = 1; -int SourceCodeInfo::location_size() const { - return location_.size(); -} -void SourceCodeInfo::clear_location() { - location_.Clear(); -} -const ::google::protobuf::SourceCodeInfo_Location& SourceCodeInfo::location(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.location) - return location_.Get(index); -} -::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::mutable_location(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.location) - return location_.Mutable(index); -} -::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::add_location() { - // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.location) - return location_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >* -SourceCodeInfo::mutable_location() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.location) - return &location_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >& -SourceCodeInfo::location() const { - // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.location) - return location_; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void GeneratedCodeInfo_Annotation::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int GeneratedCodeInfo_Annotation::kPathFieldNumber; const int GeneratedCodeInfo_Annotation::kSourceFileFieldNumber; @@ -16177,11 +13716,20 @@ const int GeneratedCodeInfo_Annotation::kEndFieldNumber; GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo_Annotation(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.GeneratedCodeInfo.Annotation) } +GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + path_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo_Annotation(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.GeneratedCodeInfo.Annotation) +} GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(const GeneratedCodeInfo_Annotation& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -16191,7 +13739,8 @@ GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(const GeneratedCodeIn _internal_metadata_.MergeFrom(from._internal_metadata_); source_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_source_file()) { - source_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_file_); + source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_file(), + GetArenaNoVirtual()); } ::memcpy(&begin_, &from.begin_, static_cast(reinterpret_cast(&end_) - @@ -16213,30 +13762,38 @@ GeneratedCodeInfo_Annotation::~GeneratedCodeInfo_Annotation() { } void GeneratedCodeInfo_Annotation::SharedDtor() { - source_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + + source_file_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); } +void GeneratedCodeInfo_Annotation::ArenaDtor(void* object) { + GeneratedCodeInfo_Annotation* _this = reinterpret_cast< GeneratedCodeInfo_Annotation* >(object); + (void)_this; +} +void GeneratedCodeInfo_Annotation::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void GeneratedCodeInfo_Annotation::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GeneratedCodeInfo_Annotation::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const GeneratedCodeInfo_Annotation& GeneratedCodeInfo_Annotation::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo_Annotation(); return *internal_default_instance(); } GeneratedCodeInfo_Annotation* GeneratedCodeInfo_Annotation::New(::google::protobuf::Arena* arena) const { - GeneratedCodeInfo_Annotation* n = new GeneratedCodeInfo_Annotation; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void GeneratedCodeInfo_Annotation::Clear() { @@ -16248,7 +13805,7 @@ void GeneratedCodeInfo_Annotation::Clear() { path_.Clear(); if (has_source_file()) { GOOGLE_DCHECK(!source_file_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*source_file_.UnsafeRawStringPointer())->clear(); + source_file_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } cached_has_bits = _has_bits_[0]; if (cached_has_bits & 6u) { @@ -16412,7 +13969,7 @@ void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( - static_cast< ::google::protobuf::uint32>( + static_cast< ::google::protobuf::int32>( _path_cached_byte_size_), target); target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->path_, target); @@ -16529,8 +14086,7 @@ void GeneratedCodeInfo_Annotation::MergeFrom(const GeneratedCodeInfo_Annotation& cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 7u) { if (cached_has_bits & 0x00000001u) { - set_has_source_file(); - source_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_file_); + set_source_file(from.source_file()); } if (cached_has_bits & 0x00000002u) { begin_ = from.begin_; @@ -16562,6 +14118,21 @@ bool GeneratedCodeInfo_Annotation::IsInitialized() const { void GeneratedCodeInfo_Annotation::Swap(GeneratedCodeInfo_Annotation* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GeneratedCodeInfo_Annotation* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GeneratedCodeInfo_Annotation::UnsafeArenaSwap(GeneratedCodeInfo_Annotation* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void GeneratedCodeInfo_Annotation::InternalSwap(GeneratedCodeInfo_Annotation* other) { @@ -16577,157 +14148,14 @@ void GeneratedCodeInfo_Annotation::InternalSwap(GeneratedCodeInfo_Annotation* ot ::google::protobuf::Metadata GeneratedCodeInfo_Annotation::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// GeneratedCodeInfo_Annotation - -// repeated int32 path = 1 [packed = true]; -int GeneratedCodeInfo_Annotation::path_size() const { - return path_.size(); -} -void GeneratedCodeInfo_Annotation::clear_path() { - path_.Clear(); -} -::google::protobuf::int32 GeneratedCodeInfo_Annotation::path(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.path) - return path_.Get(index); -} -void GeneratedCodeInfo_Annotation::set_path(int index, ::google::protobuf::int32 value) { - path_.Set(index, value); - // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.path) -} -void GeneratedCodeInfo_Annotation::add_path(::google::protobuf::int32 value) { - path_.Add(value); - // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.Annotation.path) -} -const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& -GeneratedCodeInfo_Annotation::path() const { - // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.Annotation.path) - return path_; -} -::google::protobuf::RepeatedField< ::google::protobuf::int32 >* -GeneratedCodeInfo_Annotation::mutable_path() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.Annotation.path) - return &path_; -} - -// optional string source_file = 2; -bool GeneratedCodeInfo_Annotation::has_source_file() const { - return (_has_bits_[0] & 0x00000001u) != 0; -} -void GeneratedCodeInfo_Annotation::set_has_source_file() { - _has_bits_[0] |= 0x00000001u; -} -void GeneratedCodeInfo_Annotation::clear_has_source_file() { - _has_bits_[0] &= ~0x00000001u; -} -void GeneratedCodeInfo_Annotation::clear_source_file() { - source_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_source_file(); -} -const ::std::string& GeneratedCodeInfo_Annotation::source_file() const { - // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.source_file) - return source_file_.GetNoArena(); -} -void GeneratedCodeInfo_Annotation::set_source_file(const ::std::string& value) { - set_has_source_file(); - source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.source_file) -} -#if LANG_CXX11 -void GeneratedCodeInfo_Annotation::set_source_file(::std::string&& value) { - set_has_source_file(); - source_file_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.GeneratedCodeInfo.Annotation.source_file) -} -#endif -void GeneratedCodeInfo_Annotation::set_source_file(const char* value) { - GOOGLE_DCHECK(value != NULL); - set_has_source_file(); - source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.GeneratedCodeInfo.Annotation.source_file) -} -void GeneratedCodeInfo_Annotation::set_source_file(const char* value, size_t size) { - set_has_source_file(); - source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.GeneratedCodeInfo.Annotation.source_file) -} -::std::string* GeneratedCodeInfo_Annotation::mutable_source_file() { - set_has_source_file(); - // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.Annotation.source_file) - return source_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* GeneratedCodeInfo_Annotation::release_source_file() { - // @@protoc_insertion_point(field_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file) - clear_has_source_file(); - return source_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void GeneratedCodeInfo_Annotation::set_allocated_source_file(::std::string* source_file) { - if (source_file != NULL) { - set_has_source_file(); - } else { - clear_has_source_file(); - } - source_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source_file); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file) -} - -// optional int32 begin = 3; -bool GeneratedCodeInfo_Annotation::has_begin() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -void GeneratedCodeInfo_Annotation::set_has_begin() { - _has_bits_[0] |= 0x00000002u; -} -void GeneratedCodeInfo_Annotation::clear_has_begin() { - _has_bits_[0] &= ~0x00000002u; -} -void GeneratedCodeInfo_Annotation::clear_begin() { - begin_ = 0; - clear_has_begin(); -} -::google::protobuf::int32 GeneratedCodeInfo_Annotation::begin() const { - // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.begin) - return begin_; -} -void GeneratedCodeInfo_Annotation::set_begin(::google::protobuf::int32 value) { - set_has_begin(); - begin_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.begin) -} - -// optional int32 end = 4; -bool GeneratedCodeInfo_Annotation::has_end() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -void GeneratedCodeInfo_Annotation::set_has_end() { - _has_bits_[0] |= 0x00000004u; -} -void GeneratedCodeInfo_Annotation::clear_has_end() { - _has_bits_[0] &= ~0x00000004u; -} -void GeneratedCodeInfo_Annotation::clear_end() { - end_ = 0; - clear_has_end(); -} -::google::protobuf::int32 GeneratedCodeInfo_Annotation::end() const { - // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.end) - return end_; -} -void GeneratedCodeInfo_Annotation::set_end(::google::protobuf::int32 value) { - set_has_end(); - end_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.end) + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void GeneratedCodeInfo::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int GeneratedCodeInfo::kAnnotationFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 @@ -16735,11 +14163,20 @@ const int GeneratedCodeInfo::kAnnotationFieldNumber; GeneratedCodeInfo::GeneratedCodeInfo() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.GeneratedCodeInfo) } +GeneratedCodeInfo::GeneratedCodeInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + annotation_(arena) { + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo(); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.GeneratedCodeInfo) +} GeneratedCodeInfo::GeneratedCodeInfo(const GeneratedCodeInfo& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), @@ -16760,29 +14197,37 @@ GeneratedCodeInfo::~GeneratedCodeInfo() { } void GeneratedCodeInfo::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + GOOGLE_DCHECK(arena == NULL); + if (arena != NULL) { + return; + } + } +void GeneratedCodeInfo::ArenaDtor(void* object) { + GeneratedCodeInfo* _this = reinterpret_cast< GeneratedCodeInfo* >(object); + (void)_this; +} +void GeneratedCodeInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} void GeneratedCodeInfo::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GeneratedCodeInfo::descriptor() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const GeneratedCodeInfo& GeneratedCodeInfo::default_instance() { - protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo(); return *internal_default_instance(); } GeneratedCodeInfo* GeneratedCodeInfo::New(::google::protobuf::Arena* arena) const { - GeneratedCodeInfo* n = new GeneratedCodeInfo; - if (arena != NULL) { - arena->Own(n); - } - return n; + return ::google::protobuf::Arena::CreateMessage(arena); } void GeneratedCodeInfo::Clear() { @@ -16953,6 +14398,21 @@ bool GeneratedCodeInfo::IsInitialized() const { void GeneratedCodeInfo::Swap(GeneratedCodeInfo* other) { if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GeneratedCodeInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GeneratedCodeInfo::UnsafeArenaSwap(GeneratedCodeInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void GeneratedCodeInfo::InternalSwap(GeneratedCodeInfo* other) { @@ -16965,46 +14425,11 @@ void GeneratedCodeInfo::InternalSwap(GeneratedCodeInfo* other) { ::google::protobuf::Metadata GeneratedCodeInfo::GetMetadata() const { protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// GeneratedCodeInfo - -// repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; -int GeneratedCodeInfo::annotation_size() const { - return annotation_.size(); -} -void GeneratedCodeInfo::clear_annotation() { - annotation_.Clear(); -} -const ::google::protobuf::GeneratedCodeInfo_Annotation& GeneratedCodeInfo::annotation(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.annotation) - return annotation_.Get(index); -} -::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::mutable_annotation(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.annotation) - return annotation_.Mutable(index); -} -::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::add_annotation() { - // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.annotation) - return annotation_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >* -GeneratedCodeInfo::mutable_annotation() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.annotation) - return &annotation_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >& -GeneratedCodeInfo::annotation() const { - // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.annotation) - return annotation_; + return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index 7ec516ab..2b6ba505 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -31,6 +31,102 @@ #include #include // @@protoc_insertion_point(includes) + +namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto { +// Internal implementation detail -- do not use these members. +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[27]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaultsFileDescriptorSetImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsFileDescriptorSet(); +void LIBPROTOBUF_EXPORT InitDefaultsFileDescriptorProtoImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsFileDescriptorProto(); +void LIBPROTOBUF_EXPORT InitDefaultsDescriptorProto_ExtensionRangeImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsDescriptorProto_ExtensionRange(); +void LIBPROTOBUF_EXPORT InitDefaultsDescriptorProto_ReservedRangeImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsDescriptorProto_ReservedRange(); +void LIBPROTOBUF_EXPORT InitDefaultsDescriptorProtoImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsDescriptorProto(); +void LIBPROTOBUF_EXPORT InitDefaultsExtensionRangeOptionsImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsExtensionRangeOptions(); +void LIBPROTOBUF_EXPORT InitDefaultsFieldDescriptorProtoImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsFieldDescriptorProto(); +void LIBPROTOBUF_EXPORT InitDefaultsOneofDescriptorProtoImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsOneofDescriptorProto(); +void LIBPROTOBUF_EXPORT InitDefaultsEnumDescriptorProto_EnumReservedRangeImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsEnumDescriptorProto_EnumReservedRange(); +void LIBPROTOBUF_EXPORT InitDefaultsEnumDescriptorProtoImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsEnumDescriptorProto(); +void LIBPROTOBUF_EXPORT InitDefaultsEnumValueDescriptorProtoImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsEnumValueDescriptorProto(); +void LIBPROTOBUF_EXPORT InitDefaultsServiceDescriptorProtoImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsServiceDescriptorProto(); +void LIBPROTOBUF_EXPORT InitDefaultsMethodDescriptorProtoImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsMethodDescriptorProto(); +void LIBPROTOBUF_EXPORT InitDefaultsFileOptionsImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsFileOptions(); +void LIBPROTOBUF_EXPORT InitDefaultsMessageOptionsImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsMessageOptions(); +void LIBPROTOBUF_EXPORT InitDefaultsFieldOptionsImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsFieldOptions(); +void LIBPROTOBUF_EXPORT InitDefaultsOneofOptionsImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsOneofOptions(); +void LIBPROTOBUF_EXPORT InitDefaultsEnumOptionsImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsEnumOptions(); +void LIBPROTOBUF_EXPORT InitDefaultsEnumValueOptionsImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsEnumValueOptions(); +void LIBPROTOBUF_EXPORT InitDefaultsServiceOptionsImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsServiceOptions(); +void LIBPROTOBUF_EXPORT InitDefaultsMethodOptionsImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsMethodOptions(); +void LIBPROTOBUF_EXPORT InitDefaultsUninterpretedOption_NamePartImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsUninterpretedOption_NamePart(); +void LIBPROTOBUF_EXPORT InitDefaultsUninterpretedOptionImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsUninterpretedOption(); +void LIBPROTOBUF_EXPORT InitDefaultsSourceCodeInfo_LocationImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsSourceCodeInfo_Location(); +void LIBPROTOBUF_EXPORT InitDefaultsSourceCodeInfoImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsSourceCodeInfo(); +void LIBPROTOBUF_EXPORT InitDefaultsGeneratedCodeInfo_AnnotationImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsGeneratedCodeInfo_Annotation(); +void LIBPROTOBUF_EXPORT InitDefaultsGeneratedCodeInfoImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsGeneratedCodeInfo(); +inline void LIBPROTOBUF_EXPORT InitDefaults() { + InitDefaultsFileDescriptorSet(); + InitDefaultsFileDescriptorProto(); + InitDefaultsDescriptorProto_ExtensionRange(); + InitDefaultsDescriptorProto_ReservedRange(); + InitDefaultsDescriptorProto(); + InitDefaultsExtensionRangeOptions(); + InitDefaultsFieldDescriptorProto(); + InitDefaultsOneofDescriptorProto(); + InitDefaultsEnumDescriptorProto_EnumReservedRange(); + InitDefaultsEnumDescriptorProto(); + InitDefaultsEnumValueDescriptorProto(); + InitDefaultsServiceDescriptorProto(); + InitDefaultsMethodDescriptorProto(); + InitDefaultsFileOptions(); + InitDefaultsMessageOptions(); + InitDefaultsFieldOptions(); + InitDefaultsOneofOptions(); + InitDefaultsEnumOptions(); + InitDefaultsEnumValueOptions(); + InitDefaultsServiceOptions(); + InitDefaultsMethodOptions(); + InitDefaultsUninterpretedOption_NamePart(); + InitDefaultsUninterpretedOption(); + InitDefaultsSourceCodeInfo_Location(); + InitDefaultsSourceCodeInfo(); + InitDefaultsGeneratedCodeInfo_Annotation(); + InitDefaultsGeneratedCodeInfo(); +} +} // namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto namespace google { namespace protobuf { class DescriptorProto; @@ -45,6 +141,9 @@ LIBPROTOBUF_EXPORT extern DescriptorProto_ReservedRangeDefaultTypeInternal _Desc class EnumDescriptorProto; class EnumDescriptorProtoDefaultTypeInternal; LIBPROTOBUF_EXPORT extern EnumDescriptorProtoDefaultTypeInternal _EnumDescriptorProto_default_instance_; +class EnumDescriptorProto_EnumReservedRange; +class EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal; +LIBPROTOBUF_EXPORT extern EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal _EnumDescriptorProto_EnumReservedRange_default_instance_; class EnumOptions; class EnumOptionsDefaultTypeInternal; LIBPROTOBUF_EXPORT extern EnumOptionsDefaultTypeInternal _EnumOptions_default_instance_; @@ -113,25 +212,9 @@ class UninterpretedOption_NamePartDefaultTypeInternal; LIBPROTOBUF_EXPORT extern UninterpretedOption_NamePartDefaultTypeInternal _UninterpretedOption_NamePart_default_instance_; } // namespace protobuf } // namespace google - namespace google { namespace protobuf { -namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto { -// Internal implementation detail -- do not call these. -struct LIBPROTOBUF_EXPORT TableStruct { - static const ::google::protobuf::internal::ParseTableField entries[]; - static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; - static const ::google::protobuf::internal::FieldMetadata field_metadata[]; - static const ::google::protobuf::internal::SerializationTable serialization_table[]; - static void InitDefaultsImpl(); -}; -void LIBPROTOBUF_EXPORT AddDescriptors(); -void LIBPROTOBUF_EXPORT InitDefaults(); -} // namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto - enum FieldDescriptorProto_Type { FieldDescriptorProto_Type_TYPE_DOUBLE = 1, FieldDescriptorProto_Type_TYPE_FLOAT = 2, @@ -302,9 +385,16 @@ class LIBPROTOBUF_EXPORT FileDescriptorSet : public ::google::protobuf::Message return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const FileDescriptorSet& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const FileDescriptorSet* internal_default_instance() { return reinterpret_cast( &_FileDescriptorSet_default_instance_); @@ -312,6 +402,7 @@ class LIBPROTOBUF_EXPORT FileDescriptorSet : public ::google::protobuf::Message static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 0; + void UnsafeArenaSwap(FileDescriptorSet* other); void Swap(FileDescriptorSet* other); friend void swap(FileDescriptorSet& a, FileDescriptorSet& b) { a.Swap(&b); @@ -342,12 +433,17 @@ class LIBPROTOBUF_EXPORT FileDescriptorSet : public ::google::protobuf::Message void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(FileDescriptorSet* other); + protected: + explicit FileDescriptorSet(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -373,10 +469,14 @@ class LIBPROTOBUF_EXPORT FileDescriptorSet : public ::google::protobuf::Message private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto > file_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorSetImpl(); }; // ------------------------------------------------------------------- @@ -413,9 +513,16 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const FileDescriptorProto& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const FileDescriptorProto* internal_default_instance() { return reinterpret_cast( &_FileDescriptorProto_default_instance_); @@ -423,6 +530,7 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 1; + void UnsafeArenaSwap(FileDescriptorProto* other); void Swap(FileDescriptorProto* other); friend void swap(FileDescriptorProto& a, FileDescriptorProto& b) { a.Swap(&b); @@ -453,12 +561,17 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(FileDescriptorProto* other); + protected: + explicit FileDescriptorProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -576,6 +689,9 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag ::std::string* mutable_name(); ::std::string* release_name(); void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); // optional string package = 2; bool has_package() const; @@ -591,6 +707,9 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag ::std::string* mutable_package(); ::std::string* release_package(); void set_allocated_package(::std::string* package); + ::std::string* unsafe_arena_release_package(); + void unsafe_arena_set_allocated_package( + ::std::string* package); // optional string syntax = 12; bool has_syntax() const; @@ -606,24 +725,45 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag ::std::string* mutable_syntax(); ::std::string* release_syntax(); void set_allocated_syntax(::std::string* syntax); + ::std::string* unsafe_arena_release_syntax(); + void unsafe_arena_set_allocated_syntax( + ::std::string* syntax); // optional .google.protobuf.FileOptions options = 8; bool has_options() const; void clear_options(); static const int kOptionsFieldNumber = 8; + private: + void _slow_mutable_options(); + void _slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::FileOptions** options); + ::google::protobuf::FileOptions* _slow_release_options(); + public: const ::google::protobuf::FileOptions& options() const; ::google::protobuf::FileOptions* mutable_options(); ::google::protobuf::FileOptions* release_options(); void set_allocated_options(::google::protobuf::FileOptions* options); + ::google::protobuf::FileOptions* unsafe_arena_release_options(); + void unsafe_arena_set_allocated_options( + ::google::protobuf::FileOptions* options); // optional .google.protobuf.SourceCodeInfo source_code_info = 9; bool has_source_code_info() const; void clear_source_code_info(); static const int kSourceCodeInfoFieldNumber = 9; + private: + void _slow_mutable_source_code_info(); + void _slow_set_allocated_source_code_info( + ::google::protobuf::Arena* message_arena, ::google::protobuf::SourceCodeInfo** source_code_info); + ::google::protobuf::SourceCodeInfo* _slow_release_source_code_info(); + public: const ::google::protobuf::SourceCodeInfo& source_code_info() const; ::google::protobuf::SourceCodeInfo* mutable_source_code_info(); ::google::protobuf::SourceCodeInfo* release_source_code_info(); void set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info); + ::google::protobuf::SourceCodeInfo* unsafe_arena_release_source_code_info(); + void unsafe_arena_set_allocated_source_code_info( + ::google::protobuf::SourceCodeInfo* source_code_info); // @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorProto) private: @@ -639,6 +779,9 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag void clear_has_syntax(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::std::string> dependency_; @@ -653,7 +796,8 @@ class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Messag ::google::protobuf::internal::ArenaStringPtr syntax_; ::google::protobuf::FileOptions* options_; ::google::protobuf::SourceCodeInfo* source_code_info_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProtoImpl(); }; // ------------------------------------------------------------------- @@ -690,9 +834,16 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::proto return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const DescriptorProto_ExtensionRange& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const DescriptorProto_ExtensionRange* internal_default_instance() { return reinterpret_cast( &_DescriptorProto_ExtensionRange_default_instance_); @@ -700,6 +851,7 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::proto static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 2; + void UnsafeArenaSwap(DescriptorProto_ExtensionRange* other); void Swap(DescriptorProto_ExtensionRange* other); friend void swap(DescriptorProto_ExtensionRange& a, DescriptorProto_ExtensionRange& b) { a.Swap(&b); @@ -730,12 +882,17 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::proto void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(DescriptorProto_ExtensionRange* other); + protected: + explicit DescriptorProto_ExtensionRange(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -749,10 +906,19 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::proto bool has_options() const; void clear_options(); static const int kOptionsFieldNumber = 3; + private: + void _slow_mutable_options(); + void _slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::ExtensionRangeOptions** options); + ::google::protobuf::ExtensionRangeOptions* _slow_release_options(); + public: const ::google::protobuf::ExtensionRangeOptions& options() const; ::google::protobuf::ExtensionRangeOptions* mutable_options(); ::google::protobuf::ExtensionRangeOptions* release_options(); void set_allocated_options(::google::protobuf::ExtensionRangeOptions* options); + ::google::protobuf::ExtensionRangeOptions* unsafe_arena_release_options(); + void unsafe_arena_set_allocated_options( + ::google::protobuf::ExtensionRangeOptions* options); // optional int32 start = 1; bool has_start() const; @@ -778,12 +944,16 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::proto void clear_has_options(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::ExtensionRangeOptions* options_; ::google::protobuf::int32 start_; ::google::protobuf::int32 end_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ExtensionRangeImpl(); }; // ------------------------------------------------------------------- @@ -820,9 +990,16 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ReservedRange : public ::google::protob return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const DescriptorProto_ReservedRange& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const DescriptorProto_ReservedRange* internal_default_instance() { return reinterpret_cast( &_DescriptorProto_ReservedRange_default_instance_); @@ -830,6 +1007,7 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ReservedRange : public ::google::protob static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 3; + void UnsafeArenaSwap(DescriptorProto_ReservedRange* other); void Swap(DescriptorProto_ReservedRange* other); friend void swap(DescriptorProto_ReservedRange& a, DescriptorProto_ReservedRange& b) { a.Swap(&b); @@ -860,12 +1038,17 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ReservedRange : public ::google::protob void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(DescriptorProto_ReservedRange* other); + protected: + explicit DescriptorProto_ReservedRange(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -897,11 +1080,15 @@ class LIBPROTOBUF_EXPORT DescriptorProto_ReservedRange : public ::google::protob void clear_has_end(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::int32 start_; ::google::protobuf::int32 end_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ReservedRangeImpl(); }; // ------------------------------------------------------------------- @@ -938,9 +1125,16 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const DescriptorProto& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const DescriptorProto* internal_default_instance() { return reinterpret_cast( &_DescriptorProto_default_instance_); @@ -948,6 +1142,7 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 4; + void UnsafeArenaSwap(DescriptorProto* other); void Swap(DescriptorProto* other); friend void swap(DescriptorProto& a, DescriptorProto& b) { a.Swap(&b); @@ -978,12 +1173,17 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(DescriptorProto* other); + protected: + explicit DescriptorProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -1116,15 +1316,27 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* ::std::string* mutable_name(); ::std::string* release_name(); void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); // optional .google.protobuf.MessageOptions options = 7; bool has_options() const; void clear_options(); static const int kOptionsFieldNumber = 7; + private: + void _slow_mutable_options(); + void _slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::MessageOptions** options); + ::google::protobuf::MessageOptions* _slow_release_options(); + public: const ::google::protobuf::MessageOptions& options() const; ::google::protobuf::MessageOptions* mutable_options(); ::google::protobuf::MessageOptions* release_options(); void set_allocated_options(::google::protobuf::MessageOptions* options); + ::google::protobuf::MessageOptions* unsafe_arena_release_options(); + void unsafe_arena_set_allocated_options( + ::google::protobuf::MessageOptions* options); // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto) private: @@ -1134,6 +1346,9 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* void clear_has_options(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto > field_; @@ -1146,7 +1361,8 @@ class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* ::google::protobuf::RepeatedPtrField< ::std::string> reserved_name_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::MessageOptions* options_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProtoImpl(); }; // ------------------------------------------------------------------- @@ -1183,9 +1399,16 @@ class LIBPROTOBUF_EXPORT ExtensionRangeOptions : public ::google::protobuf::Mess return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const ExtensionRangeOptions& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const ExtensionRangeOptions* internal_default_instance() { return reinterpret_cast( &_ExtensionRangeOptions_default_instance_); @@ -1193,6 +1416,7 @@ class LIBPROTOBUF_EXPORT ExtensionRangeOptions : public ::google::protobuf::Mess static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 5; + void UnsafeArenaSwap(ExtensionRangeOptions* other); void Swap(ExtensionRangeOptions* other); friend void swap(ExtensionRangeOptions& a, ExtensionRangeOptions& b) { a.Swap(&b); @@ -1223,12 +1447,17 @@ class LIBPROTOBUF_EXPORT ExtensionRangeOptions : public ::google::protobuf::Mess void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(ExtensionRangeOptions* other); + protected: + explicit ExtensionRangeOptions(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -1257,10 +1486,14 @@ class LIBPROTOBUF_EXPORT ExtensionRangeOptions : public ::google::protobuf::Mess ::google::protobuf::internal::ExtensionSet _extensions_; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsExtensionRangeOptionsImpl(); }; // ------------------------------------------------------------------- @@ -1297,9 +1530,16 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const FieldDescriptorProto& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const FieldDescriptorProto* internal_default_instance() { return reinterpret_cast( &_FieldDescriptorProto_default_instance_); @@ -1307,6 +1547,7 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 6; + void UnsafeArenaSwap(FieldDescriptorProto* other); void Swap(FieldDescriptorProto* other); friend void swap(FieldDescriptorProto& a, FieldDescriptorProto& b) { a.Swap(&b); @@ -1337,12 +1578,17 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(FieldDescriptorProto* other); + protected: + explicit FieldDescriptorProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -1452,6 +1698,9 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa ::std::string* mutable_name(); ::std::string* release_name(); void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); // optional string extendee = 2; bool has_extendee() const; @@ -1467,6 +1716,9 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa ::std::string* mutable_extendee(); ::std::string* release_extendee(); void set_allocated_extendee(::std::string* extendee); + ::std::string* unsafe_arena_release_extendee(); + void unsafe_arena_set_allocated_extendee( + ::std::string* extendee); // optional string type_name = 6; bool has_type_name() const; @@ -1482,6 +1734,9 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa ::std::string* mutable_type_name(); ::std::string* release_type_name(); void set_allocated_type_name(::std::string* type_name); + ::std::string* unsafe_arena_release_type_name(); + void unsafe_arena_set_allocated_type_name( + ::std::string* type_name); // optional string default_value = 7; bool has_default_value() const; @@ -1497,6 +1752,9 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa ::std::string* mutable_default_value(); ::std::string* release_default_value(); void set_allocated_default_value(::std::string* default_value); + ::std::string* unsafe_arena_release_default_value(); + void unsafe_arena_set_allocated_default_value( + ::std::string* default_value); // optional string json_name = 10; bool has_json_name() const; @@ -1512,15 +1770,27 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa ::std::string* mutable_json_name(); ::std::string* release_json_name(); void set_allocated_json_name(::std::string* json_name); + ::std::string* unsafe_arena_release_json_name(); + void unsafe_arena_set_allocated_json_name( + ::std::string* json_name); // optional .google.protobuf.FieldOptions options = 8; bool has_options() const; void clear_options(); static const int kOptionsFieldNumber = 8; + private: + void _slow_mutable_options(); + void _slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::FieldOptions** options); + ::google::protobuf::FieldOptions* _slow_release_options(); + public: const ::google::protobuf::FieldOptions& options() const; ::google::protobuf::FieldOptions* mutable_options(); ::google::protobuf::FieldOptions* release_options(); void set_allocated_options(::google::protobuf::FieldOptions* options); + ::google::protobuf::FieldOptions* unsafe_arena_release_options(); + void unsafe_arena_set_allocated_options( + ::google::protobuf::FieldOptions* options); // optional int32 number = 3; bool has_number() const; @@ -1574,6 +1844,9 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa void clear_has_options(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::internal::ArenaStringPtr name_; @@ -1586,7 +1859,8 @@ class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Messa ::google::protobuf::int32 oneof_index_; int label_; int type_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProtoImpl(); }; // ------------------------------------------------------------------- @@ -1623,9 +1897,16 @@ class LIBPROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Messa return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const OneofDescriptorProto& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const OneofDescriptorProto* internal_default_instance() { return reinterpret_cast( &_OneofDescriptorProto_default_instance_); @@ -1633,6 +1914,7 @@ class LIBPROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Messa static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 7; + void UnsafeArenaSwap(OneofDescriptorProto* other); void Swap(OneofDescriptorProto* other); friend void swap(OneofDescriptorProto& a, OneofDescriptorProto& b) { a.Swap(&b); @@ -1663,12 +1945,17 @@ class LIBPROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Messa void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(OneofDescriptorProto* other); + protected: + explicit OneofDescriptorProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -1692,15 +1979,27 @@ class LIBPROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Messa ::std::string* mutable_name(); ::std::string* release_name(); void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); // optional .google.protobuf.OneofOptions options = 2; bool has_options() const; void clear_options(); static const int kOptionsFieldNumber = 2; + private: + void _slow_mutable_options(); + void _slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::OneofOptions** options); + ::google::protobuf::OneofOptions* _slow_release_options(); + public: const ::google::protobuf::OneofOptions& options() const; ::google::protobuf::OneofOptions* mutable_options(); ::google::protobuf::OneofOptions* release_options(); void set_allocated_options(::google::protobuf::OneofOptions* options); + ::google::protobuf::OneofOptions* unsafe_arena_release_options(); + void unsafe_arena_set_allocated_options( + ::google::protobuf::OneofOptions* options); // @@protoc_insertion_point(class_scope:google.protobuf.OneofDescriptorProto) private: @@ -1710,11 +2009,150 @@ class LIBPROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Messa void clear_has_options(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::OneofOptions* options_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofDescriptorProtoImpl(); +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto.EnumReservedRange) */ { + public: + EnumDescriptorProto_EnumReservedRange(); + virtual ~EnumDescriptorProto_EnumReservedRange(); + + EnumDescriptorProto_EnumReservedRange(const EnumDescriptorProto_EnumReservedRange& from); + + inline EnumDescriptorProto_EnumReservedRange& operator=(const EnumDescriptorProto_EnumReservedRange& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + EnumDescriptorProto_EnumReservedRange(EnumDescriptorProto_EnumReservedRange&& from) noexcept + : EnumDescriptorProto_EnumReservedRange() { + *this = ::std::move(from); + } + + inline EnumDescriptorProto_EnumReservedRange& operator=(EnumDescriptorProto_EnumReservedRange&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const EnumDescriptorProto_EnumReservedRange& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const EnumDescriptorProto_EnumReservedRange* internal_default_instance() { + return reinterpret_cast( + &_EnumDescriptorProto_EnumReservedRange_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = + 8; + + void UnsafeArenaSwap(EnumDescriptorProto_EnumReservedRange* other); + void Swap(EnumDescriptorProto_EnumReservedRange* other); + friend void swap(EnumDescriptorProto_EnumReservedRange& a, EnumDescriptorProto_EnumReservedRange& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline EnumDescriptorProto_EnumReservedRange* New() const PROTOBUF_FINAL { return New(NULL); } + + EnumDescriptorProto_EnumReservedRange* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; + void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; + void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; + void CopyFrom(const EnumDescriptorProto_EnumReservedRange& from); + void MergeFrom(const EnumDescriptorProto_EnumReservedRange& from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const PROTOBUF_FINAL; + void InternalSwap(EnumDescriptorProto_EnumReservedRange* other); + protected: + explicit EnumDescriptorProto_EnumReservedRange(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 start = 1; + bool has_start() const; + void clear_start(); + static const int kStartFieldNumber = 1; + ::google::protobuf::int32 start() const; + void set_start(::google::protobuf::int32 value); + + // optional int32 end = 2; + bool has_end() const; + void clear_end(); + static const int kEndFieldNumber = 2; + ::google::protobuf::int32 end() const; + void set_end(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto.EnumReservedRange) + private: + void set_has_start(); + void clear_has_start(); + void set_has_end(); + void clear_has_end(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::int32 start_; + ::google::protobuf::int32 end_; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto_EnumReservedRangeImpl(); }; // ------------------------------------------------------------------- @@ -1751,16 +2189,24 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const EnumDescriptorProto& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const EnumDescriptorProto* internal_default_instance() { return reinterpret_cast( &_EnumDescriptorProto_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 8; + 9; + void UnsafeArenaSwap(EnumDescriptorProto* other); void Swap(EnumDescriptorProto* other); friend void swap(EnumDescriptorProto& a, EnumDescriptorProto& b) { a.Swap(&b); @@ -1791,12 +2237,17 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(EnumDescriptorProto* other); + protected: + explicit EnumDescriptorProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -1804,6 +2255,8 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag // nested types ---------------------------------------------------- + typedef EnumDescriptorProto_EnumReservedRange EnumReservedRange; + // accessors ------------------------------------------------------- // repeated .google.protobuf.EnumValueDescriptorProto value = 2; @@ -1818,6 +2271,40 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >& value() const; + // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + int reserved_range_size() const; + void clear_reserved_range(); + static const int kReservedRangeFieldNumber = 4; + const ::google::protobuf::EnumDescriptorProto_EnumReservedRange& reserved_range(int index) const; + ::google::protobuf::EnumDescriptorProto_EnumReservedRange* mutable_reserved_range(int index); + ::google::protobuf::EnumDescriptorProto_EnumReservedRange* add_reserved_range(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange >* + mutable_reserved_range(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange >& + reserved_range() const; + + // repeated string reserved_name = 5; + int reserved_name_size() const; + void clear_reserved_name(); + static const int kReservedNameFieldNumber = 5; + const ::std::string& reserved_name(int index) const; + ::std::string* mutable_reserved_name(int index); + void set_reserved_name(int index, const ::std::string& value); + #if LANG_CXX11 + void set_reserved_name(int index, ::std::string&& value); + #endif + void set_reserved_name(int index, const char* value); + void set_reserved_name(int index, const char* value, size_t size); + ::std::string* add_reserved_name(); + void add_reserved_name(const ::std::string& value); + #if LANG_CXX11 + void add_reserved_name(::std::string&& value); + #endif + void add_reserved_name(const char* value); + void add_reserved_name(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& reserved_name() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_reserved_name(); + // optional string name = 1; bool has_name() const; void clear_name(); @@ -1832,15 +2319,27 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag ::std::string* mutable_name(); ::std::string* release_name(); void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); // optional .google.protobuf.EnumOptions options = 3; bool has_options() const; void clear_options(); static const int kOptionsFieldNumber = 3; + private: + void _slow_mutable_options(); + void _slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::EnumOptions** options); + ::google::protobuf::EnumOptions* _slow_release_options(); + public: const ::google::protobuf::EnumOptions& options() const; ::google::protobuf::EnumOptions* mutable_options(); ::google::protobuf::EnumOptions* release_options(); void set_allocated_options(::google::protobuf::EnumOptions* options); + ::google::protobuf::EnumOptions* unsafe_arena_release_options(); + void unsafe_arena_set_allocated_options( + ::google::protobuf::EnumOptions* options); // @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto) private: @@ -1850,12 +2349,18 @@ class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Messag void clear_has_options(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto > value_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange > reserved_range_; + ::google::protobuf::RepeatedPtrField< ::std::string> reserved_name_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::EnumOptions* options_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProtoImpl(); }; // ------------------------------------------------------------------- @@ -1892,16 +2397,24 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::M return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const EnumValueDescriptorProto& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const EnumValueDescriptorProto* internal_default_instance() { return reinterpret_cast( &_EnumValueDescriptorProto_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 9; + 10; + void UnsafeArenaSwap(EnumValueDescriptorProto* other); void Swap(EnumValueDescriptorProto* other); friend void swap(EnumValueDescriptorProto& a, EnumValueDescriptorProto& b) { a.Swap(&b); @@ -1932,12 +2445,17 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::M void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(EnumValueDescriptorProto* other); + protected: + explicit EnumValueDescriptorProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -1961,15 +2479,27 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::M ::std::string* mutable_name(); ::std::string* release_name(); void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); // optional .google.protobuf.EnumValueOptions options = 3; bool has_options() const; void clear_options(); static const int kOptionsFieldNumber = 3; + private: + void _slow_mutable_options(); + void _slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::EnumValueOptions** options); + ::google::protobuf::EnumValueOptions* _slow_release_options(); + public: const ::google::protobuf::EnumValueOptions& options() const; ::google::protobuf::EnumValueOptions* mutable_options(); ::google::protobuf::EnumValueOptions* release_options(); void set_allocated_options(::google::protobuf::EnumValueOptions* options); + ::google::protobuf::EnumValueOptions* unsafe_arena_release_options(); + void unsafe_arena_set_allocated_options( + ::google::protobuf::EnumValueOptions* options); // optional int32 number = 2; bool has_number() const; @@ -1988,12 +2518,16 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::M void clear_has_options(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::EnumValueOptions* options_; ::google::protobuf::int32 number_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueDescriptorProtoImpl(); }; // ------------------------------------------------------------------- @@ -2030,16 +2564,24 @@ class LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Mes return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const ServiceDescriptorProto& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const ServiceDescriptorProto* internal_default_instance() { return reinterpret_cast( &_ServiceDescriptorProto_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 10; + 11; + void UnsafeArenaSwap(ServiceDescriptorProto* other); void Swap(ServiceDescriptorProto* other); friend void swap(ServiceDescriptorProto& a, ServiceDescriptorProto& b) { a.Swap(&b); @@ -2070,12 +2612,17 @@ class LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Mes void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(ServiceDescriptorProto* other); + protected: + explicit ServiceDescriptorProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -2111,15 +2658,27 @@ class LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Mes ::std::string* mutable_name(); ::std::string* release_name(); void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); // optional .google.protobuf.ServiceOptions options = 3; bool has_options() const; void clear_options(); static const int kOptionsFieldNumber = 3; + private: + void _slow_mutable_options(); + void _slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::ServiceOptions** options); + ::google::protobuf::ServiceOptions* _slow_release_options(); + public: const ::google::protobuf::ServiceOptions& options() const; ::google::protobuf::ServiceOptions* mutable_options(); ::google::protobuf::ServiceOptions* release_options(); void set_allocated_options(::google::protobuf::ServiceOptions* options); + ::google::protobuf::ServiceOptions* unsafe_arena_release_options(); + void unsafe_arena_set_allocated_options( + ::google::protobuf::ServiceOptions* options); // @@protoc_insertion_point(class_scope:google.protobuf.ServiceDescriptorProto) private: @@ -2129,12 +2688,16 @@ class LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Mes void clear_has_options(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto > method_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::ServiceOptions* options_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceDescriptorProtoImpl(); }; // ------------------------------------------------------------------- @@ -2171,16 +2734,24 @@ class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Mess return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const MethodDescriptorProto& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const MethodDescriptorProto* internal_default_instance() { return reinterpret_cast( &_MethodDescriptorProto_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 11; + 12; + void UnsafeArenaSwap(MethodDescriptorProto* other); void Swap(MethodDescriptorProto* other); friend void swap(MethodDescriptorProto& a, MethodDescriptorProto& b) { a.Swap(&b); @@ -2211,12 +2782,17 @@ class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Mess void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(MethodDescriptorProto* other); + protected: + explicit MethodDescriptorProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -2240,6 +2816,9 @@ class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Mess ::std::string* mutable_name(); ::std::string* release_name(); void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); // optional string input_type = 2; bool has_input_type() const; @@ -2255,6 +2834,9 @@ class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Mess ::std::string* mutable_input_type(); ::std::string* release_input_type(); void set_allocated_input_type(::std::string* input_type); + ::std::string* unsafe_arena_release_input_type(); + void unsafe_arena_set_allocated_input_type( + ::std::string* input_type); // optional string output_type = 3; bool has_output_type() const; @@ -2270,15 +2852,27 @@ class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Mess ::std::string* mutable_output_type(); ::std::string* release_output_type(); void set_allocated_output_type(::std::string* output_type); + ::std::string* unsafe_arena_release_output_type(); + void unsafe_arena_set_allocated_output_type( + ::std::string* output_type); // optional .google.protobuf.MethodOptions options = 4; bool has_options() const; void clear_options(); static const int kOptionsFieldNumber = 4; + private: + void _slow_mutable_options(); + void _slow_set_allocated_options( + ::google::protobuf::Arena* message_arena, ::google::protobuf::MethodOptions** options); + ::google::protobuf::MethodOptions* _slow_release_options(); + public: const ::google::protobuf::MethodOptions& options() const; ::google::protobuf::MethodOptions* mutable_options(); ::google::protobuf::MethodOptions* release_options(); void set_allocated_options(::google::protobuf::MethodOptions* options); + ::google::protobuf::MethodOptions* unsafe_arena_release_options(); + void unsafe_arena_set_allocated_options( + ::google::protobuf::MethodOptions* options); // optional bool client_streaming = 5 [default = false]; bool has_client_streaming() const; @@ -2310,6 +2904,9 @@ class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Mess void clear_has_server_streaming(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::internal::ArenaStringPtr name_; @@ -2318,7 +2915,8 @@ class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Mess ::google::protobuf::MethodOptions* options_; bool client_streaming_; bool server_streaming_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodDescriptorProtoImpl(); }; // ------------------------------------------------------------------- @@ -2355,16 +2953,24 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const FileOptions& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const FileOptions* internal_default_instance() { return reinterpret_cast( &_FileOptions_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 12; + 13; + void UnsafeArenaSwap(FileOptions* other); void Swap(FileOptions* other); friend void swap(FileOptions& a, FileOptions& b) { a.Swap(&b); @@ -2395,12 +3001,17 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(FileOptions* other); + protected: + explicit FileOptions(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -2464,6 +3075,9 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* mutable_java_package(); ::std::string* release_java_package(); void set_allocated_java_package(::std::string* java_package); + ::std::string* unsafe_arena_release_java_package(); + void unsafe_arena_set_allocated_java_package( + ::std::string* java_package); // optional string java_outer_classname = 8; bool has_java_outer_classname() const; @@ -2479,6 +3093,9 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* mutable_java_outer_classname(); ::std::string* release_java_outer_classname(); void set_allocated_java_outer_classname(::std::string* java_outer_classname); + ::std::string* unsafe_arena_release_java_outer_classname(); + void unsafe_arena_set_allocated_java_outer_classname( + ::std::string* java_outer_classname); // optional string go_package = 11; bool has_go_package() const; @@ -2494,6 +3111,9 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* mutable_go_package(); ::std::string* release_go_package(); void set_allocated_go_package(::std::string* go_package); + ::std::string* unsafe_arena_release_go_package(); + void unsafe_arena_set_allocated_go_package( + ::std::string* go_package); // optional string objc_class_prefix = 36; bool has_objc_class_prefix() const; @@ -2509,6 +3129,9 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* mutable_objc_class_prefix(); ::std::string* release_objc_class_prefix(); void set_allocated_objc_class_prefix(::std::string* objc_class_prefix); + ::std::string* unsafe_arena_release_objc_class_prefix(); + void unsafe_arena_set_allocated_objc_class_prefix( + ::std::string* objc_class_prefix); // optional string csharp_namespace = 37; bool has_csharp_namespace() const; @@ -2524,6 +3147,9 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* mutable_csharp_namespace(); ::std::string* release_csharp_namespace(); void set_allocated_csharp_namespace(::std::string* csharp_namespace); + ::std::string* unsafe_arena_release_csharp_namespace(); + void unsafe_arena_set_allocated_csharp_namespace( + ::std::string* csharp_namespace); // optional string swift_prefix = 39; bool has_swift_prefix() const; @@ -2539,6 +3165,9 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* mutable_swift_prefix(); ::std::string* release_swift_prefix(); void set_allocated_swift_prefix(::std::string* swift_prefix); + ::std::string* unsafe_arena_release_swift_prefix(); + void unsafe_arena_set_allocated_swift_prefix( + ::std::string* swift_prefix); // optional string php_class_prefix = 40; bool has_php_class_prefix() const; @@ -2554,6 +3183,9 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* mutable_php_class_prefix(); ::std::string* release_php_class_prefix(); void set_allocated_php_class_prefix(::std::string* php_class_prefix); + ::std::string* unsafe_arena_release_php_class_prefix(); + void unsafe_arena_set_allocated_php_class_prefix( + ::std::string* php_class_prefix); // optional string php_namespace = 41; bool has_php_namespace() const; @@ -2569,6 +3201,16 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::std::string* mutable_php_namespace(); ::std::string* release_php_namespace(); void set_allocated_php_namespace(::std::string* php_namespace); + ::std::string* unsafe_arena_release_php_namespace(); + void unsafe_arena_set_allocated_php_namespace( + ::std::string* php_namespace); + + // optional bool cc_enable_arenas = 31 [default = false]; + bool has_cc_enable_arenas() const; + void clear_cc_enable_arenas(); + static const int kCcEnableArenasFieldNumber = 31; + bool cc_enable_arenas() const; + void set_cc_enable_arenas(bool value); // optional bool java_multiple_files = 10 [default = false]; bool has_java_multiple_files() const; @@ -2612,10 +3254,10 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p bool py_generic_services() const; void set_py_generic_services(bool value); - // optional bool php_generic_services = 19 [default = false]; + // optional bool php_generic_services = 42 [default = false]; bool has_php_generic_services() const; void clear_php_generic_services(); - static const int kPhpGenericServicesFieldNumber = 19; + static const int kPhpGenericServicesFieldNumber = 42; bool php_generic_services() const; void set_php_generic_services(bool value); @@ -2626,13 +3268,6 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p bool deprecated() const; void set_deprecated(bool value); - // optional bool cc_enable_arenas = 31 [default = false]; - bool has_cc_enable_arenas() const; - void clear_cc_enable_arenas(); - static const int kCcEnableArenasFieldNumber = 31; - bool cc_enable_arenas() const; - void set_cc_enable_arenas(bool value); - // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; bool has_optimize_for() const; void clear_optimize_for(); @@ -2683,6 +3318,9 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::google::protobuf::internal::ExtensionSet _extensions_; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; @@ -2694,6 +3332,7 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p ::google::protobuf::internal::ArenaStringPtr swift_prefix_; ::google::protobuf::internal::ArenaStringPtr php_class_prefix_; ::google::protobuf::internal::ArenaStringPtr php_namespace_; + bool cc_enable_arenas_; bool java_multiple_files_; bool java_generate_equals_and_hash_; bool java_string_check_utf8_; @@ -2702,9 +3341,9 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p bool py_generic_services_; bool php_generic_services_; bool deprecated_; - bool cc_enable_arenas_; int optimize_for_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileOptionsImpl(); }; // ------------------------------------------------------------------- @@ -2741,16 +3380,24 @@ class LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const MessageOptions& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const MessageOptions* internal_default_instance() { return reinterpret_cast( &_MessageOptions_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 13; + 14; + void UnsafeArenaSwap(MessageOptions* other); void Swap(MessageOptions* other); friend void swap(MessageOptions& a, MessageOptions& b) { a.Swap(&b); @@ -2781,12 +3428,17 @@ class LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(MessageOptions* other); + protected: + explicit MessageOptions(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -2851,6 +3503,9 @@ class LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* ::google::protobuf::internal::ExtensionSet _extensions_; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; @@ -2858,7 +3513,8 @@ class LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* bool no_standard_descriptor_accessor_; bool deprecated_; bool map_entry_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMessageOptionsImpl(); }; // ------------------------------------------------------------------- @@ -2895,16 +3551,24 @@ class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@ return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const FieldOptions& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const FieldOptions* internal_default_instance() { return reinterpret_cast( &_FieldOptions_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 14; + 15; + void UnsafeArenaSwap(FieldOptions* other); void Swap(FieldOptions* other); friend void swap(FieldOptions& a, FieldOptions& b) { a.Swap(&b); @@ -2935,12 +3599,17 @@ class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@ void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(FieldOptions* other); + protected: + explicit FieldOptions(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -3079,6 +3748,9 @@ class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@ ::google::protobuf::internal::ExtensionSet _extensions_; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; @@ -3088,7 +3760,8 @@ class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@ bool deprecated_; bool weak_; int jstype_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldOptionsImpl(); }; // ------------------------------------------------------------------- @@ -3125,16 +3798,24 @@ class LIBPROTOBUF_EXPORT OneofOptions : public ::google::protobuf::Message /* @@ return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const OneofOptions& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const OneofOptions* internal_default_instance() { return reinterpret_cast( &_OneofOptions_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 15; + 16; + void UnsafeArenaSwap(OneofOptions* other); void Swap(OneofOptions* other); friend void swap(OneofOptions& a, OneofOptions& b) { a.Swap(&b); @@ -3165,12 +3846,17 @@ class LIBPROTOBUF_EXPORT OneofOptions : public ::google::protobuf::Message /* @@ void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(OneofOptions* other); + protected: + explicit OneofOptions(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -3199,10 +3885,14 @@ class LIBPROTOBUF_EXPORT OneofOptions : public ::google::protobuf::Message /* @@ ::google::protobuf::internal::ExtensionSet _extensions_; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofOptionsImpl(); }; // ------------------------------------------------------------------- @@ -3239,16 +3929,24 @@ class LIBPROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message /* @@p return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const EnumOptions& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const EnumOptions* internal_default_instance() { return reinterpret_cast( &_EnumOptions_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 16; + 17; + void UnsafeArenaSwap(EnumOptions* other); void Swap(EnumOptions* other); friend void swap(EnumOptions& a, EnumOptions& b) { a.Swap(&b); @@ -3279,12 +3977,17 @@ class LIBPROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message /* @@p void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(EnumOptions* other); + protected: + explicit EnumOptions(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -3331,12 +4034,16 @@ class LIBPROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message /* @@p ::google::protobuf::internal::ExtensionSet _extensions_; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; bool allow_alias_; bool deprecated_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumOptionsImpl(); }; // ------------------------------------------------------------------- @@ -3373,16 +4080,24 @@ class LIBPROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message / return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const EnumValueOptions& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const EnumValueOptions* internal_default_instance() { return reinterpret_cast( &_EnumValueOptions_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 17; + 18; + void UnsafeArenaSwap(EnumValueOptions* other); void Swap(EnumValueOptions* other); friend void swap(EnumValueOptions& a, EnumValueOptions& b) { a.Swap(&b); @@ -3413,12 +4128,17 @@ class LIBPROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message / void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(EnumValueOptions* other); + protected: + explicit EnumValueOptions(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -3456,11 +4176,15 @@ class LIBPROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message / ::google::protobuf::internal::ExtensionSet _extensions_; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; bool deprecated_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumValueOptionsImpl(); }; // ------------------------------------------------------------------- @@ -3497,16 +4221,24 @@ class LIBPROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message /* return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const ServiceOptions& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const ServiceOptions* internal_default_instance() { return reinterpret_cast( &_ServiceOptions_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 18; + 19; + void UnsafeArenaSwap(ServiceOptions* other); void Swap(ServiceOptions* other); friend void swap(ServiceOptions& a, ServiceOptions& b) { a.Swap(&b); @@ -3537,12 +4269,17 @@ class LIBPROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message /* void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(ServiceOptions* other); + protected: + explicit ServiceOptions(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -3580,11 +4317,15 @@ class LIBPROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message /* ::google::protobuf::internal::ExtensionSet _extensions_; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; bool deprecated_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsServiceOptionsImpl(); }; // ------------------------------------------------------------------- @@ -3621,16 +4362,24 @@ class LIBPROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message /* @ return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const MethodOptions& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const MethodOptions* internal_default_instance() { return reinterpret_cast( &_MethodOptions_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 19; + 20; + void UnsafeArenaSwap(MethodOptions* other); void Swap(MethodOptions* other); friend void swap(MethodOptions& a, MethodOptions& b) { a.Swap(&b); @@ -3661,12 +4410,17 @@ class LIBPROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message /* @ void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(MethodOptions* other); + protected: + explicit MethodOptions(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -3741,12 +4495,16 @@ class LIBPROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message /* @ ::google::protobuf::internal::ExtensionSet _extensions_; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; bool deprecated_; int idempotency_level_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsMethodOptionsImpl(); }; // ------------------------------------------------------------------- @@ -3783,16 +4541,24 @@ class LIBPROTOBUF_EXPORT UninterpretedOption_NamePart : public ::google::protobu return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const UninterpretedOption_NamePart& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const UninterpretedOption_NamePart* internal_default_instance() { return reinterpret_cast( &_UninterpretedOption_NamePart_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 20; + 21; + void UnsafeArenaSwap(UninterpretedOption_NamePart* other); void Swap(UninterpretedOption_NamePart* other); friend void swap(UninterpretedOption_NamePart& a, UninterpretedOption_NamePart& b) { a.Swap(&b); @@ -3823,12 +4589,17 @@ class LIBPROTOBUF_EXPORT UninterpretedOption_NamePart : public ::google::protobu void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(UninterpretedOption_NamePart* other); + protected: + explicit UninterpretedOption_NamePart(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -3852,6 +4623,9 @@ class LIBPROTOBUF_EXPORT UninterpretedOption_NamePart : public ::google::protobu ::std::string* mutable_name_part(); ::std::string* release_name_part(); void set_allocated_name_part(::std::string* name_part); + ::std::string* unsafe_arena_release_name_part(); + void unsafe_arena_set_allocated_name_part( + ::std::string* name_part); // required bool is_extension = 2; bool has_is_extension() const; @@ -3871,11 +4645,15 @@ class LIBPROTOBUF_EXPORT UninterpretedOption_NamePart : public ::google::protobu size_t RequiredFieldsByteSizeFallback() const; ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::internal::ArenaStringPtr name_part_; bool is_extension_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOption_NamePartImpl(); }; // ------------------------------------------------------------------- @@ -3912,16 +4690,24 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const UninterpretedOption& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const UninterpretedOption* internal_default_instance() { return reinterpret_cast( &_UninterpretedOption_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 21; + 22; + void UnsafeArenaSwap(UninterpretedOption* other); void Swap(UninterpretedOption* other); friend void swap(UninterpretedOption& a, UninterpretedOption& b) { a.Swap(&b); @@ -3952,12 +4738,17 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(UninterpretedOption* other); + protected: + explicit UninterpretedOption(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -3995,6 +4786,9 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag ::std::string* mutable_identifier_value(); ::std::string* release_identifier_value(); void set_allocated_identifier_value(::std::string* identifier_value); + ::std::string* unsafe_arena_release_identifier_value(); + void unsafe_arena_set_allocated_identifier_value( + ::std::string* identifier_value); // optional bytes string_value = 7; bool has_string_value() const; @@ -4010,6 +4804,9 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag ::std::string* mutable_string_value(); ::std::string* release_string_value(); void set_allocated_string_value(::std::string* string_value); + ::std::string* unsafe_arena_release_string_value(); + void unsafe_arena_set_allocated_string_value( + ::std::string* string_value); // optional string aggregate_value = 8; bool has_aggregate_value() const; @@ -4025,6 +4822,9 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag ::std::string* mutable_aggregate_value(); ::std::string* release_aggregate_value(); void set_allocated_aggregate_value(::std::string* aggregate_value); + ::std::string* unsafe_arena_release_aggregate_value(); + void unsafe_arena_set_allocated_aggregate_value( + ::std::string* aggregate_value); // optional uint64 positive_int_value = 4; bool has_positive_int_value() const; @@ -4063,6 +4863,9 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag void clear_has_aggregate_value(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart > name_; @@ -4072,7 +4875,8 @@ class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Messag ::google::protobuf::uint64 positive_int_value_; ::google::protobuf::int64 negative_int_value_; double double_value_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsUninterpretedOptionImpl(); }; // ------------------------------------------------------------------- @@ -4109,16 +4913,24 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Me return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const SourceCodeInfo_Location& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const SourceCodeInfo_Location* internal_default_instance() { return reinterpret_cast( &_SourceCodeInfo_Location_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 22; + 23; + void UnsafeArenaSwap(SourceCodeInfo_Location* other); void Swap(SourceCodeInfo_Location* other); friend void swap(SourceCodeInfo_Location& a, SourceCodeInfo_Location& b) { a.Swap(&b); @@ -4149,12 +4961,17 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Me void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(SourceCodeInfo_Location* other); + protected: + explicit SourceCodeInfo_Location(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -4224,6 +5041,9 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Me ::std::string* mutable_leading_comments(); ::std::string* release_leading_comments(); void set_allocated_leading_comments(::std::string* leading_comments); + ::std::string* unsafe_arena_release_leading_comments(); + void unsafe_arena_set_allocated_leading_comments( + ::std::string* leading_comments); // optional string trailing_comments = 4; bool has_trailing_comments() const; @@ -4239,6 +5059,9 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Me ::std::string* mutable_trailing_comments(); ::std::string* release_trailing_comments(); void set_allocated_trailing_comments(::std::string* trailing_comments); + ::std::string* unsafe_arena_release_trailing_comments(); + void unsafe_arena_set_allocated_trailing_comments( + ::std::string* trailing_comments); // @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo.Location) private: @@ -4248,6 +5071,9 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Me void clear_has_trailing_comments(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedField< ::google::protobuf::int32 > path_; @@ -4257,7 +5083,8 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Me ::google::protobuf::RepeatedPtrField< ::std::string> leading_detached_comments_; ::google::protobuf::internal::ArenaStringPtr leading_comments_; ::google::protobuf::internal::ArenaStringPtr trailing_comments_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfo_LocationImpl(); }; // ------------------------------------------------------------------- @@ -4294,16 +5121,24 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo : public ::google::protobuf::Message /* return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const SourceCodeInfo& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const SourceCodeInfo* internal_default_instance() { return reinterpret_cast( &_SourceCodeInfo_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 23; + 24; + void UnsafeArenaSwap(SourceCodeInfo* other); void Swap(SourceCodeInfo* other); friend void swap(SourceCodeInfo& a, SourceCodeInfo& b) { a.Swap(&b); @@ -4334,12 +5169,17 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo : public ::google::protobuf::Message /* void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(SourceCodeInfo* other); + protected: + explicit SourceCodeInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -4367,10 +5207,14 @@ class LIBPROTOBUF_EXPORT SourceCodeInfo : public ::google::protobuf::Message /* private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location > location_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsSourceCodeInfoImpl(); }; // ------------------------------------------------------------------- @@ -4407,16 +5251,24 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobu return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const GeneratedCodeInfo_Annotation& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const GeneratedCodeInfo_Annotation* internal_default_instance() { return reinterpret_cast( &_GeneratedCodeInfo_Annotation_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 24; + 25; + void UnsafeArenaSwap(GeneratedCodeInfo_Annotation* other); void Swap(GeneratedCodeInfo_Annotation* other); friend void swap(GeneratedCodeInfo_Annotation& a, GeneratedCodeInfo_Annotation& b) { a.Swap(&b); @@ -4447,12 +5299,17 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobu void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(GeneratedCodeInfo_Annotation* other); + protected: + explicit GeneratedCodeInfo_Annotation(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -4488,6 +5345,9 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobu ::std::string* mutable_source_file(); ::std::string* release_source_file(); void set_allocated_source_file(::std::string* source_file); + ::std::string* unsafe_arena_release_source_file(); + void unsafe_arena_set_allocated_source_file( + ::std::string* source_file); // optional int32 begin = 3; bool has_begin() const; @@ -4513,6 +5373,9 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobu void clear_has_end(); ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedField< ::google::protobuf::int32 > path_; @@ -4520,7 +5383,8 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobu ::google::protobuf::internal::ArenaStringPtr source_file_; ::google::protobuf::int32 begin_; ::google::protobuf::int32 end_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfo_AnnotationImpl(); }; // ------------------------------------------------------------------- @@ -4557,16 +5421,24 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message return _internal_metadata_.mutable_unknown_fields(); } + inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { + return MaybeArenaPtr(); + } static const ::google::protobuf::Descriptor* descriptor(); static const GeneratedCodeInfo& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const GeneratedCodeInfo* internal_default_instance() { return reinterpret_cast( &_GeneratedCodeInfo_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = - 25; + 26; + void UnsafeArenaSwap(GeneratedCodeInfo* other); void Swap(GeneratedCodeInfo* other); friend void swap(GeneratedCodeInfo& a, GeneratedCodeInfo& b) { a.Swap(&b); @@ -4597,12 +5469,17 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(GeneratedCodeInfo* other); + protected: + explicit GeneratedCodeInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { - return NULL; + return _internal_metadata_.raw_arena_ptr(); } public: @@ -4630,17 +5507,20 @@ class LIBPROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; ::google::protobuf::internal::HasBits<1> _has_bits_; mutable int _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation > annotation_; - friend struct protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsGeneratedCodeInfoImpl(); }; // =================================================================== // =================================================================== -#if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -4692,47 +5572,56 @@ inline void FileDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void FileDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_name(); } inline const ::std::string& FileDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.name) - return name_.GetNoArena(); + return name_.Get(); } inline void FileDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.name) } #if LANG_CXX11 inline void FileDescriptorProto::set_name(::std::string&& value) { set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileDescriptorProto.name) } #endif inline void FileDescriptorProto::set_name(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.name) } -inline void FileDescriptorProto::set_name(const char* value, size_t size) { +inline void FileDescriptorProto::set_name(const char* value, + size_t size) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.name) } inline ::std::string* FileDescriptorProto::mutable_name() { set_has_name(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.name) clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileDescriptorProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_name(); + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileDescriptorProto::set_allocated_name(::std::string* name) { if (name != NULL) { @@ -4740,9 +5629,22 @@ inline void FileDescriptorProto::set_allocated_name(::std::string* name) { } else { clear_has_name(); } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.name) } +inline void FileDescriptorProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.name) +} // optional string package = 2; inline bool FileDescriptorProto::has_package() const { @@ -4755,47 +5657,56 @@ inline void FileDescriptorProto::clear_has_package() { _has_bits_[0] &= ~0x00000002u; } inline void FileDescriptorProto::clear_package() { - package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_package(); } inline const ::std::string& FileDescriptorProto::package() const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.package) - return package_.GetNoArena(); + return package_.Get(); } inline void FileDescriptorProto::set_package(const ::std::string& value) { set_has_package(); - package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.package) } #if LANG_CXX11 inline void FileDescriptorProto::set_package(::std::string&& value) { set_has_package(); - package_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + package_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileDescriptorProto.package) } #endif inline void FileDescriptorProto::set_package(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_package(); - package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.package) } -inline void FileDescriptorProto::set_package(const char* value, size_t size) { +inline void FileDescriptorProto::set_package(const char* value, + size_t size) { set_has_package(); - package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.package) } inline ::std::string* FileDescriptorProto::mutable_package() { set_has_package(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.package) - return package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileDescriptorProto::release_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.package) clear_has_package(); - return package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return package_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileDescriptorProto::unsafe_arena_release_package() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.package) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_package(); + return package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileDescriptorProto::set_allocated_package(::std::string* package) { if (package != NULL) { @@ -4803,9 +5714,22 @@ inline void FileDescriptorProto::set_allocated_package(::std::string* package) { } else { clear_has_package(); } - package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), package); + package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), package, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.package) } +inline void FileDescriptorProto::unsafe_arena_set_allocated_package( + ::std::string* package) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (package != NULL) { + set_has_package(); + } else { + clear_has_package(); + } + package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + package, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.package) +} // repeated string dependency = 3; inline int FileDescriptorProto::dependency_size() const { @@ -5079,7 +6003,7 @@ inline const ::google::protobuf::FileOptions& FileDescriptorProto::options() con inline ::google::protobuf::FileOptions* FileDescriptorProto::mutable_options() { set_has_options(); if (options_ == NULL) { - options_ = new ::google::protobuf::FileOptions; + _slow_mutable_options(); } // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.options) return options_; @@ -5087,12 +6011,22 @@ inline ::google::protobuf::FileOptions* FileDescriptorProto::mutable_options() { inline ::google::protobuf::FileOptions* FileDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.options) clear_has_options(); - ::google::protobuf::FileOptions* temp = options_; - options_ = NULL; - return temp; + if (GetArenaNoVirtual() != NULL) { + return _slow_release_options(); + } else { + ::google::protobuf::FileOptions* temp = options_; + options_ = NULL; + return temp; + } } -inline void FileDescriptorProto::set_allocated_options(::google::protobuf::FileOptions* options) { - delete options_; +inline void FileDescriptorProto::set_allocated_options(::google::protobuf::FileOptions* options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete options_; + } + if (options != NULL) { + _slow_set_allocated_options(message_arena, &options); + } options_ = options; if (options) { set_has_options(); @@ -5101,6 +6035,13 @@ inline void FileDescriptorProto::set_allocated_options(::google::protobuf::FileO } // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.options) } +inline ::google::protobuf::FileOptions* FileDescriptorProto::unsafe_arena_release_options() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.options) + clear_has_options(); + ::google::protobuf::FileOptions* temp = options_; + options_ = NULL; + return temp; +} // optional .google.protobuf.SourceCodeInfo source_code_info = 9; inline bool FileDescriptorProto::has_source_code_info() const { @@ -5125,7 +6066,7 @@ inline const ::google::protobuf::SourceCodeInfo& FileDescriptorProto::source_cod inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::mutable_source_code_info() { set_has_source_code_info(); if (source_code_info_ == NULL) { - source_code_info_ = new ::google::protobuf::SourceCodeInfo; + _slow_mutable_source_code_info(); } // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.source_code_info) return source_code_info_; @@ -5133,12 +6074,22 @@ inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::mutable_source_c inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::release_source_code_info() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.source_code_info) clear_has_source_code_info(); - ::google::protobuf::SourceCodeInfo* temp = source_code_info_; - source_code_info_ = NULL; - return temp; + if (GetArenaNoVirtual() != NULL) { + return _slow_release_source_code_info(); + } else { + ::google::protobuf::SourceCodeInfo* temp = source_code_info_; + source_code_info_ = NULL; + return temp; + } } -inline void FileDescriptorProto::set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info) { - delete source_code_info_; +inline void FileDescriptorProto::set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete source_code_info_; + } + if (source_code_info != NULL) { + _slow_set_allocated_source_code_info(message_arena, &source_code_info); + } source_code_info_ = source_code_info; if (source_code_info) { set_has_source_code_info(); @@ -5147,6 +6098,13 @@ inline void FileDescriptorProto::set_allocated_source_code_info(::google::protob } // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.source_code_info) } +inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::unsafe_arena_release_source_code_info() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.source_code_info) + clear_has_source_code_info(); + ::google::protobuf::SourceCodeInfo* temp = source_code_info_; + source_code_info_ = NULL; + return temp; +} // optional string syntax = 12; inline bool FileDescriptorProto::has_syntax() const { @@ -5159,47 +6117,56 @@ inline void FileDescriptorProto::clear_has_syntax() { _has_bits_[0] &= ~0x00000004u; } inline void FileDescriptorProto::clear_syntax() { - syntax_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + syntax_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_syntax(); } inline const ::std::string& FileDescriptorProto::syntax() const { // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.syntax) - return syntax_.GetNoArena(); + return syntax_.Get(); } inline void FileDescriptorProto::set_syntax(const ::std::string& value) { set_has_syntax(); - syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.syntax) } #if LANG_CXX11 inline void FileDescriptorProto::set_syntax(::std::string&& value) { set_has_syntax(); - syntax_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + syntax_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileDescriptorProto.syntax) } #endif inline void FileDescriptorProto::set_syntax(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_syntax(); - syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.syntax) } -inline void FileDescriptorProto::set_syntax(const char* value, size_t size) { +inline void FileDescriptorProto::set_syntax(const char* value, + size_t size) { set_has_syntax(); - syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.syntax) } inline ::std::string* FileDescriptorProto::mutable_syntax() { set_has_syntax(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.syntax) - return syntax_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return syntax_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileDescriptorProto::release_syntax() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.syntax) clear_has_syntax(); - return syntax_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return syntax_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileDescriptorProto::unsafe_arena_release_syntax() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.syntax) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_syntax(); + return syntax_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileDescriptorProto::set_allocated_syntax(::std::string* syntax) { if (syntax != NULL) { @@ -5207,9 +6174,22 @@ inline void FileDescriptorProto::set_allocated_syntax(::std::string* syntax) { } else { clear_has_syntax(); } - syntax_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), syntax); + syntax_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), syntax, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.syntax) } +inline void FileDescriptorProto::unsafe_arena_set_allocated_syntax( + ::std::string* syntax) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (syntax != NULL) { + set_has_syntax(); + } else { + clear_has_syntax(); + } + syntax_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + syntax, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.syntax) +} // ------------------------------------------------------------------- @@ -5286,7 +6266,7 @@ inline const ::google::protobuf::ExtensionRangeOptions& DescriptorProto_Extensio inline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::mutable_options() { set_has_options(); if (options_ == NULL) { - options_ = new ::google::protobuf::ExtensionRangeOptions; + _slow_mutable_options(); } // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.ExtensionRange.options) return options_; @@ -5294,12 +6274,22 @@ inline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange inline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.ExtensionRange.options) clear_has_options(); - ::google::protobuf::ExtensionRangeOptions* temp = options_; - options_ = NULL; - return temp; + if (GetArenaNoVirtual() != NULL) { + return _slow_release_options(); + } else { + ::google::protobuf::ExtensionRangeOptions* temp = options_; + options_ = NULL; + return temp; + } } -inline void DescriptorProto_ExtensionRange::set_allocated_options(::google::protobuf::ExtensionRangeOptions* options) { - delete options_; +inline void DescriptorProto_ExtensionRange::set_allocated_options(::google::protobuf::ExtensionRangeOptions* options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete options_; + } + if (options != NULL) { + _slow_set_allocated_options(message_arena, &options); + } options_ = options; if (options) { set_has_options(); @@ -5308,6 +6298,13 @@ inline void DescriptorProto_ExtensionRange::set_allocated_options(::google::prot } // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options) } +inline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::unsafe_arena_release_options() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.DescriptorProto.ExtensionRange.options) + clear_has_options(); + ::google::protobuf::ExtensionRangeOptions* temp = options_; + options_ = NULL; + return temp; +} // ------------------------------------------------------------------- @@ -5376,47 +6373,56 @@ inline void DescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void DescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_name(); } inline const ::std::string& DescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.name) - return name_.GetNoArena(); + return name_.Get(); } inline void DescriptorProto::set_name(const ::std::string& value) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.name) } #if LANG_CXX11 inline void DescriptorProto::set_name(::std::string&& value) { set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.DescriptorProto.name) } #endif inline void DescriptorProto::set_name(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.name) } -inline void DescriptorProto::set_name(const char* value, size_t size) { +inline void DescriptorProto::set_name(const char* value, + size_t size) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.name) } inline ::std::string* DescriptorProto::mutable_name() { set_has_name(); // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* DescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.name) clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* DescriptorProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.DescriptorProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_name(); + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void DescriptorProto::set_allocated_name(::std::string* name) { if (name != NULL) { @@ -5424,9 +6430,22 @@ inline void DescriptorProto::set_allocated_name(::std::string* name) { } else { clear_has_name(); } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.name) } +inline void DescriptorProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.name) +} // repeated .google.protobuf.FieldDescriptorProto field = 2; inline int DescriptorProto::field_size() const { @@ -5631,7 +6650,7 @@ inline const ::google::protobuf::MessageOptions& DescriptorProto::options() cons inline ::google::protobuf::MessageOptions* DescriptorProto::mutable_options() { set_has_options(); if (options_ == NULL) { - options_ = new ::google::protobuf::MessageOptions; + _slow_mutable_options(); } // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.options) return options_; @@ -5639,12 +6658,22 @@ inline ::google::protobuf::MessageOptions* DescriptorProto::mutable_options() { inline ::google::protobuf::MessageOptions* DescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.options) clear_has_options(); - ::google::protobuf::MessageOptions* temp = options_; - options_ = NULL; - return temp; + if (GetArenaNoVirtual() != NULL) { + return _slow_release_options(); + } else { + ::google::protobuf::MessageOptions* temp = options_; + options_ = NULL; + return temp; + } } -inline void DescriptorProto::set_allocated_options(::google::protobuf::MessageOptions* options) { - delete options_; +inline void DescriptorProto::set_allocated_options(::google::protobuf::MessageOptions* options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete options_; + } + if (options != NULL) { + _slow_set_allocated_options(message_arena, &options); + } options_ = options; if (options) { set_has_options(); @@ -5653,6 +6682,13 @@ inline void DescriptorProto::set_allocated_options(::google::protobuf::MessageOp } // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.options) } +inline ::google::protobuf::MessageOptions* DescriptorProto::unsafe_arena_release_options() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.DescriptorProto.options) + clear_has_options(); + ::google::protobuf::MessageOptions* temp = options_; + options_ = NULL; + return temp; +} // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; inline int DescriptorProto::reserved_range_size() const { @@ -5802,47 +6838,56 @@ inline void FieldDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void FieldDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_name(); } inline const ::std::string& FieldDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.name) - return name_.GetNoArena(); + return name_.Get(); } inline void FieldDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.name) } #if LANG_CXX11 inline void FieldDescriptorProto::set_name(::std::string&& value) { set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.name) } #endif inline void FieldDescriptorProto::set_name(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.name) } -inline void FieldDescriptorProto::set_name(const char* value, size_t size) { +inline void FieldDescriptorProto::set_name(const char* value, + size_t size) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.name) } inline ::std::string* FieldDescriptorProto::mutable_name() { set_has_name(); // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FieldDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.name) clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FieldDescriptorProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_name(); + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FieldDescriptorProto::set_allocated_name(::std::string* name) { if (name != NULL) { @@ -5850,9 +6895,22 @@ inline void FieldDescriptorProto::set_allocated_name(::std::string* name) { } else { clear_has_name(); } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.name) } +inline void FieldDescriptorProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.name) +} // optional int32 number = 3; inline bool FieldDescriptorProto::has_number() const { @@ -5939,47 +6997,56 @@ inline void FieldDescriptorProto::clear_has_type_name() { _has_bits_[0] &= ~0x00000004u; } inline void FieldDescriptorProto::clear_type_name() { - type_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_type_name(); } inline const ::std::string& FieldDescriptorProto::type_name() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type_name) - return type_name_.GetNoArena(); + return type_name_.Get(); } inline void FieldDescriptorProto::set_type_name(const ::std::string& value) { set_has_type_name(); - type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type_name) } #if LANG_CXX11 inline void FieldDescriptorProto::set_type_name(::std::string&& value) { set_has_type_name(); - type_name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + type_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.type_name) } #endif inline void FieldDescriptorProto::set_type_name(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_type_name(); - type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.type_name) } -inline void FieldDescriptorProto::set_type_name(const char* value, size_t size) { +inline void FieldDescriptorProto::set_type_name(const char* value, + size_t size) { set_has_type_name(); - type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.type_name) } inline ::std::string* FieldDescriptorProto::mutable_type_name() { set_has_type_name(); // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.type_name) - return type_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return type_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FieldDescriptorProto::release_type_name() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.type_name) clear_has_type_name(); - return type_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return type_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FieldDescriptorProto::unsafe_arena_release_type_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.type_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_type_name(); + return type_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FieldDescriptorProto::set_allocated_type_name(::std::string* type_name) { if (type_name != NULL) { @@ -5987,9 +7054,22 @@ inline void FieldDescriptorProto::set_allocated_type_name(::std::string* type_na } else { clear_has_type_name(); } - type_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_name); + type_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_name, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.type_name) } +inline void FieldDescriptorProto::unsafe_arena_set_allocated_type_name( + ::std::string* type_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type_name != NULL) { + set_has_type_name(); + } else { + clear_has_type_name(); + } + type_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.type_name) +} // optional string extendee = 2; inline bool FieldDescriptorProto::has_extendee() const { @@ -6002,47 +7082,56 @@ inline void FieldDescriptorProto::clear_has_extendee() { _has_bits_[0] &= ~0x00000002u; } inline void FieldDescriptorProto::clear_extendee() { - extendee_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + extendee_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_extendee(); } inline const ::std::string& FieldDescriptorProto::extendee() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.extendee) - return extendee_.GetNoArena(); + return extendee_.Get(); } inline void FieldDescriptorProto::set_extendee(const ::std::string& value) { set_has_extendee(); - extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.extendee) } #if LANG_CXX11 inline void FieldDescriptorProto::set_extendee(::std::string&& value) { set_has_extendee(); - extendee_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + extendee_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.extendee) } #endif inline void FieldDescriptorProto::set_extendee(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_extendee(); - extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.extendee) } -inline void FieldDescriptorProto::set_extendee(const char* value, size_t size) { +inline void FieldDescriptorProto::set_extendee(const char* value, + size_t size) { set_has_extendee(); - extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.extendee) } inline ::std::string* FieldDescriptorProto::mutable_extendee() { set_has_extendee(); // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.extendee) - return extendee_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return extendee_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FieldDescriptorProto::release_extendee() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.extendee) clear_has_extendee(); - return extendee_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return extendee_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FieldDescriptorProto::unsafe_arena_release_extendee() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.extendee) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_extendee(); + return extendee_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee) { if (extendee != NULL) { @@ -6050,9 +7139,22 @@ inline void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee } else { clear_has_extendee(); } - extendee_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), extendee); + extendee_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), extendee, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.extendee) } +inline void FieldDescriptorProto::unsafe_arena_set_allocated_extendee( + ::std::string* extendee) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (extendee != NULL) { + set_has_extendee(); + } else { + clear_has_extendee(); + } + extendee_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + extendee, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.extendee) +} // optional string default_value = 7; inline bool FieldDescriptorProto::has_default_value() const { @@ -6065,47 +7167,56 @@ inline void FieldDescriptorProto::clear_has_default_value() { _has_bits_[0] &= ~0x00000008u; } inline void FieldDescriptorProto::clear_default_value() { - default_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_default_value(); } inline const ::std::string& FieldDescriptorProto::default_value() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.default_value) - return default_value_.GetNoArena(); + return default_value_.Get(); } inline void FieldDescriptorProto::set_default_value(const ::std::string& value) { set_has_default_value(); - default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.default_value) } #if LANG_CXX11 inline void FieldDescriptorProto::set_default_value(::std::string&& value) { set_has_default_value(); - default_value_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + default_value_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.default_value) } #endif inline void FieldDescriptorProto::set_default_value(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_default_value(); - default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.default_value) } -inline void FieldDescriptorProto::set_default_value(const char* value, size_t size) { +inline void FieldDescriptorProto::set_default_value(const char* value, + size_t size) { set_has_default_value(); - default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.default_value) } inline ::std::string* FieldDescriptorProto::mutable_default_value() { set_has_default_value(); // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.default_value) - return default_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return default_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FieldDescriptorProto::release_default_value() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.default_value) clear_has_default_value(); - return default_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return default_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FieldDescriptorProto::unsafe_arena_release_default_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.default_value) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_default_value(); + return default_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FieldDescriptorProto::set_allocated_default_value(::std::string* default_value) { if (default_value != NULL) { @@ -6113,9 +7224,22 @@ inline void FieldDescriptorProto::set_allocated_default_value(::std::string* def } else { clear_has_default_value(); } - default_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value); + default_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.default_value) } +inline void FieldDescriptorProto::unsafe_arena_set_allocated_default_value( + ::std::string* default_value) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (default_value != NULL) { + set_has_default_value(); + } else { + clear_has_default_value(); + } + default_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + default_value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.default_value) +} // optional int32 oneof_index = 9; inline bool FieldDescriptorProto::has_oneof_index() const { @@ -6152,47 +7276,56 @@ inline void FieldDescriptorProto::clear_has_json_name() { _has_bits_[0] &= ~0x00000010u; } inline void FieldDescriptorProto::clear_json_name() { - json_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_json_name(); } inline const ::std::string& FieldDescriptorProto::json_name() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.json_name) - return json_name_.GetNoArena(); + return json_name_.Get(); } inline void FieldDescriptorProto::set_json_name(const ::std::string& value) { set_has_json_name(); - json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.json_name) } #if LANG_CXX11 inline void FieldDescriptorProto::set_json_name(::std::string&& value) { set_has_json_name(); - json_name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + json_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.json_name) } #endif inline void FieldDescriptorProto::set_json_name(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_json_name(); - json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.json_name) } -inline void FieldDescriptorProto::set_json_name(const char* value, size_t size) { +inline void FieldDescriptorProto::set_json_name(const char* value, + size_t size) { set_has_json_name(); - json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.json_name) } inline ::std::string* FieldDescriptorProto::mutable_json_name() { set_has_json_name(); // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.json_name) - return json_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return json_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FieldDescriptorProto::release_json_name() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.json_name) clear_has_json_name(); - return json_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return json_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FieldDescriptorProto::unsafe_arena_release_json_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.json_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_json_name(); + return json_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FieldDescriptorProto::set_allocated_json_name(::std::string* json_name) { if (json_name != NULL) { @@ -6200,9 +7333,22 @@ inline void FieldDescriptorProto::set_allocated_json_name(::std::string* json_na } else { clear_has_json_name(); } - json_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name); + json_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.json_name) } +inline void FieldDescriptorProto::unsafe_arena_set_allocated_json_name( + ::std::string* json_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (json_name != NULL) { + set_has_json_name(); + } else { + clear_has_json_name(); + } + json_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + json_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.json_name) +} // optional .google.protobuf.FieldOptions options = 8; inline bool FieldDescriptorProto::has_options() const { @@ -6227,7 +7373,7 @@ inline const ::google::protobuf::FieldOptions& FieldDescriptorProto::options() c inline ::google::protobuf::FieldOptions* FieldDescriptorProto::mutable_options() { set_has_options(); if (options_ == NULL) { - options_ = new ::google::protobuf::FieldOptions; + _slow_mutable_options(); } // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.options) return options_; @@ -6235,12 +7381,22 @@ inline ::google::protobuf::FieldOptions* FieldDescriptorProto::mutable_options() inline ::google::protobuf::FieldOptions* FieldDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.options) clear_has_options(); - ::google::protobuf::FieldOptions* temp = options_; - options_ = NULL; - return temp; + if (GetArenaNoVirtual() != NULL) { + return _slow_release_options(); + } else { + ::google::protobuf::FieldOptions* temp = options_; + options_ = NULL; + return temp; + } } -inline void FieldDescriptorProto::set_allocated_options(::google::protobuf::FieldOptions* options) { - delete options_; +inline void FieldDescriptorProto::set_allocated_options(::google::protobuf::FieldOptions* options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete options_; + } + if (options != NULL) { + _slow_set_allocated_options(message_arena, &options); + } options_ = options; if (options) { set_has_options(); @@ -6249,6 +7405,13 @@ inline void FieldDescriptorProto::set_allocated_options(::google::protobuf::Fiel } // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.options) } +inline ::google::protobuf::FieldOptions* FieldDescriptorProto::unsafe_arena_release_options() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.options) + clear_has_options(); + ::google::protobuf::FieldOptions* temp = options_; + options_ = NULL; + return temp; +} // ------------------------------------------------------------------- @@ -6265,47 +7428,56 @@ inline void OneofDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void OneofDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_name(); } inline const ::std::string& OneofDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.name) - return name_.GetNoArena(); + return name_.Get(); } inline void OneofDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.OneofDescriptorProto.name) } #if LANG_CXX11 inline void OneofDescriptorProto::set_name(::std::string&& value) { set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.OneofDescriptorProto.name) } #endif inline void OneofDescriptorProto::set_name(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.OneofDescriptorProto.name) } -inline void OneofDescriptorProto::set_name(const char* value, size_t size) { +inline void OneofDescriptorProto::set_name(const char* value, + size_t size) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.OneofDescriptorProto.name) } inline ::std::string* OneofDescriptorProto::mutable_name() { set_has_name(); // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* OneofDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.name) clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OneofDescriptorProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.OneofDescriptorProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_name(); + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void OneofDescriptorProto::set_allocated_name(::std::string* name) { if (name != NULL) { @@ -6313,9 +7485,22 @@ inline void OneofDescriptorProto::set_allocated_name(::std::string* name) { } else { clear_has_name(); } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.name) } +inline void OneofDescriptorProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.OneofDescriptorProto.name) +} // optional .google.protobuf.OneofOptions options = 2; inline bool OneofDescriptorProto::has_options() const { @@ -6340,7 +7525,7 @@ inline const ::google::protobuf::OneofOptions& OneofDescriptorProto::options() c inline ::google::protobuf::OneofOptions* OneofDescriptorProto::mutable_options() { set_has_options(); if (options_ == NULL) { - options_ = new ::google::protobuf::OneofOptions; + _slow_mutable_options(); } // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.options) return options_; @@ -6348,12 +7533,22 @@ inline ::google::protobuf::OneofOptions* OneofDescriptorProto::mutable_options() inline ::google::protobuf::OneofOptions* OneofDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.options) clear_has_options(); - ::google::protobuf::OneofOptions* temp = options_; - options_ = NULL; - return temp; + if (GetArenaNoVirtual() != NULL) { + return _slow_release_options(); + } else { + ::google::protobuf::OneofOptions* temp = options_; + options_ = NULL; + return temp; + } } -inline void OneofDescriptorProto::set_allocated_options(::google::protobuf::OneofOptions* options) { - delete options_; +inline void OneofDescriptorProto::set_allocated_options(::google::protobuf::OneofOptions* options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete options_; + } + if (options != NULL) { + _slow_set_allocated_options(message_arena, &options); + } options_ = options; if (options) { set_has_options(); @@ -6362,6 +7557,65 @@ inline void OneofDescriptorProto::set_allocated_options(::google::protobuf::Oneo } // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.options) } +inline ::google::protobuf::OneofOptions* OneofDescriptorProto::unsafe_arena_release_options() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.OneofDescriptorProto.options) + clear_has_options(); + ::google::protobuf::OneofOptions* temp = options_; + options_ = NULL; + return temp; +} + +// ------------------------------------------------------------------- + +// EnumDescriptorProto_EnumReservedRange + +// optional int32 start = 1; +inline bool EnumDescriptorProto_EnumReservedRange::has_start() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void EnumDescriptorProto_EnumReservedRange::set_has_start() { + _has_bits_[0] |= 0x00000001u; +} +inline void EnumDescriptorProto_EnumReservedRange::clear_has_start() { + _has_bits_[0] &= ~0x00000001u; +} +inline void EnumDescriptorProto_EnumReservedRange::clear_start() { + start_ = 0; + clear_has_start(); +} +inline ::google::protobuf::int32 EnumDescriptorProto_EnumReservedRange::start() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.EnumReservedRange.start) + return start_; +} +inline void EnumDescriptorProto_EnumReservedRange::set_start(::google::protobuf::int32 value) { + set_has_start(); + start_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.EnumReservedRange.start) +} + +// optional int32 end = 2; +inline bool EnumDescriptorProto_EnumReservedRange::has_end() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void EnumDescriptorProto_EnumReservedRange::set_has_end() { + _has_bits_[0] |= 0x00000002u; +} +inline void EnumDescriptorProto_EnumReservedRange::clear_has_end() { + _has_bits_[0] &= ~0x00000002u; +} +inline void EnumDescriptorProto_EnumReservedRange::clear_end() { + end_ = 0; + clear_has_end(); +} +inline ::google::protobuf::int32 EnumDescriptorProto_EnumReservedRange::end() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.EnumReservedRange.end) + return end_; +} +inline void EnumDescriptorProto_EnumReservedRange::set_end(::google::protobuf::int32 value) { + set_has_end(); + end_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.EnumReservedRange.end) +} // ------------------------------------------------------------------- @@ -6378,47 +7632,56 @@ inline void EnumDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void EnumDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_name(); } inline const ::std::string& EnumDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.name) - return name_.GetNoArena(); + return name_.Get(); } inline void EnumDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.name) } #if LANG_CXX11 inline void EnumDescriptorProto::set_name(::std::string&& value) { set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.EnumDescriptorProto.name) } #endif inline void EnumDescriptorProto::set_name(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.EnumDescriptorProto.name) } -inline void EnumDescriptorProto::set_name(const char* value, size_t size) { +inline void EnumDescriptorProto::set_name(const char* value, + size_t size) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumDescriptorProto.name) } inline ::std::string* EnumDescriptorProto::mutable_name() { set_has_name(); // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* EnumDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.name) clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* EnumDescriptorProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumDescriptorProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_name(); + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void EnumDescriptorProto::set_allocated_name(::std::string* name) { if (name != NULL) { @@ -6426,9 +7689,22 @@ inline void EnumDescriptorProto::set_allocated_name(::std::string* name) { } else { clear_has_name(); } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.name) } +inline void EnumDescriptorProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumDescriptorProto.name) +} // repeated .google.protobuf.EnumValueDescriptorProto value = 2; inline int EnumDescriptorProto::value_size() const { @@ -6483,7 +7759,7 @@ inline const ::google::protobuf::EnumOptions& EnumDescriptorProto::options() con inline ::google::protobuf::EnumOptions* EnumDescriptorProto::mutable_options() { set_has_options(); if (options_ == NULL) { - options_ = new ::google::protobuf::EnumOptions; + _slow_mutable_options(); } // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.options) return options_; @@ -6491,12 +7767,22 @@ inline ::google::protobuf::EnumOptions* EnumDescriptorProto::mutable_options() { inline ::google::protobuf::EnumOptions* EnumDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.options) clear_has_options(); - ::google::protobuf::EnumOptions* temp = options_; - options_ = NULL; - return temp; + if (GetArenaNoVirtual() != NULL) { + return _slow_release_options(); + } else { + ::google::protobuf::EnumOptions* temp = options_; + options_ = NULL; + return temp; + } } -inline void EnumDescriptorProto::set_allocated_options(::google::protobuf::EnumOptions* options) { - delete options_; +inline void EnumDescriptorProto::set_allocated_options(::google::protobuf::EnumOptions* options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete options_; + } + if (options != NULL) { + _slow_set_allocated_options(message_arena, &options); + } options_ = options; if (options) { set_has_options(); @@ -6505,14 +7791,120 @@ inline void EnumDescriptorProto::set_allocated_options(::google::protobuf::EnumO } // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.options) } - -// ------------------------------------------------------------------- - -// EnumValueDescriptorProto - -// optional string name = 1; -inline bool EnumValueDescriptorProto::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; +inline ::google::protobuf::EnumOptions* EnumDescriptorProto::unsafe_arena_release_options() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumDescriptorProto.options) + clear_has_options(); + ::google::protobuf::EnumOptions* temp = options_; + options_ = NULL; + return temp; +} + +// repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; +inline int EnumDescriptorProto::reserved_range_size() const { + return reserved_range_.size(); +} +inline void EnumDescriptorProto::clear_reserved_range() { + reserved_range_.Clear(); +} +inline const ::google::protobuf::EnumDescriptorProto_EnumReservedRange& EnumDescriptorProto::reserved_range(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.reserved_range) + return reserved_range_.Get(index); +} +inline ::google::protobuf::EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto::mutable_reserved_range(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.reserved_range) + return reserved_range_.Mutable(index); +} +inline ::google::protobuf::EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto::add_reserved_range() { + // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.reserved_range) + return reserved_range_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange >* +EnumDescriptorProto::mutable_reserved_range() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.reserved_range) + return &reserved_range_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange >& +EnumDescriptorProto::reserved_range() const { + // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.reserved_range) + return reserved_range_; +} + +// repeated string reserved_name = 5; +inline int EnumDescriptorProto::reserved_name_size() const { + return reserved_name_.size(); +} +inline void EnumDescriptorProto::clear_reserved_name() { + reserved_name_.Clear(); +} +inline const ::std::string& EnumDescriptorProto::reserved_name(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.reserved_name) + return reserved_name_.Get(index); +} +inline ::std::string* EnumDescriptorProto::mutable_reserved_name(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.reserved_name) + return reserved_name_.Mutable(index); +} +inline void EnumDescriptorProto::set_reserved_name(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.reserved_name) + reserved_name_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void EnumDescriptorProto::set_reserved_name(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.reserved_name) + reserved_name_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void EnumDescriptorProto::set_reserved_name(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + 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( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumDescriptorProto.reserved_name) +} +inline ::std::string* EnumDescriptorProto::add_reserved_name() { + // @@protoc_insertion_point(field_add_mutable:google.protobuf.EnumDescriptorProto.reserved_name) + return reserved_name_.Add(); +} +inline void EnumDescriptorProto::add_reserved_name(const ::std::string& value) { + reserved_name_.Add()->assign(value); + // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.reserved_name) +} +#if LANG_CXX11 +inline void EnumDescriptorProto::add_reserved_name(::std::string&& value) { + reserved_name_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.reserved_name) +} +#endif +inline void EnumDescriptorProto::add_reserved_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + 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); + // @@protoc_insertion_point(field_add_pointer:google.protobuf.EnumDescriptorProto.reserved_name) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +EnumDescriptorProto::reserved_name() const { + // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.reserved_name) + return reserved_name_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +EnumDescriptorProto::mutable_reserved_name() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.reserved_name) + return &reserved_name_; +} + +// ------------------------------------------------------------------- + +// EnumValueDescriptorProto + +// optional string name = 1; +inline bool EnumValueDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; } inline void EnumValueDescriptorProto::set_has_name() { _has_bits_[0] |= 0x00000001u; @@ -6521,47 +7913,56 @@ inline void EnumValueDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void EnumValueDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_name(); } inline const ::std::string& EnumValueDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.name) - return name_.GetNoArena(); + return name_.Get(); } inline void EnumValueDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.name) } #if LANG_CXX11 inline void EnumValueDescriptorProto::set_name(::std::string&& value) { set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.EnumValueDescriptorProto.name) } #endif inline void EnumValueDescriptorProto::set_name(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.EnumValueDescriptorProto.name) } -inline void EnumValueDescriptorProto::set_name(const char* value, size_t size) { +inline void EnumValueDescriptorProto::set_name(const char* value, + size_t size) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumValueDescriptorProto.name) } inline ::std::string* EnumValueDescriptorProto::mutable_name() { set_has_name(); // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* EnumValueDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.name) clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* EnumValueDescriptorProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValueDescriptorProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_name(); + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void EnumValueDescriptorProto::set_allocated_name(::std::string* name) { if (name != NULL) { @@ -6569,9 +7970,22 @@ inline void EnumValueDescriptorProto::set_allocated_name(::std::string* name) { } else { clear_has_name(); } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.name) } +inline void EnumValueDescriptorProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValueDescriptorProto.name) +} // optional int32 number = 2; inline bool EnumValueDescriptorProto::has_number() const { @@ -6620,7 +8034,7 @@ inline const ::google::protobuf::EnumValueOptions& EnumValueDescriptorProto::opt inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::mutable_options() { set_has_options(); if (options_ == NULL) { - options_ = new ::google::protobuf::EnumValueOptions; + _slow_mutable_options(); } // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.options) return options_; @@ -6628,12 +8042,22 @@ inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::mutable_o inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.options) clear_has_options(); - ::google::protobuf::EnumValueOptions* temp = options_; - options_ = NULL; - return temp; + if (GetArenaNoVirtual() != NULL) { + return _slow_release_options(); + } else { + ::google::protobuf::EnumValueOptions* temp = options_; + options_ = NULL; + return temp; + } } -inline void EnumValueDescriptorProto::set_allocated_options(::google::protobuf::EnumValueOptions* options) { - delete options_; +inline void EnumValueDescriptorProto::set_allocated_options(::google::protobuf::EnumValueOptions* options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete options_; + } + if (options != NULL) { + _slow_set_allocated_options(message_arena, &options); + } options_ = options; if (options) { set_has_options(); @@ -6642,6 +8066,13 @@ inline void EnumValueDescriptorProto::set_allocated_options(::google::protobuf:: } // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.options) } +inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::unsafe_arena_release_options() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValueDescriptorProto.options) + clear_has_options(); + ::google::protobuf::EnumValueOptions* temp = options_; + options_ = NULL; + return temp; +} // ------------------------------------------------------------------- @@ -6658,47 +8089,56 @@ inline void ServiceDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void ServiceDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_name(); } inline const ::std::string& ServiceDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.name) - return name_.GetNoArena(); + return name_.Get(); } inline void ServiceDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.ServiceDescriptorProto.name) } #if LANG_CXX11 inline void ServiceDescriptorProto::set_name(::std::string&& value) { set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.ServiceDescriptorProto.name) } #endif inline void ServiceDescriptorProto::set_name(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.ServiceDescriptorProto.name) } -inline void ServiceDescriptorProto::set_name(const char* value, size_t size) { +inline void ServiceDescriptorProto::set_name(const char* value, + size_t size) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.ServiceDescriptorProto.name) } inline ::std::string* ServiceDescriptorProto::mutable_name() { set_has_name(); // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* ServiceDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.name) clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ServiceDescriptorProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.ServiceDescriptorProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_name(); + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void ServiceDescriptorProto::set_allocated_name(::std::string* name) { if (name != NULL) { @@ -6706,9 +8146,22 @@ inline void ServiceDescriptorProto::set_allocated_name(::std::string* name) { } else { clear_has_name(); } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.name) } +inline void ServiceDescriptorProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.ServiceDescriptorProto.name) +} // repeated .google.protobuf.MethodDescriptorProto method = 2; inline int ServiceDescriptorProto::method_size() const { @@ -6763,7 +8216,7 @@ inline const ::google::protobuf::ServiceOptions& ServiceDescriptorProto::options inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::mutable_options() { set_has_options(); if (options_ == NULL) { - options_ = new ::google::protobuf::ServiceOptions; + _slow_mutable_options(); } // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.options) return options_; @@ -6771,12 +8224,22 @@ inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::mutable_optio inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.options) clear_has_options(); - ::google::protobuf::ServiceOptions* temp = options_; - options_ = NULL; - return temp; + if (GetArenaNoVirtual() != NULL) { + return _slow_release_options(); + } else { + ::google::protobuf::ServiceOptions* temp = options_; + options_ = NULL; + return temp; + } } -inline void ServiceDescriptorProto::set_allocated_options(::google::protobuf::ServiceOptions* options) { - delete options_; +inline void ServiceDescriptorProto::set_allocated_options(::google::protobuf::ServiceOptions* options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete options_; + } + if (options != NULL) { + _slow_set_allocated_options(message_arena, &options); + } options_ = options; if (options) { set_has_options(); @@ -6785,6 +8248,13 @@ inline void ServiceDescriptorProto::set_allocated_options(::google::protobuf::Se } // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.options) } +inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::unsafe_arena_release_options() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.ServiceDescriptorProto.options) + clear_has_options(); + ::google::protobuf::ServiceOptions* temp = options_; + options_ = NULL; + return temp; +} // ------------------------------------------------------------------- @@ -6801,47 +8271,56 @@ inline void MethodDescriptorProto::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void MethodDescriptorProto::clear_name() { - name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_name(); } inline const ::std::string& MethodDescriptorProto::name() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.name) - return name_.GetNoArena(); + return name_.Get(); } inline void MethodDescriptorProto::set_name(const ::std::string& value) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.name) } #if LANG_CXX11 inline void MethodDescriptorProto::set_name(::std::string&& value) { set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.MethodDescriptorProto.name) } #endif inline void MethodDescriptorProto::set_name(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.name) } -inline void MethodDescriptorProto::set_name(const char* value, size_t size) { +inline void MethodDescriptorProto::set_name(const char* value, + size_t size) { set_has_name(); - name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.name) } inline ::std::string* MethodDescriptorProto::mutable_name() { set_has_name(); // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.name) - return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* MethodDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.name) clear_has_name(); - return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MethodDescriptorProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_name(); + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void MethodDescriptorProto::set_allocated_name(::std::string* name) { if (name != NULL) { @@ -6849,9 +8328,22 @@ inline void MethodDescriptorProto::set_allocated_name(::std::string* name) { } else { clear_has_name(); } - name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.name) } +inline void MethodDescriptorProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.name) +} // optional string input_type = 2; inline bool MethodDescriptorProto::has_input_type() const { @@ -6864,47 +8356,56 @@ inline void MethodDescriptorProto::clear_has_input_type() { _has_bits_[0] &= ~0x00000002u; } inline void MethodDescriptorProto::clear_input_type() { - input_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + input_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_input_type(); } inline const ::std::string& MethodDescriptorProto::input_type() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.input_type) - return input_type_.GetNoArena(); + return input_type_.Get(); } inline void MethodDescriptorProto::set_input_type(const ::std::string& value) { set_has_input_type(); - input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + input_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.input_type) } #if LANG_CXX11 inline void MethodDescriptorProto::set_input_type(::std::string&& value) { set_has_input_type(); - input_type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + input_type_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.MethodDescriptorProto.input_type) } #endif inline void MethodDescriptorProto::set_input_type(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_input_type(); - input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + input_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.input_type) } -inline void MethodDescriptorProto::set_input_type(const char* value, size_t size) { +inline void MethodDescriptorProto::set_input_type(const char* value, + size_t size) { set_has_input_type(); - input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + input_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.input_type) } inline ::std::string* MethodDescriptorProto::mutable_input_type() { set_has_input_type(); // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.input_type) - return input_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return input_type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* MethodDescriptorProto::release_input_type() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.input_type) clear_has_input_type(); - return input_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return input_type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MethodDescriptorProto::unsafe_arena_release_input_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.input_type) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_input_type(); + return input_type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void MethodDescriptorProto::set_allocated_input_type(::std::string* input_type) { if (input_type != NULL) { @@ -6912,9 +8413,22 @@ inline void MethodDescriptorProto::set_allocated_input_type(::std::string* input } else { clear_has_input_type(); } - input_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), input_type); + input_type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), input_type, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.input_type) } +inline void MethodDescriptorProto::unsafe_arena_set_allocated_input_type( + ::std::string* input_type) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (input_type != NULL) { + set_has_input_type(); + } else { + clear_has_input_type(); + } + input_type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + input_type, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.input_type) +} // optional string output_type = 3; inline bool MethodDescriptorProto::has_output_type() const { @@ -6927,47 +8441,56 @@ inline void MethodDescriptorProto::clear_has_output_type() { _has_bits_[0] &= ~0x00000004u; } inline void MethodDescriptorProto::clear_output_type() { - output_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_output_type(); } inline const ::std::string& MethodDescriptorProto::output_type() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.output_type) - return output_type_.GetNoArena(); + return output_type_.Get(); } inline void MethodDescriptorProto::set_output_type(const ::std::string& value) { set_has_output_type(); - output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + output_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.output_type) } #if LANG_CXX11 inline void MethodDescriptorProto::set_output_type(::std::string&& value) { set_has_output_type(); - output_type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + output_type_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.MethodDescriptorProto.output_type) } #endif inline void MethodDescriptorProto::set_output_type(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_output_type(); - output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + output_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.output_type) } -inline void MethodDescriptorProto::set_output_type(const char* value, size_t size) { +inline void MethodDescriptorProto::set_output_type(const char* value, + size_t size) { set_has_output_type(); - output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + output_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.output_type) } inline ::std::string* MethodDescriptorProto::mutable_output_type() { set_has_output_type(); // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.output_type) - return output_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return output_type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* MethodDescriptorProto::release_output_type() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.output_type) clear_has_output_type(); - return output_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return output_type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MethodDescriptorProto::unsafe_arena_release_output_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.output_type) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_output_type(); + return output_type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void MethodDescriptorProto::set_allocated_output_type(::std::string* output_type) { if (output_type != NULL) { @@ -6975,9 +8498,22 @@ inline void MethodDescriptorProto::set_allocated_output_type(::std::string* outp } else { clear_has_output_type(); } - output_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_type); + output_type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_type, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.output_type) } +inline void MethodDescriptorProto::unsafe_arena_set_allocated_output_type( + ::std::string* output_type) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (output_type != NULL) { + set_has_output_type(); + } else { + clear_has_output_type(); + } + output_type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + output_type, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.output_type) +} // optional .google.protobuf.MethodOptions options = 4; inline bool MethodDescriptorProto::has_options() const { @@ -7002,7 +8538,7 @@ inline const ::google::protobuf::MethodOptions& MethodDescriptorProto::options() inline ::google::protobuf::MethodOptions* MethodDescriptorProto::mutable_options() { set_has_options(); if (options_ == NULL) { - options_ = new ::google::protobuf::MethodOptions; + _slow_mutable_options(); } // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.options) return options_; @@ -7010,12 +8546,22 @@ inline ::google::protobuf::MethodOptions* MethodDescriptorProto::mutable_options inline ::google::protobuf::MethodOptions* MethodDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.options) clear_has_options(); - ::google::protobuf::MethodOptions* temp = options_; - options_ = NULL; - return temp; + if (GetArenaNoVirtual() != NULL) { + return _slow_release_options(); + } else { + ::google::protobuf::MethodOptions* temp = options_; + options_ = NULL; + return temp; + } } -inline void MethodDescriptorProto::set_allocated_options(::google::protobuf::MethodOptions* options) { - delete options_; +inline void MethodDescriptorProto::set_allocated_options(::google::protobuf::MethodOptions* options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete options_; + } + if (options != NULL) { + _slow_set_allocated_options(message_arena, &options); + } options_ = options; if (options) { set_has_options(); @@ -7024,6 +8570,13 @@ inline void MethodDescriptorProto::set_allocated_options(::google::protobuf::Met } // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.options) } +inline ::google::protobuf::MethodOptions* MethodDescriptorProto::unsafe_arena_release_options() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.options) + clear_has_options(); + ::google::protobuf::MethodOptions* temp = options_; + options_ = NULL; + return temp; +} // optional bool client_streaming = 5 [default = false]; inline bool MethodDescriptorProto::has_client_streaming() const { @@ -7088,47 +8641,56 @@ inline void FileOptions::clear_has_java_package() { _has_bits_[0] &= ~0x00000001u; } inline void FileOptions::clear_java_package() { - java_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + java_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_java_package(); } inline const ::std::string& FileOptions::java_package() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_package) - return java_package_.GetNoArena(); + return java_package_.Get(); } inline void FileOptions::set_java_package(const ::std::string& value) { set_has_java_package(); - java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + java_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_package) } #if LANG_CXX11 inline void FileOptions::set_java_package(::std::string&& value) { set_has_java_package(); - java_package_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + java_package_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.java_package) } #endif inline void FileOptions::set_java_package(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_java_package(); - java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + java_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.java_package) } -inline void FileOptions::set_java_package(const char* value, size_t size) { +inline void FileOptions::set_java_package(const char* value, + size_t size) { set_has_java_package(); - java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + java_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.java_package) } inline ::std::string* FileOptions::mutable_java_package() { set_has_java_package(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_package) - return java_package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return java_package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileOptions::release_java_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_package) clear_has_java_package(); - return java_package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return java_package_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileOptions::unsafe_arena_release_java_package() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.java_package) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_java_package(); + return java_package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileOptions::set_allocated_java_package(::std::string* java_package) { if (java_package != NULL) { @@ -7136,9 +8698,22 @@ inline void FileOptions::set_allocated_java_package(::std::string* java_package) } else { clear_has_java_package(); } - java_package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_package); + java_package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_package, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_package) } +inline void FileOptions::unsafe_arena_set_allocated_java_package( + ::std::string* java_package) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (java_package != NULL) { + set_has_java_package(); + } else { + clear_has_java_package(); + } + java_package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + java_package, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.java_package) +} // optional string java_outer_classname = 8; inline bool FileOptions::has_java_outer_classname() const { @@ -7151,47 +8726,56 @@ inline void FileOptions::clear_has_java_outer_classname() { _has_bits_[0] &= ~0x00000002u; } inline void FileOptions::clear_java_outer_classname() { - java_outer_classname_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + java_outer_classname_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_java_outer_classname(); } inline const ::std::string& FileOptions::java_outer_classname() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_outer_classname) - return java_outer_classname_.GetNoArena(); + return java_outer_classname_.Get(); } inline void FileOptions::set_java_outer_classname(const ::std::string& value) { set_has_java_outer_classname(); - java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + java_outer_classname_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_outer_classname) } #if LANG_CXX11 inline void FileOptions::set_java_outer_classname(::std::string&& value) { set_has_java_outer_classname(); - java_outer_classname_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + java_outer_classname_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.java_outer_classname) } #endif inline void FileOptions::set_java_outer_classname(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_java_outer_classname(); - java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + java_outer_classname_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.java_outer_classname) } -inline void FileOptions::set_java_outer_classname(const char* value, size_t size) { +inline void FileOptions::set_java_outer_classname(const char* value, + size_t size) { set_has_java_outer_classname(); - java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + java_outer_classname_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.java_outer_classname) } inline ::std::string* FileOptions::mutable_java_outer_classname() { set_has_java_outer_classname(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_outer_classname) - return java_outer_classname_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return java_outer_classname_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileOptions::release_java_outer_classname() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_outer_classname) clear_has_java_outer_classname(); - return java_outer_classname_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return java_outer_classname_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileOptions::unsafe_arena_release_java_outer_classname() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.java_outer_classname) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_java_outer_classname(); + return java_outer_classname_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileOptions::set_allocated_java_outer_classname(::std::string* java_outer_classname) { if (java_outer_classname != NULL) { @@ -7199,19 +8783,32 @@ inline void FileOptions::set_allocated_java_outer_classname(::std::string* java_ } else { clear_has_java_outer_classname(); } - java_outer_classname_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_outer_classname); + java_outer_classname_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_outer_classname, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_outer_classname) } +inline void FileOptions::unsafe_arena_set_allocated_java_outer_classname( + ::std::string* java_outer_classname) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (java_outer_classname != NULL) { + set_has_java_outer_classname(); + } else { + clear_has_java_outer_classname(); + } + java_outer_classname_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + java_outer_classname, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.java_outer_classname) +} // optional bool java_multiple_files = 10 [default = false]; inline bool FileOptions::has_java_multiple_files() const { - return (_has_bits_[0] & 0x00000100u) != 0; + return (_has_bits_[0] & 0x00000200u) != 0; } inline void FileOptions::set_has_java_multiple_files() { - _has_bits_[0] |= 0x00000100u; + _has_bits_[0] |= 0x00000200u; } inline void FileOptions::clear_has_java_multiple_files() { - _has_bits_[0] &= ~0x00000100u; + _has_bits_[0] &= ~0x00000200u; } inline void FileOptions::clear_java_multiple_files() { java_multiple_files_ = false; @@ -7229,13 +8826,13 @@ inline void FileOptions::set_java_multiple_files(bool value) { // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; inline bool FileOptions::has_java_generate_equals_and_hash() const { - return (_has_bits_[0] & 0x00000200u) != 0; + return (_has_bits_[0] & 0x00000400u) != 0; } inline void FileOptions::set_has_java_generate_equals_and_hash() { - _has_bits_[0] |= 0x00000200u; + _has_bits_[0] |= 0x00000400u; } inline void FileOptions::clear_has_java_generate_equals_and_hash() { - _has_bits_[0] &= ~0x00000200u; + _has_bits_[0] &= ~0x00000400u; } inline void FileOptions::clear_java_generate_equals_and_hash() { java_generate_equals_and_hash_ = false; @@ -7253,13 +8850,13 @@ inline void FileOptions::set_java_generate_equals_and_hash(bool value) { // optional bool java_string_check_utf8 = 27 [default = false]; inline bool FileOptions::has_java_string_check_utf8() const { - return (_has_bits_[0] & 0x00000400u) != 0; + return (_has_bits_[0] & 0x00000800u) != 0; } inline void FileOptions::set_has_java_string_check_utf8() { - _has_bits_[0] |= 0x00000400u; + _has_bits_[0] |= 0x00000800u; } inline void FileOptions::clear_has_java_string_check_utf8() { - _has_bits_[0] &= ~0x00000400u; + _has_bits_[0] &= ~0x00000800u; } inline void FileOptions::clear_java_string_check_utf8() { java_string_check_utf8_ = false; @@ -7311,47 +8908,56 @@ inline void FileOptions::clear_has_go_package() { _has_bits_[0] &= ~0x00000004u; } inline void FileOptions::clear_go_package() { - go_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + go_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_go_package(); } inline const ::std::string& FileOptions::go_package() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.go_package) - return go_package_.GetNoArena(); + return go_package_.Get(); } inline void FileOptions::set_go_package(const ::std::string& value) { set_has_go_package(); - go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + go_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.go_package) } #if LANG_CXX11 inline void FileOptions::set_go_package(::std::string&& value) { set_has_go_package(); - go_package_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + go_package_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.go_package) } #endif inline void FileOptions::set_go_package(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_go_package(); - go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + go_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.go_package) } -inline void FileOptions::set_go_package(const char* value, size_t size) { +inline void FileOptions::set_go_package(const char* value, + size_t size) { set_has_go_package(); - go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + go_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.go_package) } inline ::std::string* FileOptions::mutable_go_package() { set_has_go_package(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.go_package) - return go_package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return go_package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileOptions::release_go_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.go_package) clear_has_go_package(); - return go_package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return go_package_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileOptions::unsafe_arena_release_go_package() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.go_package) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_go_package(); + return go_package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileOptions::set_allocated_go_package(::std::string* go_package) { if (go_package != NULL) { @@ -7359,19 +8965,32 @@ inline void FileOptions::set_allocated_go_package(::std::string* go_package) { } else { clear_has_go_package(); } - go_package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), go_package); + go_package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), go_package, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.go_package) } +inline void FileOptions::unsafe_arena_set_allocated_go_package( + ::std::string* go_package) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (go_package != NULL) { + set_has_go_package(); + } else { + clear_has_go_package(); + } + go_package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + go_package, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.go_package) +} // optional bool cc_generic_services = 16 [default = false]; inline bool FileOptions::has_cc_generic_services() const { - return (_has_bits_[0] & 0x00000800u) != 0; + return (_has_bits_[0] & 0x00001000u) != 0; } inline void FileOptions::set_has_cc_generic_services() { - _has_bits_[0] |= 0x00000800u; + _has_bits_[0] |= 0x00001000u; } inline void FileOptions::clear_has_cc_generic_services() { - _has_bits_[0] &= ~0x00000800u; + _has_bits_[0] &= ~0x00001000u; } inline void FileOptions::clear_cc_generic_services() { cc_generic_services_ = false; @@ -7389,13 +9008,13 @@ inline void FileOptions::set_cc_generic_services(bool value) { // optional bool java_generic_services = 17 [default = false]; inline bool FileOptions::has_java_generic_services() const { - return (_has_bits_[0] & 0x00001000u) != 0; + return (_has_bits_[0] & 0x00002000u) != 0; } inline void FileOptions::set_has_java_generic_services() { - _has_bits_[0] |= 0x00001000u; + _has_bits_[0] |= 0x00002000u; } inline void FileOptions::clear_has_java_generic_services() { - _has_bits_[0] &= ~0x00001000u; + _has_bits_[0] &= ~0x00002000u; } inline void FileOptions::clear_java_generic_services() { java_generic_services_ = false; @@ -7413,13 +9032,13 @@ inline void FileOptions::set_java_generic_services(bool value) { // optional bool py_generic_services = 18 [default = false]; inline bool FileOptions::has_py_generic_services() const { - return (_has_bits_[0] & 0x00002000u) != 0; + return (_has_bits_[0] & 0x00004000u) != 0; } inline void FileOptions::set_has_py_generic_services() { - _has_bits_[0] |= 0x00002000u; + _has_bits_[0] |= 0x00004000u; } inline void FileOptions::clear_has_py_generic_services() { - _has_bits_[0] &= ~0x00002000u; + _has_bits_[0] &= ~0x00004000u; } inline void FileOptions::clear_py_generic_services() { py_generic_services_ = false; @@ -7435,15 +9054,15 @@ inline void FileOptions::set_py_generic_services(bool value) { // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.py_generic_services) } -// optional bool php_generic_services = 19 [default = false]; +// optional bool php_generic_services = 42 [default = false]; inline bool FileOptions::has_php_generic_services() const { - return (_has_bits_[0] & 0x00004000u) != 0; + return (_has_bits_[0] & 0x00008000u) != 0; } inline void FileOptions::set_has_php_generic_services() { - _has_bits_[0] |= 0x00004000u; + _has_bits_[0] |= 0x00008000u; } inline void FileOptions::clear_has_php_generic_services() { - _has_bits_[0] &= ~0x00004000u; + _has_bits_[0] &= ~0x00008000u; } inline void FileOptions::clear_php_generic_services() { php_generic_services_ = false; @@ -7461,13 +9080,13 @@ inline void FileOptions::set_php_generic_services(bool value) { // optional bool deprecated = 23 [default = false]; inline bool FileOptions::has_deprecated() const { - return (_has_bits_[0] & 0x00008000u) != 0; + return (_has_bits_[0] & 0x00010000u) != 0; } inline void FileOptions::set_has_deprecated() { - _has_bits_[0] |= 0x00008000u; + _has_bits_[0] |= 0x00010000u; } inline void FileOptions::clear_has_deprecated() { - _has_bits_[0] &= ~0x00008000u; + _has_bits_[0] &= ~0x00010000u; } inline void FileOptions::clear_deprecated() { deprecated_ = false; @@ -7485,13 +9104,13 @@ inline void FileOptions::set_deprecated(bool value) { // optional bool cc_enable_arenas = 31 [default = false]; inline bool FileOptions::has_cc_enable_arenas() const { - return (_has_bits_[0] & 0x00010000u) != 0; + return (_has_bits_[0] & 0x00000100u) != 0; } inline void FileOptions::set_has_cc_enable_arenas() { - _has_bits_[0] |= 0x00010000u; + _has_bits_[0] |= 0x00000100u; } inline void FileOptions::clear_has_cc_enable_arenas() { - _has_bits_[0] &= ~0x00010000u; + _has_bits_[0] &= ~0x00000100u; } inline void FileOptions::clear_cc_enable_arenas() { cc_enable_arenas_ = false; @@ -7518,47 +9137,56 @@ inline void FileOptions::clear_has_objc_class_prefix() { _has_bits_[0] &= ~0x00000008u; } inline void FileOptions::clear_objc_class_prefix() { - objc_class_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + objc_class_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_objc_class_prefix(); } inline const ::std::string& FileOptions::objc_class_prefix() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.objc_class_prefix) - return objc_class_prefix_.GetNoArena(); + return objc_class_prefix_.Get(); } inline void FileOptions::set_objc_class_prefix(const ::std::string& value) { set_has_objc_class_prefix(); - objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + objc_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.objc_class_prefix) } #if LANG_CXX11 inline void FileOptions::set_objc_class_prefix(::std::string&& value) { set_has_objc_class_prefix(); - objc_class_prefix_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + objc_class_prefix_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.objc_class_prefix) } #endif inline void FileOptions::set_objc_class_prefix(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_objc_class_prefix(); - objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + objc_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.objc_class_prefix) } -inline void FileOptions::set_objc_class_prefix(const char* value, size_t size) { +inline void FileOptions::set_objc_class_prefix(const char* value, + size_t size) { set_has_objc_class_prefix(); - objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + objc_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.objc_class_prefix) } inline ::std::string* FileOptions::mutable_objc_class_prefix() { set_has_objc_class_prefix(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.objc_class_prefix) - return objc_class_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return objc_class_prefix_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileOptions::release_objc_class_prefix() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.objc_class_prefix) clear_has_objc_class_prefix(); - return objc_class_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return objc_class_prefix_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileOptions::unsafe_arena_release_objc_class_prefix() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.objc_class_prefix) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_objc_class_prefix(); + return objc_class_prefix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileOptions::set_allocated_objc_class_prefix(::std::string* objc_class_prefix) { if (objc_class_prefix != NULL) { @@ -7566,9 +9194,22 @@ inline void FileOptions::set_allocated_objc_class_prefix(::std::string* objc_cla } else { clear_has_objc_class_prefix(); } - objc_class_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), objc_class_prefix); + objc_class_prefix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), objc_class_prefix, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.objc_class_prefix) } +inline void FileOptions::unsafe_arena_set_allocated_objc_class_prefix( + ::std::string* objc_class_prefix) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (objc_class_prefix != NULL) { + set_has_objc_class_prefix(); + } else { + clear_has_objc_class_prefix(); + } + objc_class_prefix_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + objc_class_prefix, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.objc_class_prefix) +} // optional string csharp_namespace = 37; inline bool FileOptions::has_csharp_namespace() const { @@ -7581,47 +9222,56 @@ inline void FileOptions::clear_has_csharp_namespace() { _has_bits_[0] &= ~0x00000010u; } inline void FileOptions::clear_csharp_namespace() { - csharp_namespace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + csharp_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_csharp_namespace(); } inline const ::std::string& FileOptions::csharp_namespace() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.csharp_namespace) - return csharp_namespace_.GetNoArena(); + return csharp_namespace_.Get(); } inline void FileOptions::set_csharp_namespace(const ::std::string& value) { set_has_csharp_namespace(); - csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + csharp_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.csharp_namespace) } #if LANG_CXX11 inline void FileOptions::set_csharp_namespace(::std::string&& value) { set_has_csharp_namespace(); - csharp_namespace_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + csharp_namespace_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.csharp_namespace) } #endif inline void FileOptions::set_csharp_namespace(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_csharp_namespace(); - csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + csharp_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.csharp_namespace) } -inline void FileOptions::set_csharp_namespace(const char* value, size_t size) { +inline void FileOptions::set_csharp_namespace(const char* value, + size_t size) { set_has_csharp_namespace(); - csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + csharp_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.csharp_namespace) } inline ::std::string* FileOptions::mutable_csharp_namespace() { set_has_csharp_namespace(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.csharp_namespace) - return csharp_namespace_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return csharp_namespace_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileOptions::release_csharp_namespace() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.csharp_namespace) clear_has_csharp_namespace(); - return csharp_namespace_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return csharp_namespace_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileOptions::unsafe_arena_release_csharp_namespace() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.csharp_namespace) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_csharp_namespace(); + return csharp_namespace_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileOptions::set_allocated_csharp_namespace(::std::string* csharp_namespace) { if (csharp_namespace != NULL) { @@ -7629,9 +9279,22 @@ inline void FileOptions::set_allocated_csharp_namespace(::std::string* csharp_na } else { clear_has_csharp_namespace(); } - csharp_namespace_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), csharp_namespace); + csharp_namespace_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), csharp_namespace, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.csharp_namespace) } +inline void FileOptions::unsafe_arena_set_allocated_csharp_namespace( + ::std::string* csharp_namespace) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (csharp_namespace != NULL) { + set_has_csharp_namespace(); + } else { + clear_has_csharp_namespace(); + } + csharp_namespace_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + csharp_namespace, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.csharp_namespace) +} // optional string swift_prefix = 39; inline bool FileOptions::has_swift_prefix() const { @@ -7644,47 +9307,56 @@ inline void FileOptions::clear_has_swift_prefix() { _has_bits_[0] &= ~0x00000020u; } inline void FileOptions::clear_swift_prefix() { - swift_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + swift_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_swift_prefix(); } inline const ::std::string& FileOptions::swift_prefix() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.swift_prefix) - return swift_prefix_.GetNoArena(); + return swift_prefix_.Get(); } inline void FileOptions::set_swift_prefix(const ::std::string& value) { set_has_swift_prefix(); - swift_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + swift_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.swift_prefix) } #if LANG_CXX11 inline void FileOptions::set_swift_prefix(::std::string&& value) { set_has_swift_prefix(); - swift_prefix_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + swift_prefix_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.swift_prefix) } #endif inline void FileOptions::set_swift_prefix(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_swift_prefix(); - swift_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + swift_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.swift_prefix) } -inline void FileOptions::set_swift_prefix(const char* value, size_t size) { +inline void FileOptions::set_swift_prefix(const char* value, + size_t size) { set_has_swift_prefix(); - swift_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + swift_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.swift_prefix) } inline ::std::string* FileOptions::mutable_swift_prefix() { set_has_swift_prefix(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.swift_prefix) - return swift_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return swift_prefix_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileOptions::release_swift_prefix() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.swift_prefix) clear_has_swift_prefix(); - return swift_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return swift_prefix_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileOptions::unsafe_arena_release_swift_prefix() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.swift_prefix) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_swift_prefix(); + return swift_prefix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileOptions::set_allocated_swift_prefix(::std::string* swift_prefix) { if (swift_prefix != NULL) { @@ -7692,9 +9364,22 @@ inline void FileOptions::set_allocated_swift_prefix(::std::string* swift_prefix) } else { clear_has_swift_prefix(); } - swift_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), swift_prefix); + swift_prefix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), swift_prefix, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.swift_prefix) } +inline void FileOptions::unsafe_arena_set_allocated_swift_prefix( + ::std::string* swift_prefix) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (swift_prefix != NULL) { + set_has_swift_prefix(); + } else { + clear_has_swift_prefix(); + } + swift_prefix_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + swift_prefix, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.swift_prefix) +} // optional string php_class_prefix = 40; inline bool FileOptions::has_php_class_prefix() const { @@ -7707,47 +9392,56 @@ inline void FileOptions::clear_has_php_class_prefix() { _has_bits_[0] &= ~0x00000040u; } inline void FileOptions::clear_php_class_prefix() { - php_class_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + php_class_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_php_class_prefix(); } inline const ::std::string& FileOptions::php_class_prefix() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_class_prefix) - return php_class_prefix_.GetNoArena(); + return php_class_prefix_.Get(); } inline void FileOptions::set_php_class_prefix(const ::std::string& value) { set_has_php_class_prefix(); - php_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + php_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_class_prefix) } #if LANG_CXX11 inline void FileOptions::set_php_class_prefix(::std::string&& value) { set_has_php_class_prefix(); - php_class_prefix_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + php_class_prefix_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.php_class_prefix) } #endif inline void FileOptions::set_php_class_prefix(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_php_class_prefix(); - php_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + php_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.php_class_prefix) } -inline void FileOptions::set_php_class_prefix(const char* value, size_t size) { +inline void FileOptions::set_php_class_prefix(const char* value, + size_t size) { set_has_php_class_prefix(); - php_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + php_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.php_class_prefix) } inline ::std::string* FileOptions::mutable_php_class_prefix() { set_has_php_class_prefix(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_class_prefix) - return php_class_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return php_class_prefix_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileOptions::release_php_class_prefix() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_class_prefix) clear_has_php_class_prefix(); - return php_class_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return php_class_prefix_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileOptions::unsafe_arena_release_php_class_prefix() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_class_prefix) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_php_class_prefix(); + return php_class_prefix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileOptions::set_allocated_php_class_prefix(::std::string* php_class_prefix) { if (php_class_prefix != NULL) { @@ -7755,9 +9449,22 @@ inline void FileOptions::set_allocated_php_class_prefix(::std::string* php_class } else { clear_has_php_class_prefix(); } - php_class_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_class_prefix); + php_class_prefix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_class_prefix, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_class_prefix) } +inline void FileOptions::unsafe_arena_set_allocated_php_class_prefix( + ::std::string* php_class_prefix) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (php_class_prefix != NULL) { + set_has_php_class_prefix(); + } else { + clear_has_php_class_prefix(); + } + php_class_prefix_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + php_class_prefix, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_class_prefix) +} // optional string php_namespace = 41; inline bool FileOptions::has_php_namespace() const { @@ -7770,47 +9477,56 @@ inline void FileOptions::clear_has_php_namespace() { _has_bits_[0] &= ~0x00000080u; } inline void FileOptions::clear_php_namespace() { - php_namespace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + php_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_php_namespace(); } inline const ::std::string& FileOptions::php_namespace() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_namespace) - return php_namespace_.GetNoArena(); + return php_namespace_.Get(); } inline void FileOptions::set_php_namespace(const ::std::string& value) { set_has_php_namespace(); - php_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_namespace) } #if LANG_CXX11 inline void FileOptions::set_php_namespace(::std::string&& value) { set_has_php_namespace(); - php_namespace_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + php_namespace_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.php_namespace) } #endif inline void FileOptions::set_php_namespace(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_php_namespace(); - php_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.php_namespace) } -inline void FileOptions::set_php_namespace(const char* value, size_t size) { +inline void FileOptions::set_php_namespace(const char* value, + size_t size) { set_has_php_namespace(); - php_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.php_namespace) } inline ::std::string* FileOptions::mutable_php_namespace() { set_has_php_namespace(); // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_namespace) - return php_namespace_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return php_namespace_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* FileOptions::release_php_namespace() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_namespace) clear_has_php_namespace(); - return php_namespace_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return php_namespace_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FileOptions::unsafe_arena_release_php_namespace() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_namespace) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_php_namespace(); + return php_namespace_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void FileOptions::set_allocated_php_namespace(::std::string* php_namespace) { if (php_namespace != NULL) { @@ -7818,9 +9534,22 @@ inline void FileOptions::set_allocated_php_namespace(::std::string* php_namespac } else { clear_has_php_namespace(); } - php_namespace_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_namespace); + php_namespace_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_namespace, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_namespace) } +inline void FileOptions::unsafe_arena_set_allocated_php_namespace( + ::std::string* php_namespace) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (php_namespace != NULL) { + set_has_php_namespace(); + } else { + clear_has_php_namespace(); + } + php_namespace_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + php_namespace, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_namespace) +} // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int FileOptions::uninterpreted_option_size() const { @@ -8492,47 +10221,56 @@ inline void UninterpretedOption_NamePart::clear_has_name_part() { _has_bits_[0] &= ~0x00000001u; } inline void UninterpretedOption_NamePart::clear_name_part() { - name_part_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_part_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_name_part(); } inline const ::std::string& UninterpretedOption_NamePart::name_part() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.name_part) - return name_part_.GetNoArena(); + return name_part_.Get(); } inline void UninterpretedOption_NamePart::set_name_part(const ::std::string& value) { set_has_name_part(); - name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.name_part) } #if LANG_CXX11 inline void UninterpretedOption_NamePart::set_name_part(::std::string&& value) { set_has_name_part(); - name_part_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + name_part_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.NamePart.name_part) } #endif inline void UninterpretedOption_NamePart::set_name_part(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_name_part(); - name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.NamePart.name_part) } -inline void UninterpretedOption_NamePart::set_name_part(const char* value, size_t size) { +inline void UninterpretedOption_NamePart::set_name_part(const char* value, + size_t size) { set_has_name_part(); - name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.NamePart.name_part) } inline ::std::string* UninterpretedOption_NamePart::mutable_name_part() { set_has_name_part(); // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.NamePart.name_part) - return name_part_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_part_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* UninterpretedOption_NamePart::release_name_part() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.NamePart.name_part) clear_has_name_part(); - return name_part_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return name_part_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* UninterpretedOption_NamePart::unsafe_arena_release_name_part() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.NamePart.name_part) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_name_part(); + return name_part_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* name_part) { if (name_part != NULL) { @@ -8540,9 +10278,22 @@ inline void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* } else { clear_has_name_part(); } - name_part_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name_part); + name_part_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name_part, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part) } +inline void UninterpretedOption_NamePart::unsafe_arena_set_allocated_name_part( + ::std::string* name_part) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name_part != NULL) { + set_has_name_part(); + } else { + clear_has_name_part(); + } + name_part_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name_part, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part) +} // required bool is_extension = 2; inline bool UninterpretedOption_NamePart::has_is_extension() const { @@ -8613,47 +10364,56 @@ inline void UninterpretedOption::clear_has_identifier_value() { _has_bits_[0] &= ~0x00000001u; } inline void UninterpretedOption::clear_identifier_value() { - identifier_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + identifier_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_identifier_value(); } inline const ::std::string& UninterpretedOption::identifier_value() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.identifier_value) - return identifier_value_.GetNoArena(); + return identifier_value_.Get(); } inline void UninterpretedOption::set_identifier_value(const ::std::string& value) { set_has_identifier_value(); - identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + identifier_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.identifier_value) } #if LANG_CXX11 inline void UninterpretedOption::set_identifier_value(::std::string&& value) { set_has_identifier_value(); - identifier_value_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + identifier_value_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.identifier_value) } #endif inline void UninterpretedOption::set_identifier_value(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_identifier_value(); - identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + identifier_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.identifier_value) } -inline void UninterpretedOption::set_identifier_value(const char* value, size_t size) { +inline void UninterpretedOption::set_identifier_value(const char* value, + size_t size) { set_has_identifier_value(); - identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + identifier_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.identifier_value) } inline ::std::string* UninterpretedOption::mutable_identifier_value() { set_has_identifier_value(); // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.identifier_value) - return identifier_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return identifier_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* UninterpretedOption::release_identifier_value() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.identifier_value) clear_has_identifier_value(); - return identifier_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return identifier_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* UninterpretedOption::unsafe_arena_release_identifier_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.identifier_value) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_identifier_value(); + return identifier_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void UninterpretedOption::set_allocated_identifier_value(::std::string* identifier_value) { if (identifier_value != NULL) { @@ -8661,9 +10421,22 @@ inline void UninterpretedOption::set_allocated_identifier_value(::std::string* i } else { clear_has_identifier_value(); } - identifier_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), identifier_value); + identifier_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), identifier_value, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.identifier_value) } +inline void UninterpretedOption::unsafe_arena_set_allocated_identifier_value( + ::std::string* identifier_value) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (identifier_value != NULL) { + set_has_identifier_value(); + } else { + clear_has_identifier_value(); + } + identifier_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + identifier_value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.identifier_value) +} // optional uint64 positive_int_value = 4; inline bool UninterpretedOption::has_positive_int_value() const { @@ -8748,47 +10521,56 @@ inline void UninterpretedOption::clear_has_string_value() { _has_bits_[0] &= ~0x00000002u; } inline void UninterpretedOption::clear_string_value() { - string_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + string_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_string_value(); } inline const ::std::string& UninterpretedOption::string_value() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.string_value) - return string_value_.GetNoArena(); + return string_value_.Get(); } inline void UninterpretedOption::set_string_value(const ::std::string& value) { set_has_string_value(); - string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.string_value) } #if LANG_CXX11 inline void UninterpretedOption::set_string_value(::std::string&& value) { set_has_string_value(); - string_value_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + string_value_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.string_value) } #endif inline void UninterpretedOption::set_string_value(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_string_value(); - string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.string_value) } -inline void UninterpretedOption::set_string_value(const void* value, size_t size) { +inline void UninterpretedOption::set_string_value(const void* value, + size_t size) { set_has_string_value(); - string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.string_value) } inline ::std::string* UninterpretedOption::mutable_string_value() { set_has_string_value(); // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.string_value) - return string_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return string_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* UninterpretedOption::release_string_value() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.string_value) clear_has_string_value(); - return string_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return string_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* UninterpretedOption::unsafe_arena_release_string_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.string_value) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_string_value(); + return string_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void UninterpretedOption::set_allocated_string_value(::std::string* string_value) { if (string_value != NULL) { @@ -8796,9 +10578,22 @@ inline void UninterpretedOption::set_allocated_string_value(::std::string* strin } else { clear_has_string_value(); } - string_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value); + string_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.string_value) } +inline void UninterpretedOption::unsafe_arena_set_allocated_string_value( + ::std::string* string_value) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (string_value != NULL) { + set_has_string_value(); + } else { + clear_has_string_value(); + } + string_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + string_value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.string_value) +} // optional string aggregate_value = 8; inline bool UninterpretedOption::has_aggregate_value() const { @@ -8811,47 +10606,56 @@ inline void UninterpretedOption::clear_has_aggregate_value() { _has_bits_[0] &= ~0x00000004u; } inline void UninterpretedOption::clear_aggregate_value() { - aggregate_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + aggregate_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_aggregate_value(); } inline const ::std::string& UninterpretedOption::aggregate_value() const { // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.aggregate_value) - return aggregate_value_.GetNoArena(); + return aggregate_value_.Get(); } inline void UninterpretedOption::set_aggregate_value(const ::std::string& value) { set_has_aggregate_value(); - aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.aggregate_value) } #if LANG_CXX11 inline void UninterpretedOption::set_aggregate_value(::std::string&& value) { set_has_aggregate_value(); - aggregate_value_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + aggregate_value_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.aggregate_value) } #endif inline void UninterpretedOption::set_aggregate_value(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_aggregate_value(); - aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.aggregate_value) } -inline void UninterpretedOption::set_aggregate_value(const char* value, size_t size) { +inline void UninterpretedOption::set_aggregate_value(const char* value, + size_t size) { set_has_aggregate_value(); - aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.aggregate_value) } inline ::std::string* UninterpretedOption::mutable_aggregate_value() { set_has_aggregate_value(); // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.aggregate_value) - return aggregate_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return aggregate_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* UninterpretedOption::release_aggregate_value() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.aggregate_value) clear_has_aggregate_value(); - return aggregate_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return aggregate_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* UninterpretedOption::unsafe_arena_release_aggregate_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.aggregate_value) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_aggregate_value(); + return aggregate_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void UninterpretedOption::set_allocated_aggregate_value(::std::string* aggregate_value) { if (aggregate_value != NULL) { @@ -8859,9 +10663,22 @@ inline void UninterpretedOption::set_allocated_aggregate_value(::std::string* ag } else { clear_has_aggregate_value(); } - aggregate_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), aggregate_value); + aggregate_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), aggregate_value, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.aggregate_value) } +inline void UninterpretedOption::unsafe_arena_set_allocated_aggregate_value( + ::std::string* aggregate_value) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (aggregate_value != NULL) { + set_has_aggregate_value(); + } else { + clear_has_aggregate_value(); + } + aggregate_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + aggregate_value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.aggregate_value) +} // ------------------------------------------------------------------- @@ -8938,47 +10755,56 @@ inline void SourceCodeInfo_Location::clear_has_leading_comments() { _has_bits_[0] &= ~0x00000001u; } inline void SourceCodeInfo_Location::clear_leading_comments() { - leading_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + leading_comments_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_leading_comments(); } inline const ::std::string& SourceCodeInfo_Location::leading_comments() const { // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_comments) - return leading_comments_.GetNoArena(); + return leading_comments_.Get(); } inline void SourceCodeInfo_Location::set_leading_comments(const ::std::string& value) { set_has_leading_comments(); - leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + leading_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_comments) } #if LANG_CXX11 inline void SourceCodeInfo_Location::set_leading_comments(::std::string&& value) { set_has_leading_comments(); - leading_comments_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + leading_comments_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.SourceCodeInfo.Location.leading_comments) } #endif inline void SourceCodeInfo_Location::set_leading_comments(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_leading_comments(); - leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + leading_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_comments) } -inline void SourceCodeInfo_Location::set_leading_comments(const char* value, size_t size) { +inline void SourceCodeInfo_Location::set_leading_comments(const char* value, + size_t size) { set_has_leading_comments(); - leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + leading_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_comments) } inline ::std::string* SourceCodeInfo_Location::mutable_leading_comments() { set_has_leading_comments(); // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_comments) - return leading_comments_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return leading_comments_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* SourceCodeInfo_Location::release_leading_comments() { // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.leading_comments) clear_has_leading_comments(); - return leading_comments_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return leading_comments_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SourceCodeInfo_Location::unsafe_arena_release_leading_comments() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.SourceCodeInfo.Location.leading_comments) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_leading_comments(); + return leading_comments_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void SourceCodeInfo_Location::set_allocated_leading_comments(::std::string* leading_comments) { if (leading_comments != NULL) { @@ -8986,9 +10812,22 @@ inline void SourceCodeInfo_Location::set_allocated_leading_comments(::std::strin } else { clear_has_leading_comments(); } - leading_comments_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), leading_comments); + leading_comments_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), leading_comments, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments) } +inline void SourceCodeInfo_Location::unsafe_arena_set_allocated_leading_comments( + ::std::string* leading_comments) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (leading_comments != NULL) { + set_has_leading_comments(); + } else { + clear_has_leading_comments(); + } + leading_comments_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + leading_comments, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments) +} // optional string trailing_comments = 4; inline bool SourceCodeInfo_Location::has_trailing_comments() const { @@ -9001,47 +10840,56 @@ inline void SourceCodeInfo_Location::clear_has_trailing_comments() { _has_bits_[0] &= ~0x00000002u; } inline void SourceCodeInfo_Location::clear_trailing_comments() { - trailing_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + trailing_comments_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_trailing_comments(); } inline const ::std::string& SourceCodeInfo_Location::trailing_comments() const { // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.trailing_comments) - return trailing_comments_.GetNoArena(); + return trailing_comments_.Get(); } inline void SourceCodeInfo_Location::set_trailing_comments(const ::std::string& value) { set_has_trailing_comments(); - trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + trailing_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.trailing_comments) } #if LANG_CXX11 inline void SourceCodeInfo_Location::set_trailing_comments(::std::string&& value) { set_has_trailing_comments(); - trailing_comments_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + trailing_comments_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.SourceCodeInfo.Location.trailing_comments) } #endif inline void SourceCodeInfo_Location::set_trailing_comments(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_trailing_comments(); - trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + trailing_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.trailing_comments) } -inline void SourceCodeInfo_Location::set_trailing_comments(const char* value, size_t size) { +inline void SourceCodeInfo_Location::set_trailing_comments(const char* value, + size_t size) { set_has_trailing_comments(); - trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + trailing_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.trailing_comments) } inline ::std::string* SourceCodeInfo_Location::mutable_trailing_comments() { set_has_trailing_comments(); // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.trailing_comments) - return trailing_comments_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return trailing_comments_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* SourceCodeInfo_Location::release_trailing_comments() { // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.trailing_comments) clear_has_trailing_comments(); - return trailing_comments_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return trailing_comments_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SourceCodeInfo_Location::unsafe_arena_release_trailing_comments() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.SourceCodeInfo.Location.trailing_comments) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_trailing_comments(); + return trailing_comments_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::string* trailing_comments) { if (trailing_comments != NULL) { @@ -9049,9 +10897,22 @@ inline void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::stri } else { clear_has_trailing_comments(); } - trailing_comments_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), trailing_comments); + trailing_comments_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), trailing_comments, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments) } +inline void SourceCodeInfo_Location::unsafe_arena_set_allocated_trailing_comments( + ::std::string* trailing_comments) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (trailing_comments != NULL) { + set_has_trailing_comments(); + } else { + clear_has_trailing_comments(); + } + trailing_comments_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + trailing_comments, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments) +} // repeated string leading_detached_comments = 6; inline int SourceCodeInfo_Location::leading_detached_comments_size() const { @@ -9201,47 +11062,56 @@ inline void GeneratedCodeInfo_Annotation::clear_has_source_file() { _has_bits_[0] &= ~0x00000001u; } inline void GeneratedCodeInfo_Annotation::clear_source_file() { - source_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_file_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); clear_has_source_file(); } inline const ::std::string& GeneratedCodeInfo_Annotation::source_file() const { // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.source_file) - return source_file_.GetNoArena(); + return source_file_.Get(); } inline void GeneratedCodeInfo_Annotation::set_source_file(const ::std::string& value) { set_has_source_file(); - source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.source_file) } #if LANG_CXX11 inline void GeneratedCodeInfo_Annotation::set_source_file(::std::string&& value) { set_has_source_file(); - source_file_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + source_file_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.protobuf.GeneratedCodeInfo.Annotation.source_file) } #endif inline void GeneratedCodeInfo_Annotation::set_source_file(const char* value) { GOOGLE_DCHECK(value != NULL); set_has_source_file(); - source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.protobuf.GeneratedCodeInfo.Annotation.source_file) } -inline void GeneratedCodeInfo_Annotation::set_source_file(const char* value, size_t size) { +inline void GeneratedCodeInfo_Annotation::set_source_file(const char* value, + size_t size) { set_has_source_file(); - source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); + source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.GeneratedCodeInfo.Annotation.source_file) } inline ::std::string* GeneratedCodeInfo_Annotation::mutable_source_file() { set_has_source_file(); // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.Annotation.source_file) - return source_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return source_file_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* GeneratedCodeInfo_Annotation::release_source_file() { // @@protoc_insertion_point(field_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file) clear_has_source_file(); - return source_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return source_file_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GeneratedCodeInfo_Annotation::unsafe_arena_release_source_file() { + // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + clear_has_source_file(); + return source_file_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); } inline void GeneratedCodeInfo_Annotation::set_allocated_source_file(::std::string* source_file) { if (source_file != NULL) { @@ -9249,9 +11119,22 @@ inline void GeneratedCodeInfo_Annotation::set_allocated_source_file(::std::strin } else { clear_has_source_file(); } - source_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source_file); + source_file_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source_file, + GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file) } +inline void GeneratedCodeInfo_Annotation::unsafe_arena_set_allocated_source_file( + ::std::string* source_file) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (source_file != NULL) { + set_has_source_file(); + } else { + clear_has_source_file(); + } + source_file_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + source_file, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file) +} // optional int32 begin = 3; inline bool GeneratedCodeInfo_Annotation::has_begin() const { @@ -9338,7 +11221,8 @@ GeneratedCodeInfo::annotation() const { #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + // ------------------------------------------------------------------- // ------------------------------------------------------------------- @@ -9392,7 +11276,6 @@ GeneratedCodeInfo::annotation() const { // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index f1ec5735..4fd66e41 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -45,6 +45,7 @@ option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; option csharp_namespace = "Google.Protobuf.Reflection"; option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; // descriptor.proto must be optimized for speed because reflection-based // algorithms don't work during bootstrapping. @@ -225,6 +226,26 @@ message EnumDescriptorProto { repeated EnumValueDescriptorProto value = 2; optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; } // Describes a value within an enum. @@ -361,7 +382,7 @@ message FileOptions { optional bool cc_generic_services = 16 [default=false]; optional bool java_generic_services = 17 [default=false]; optional bool py_generic_services = 18 [default=false]; - optional bool php_generic_services = 19 [default=false]; + optional bool php_generic_services = 42 [default=false]; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations diff --git a/src/google/protobuf/descriptor_database_unittest.cc b/src/google/protobuf/descriptor_database_unittest.cc index 7e81d70a..9d710886 100644 --- a/src/google/protobuf/descriptor_database_unittest.cc +++ b/src/google/protobuf/descriptor_database_unittest.cc @@ -247,6 +247,10 @@ TEST_P(DescriptorDatabaseTest, FindFileContainingSymbol) { FileDescriptorProto file; EXPECT_TRUE(database_->FindFileContainingSymbol("Foo.qux", &file)); EXPECT_EQ("foo.proto", file.name()); + // Non-existent field under a valid top level symbol can also be + // found. + EXPECT_TRUE(database_->FindFileContainingSymbol("Foo.none_field.none", + &file)); } { diff --git a/src/google/protobuf/descriptor_unittest.cc b/src/google/protobuf/descriptor_unittest.cc index 75238931..6cca0ada 100644 --- a/src/google/protobuf/descriptor_unittest.cc +++ b/src/google/protobuf/descriptor_unittest.cc @@ -34,6 +34,7 @@ // // This file makes extensive use of RFC 3092. :) +#include #include #ifndef _SHARED_PTR_H #include @@ -62,6 +63,7 @@ #include #include + namespace google { namespace protobuf { @@ -157,6 +159,14 @@ DescriptorProto::ReservedRange* AddReservedRange(DescriptorProto* parent, return result; } +EnumDescriptorProto::EnumReservedRange* AddReservedRange( + EnumDescriptorProto* parent, int start, int end) { + EnumDescriptorProto::EnumReservedRange* result = parent->add_reserved_range(); + result->set_start(start); + result->set_end(end); + return result; +} + EnumValueDescriptorProto* AddEnumValue(EnumDescriptorProto* enum_proto, const string& name, int number) { EnumValueDescriptorProto* result = enum_proto->add_value(); @@ -2047,6 +2057,137 @@ TEST_F(ReservedDescriptorTest, IsReservedName) { // =================================================================== +// Test reserved enum fields. +class ReservedEnumDescriptorTest : public testing::Test { + protected: + virtual void SetUp() { + // Build descriptors for the following definitions: + // + // enum Foo { + // BAR = 1; + // reserved 2, 9 to 11, 15; + // reserved "foo", "bar"; + // } + + FileDescriptorProto foo_file; + foo_file.set_name("foo.proto"); + + EnumDescriptorProto* foo = AddEnum(&foo_file, "Foo"); + EnumDescriptorProto* edge1 = AddEnum(&foo_file, "Edge1"); + EnumDescriptorProto* edge2 = AddEnum(&foo_file, "Edge2"); + + AddEnumValue(foo, "BAR", 4); + AddReservedRange(foo, -5, -3); + AddReservedRange(foo, -2, 1); + AddReservedRange(foo, 2, 3); + AddReservedRange(foo, 9, 12); + AddReservedRange(foo, 15, 16); + + foo->add_reserved_name("foo"); + foo->add_reserved_name("bar"); + + // Some additional edge cases that cover most or all of the range of enum + // values + + // Note: We use INT_MAX as the maximum reserved range upper bound, + // inclusive. + AddEnumValue(edge1, "EDGE1", 1); + AddReservedRange(edge1, 10, INT_MAX); + AddEnumValue(edge2, "EDGE2", 15); + AddReservedRange(edge2, INT_MIN, 10); + + // Build the descriptors and get the pointers. + foo_file_ = pool_.BuildFile(foo_file); + ASSERT_TRUE(foo_file_ != NULL); + + ASSERT_EQ(3, foo_file_->enum_type_count()); + foo_ = foo_file_->enum_type(0); + edge1_ = foo_file_->enum_type(1); + edge2_ = foo_file_->enum_type(2); + } + + DescriptorPool pool_; + const FileDescriptor* foo_file_; + const EnumDescriptor* foo_; + const EnumDescriptor* edge1_; + const EnumDescriptor* edge2_; +}; + +TEST_F(ReservedEnumDescriptorTest, ReservedRanges) { + ASSERT_EQ(5, foo_->reserved_range_count()); + + EXPECT_EQ(-5, foo_->reserved_range(0)->start); + EXPECT_EQ(-3, foo_->reserved_range(0)->end); + + EXPECT_EQ(-2, foo_->reserved_range(1)->start); + EXPECT_EQ(1, foo_->reserved_range(1)->end); + + EXPECT_EQ(2, foo_->reserved_range(2)->start); + EXPECT_EQ(3, foo_->reserved_range(2)->end); + + EXPECT_EQ(9, foo_->reserved_range(3)->start); + EXPECT_EQ(12, foo_->reserved_range(3)->end); + + EXPECT_EQ(15, foo_->reserved_range(4)->start); + EXPECT_EQ(16, foo_->reserved_range(4)->end); + + ASSERT_EQ(1, edge1_->reserved_range_count()); + EXPECT_EQ(10, edge1_->reserved_range(0)->start); + EXPECT_EQ(INT_MAX, edge1_->reserved_range(0)->end); + + ASSERT_EQ(1, edge2_->reserved_range_count()); + EXPECT_EQ(INT_MIN, edge2_->reserved_range(0)->start); + EXPECT_EQ(10, edge2_->reserved_range(0)->end); +} + +TEST_F(ReservedEnumDescriptorTest, IsReservedNumber) { + EXPECT_TRUE(foo_->IsReservedNumber(-5)); + EXPECT_TRUE(foo_->IsReservedNumber(-4)); + EXPECT_TRUE(foo_->IsReservedNumber(-3)); + EXPECT_TRUE(foo_->IsReservedNumber(-2)); + EXPECT_TRUE(foo_->IsReservedNumber(-1)); + EXPECT_TRUE(foo_->IsReservedNumber(0)); + EXPECT_TRUE(foo_->IsReservedNumber(1)); + EXPECT_TRUE (foo_->IsReservedNumber(2)); + EXPECT_TRUE(foo_->IsReservedNumber(3)); + EXPECT_FALSE(foo_->IsReservedNumber(8)); + EXPECT_TRUE (foo_->IsReservedNumber(9)); + EXPECT_TRUE (foo_->IsReservedNumber(10)); + EXPECT_TRUE (foo_->IsReservedNumber(11)); + EXPECT_TRUE(foo_->IsReservedNumber(12)); + EXPECT_FALSE(foo_->IsReservedNumber(13)); + EXPECT_FALSE(foo_->IsReservedNumber(13)); + EXPECT_FALSE(foo_->IsReservedNumber(14)); + EXPECT_TRUE (foo_->IsReservedNumber(15)); + EXPECT_TRUE(foo_->IsReservedNumber(16)); + EXPECT_FALSE(foo_->IsReservedNumber(17)); + + EXPECT_FALSE(edge1_->IsReservedNumber(9)); + EXPECT_TRUE(edge1_->IsReservedNumber(10)); + EXPECT_TRUE(edge1_->IsReservedNumber(INT_MAX - 1)); + EXPECT_TRUE(edge1_->IsReservedNumber(INT_MAX)); + + EXPECT_TRUE(edge2_->IsReservedNumber(INT_MIN)); + EXPECT_TRUE(edge2_->IsReservedNumber(9)); + EXPECT_TRUE(edge2_->IsReservedNumber(10)); + EXPECT_FALSE(edge2_->IsReservedNumber(11)); +} + +TEST_F(ReservedEnumDescriptorTest, ReservedNames) { + ASSERT_EQ(2, foo_->reserved_name_count()); + + EXPECT_EQ("foo", foo_->reserved_name(0)); + EXPECT_EQ("bar", foo_->reserved_name(1)); +} + +TEST_F(ReservedEnumDescriptorTest, IsReservedName) { + EXPECT_TRUE (foo_->IsReservedName("foo")); + EXPECT_TRUE (foo_->IsReservedName("bar")); + EXPECT_FALSE(foo_->IsReservedName("baz")); +} + +// =================================================================== + class MiscTest : public testing::Test { protected: // Function which makes a field descriptor of the given type. @@ -3774,6 +3915,138 @@ TEST_F(ValidationErrorTest, ReservedFieldsDebugString) { file->DebugString()); } +TEST_F(ValidationErrorTest, EnumReservedFieldError) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Foo\"" + " value { name:\"BAR\" number:15 }" + " reserved_range { start: 10 end: 20 }" + "}", + + "foo.proto: BAR: NUMBER: Enum value \"BAR\" uses reserved number 15.\n"); +} + +TEST_F(ValidationErrorTest, EnumNegativeReservedFieldError) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Foo\"" + " value { name:\"BAR\" number:-15 }" + " reserved_range { start: -20 end: -10 }" + "}", + + "foo.proto: BAR: NUMBER: Enum value \"BAR\" uses reserved number -15.\n"); +} + +TEST_F(ValidationErrorTest, EnumReservedRangeOverlap) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Foo\"" + " value { name:\"BAR\" number:0 }" + " reserved_range { start: 10 end: 20 }" + " reserved_range { start: 5 end: 15 }" + "}", + + "foo.proto: Foo: NUMBER: Reserved range 5 to 14" + " overlaps with already-defined range 10 to 19.\n"); +} + +TEST_F(ValidationErrorTest, EnumNegativeReservedRangeOverlap) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Foo\"" + " value { name:\"BAR\" number:0 }" + " reserved_range { start: -20 end: -10 }" + " reserved_range { start: -15 end: -5 }" + "}", + + "foo.proto: Foo: NUMBER: Reserved range -15 to -6" + " overlaps with already-defined range -20 to -11.\n"); +} + +TEST_F(ValidationErrorTest, EnumMixedReservedRangeOverlap) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Foo\"" + " value { name:\"BAR\" number:20 }" + " reserved_range { start: -20 end: 10 }" + " reserved_range { start: -15 end: 5 }" + "}", + + "foo.proto: Foo: NUMBER: Reserved range -15 to 4" + " overlaps with already-defined range -20 to 9.\n"); +} + +TEST_F(ValidationErrorTest, EnumReservedRangeStartGreaterThanEnd) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Foo\"" + " value { name:\"BAR\" number:20 }" + " reserved_range { start: 11 end: 10 }" + "}", + + "foo.proto: Foo: NUMBER: Reserved range end number must be greater" + " than start number.\n"); +} + +TEST_F(ValidationErrorTest, EnumReservedNameError) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Foo\"" + " value { name:\"FOO\" number:15 }" + " value { name:\"BAR\" number:15 }" + " reserved_name: \"FOO\"" + " reserved_name: \"BAR\"" + "}", + + "foo.proto: FOO: NAME: Enum value \"FOO\" is reserved.\n" + "foo.proto: BAR: NAME: Enum value \"BAR\" is reserved.\n"); +} + +TEST_F(ValidationErrorTest, EnumReservedNameRedundant) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Foo\"" + " value { name:\"FOO\" number:15 }" + " reserved_name: \"foo\"" + " reserved_name: \"foo\"" + "}", + + "foo.proto: foo: NAME: Enum value \"foo\" is reserved multiple times.\n"); +} + +TEST_F(ValidationErrorTest, EnumReservedFieldsDebugString) { + const FileDescriptor* file = BuildFile( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Foo\"" + " value { name:\"FOO\" number:3 }" + " reserved_name: \"foo\"" + " reserved_name: \"bar\"" + " reserved_range { start: -6 end: -6 }" + " reserved_range { start: -5 end: -4 }" + " reserved_range { start: -1 end: 1 }" + " reserved_range { start: 5 end: 5 }" + " reserved_range { start: 10 end: 19 }" + "}"); + + ASSERT_EQ( + "syntax = \"proto2\";\n\n" + "enum Foo {\n" + " FOO = 3;\n" + " reserved -6, -5 to -4, -1 to 1, 5, 10 to 19;\n" + " reserved \"foo\", \"bar\";\n" + "}\n\n", + file->DebugString()); +} + TEST_F(ValidationErrorTest, InvalidDefaults) { BuildFileWithErrors( "name: \"foo.proto\" " diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index ad0eeb45..01c8c9aa 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/duration.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,57 +15,52 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { class DurationDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Duration_default_instance_; - +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2fduration_2eproto { +void InitDefaultsDurationImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_Duration_default_instance_; + new (ptr) ::google::protobuf::Duration(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Duration::InitAsDefaultInstance(); +} -namespace { +void InitDefaultsDuration() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDurationImpl); +} ::google::protobuf::Metadata file_level_metadata[1]; -} // namespace - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField - const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, -}; - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField - const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - ::google::protobuf::internal::AuxillaryParseTableField(), -}; -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const - TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, -}; - -const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Duration, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, seconds_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, nanos_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Duration, seconds_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Duration, nanos_), }; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(Duration)}, +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::google::protobuf::Duration)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { - reinterpret_cast(&_Duration_default_instance_), + reinterpret_cast(&::google::protobuf::_Duration_default_instance_), }; -namespace { - void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; @@ -80,29 +74,15 @@ void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); } -} // namespace -void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::internal::InitProtobufDefaults(); - _Duration_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Duration_default_instance_);} - -void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); -} -namespace { void AddDescriptorsImpl() { InitDefaults(); - static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n\036google/protobuf/duration.proto\022\017google" ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r" "\n\005nanos\030\002 \001(\005B|\n\023com.google.protobufB\rDu" @@ -115,7 +95,6 @@ void AddDescriptorsImpl() { ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/duration.proto", &protobuf_RegisterTypes); } -} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); @@ -127,12 +106,14 @@ struct StaticDescriptorInitializer { AddDescriptors(); } } static_descriptor_initializer; - } // namespace protobuf_google_2fprotobuf_2fduration_2eproto - +namespace google { +namespace protobuf { // =================================================================== +void Duration::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Duration::kSecondsFieldNumber; const int Duration::kNanosFieldNumber; @@ -141,7 +122,7 @@ const int Duration::kNanosFieldNumber; Duration::Duration() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaultsDuration(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Duration) @@ -149,7 +130,7 @@ Duration::Duration() Duration::Duration(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { - protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaultsDuration(); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Duration) @@ -198,12 +179,12 @@ void Duration::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Duration::descriptor() { - protobuf_google_2fprotobuf_2fduration_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fduration_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fduration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fduration_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Duration& Duration::default_instance() { - protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaultsDuration(); return *internal_default_instance(); } @@ -436,44 +417,11 @@ void Duration::InternalSwap(Duration* other) { ::google::protobuf::Metadata Duration::GetMetadata() const { protobuf_google_2fprotobuf_2fduration_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fduration_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fduration_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Duration - -// int64 seconds = 1; -void Duration::clear_seconds() { - seconds_ = GOOGLE_LONGLONG(0); -} -::google::protobuf::int64 Duration::seconds() const { - // @@protoc_insertion_point(field_get:google.protobuf.Duration.seconds) - return seconds_; -} -void Duration::set_seconds(::google::protobuf::int64 value) { - - seconds_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Duration.seconds) -} - -// int32 nanos = 2; -void Duration::clear_nanos() { - nanos_ = 0; -} -::google::protobuf::int32 Duration::nanos() const { - // @@protoc_insertion_point(field_get:google.protobuf.Duration.nanos) - return nanos_; -} -void Duration::set_nanos(::google::protobuf::int32 value) { - - nanos_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Duration.nanos) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h index bed112b5..0489df43 100644 --- a/src/google/protobuf/duration.pb.h +++ b/src/google/protobuf/duration.pb.h @@ -30,31 +30,33 @@ #include // IWYU pragma: export #include // @@protoc_insertion_point(includes) -namespace google { -namespace protobuf { -class Duration; -class DurationDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern DurationDefaultTypeInternal _Duration_default_instance_; -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { namespace protobuf_google_2fprotobuf_2fduration_2eproto { -// Internal implementation detail -- do not call these. +// Internal implementation detail -- do not use these members. struct LIBPROTOBUF_EXPORT TableStruct { static const ::google::protobuf::internal::ParseTableField entries[]; static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; + static const ::google::protobuf::internal::ParseTable schema[1]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; - static void InitDefaultsImpl(); + static const ::google::protobuf::uint32 offsets[]; }; void LIBPROTOBUF_EXPORT AddDescriptors(); -void LIBPROTOBUF_EXPORT InitDefaults(); +void LIBPROTOBUF_EXPORT InitDefaultsDurationImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsDuration(); +inline void LIBPROTOBUF_EXPORT InitDefaults() { + InitDefaultsDuration(); +} } // namespace protobuf_google_2fprotobuf_2fduration_2eproto +namespace google { +namespace protobuf { +class Duration; +class DurationDefaultTypeInternal; +LIBPROTOBUF_EXPORT extern DurationDefaultTypeInternal _Duration_default_instance_; +} // namespace protobuf +} // namespace google +namespace google { +namespace protobuf { // =================================================================== @@ -93,6 +95,7 @@ class LIBPROTOBUF_EXPORT Duration : public ::google::protobuf::Message /* @@prot static const ::google::protobuf::Descriptor* descriptor(); static const Duration& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Duration* internal_default_instance() { return reinterpret_cast( &_Duration_default_instance_); @@ -173,14 +176,14 @@ class LIBPROTOBUF_EXPORT Duration : public ::google::protobuf::Message /* @@prot ::google::protobuf::int64 seconds_; ::google::protobuf::int32 nanos_; mutable int _cached_size_; - friend struct protobuf_google_2fprotobuf_2fduration_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fduration_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaultsDurationImpl(); }; // =================================================================== // =================================================================== -#if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -218,11 +221,9 @@ inline void Duration::set_nanos(::google::protobuf::int32 value) { #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc index 6d2ea338..0cc6a313 100644 --- a/src/google/protobuf/empty.pb.cc +++ b/src/google/protobuf/empty.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/empty.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,55 +15,50 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { class EmptyDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Empty_default_instance_; - +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2fempty_2eproto { +void InitDefaultsEmptyImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_Empty_default_instance_; + new (ptr) ::google::protobuf::Empty(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Empty::InitAsDefaultInstance(); +} -namespace { +void InitDefaultsEmpty() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEmptyImpl); +} ::google::protobuf::Metadata file_level_metadata[1]; -} // namespace - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField - const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, -}; - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField - const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - ::google::protobuf::internal::AuxillaryParseTableField(), -}; -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const - TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, -}; - -const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Empty, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Empty, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ }; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(Empty)}, +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::google::protobuf::Empty)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { - reinterpret_cast(&_Empty_default_instance_), + reinterpret_cast(&::google::protobuf::_Empty_default_instance_), }; -namespace { - void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; @@ -78,29 +72,15 @@ void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); } -} // namespace -void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::internal::InitProtobufDefaults(); - _Empty_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Empty_default_instance_);} - -void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); -} -namespace { void AddDescriptorsImpl() { InitDefaults(); - static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n\033google/protobuf/empty.proto\022\017google.pr" "otobuf\"\007\n\005EmptyBv\n\023com.google.protobufB\n" "EmptyProtoP\001Z\'github.com/golang/protobuf" @@ -112,7 +92,6 @@ void AddDescriptorsImpl() { ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/empty.proto", &protobuf_RegisterTypes); } -} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); @@ -124,19 +103,21 @@ struct StaticDescriptorInitializer { AddDescriptors(); } } static_descriptor_initializer; - } // namespace protobuf_google_2fprotobuf_2fempty_2eproto - +namespace google { +namespace protobuf { // =================================================================== +void Empty::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Empty::Empty() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaultsEmpty(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Empty) @@ -144,7 +125,7 @@ Empty::Empty() Empty::Empty(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { - protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaultsEmpty(); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Empty) @@ -187,12 +168,12 @@ void Empty::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Empty::descriptor() { - protobuf_google_2fprotobuf_2fempty_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fempty_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fempty_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fempty_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Empty& Empty::default_instance() { - protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaultsEmpty(); return *internal_default_instance(); } @@ -347,16 +328,11 @@ void Empty::InternalSwap(Empty* other) { ::google::protobuf::Metadata Empty::GetMetadata() const { protobuf_google_2fprotobuf_2fempty_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fempty_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fempty_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Empty - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h index 1c6e53e6..1d7c5887 100644 --- a/src/google/protobuf/empty.pb.h +++ b/src/google/protobuf/empty.pb.h @@ -30,31 +30,33 @@ #include // IWYU pragma: export #include // @@protoc_insertion_point(includes) -namespace google { -namespace protobuf { -class Empty; -class EmptyDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern EmptyDefaultTypeInternal _Empty_default_instance_; -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { namespace protobuf_google_2fprotobuf_2fempty_2eproto { -// Internal implementation detail -- do not call these. +// Internal implementation detail -- do not use these members. struct LIBPROTOBUF_EXPORT TableStruct { static const ::google::protobuf::internal::ParseTableField entries[]; static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; + static const ::google::protobuf::internal::ParseTable schema[1]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; - static void InitDefaultsImpl(); + static const ::google::protobuf::uint32 offsets[]; }; void LIBPROTOBUF_EXPORT AddDescriptors(); -void LIBPROTOBUF_EXPORT InitDefaults(); +void LIBPROTOBUF_EXPORT InitDefaultsEmptyImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsEmpty(); +inline void LIBPROTOBUF_EXPORT InitDefaults() { + InitDefaultsEmpty(); +} } // namespace protobuf_google_2fprotobuf_2fempty_2eproto +namespace google { +namespace protobuf { +class Empty; +class EmptyDefaultTypeInternal; +LIBPROTOBUF_EXPORT extern EmptyDefaultTypeInternal _Empty_default_instance_; +} // namespace protobuf +} // namespace google +namespace google { +namespace protobuf { // =================================================================== @@ -93,6 +95,7 @@ class LIBPROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_ static const ::google::protobuf::Descriptor* descriptor(); static const Empty& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Empty* internal_default_instance() { return reinterpret_cast( &_Empty_default_instance_); @@ -159,14 +162,14 @@ class LIBPROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_ typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; mutable int _cached_size_; - friend struct protobuf_google_2fprotobuf_2fempty_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fempty_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaultsEmptyImpl(); }; // =================================================================== // =================================================================== -#if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -176,11 +179,9 @@ class LIBPROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_ #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/extension_set.cc b/src/google/protobuf/extension_set.cc index 955c079b..cf6b6fb4 100644 --- a/src/google/protobuf/extension_set.cc +++ b/src/google/protobuf/extension_set.cc @@ -221,7 +221,7 @@ int ExtensionSet::NumExtensions() const { int ExtensionSet::ExtensionSize(int number) const { ExtensionMap::const_iterator iter = extensions_.find(number); - if (iter == extensions_.end()) return false; + if (iter == extensions_.end()) return 0; return iter->second.GetSize(); } diff --git a/src/google/protobuf/extension_set.h b/src/google/protobuf/extension_set.h index 6f47c4a6..0a5d98f2 100644 --- a/src/google/protobuf/extension_set.h +++ b/src/google/protobuf/extension_set.h @@ -697,6 +697,10 @@ inline void ExtensionSet::AddString(int number, FieldType type, // ExtensionSet* set); // static inline void Add(int number, ConstType value, ExtensionSet* set); // static inline MutableType Add(int number, ExtensionSet* set); +// This is used by the ExtensionIdentifier constructor to register +// the extension at dynamic initialization. +// template +// static void Register(int number, FieldType type, bool is_packed); // }; // // Not all of these methods make sense for all field types. For example, the @@ -728,6 +732,11 @@ class PrimitiveTypeTraits { ConstType default_value); static inline void Set(int number, FieldType field_type, ConstType value, ExtensionSet* set); + template + static void Register(int number, FieldType type, bool is_packed) { + ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number, + type, false, is_packed); + } }; template @@ -751,6 +760,11 @@ class RepeatedPrimitiveTypeTraits { bool is_packed, ExtensionSet* set); static const RepeatedFieldType* GetDefaultRepeatedField(); + template + static void Register(int number, FieldType type, bool is_packed) { + ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number, + type, true, is_packed); + } }; LIBPROTOBUF_EXPORT extern ProtobufOnceType repeated_primitive_generic_type_traits_once_init_; @@ -848,6 +862,11 @@ class LIBPROTOBUF_EXPORT StringTypeTraits { ExtensionSet* set) { return set->MutableString(number, field_type, NULL); } + template + static void Register(int number, FieldType type, bool is_packed) { + ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number, + type, false, is_packed); + } }; LIBPROTOBUF_EXPORT extern ProtobufOnceType repeated_string_type_traits_once_init_; @@ -900,6 +919,12 @@ class LIBPROTOBUF_EXPORT RepeatedStringTypeTraits { return default_repeated_field_; } + template + static void Register(int number, FieldType type, bool is_packed) { + ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number, + type, true, is_packed); + } + private: static void InitializeDefaultRepeatedFields(); static void DestroyDefaultRepeatedFields(); @@ -927,6 +952,11 @@ class EnumTypeTraits { GOOGLE_DCHECK(IsValid(value)); set->SetEnum(number, field_type, value, NULL); } + template + static void Register(int number, FieldType type, bool is_packed) { + ExtensionSet::RegisterEnumExtension(&ExtendeeT::default_instance(), number, + type, false, is_packed, IsValid); + } }; template @@ -980,6 +1010,11 @@ class RepeatedEnumTypeTraits { return reinterpret_cast*>( RepeatedPrimitiveTypeTraits::GetDefaultRepeatedField()); } + template + static void Register(int number, FieldType type, bool is_packed) { + ExtensionSet::RegisterEnumExtension(&ExtendeeT::default_instance(), number, + type, true, is_packed, IsValid); + } }; // ------------------------------------------------------------------- @@ -1025,6 +1060,12 @@ class MessageTypeTraits { return static_cast(set->UnsafeArenaReleaseMessage( number, Type::default_instance())); } + template + static void Register(int number, FieldType type, bool is_packed) { + ExtensionSet::RegisterMessageExtension(&ExtendeeT::default_instance(), + number, type, false, is_packed, + &Type::default_instance()); + } }; // forward declaration @@ -1070,6 +1111,12 @@ class RepeatedMessageTypeTraits { } static const RepeatedFieldType* GetDefaultRepeatedField(); + template + static void Register(int number, FieldType type, bool is_packed) { + ExtensionSet::RegisterMessageExtension(&ExtendeeT::default_instance(), + number, type, true, is_packed, + &Type::default_instance()); + } }; LIBPROTOBUF_EXPORT extern ProtobufOnceType repeated_message_generic_type_traits_once_init_; @@ -1121,12 +1168,18 @@ class ExtensionIdentifier { typedef ExtendeeType Extendee; ExtensionIdentifier(int number, typename TypeTraits::ConstType default_value) - : number_(number), default_value_(default_value) {} + : number_(number), default_value_(default_value) { + Register(number); + } 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); + } + private: const int number_; typename TypeTraits::ConstType default_value_; diff --git a/src/google/protobuf/extension_set_heavy.cc b/src/google/protobuf/extension_set_heavy.cc index f545fe30..fad31340 100644 --- a/src/google/protobuf/extension_set_heavy.cc +++ b/src/google/protobuf/extension_set_heavy.cc @@ -37,10 +37,12 @@ #include #include +#include #include #include #include #include +#include #include #include @@ -489,10 +491,10 @@ uint8* ExtensionSet::Extension::InternalSerializeFieldWithCachedSizesToArray( HANDLE_TYPE( ENUM, Enum, enum); #undef HANDLE_TYPE - case WireFormatLite::TYPE_STRING: - case WireFormatLite::TYPE_BYTES: - case WireFormatLite::TYPE_GROUP: - case WireFormatLite::TYPE_MESSAGE: + case FieldDescriptor::TYPE_STRING: + case FieldDescriptor::TYPE_BYTES: + case FieldDescriptor::TYPE_GROUP: + case FieldDescriptor::TYPE_MESSAGE: GOOGLE_LOG(FATAL) << "Non-primitive types can't be packed."; break; } diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc index afc3db56..a81a71f5 100644 --- a/src/google/protobuf/field_mask.pb.cc +++ b/src/google/protobuf/field_mask.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/field_mask.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,56 +15,51 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { class FieldMaskDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _FieldMask_default_instance_; - +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto { +void InitDefaultsFieldMaskImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_FieldMask_default_instance_; + new (ptr) ::google::protobuf::FieldMask(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::FieldMask::InitAsDefaultInstance(); +} -namespace { +void InitDefaultsFieldMask() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFieldMaskImpl); +} ::google::protobuf::Metadata file_level_metadata[1]; -} // namespace - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField - const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, -}; - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField - const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - ::google::protobuf::internal::AuxillaryParseTableField(), -}; -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const - TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, -}; - -const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldMask, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, paths_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FieldMask, paths_), }; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(FieldMask)}, +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::google::protobuf::FieldMask)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { - reinterpret_cast(&_FieldMask_default_instance_), + reinterpret_cast(&::google::protobuf::_FieldMask_default_instance_), }; -namespace { - void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; @@ -79,29 +73,15 @@ void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); } -} // namespace -void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::internal::InitProtobufDefaults(); - _FieldMask_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_FieldMask_default_instance_);} - -void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); -} -namespace { void AddDescriptorsImpl() { InitDefaults(); - static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n google/protobuf/field_mask.proto\022\017goog" "le.protobuf\"\032\n\tFieldMask\022\r\n\005paths\030\001 \003(\tB" "\211\001\n\023com.google.protobufB\016FieldMaskProtoP" @@ -114,7 +94,6 @@ void AddDescriptorsImpl() { ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/field_mask.proto", &protobuf_RegisterTypes); } -} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); @@ -126,12 +105,14 @@ struct StaticDescriptorInitializer { AddDescriptors(); } } static_descriptor_initializer; - } // namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto - +namespace google { +namespace protobuf { // =================================================================== +void FieldMask::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int FieldMask::kPathsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 @@ -139,7 +120,7 @@ const int FieldMask::kPathsFieldNumber; FieldMask::FieldMask() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::InitDefaultsFieldMask(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FieldMask) @@ -171,12 +152,12 @@ void FieldMask::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* FieldMask::descriptor() { - protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const FieldMask& FieldMask::default_instance() { - protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::InitDefaultsFieldMask(); return *internal_default_instance(); } @@ -373,85 +354,11 @@ void FieldMask::InternalSwap(FieldMask* other) { ::google::protobuf::Metadata FieldMask::GetMetadata() const { protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// FieldMask - -// repeated string paths = 1; -int FieldMask::paths_size() const { - return paths_.size(); -} -void FieldMask::clear_paths() { - paths_.Clear(); -} -const ::std::string& FieldMask::paths(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.FieldMask.paths) - return paths_.Get(index); -} -::std::string* FieldMask::mutable_paths(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.FieldMask.paths) - return paths_.Mutable(index); -} -void FieldMask::set_paths(int index, const ::std::string& value) { - // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths) - paths_.Mutable(index)->assign(value); -} -#if LANG_CXX11 -void FieldMask::set_paths(int index, ::std::string&& value) { - // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths) - paths_.Mutable(index)->assign(std::move(value)); -} -#endif -void FieldMask::set_paths(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); - paths_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:google.protobuf.FieldMask.paths) -} -void FieldMask::set_paths(int index, const char* value, size_t size) { - paths_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldMask.paths) -} -::std::string* FieldMask::add_paths() { - // @@protoc_insertion_point(field_add_mutable:google.protobuf.FieldMask.paths) - return paths_.Add(); -} -void FieldMask::add_paths(const ::std::string& value) { - paths_.Add()->assign(value); - // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths) -} -#if LANG_CXX11 -void FieldMask::add_paths(::std::string&& value) { - paths_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths) -} -#endif -void FieldMask::add_paths(const char* value) { - GOOGLE_DCHECK(value != NULL); - paths_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:google.protobuf.FieldMask.paths) -} -void FieldMask::add_paths(const char* value, size_t size) { - paths_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:google.protobuf.FieldMask.paths) -} -const ::google::protobuf::RepeatedPtrField< ::std::string>& -FieldMask::paths() const { - // @@protoc_insertion_point(field_list:google.protobuf.FieldMask.paths) - return paths_; -} -::google::protobuf::RepeatedPtrField< ::std::string>* -FieldMask::mutable_paths() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldMask.paths) - return &paths_; + return ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h index b8f10389..3275dc54 100644 --- a/src/google/protobuf/field_mask.pb.h +++ b/src/google/protobuf/field_mask.pb.h @@ -30,31 +30,33 @@ #include // IWYU pragma: export #include // @@protoc_insertion_point(includes) -namespace google { -namespace protobuf { -class FieldMask; -class FieldMaskDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern FieldMaskDefaultTypeInternal _FieldMask_default_instance_; -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto { -// Internal implementation detail -- do not call these. +// Internal implementation detail -- do not use these members. struct LIBPROTOBUF_EXPORT TableStruct { static const ::google::protobuf::internal::ParseTableField entries[]; static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; + static const ::google::protobuf::internal::ParseTable schema[1]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; - static void InitDefaultsImpl(); + static const ::google::protobuf::uint32 offsets[]; }; void LIBPROTOBUF_EXPORT AddDescriptors(); -void LIBPROTOBUF_EXPORT InitDefaults(); +void LIBPROTOBUF_EXPORT InitDefaultsFieldMaskImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsFieldMask(); +inline void LIBPROTOBUF_EXPORT InitDefaults() { + InitDefaultsFieldMask(); +} } // namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto +namespace google { +namespace protobuf { +class FieldMask; +class FieldMaskDefaultTypeInternal; +LIBPROTOBUF_EXPORT extern FieldMaskDefaultTypeInternal _FieldMask_default_instance_; +} // namespace protobuf +} // namespace google +namespace google { +namespace protobuf { // =================================================================== @@ -87,6 +89,7 @@ class LIBPROTOBUF_EXPORT FieldMask : public ::google::protobuf::Message /* @@pro static const ::google::protobuf::Descriptor* descriptor(); static const FieldMask& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const FieldMask* internal_default_instance() { return reinterpret_cast( &_FieldMask_default_instance_); @@ -167,14 +170,14 @@ class LIBPROTOBUF_EXPORT FieldMask : public ::google::protobuf::Message /* @@pro ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::google::protobuf::RepeatedPtrField< ::std::string> paths_; mutable int _cached_size_; - friend struct protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::InitDefaultsFieldMaskImpl(); }; // =================================================================== // =================================================================== -#if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -253,11 +256,9 @@ FieldMask::mutable_paths() { #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc index 263d52ab..f0f207ea 100644 --- a/src/google/protobuf/generated_message_reflection.cc +++ b/src/google/protobuf/generated_message_reflection.cc @@ -2250,17 +2250,15 @@ class AssignDescriptorsHelper { file_level_metadata_->descriptor = descriptor; - if (!descriptor->options().map_entry()) { - // Only set reflection for non map types. - file_level_metadata_->reflection = new GeneratedMessageReflection( - descriptor, MigrationToReflectionSchema(default_instance_data_, - offsets_, *schemas_), - ::google::protobuf::DescriptorPool::generated_pool(), factory_); - for (int i = 0; i < descriptor->enum_type_count(); i++) { - AssignEnumDescriptor(descriptor->enum_type(i)); - } - schemas_++; + file_level_metadata_->reflection = new GeneratedMessageReflection( + descriptor, + MigrationToReflectionSchema(default_instance_data_, offsets_, + *schemas_), + ::google::protobuf::DescriptorPool::generated_pool(), factory_); + for (int i = 0; i < descriptor->enum_type_count(); i++) { + AssignEnumDescriptor(descriptor->enum_type(i)); } + schemas_++; default_instance_data_++; file_level_metadata_++; } diff --git a/src/google/protobuf/generated_message_table_driven.h b/src/google/protobuf/generated_message_table_driven.h index 5eb63dbd..5b477051 100644 --- a/src/google/protobuf/generated_message_table_driven.h +++ b/src/google/protobuf/generated_message_table_driven.h @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -197,20 +198,6 @@ bool MergePartialFromCodedStream(MessageLite* msg, const ParseTable& table, bool MergePartialFromCodedStreamLite(MessageLite* msg, const ParseTable& table, io::CodedInputStream* input); -template -struct MapEntryToMapField; - -template -struct MapEntryToMapField > { - typedef MapFieldLite, - Key, Value, kKeyFieldType, kValueFieldType, - default_enum_value> - MapFieldType; -}; - template bool ParseMap(io::CodedInputStream* input, void* map_field) { typedef typename MapEntryToMapField::MapFieldType MapFieldType; diff --git a/src/google/protobuf/has_bits.h b/src/google/protobuf/has_bits.h index cb1d7ccc..e3a0149a 100644 --- a/src/google/protobuf/has_bits.h +++ b/src/google/protobuf/has_bits.h @@ -32,6 +32,7 @@ #define GOOGLE_PROTOBUF_HAS_BITS_H__ #include +#include namespace google { namespace protobuf { @@ -40,17 +41,18 @@ namespace internal { template class HasBits { public: - HasBits() GOOGLE_ATTRIBUTE_ALWAYS_INLINE { Clear(); } + HasBits() GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE { Clear(); } - void Clear() GOOGLE_ATTRIBUTE_ALWAYS_INLINE { + void Clear() GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE { memset(has_bits_, 0, sizeof(has_bits_)); } - ::google::protobuf::uint32& operator[](int index) GOOGLE_ATTRIBUTE_ALWAYS_INLINE { + ::google::protobuf::uint32& operator[](int index) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE { return has_bits_[index]; } - const ::google::protobuf::uint32& operator[](int index) const GOOGLE_ATTRIBUTE_ALWAYS_INLINE { + const ::google::protobuf::uint32& operator[](int index) const + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE { return has_bits_[index]; } diff --git a/src/google/protobuf/implicit_weak_message.cc b/src/google/protobuf/implicit_weak_message.cc new file mode 100644 index 00000000..0dd126be --- /dev/null +++ b/src/google/protobuf/implicit_weak_message.cc @@ -0,0 +1,51 @@ +// 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 + +#include +#include + +namespace google { +namespace protobuf { +namespace internal { + +::google::protobuf::internal::ExplicitlyConstructed + implicit_weak_message_default_instance; + +bool ImplicitWeakMessage::MergePartialFromCodedStream(io::CodedInputStream* input) { + io::StringOutputStream string_stream(&data_); + io::CodedOutputStream coded_stream(&string_stream, false); + return WireFormatLite::SkipMessage(input, &coded_stream); +} + +} // namespace internal +} // namespace protobuf +} // namespace google diff --git a/src/google/protobuf/implicit_weak_message.h b/src/google/protobuf/implicit_weak_message.h new file mode 100644 index 00000000..12cc7db9 --- /dev/null +++ b/src/google/protobuf/implicit_weak_message.h @@ -0,0 +1,89 @@ +// 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_IMPLICIT_WEAK_MESSAGE_H__ +#define GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__ + +#include +#include +#include + +namespace google { +namespace protobuf { +namespace internal { + +class LIBPROTOBUF_EXPORT ImplicitWeakMessage : public MessageLite { + public: + ImplicitWeakMessage() : arena_(NULL) {} + explicit ImplicitWeakMessage(Arena* arena) : arena_(arena) {} + + string GetTypeName() const { return ""; } + + MessageLite* New() const { return new ImplicitWeakMessage; } + MessageLite* New(Arena* arena) const { + return Arena::CreateMessage(arena); + } + + Arena* GetArena() const { return arena_; } + + void Clear() { data_.clear(); } + + bool IsInitialized() const { return true; } + + void CheckTypeAndMergeFrom(const MessageLite& other) { + data_.append(static_cast(other).data_); + } + + bool MergePartialFromCodedStream(io::CodedInputStream* input); + + size_t ByteSizeLong() const { return data_.size(); } + + void SerializeWithCachedSizes(io::CodedOutputStream* output) const { + output->WriteString(data_); + } + + int GetCachedSize() const { return data_.size(); } + + typedef void InternalArenaConstructable_; + + private: + Arena* const arena_; + string data_; + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImplicitWeakMessage); +}; + +extern ::google::protobuf::internal::ExplicitlyConstructed + implicit_weak_message_default_instance; + +} // namespace internal +} // namespace protobuf + +} // namespace google +#endif // GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__ diff --git a/src/google/protobuf/io/coded_stream.cc b/src/google/protobuf/io/coded_stream.cc index 17eb0ffa..79cff2c7 100644 --- a/src/google/protobuf/io/coded_stream.cc +++ b/src/google/protobuf/io/coded_stream.cc @@ -315,7 +315,8 @@ namespace { // The first part of the pair is true iff the read was successful. The second // part is buffer + (number of bytes read). This function is always inlined, // so returning a pair is costless. -GOOGLE_ATTRIBUTE_ALWAYS_INLINE ::std::pair ReadVarint32FromArray( +GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE +::std::pair ReadVarint32FromArray( uint32 first_byte, const uint8* buffer, uint32* value); inline ::std::pair ReadVarint32FromArray( @@ -352,8 +353,8 @@ inline ::std::pair ReadVarint32FromArray( return std::make_pair(true, ptr); } -GOOGLE_ATTRIBUTE_ALWAYS_INLINE::std::pair ReadVarint64FromArray( - const uint8* buffer, uint64* value); +GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE::std::pair +ReadVarint64FromArray(const uint8* buffer, uint64* value); inline ::std::pair ReadVarint64FromArray( const uint8* buffer, uint64* value) { const uint8* ptr = buffer; diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h index 6d2599fb..59db8ce1 100644 --- a/src/google/protobuf/io/coded_stream.h +++ b/src/google/protobuf/io/coded_stream.h @@ -134,6 +134,7 @@ #include #include #include +#include namespace google { @@ -197,28 +198,23 @@ class LIBPROTOBUF_EXPORT CodedInputStream { // Like GetDirectBufferPointer, but this method is inlined, and does not // attempt to Refresh() if the buffer is currently empty. - GOOGLE_ATTRIBUTE_ALWAYS_INLINE void GetDirectBufferPointerInline(const void** data, - int* size); + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + void GetDirectBufferPointerInline(const void** data, int* size); // Read raw bytes, copying them into the given buffer. bool ReadRaw(void* buffer, int size); // Like the above, with inlined optimizations. This should only be used // by the protobuf implementation. - GOOGLE_ATTRIBUTE_ALWAYS_INLINE bool InternalReadRawInline(void* buffer, int size); + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + bool InternalReadRawInline(void* buffer, int size); // Like ReadRaw, but reads into a string. - // - // Implementation Note: ReadString() grows the string gradually as it - // reads in the data, rather than allocating the entire requested size - // upfront. This prevents denial-of-service attacks in which a client - // could claim that a string is going to be MAX_INT bytes long in order to - // crash the server because it can't allocate this much space at once. bool ReadString(string* buffer, int size); // Like the above, with inlined optimizations. This should only be used // by the protobuf implementation. - GOOGLE_ATTRIBUTE_ALWAYS_INLINE bool InternalReadStringInline(string* buffer, - int size); + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + bool InternalReadStringInline(string* buffer, int size); // Read a 32-bit little-endian integer. @@ -261,11 +257,11 @@ class LIBPROTOBUF_EXPORT CodedInputStream { // Always inline because this is only called in one place per parse loop // but it is called for every iteration of said loop, so it should be fast. // GCC doesn't want to inline this by default. - GOOGLE_ATTRIBUTE_ALWAYS_INLINE uint32 ReadTag() { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE uint32 ReadTag() { return last_tag_ = ReadTagNoLastTag(); } - GOOGLE_ATTRIBUTE_ALWAYS_INLINE uint32 ReadTagNoLastTag(); + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE uint32 ReadTagNoLastTag(); // This usually a faster alternative to ReadTag() when cutoff is a manifest @@ -276,15 +272,15 @@ class LIBPROTOBUF_EXPORT CodedInputStream { // above cutoff or is 0. (There's intentional wiggle room when tag is 0, // because that can arise in several ways, and for best performance we want // to avoid an extra "is tag == 0?" check here.) - GOOGLE_ATTRIBUTE_ALWAYS_INLINE std::pair ReadTagWithCutoff( - uint32 cutoff) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + std::pair ReadTagWithCutoff(uint32 cutoff) { std::pair result = ReadTagWithCutoffNoLastTag(cutoff); last_tag_ = result.first; return result; } - GOOGLE_ATTRIBUTE_ALWAYS_INLINE std::pair ReadTagWithCutoffNoLastTag( - uint32 cutoff); + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + std::pair ReadTagWithCutoffNoLastTag(uint32 cutoff); // Usually returns true if calling ReadVarint32() now would produce the given // value. Will always return false if ReadVarint32() would not return the @@ -293,7 +289,7 @@ class LIBPROTOBUF_EXPORT CodedInputStream { // parameter. // Always inline because this collapses to a small number of instructions // when given a constant parameter, but GCC doesn't want to inline by default. - GOOGLE_ATTRIBUTE_ALWAYS_INLINE bool ExpectTag(uint32 expected); + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool ExpectTag(uint32 expected); // Like above, except this reads from the specified buffer. The caller is // responsible for ensuring that the buffer is large enough to read a varint @@ -302,9 +298,8 @@ class LIBPROTOBUF_EXPORT CodedInputStream { // // Returns a pointer beyond the expected tag if it was found, or NULL if it // was not. - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static const uint8* ExpectTagFromArray( - const uint8* buffer, - uint32 expected); + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static const uint8* ExpectTagFromArray(const uint8* buffer, uint32 expected); // Usually returns true if no more bytes can be read. Always returns false // if more bytes can be read. If ExpectAtEnd() returns true, a subsequent @@ -799,8 +794,8 @@ class LIBPROTOBUF_EXPORT CodedOutputStream { // but GCC by default doesn't want to inline this. void WriteTag(uint32 value); // Like WriteTag() but writing directly to the target array. - GOOGLE_ATTRIBUTE_ALWAYS_INLINE static uint8* WriteTagToArray(uint32 value, - uint8* target); + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + static uint8* WriteTagToArray(uint32 value, uint8* target); // Returns the number of bytes needed to encode the given value as a varint. static size_t VarintSize32(uint32 value); diff --git a/src/google/protobuf/io/zero_copy_stream_impl.cc b/src/google/protobuf/io/zero_copy_stream_impl.cc index 81fb5033..83dec3e6 100644 --- a/src/google/protobuf/io/zero_copy_stream_impl.cc +++ b/src/google/protobuf/io/zero_copy_stream_impl.cc @@ -43,9 +43,9 @@ #include #include #include -#include #include #include +#include namespace google { diff --git a/src/google/protobuf/io/zero_copy_stream_impl_lite.cc b/src/google/protobuf/io/zero_copy_stream_impl_lite.cc index 60c71c80..66ad49bc 100644 --- a/src/google/protobuf/io/zero_copy_stream_impl_lite.cc +++ b/src/google/protobuf/io/zero_copy_stream_impl_lite.cc @@ -196,27 +196,6 @@ void StringOutputStream::SetString(string* target) { // =================================================================== -LazyStringOutputStream::LazyStringOutputStream( - ResultCallback* callback) - : StringOutputStream(NULL), - callback_(GOOGLE_CHECK_NOTNULL(callback)), - string_is_set_(false) { -} - -bool LazyStringOutputStream::Next(void** data, int* size) { - if (!string_is_set_) { - SetString(callback_->Run()); - string_is_set_ = true; - } - return StringOutputStream::Next(data, size); -} - -int64 LazyStringOutputStream::ByteCount() const { - return string_is_set_ ? StringOutputStream::ByteCount() : 0; -} - -// =================================================================== - int CopyingInputStream::Skip(int count) { char junk[4096]; int skipped = 0; diff --git a/src/google/protobuf/io/zero_copy_stream_impl_lite.h b/src/google/protobuf/io/zero_copy_stream_impl_lite.h index a7bbc625..ab0fd5ac 100644 --- a/src/google/protobuf/io/zero_copy_stream_impl_lite.h +++ b/src/google/protobuf/io/zero_copy_stream_impl_lite.h @@ -156,26 +156,6 @@ class LIBPROTOBUF_EXPORT StringOutputStream : public ZeroCopyOutputStream { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringOutputStream); }; -// LazyStringOutputStream is a StringOutputStream with lazy acquisition of -// the output string from a callback. The string is owned externally, and not -// deleted in the stream destructor. -class LIBPROTOBUF_EXPORT LazyStringOutputStream : public StringOutputStream { - public: - // Callback should be permanent (non-self-deleting). Ownership is transferred - // to the LazyStringOutputStream. - explicit LazyStringOutputStream(ResultCallback* callback); - - // implements ZeroCopyOutputStream, overriding StringOutputStream ----------- - bool Next(void** data, int* size); - int64 ByteCount() const; - - private: - const google::protobuf::scoped_ptr > callback_; - bool string_is_set_; - - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(LazyStringOutputStream); -}; - // Note: There is no StringInputStream. Instead, just create an // ArrayInputStream as follows: // ArrayInputStream input(str.data(), str.size()); diff --git a/src/google/protobuf/io/zero_copy_stream_unittest.cc b/src/google/protobuf/io/zero_copy_stream_unittest.cc index 2bca6a90..dfc383a3 100644 --- a/src/google/protobuf/io/zero_copy_stream_unittest.cc +++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc @@ -70,11 +70,11 @@ #endif #include -#include #include #include #include #include +#include namespace google { namespace protobuf { diff --git a/src/google/protobuf/lite_arena_unittest.cc b/src/google/protobuf/lite_arena_unittest.cc index f0bee880..1f4c2540 100644 --- a/src/google/protobuf/lite_arena_unittest.cc +++ b/src/google/protobuf/lite_arena_unittest.cc @@ -37,13 +37,22 @@ namespace google { namespace protobuf { namespace { -TEST(LiteArenaTest, MapNoHeapAllocation) { - // Allocate a large initial block to avoid mallocs during hooked test. - std::vector arena_block(128 * 1024); - google::protobuf::ArenaOptions options; - options.initial_block = &arena_block[0]; - options.initial_block_size = arena_block.size(); - google::protobuf::Arena arena(options); +class LiteArenaTest : public testing::Test { + protected: + // We create an Arena with a large initial block of memory, so that tests can + // verify that no new allocations are made. + LiteArenaTest() : arena_block_(128 * 1024) { + ArenaOptions options; + options.initial_block = &arena_block_[0]; + options.initial_block_size = arena_block_.size(); + arena_.reset(new Arena(options)); + } + + std::vector arena_block_; + google::protobuf::scoped_ptr arena_; +}; + +TEST_F(LiteArenaTest, MapNoHeapAllocation) { string data; data.reserve(128 * 1024); @@ -53,22 +62,21 @@ TEST(LiteArenaTest, MapNoHeapAllocation) { // google::protobuf::internal::NoHeapChecker no_heap; protobuf_unittest::TestArenaMapLite* from = - google::protobuf::Arena::CreateMessage(&arena); + Arena::CreateMessage(arena_.get()); google::protobuf::MapLiteTestUtil::SetArenaMapFields(from); from->SerializeToString(&data); protobuf_unittest::TestArenaMapLite* to = - google::protobuf::Arena::CreateMessage(&arena); + Arena::CreateMessage(arena_.get()); to->ParseFromString(data); google::protobuf::MapLiteTestUtil::ExpectArenaMapFieldsSet(*to); } } -TEST(LiteArenaTest, UnknownFieldMemLeak) { - google::protobuf::Arena arena; +TEST_F(LiteArenaTest, UnknownFieldMemLeak) { protobuf_unittest::ForeignMessageArenaLite* message = google::protobuf::Arena::CreateMessage( - &arena); + arena_.get()); string data = "\012\000"; int original_capacity = data.capacity(); while (data.capacity() <= original_capacity) { diff --git a/src/google/protobuf/lite_unittest.cc b/src/google/protobuf/lite_unittest.cc index 6cf16629..d6693963 100644 --- a/src/google/protobuf/lite_unittest.cc +++ b/src/google/protobuf/lite_unittest.cc @@ -988,3 +988,18 @@ TEST(Lite, AllLite44) { std::cout << "PASS" << std::endl; } + +TEST(Lite, AllLite45) { + // Test unknown fields are not discarded upon parsing. + string data = "\20\1"; // varint 1 with field number 2 + + protobuf_unittest::ForeignMessageLite a; + EXPECT_TRUE(a.ParseFromString(data)); + google::protobuf::io::CodedInputStream input_stream( + reinterpret_cast(data.data()), data.size()); + EXPECT_TRUE(a.MergePartialFromCodedStream(&input_stream)); + + string serialized = a.SerializeAsString(); + EXPECT_EQ(serialized.substr(0, 2), data); + EXPECT_EQ(serialized.substr(2), data); +} diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 883556a7..63db2925 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -1142,9 +1142,7 @@ class Map { // Access to hasher. Currently this returns a copy, but it may // be modified to return a const reference in the future. - hasher hash_function() const { - return elements_->hash_function(); - } + hasher hash_function() const { return elements_->hash_function(); } private: // Set default enum value only for proto2 map field whose value is enum type. diff --git a/src/google/protobuf/map_entry.h b/src/google/protobuf/map_entry.h index afe809b2..801def97 100644 --- a/src/google/protobuf/map_entry.h +++ b/src/google/protobuf/map_entry.h @@ -87,29 +87,6 @@ class MapEntry : public MapEntryImpl { public: - // Create default MapEntry instance for given descriptor. Descriptor has to be - // given when creating default MapEntry instance because different map field - // may have the same type and MapEntry class. The given descriptor is needed - // to distinguish instances of the same MapEntry class. - static const Reflection* CreateReflection(const Descriptor* descriptor, - const Derived* entry) { - ReflectionSchema schema = { - entry, - offsets_, - has_bits_, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, _internal_metadata_), - -1, - -1, - sizeof(MapEntry), - -1, - }; - const Reflection* reflection = new GeneratedMessageReflection( - descriptor, schema, DescriptorPool::generated_pool(), - MessageFactory::generated_factory()); - return reflection; - } - MapEntry() : _internal_metadata_(NULL) {} explicit MapEntry(Arena* arena) : MapEntryImpl -uint32 MapEntry::offsets_[2] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, key_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, value_), -}; - -template -uint32 MapEntry::has_bits_[2] = {0, 1}; - // Specialization for the full runtime template struct MapEntryHelper > - : MapEntryHelper > { + : MapEntryHelper > { explicit MapEntryHelper(const MapPair& map_pair) - : MapEntryHelper >(map_pair) {} + : MapEntryHelper >( + map_pair) {} }; template #include #include +#include #include namespace google { @@ -132,14 +133,14 @@ class MapEntryImpl : public Base { static const WireFormatLite::FieldType kEntryValueFieldType = kValueFieldType; static const int kEntryDefaultEnumValue = default_enum_value; - MapEntryImpl() : default_instance_(NULL), arena_(NULL) { + MapEntryImpl() : arena_(NULL) { KeyTypeHandler::Initialize(&key_, NULL); ValueTypeHandler::InitializeMaybeByDefaultEnum(&value_, default_enum_value, NULL); _has_bits_[0] = 0; } - explicit MapEntryImpl(Arena* arena) : default_instance_(NULL), arena_(arena) { + explicit MapEntryImpl(Arena* arena) : arena_(arena) { KeyTypeHandler::Initialize(&key_, arena); ValueTypeHandler::InitializeMaybeByDefaultEnum(&value_, default_enum_value, arena); @@ -147,11 +148,9 @@ class MapEntryImpl : public Base { } ~MapEntryImpl() { - if (this != default_instance_) { - if (GetArenaNoVirtual() != NULL) return; - KeyTypeHandler::DeleteNoArena(key_); - ValueTypeHandler::DeleteNoArena(value_); - } + if (GetArenaNoVirtual() != NULL) return; + KeyTypeHandler::DeleteNoArena(key_); + ValueTypeHandler::DeleteNoArena(value_); } // accessors ====================================================== @@ -160,9 +159,8 @@ class MapEntryImpl : public Base { return KeyTypeHandler::GetExternalReference(key_); } virtual inline const ValueMapEntryAccessorType& value() const { - GOOGLE_CHECK(default_instance_ != NULL); - return ValueTypeHandler::DefaultIfNotInitialized(value_, - default_instance_->value_); + return ValueTypeHandler::DefaultIfNotInitialized( + value_, Derived::internal_default_instance()->value_); } inline KeyMapEntryAccessorType* mutable_key() { set_has_key(); @@ -265,13 +263,11 @@ class MapEntryImpl : public Base { Base* New() const { Derived* entry = new Derived; - entry->default_instance_ = default_instance_; return entry; } Base* New(Arena* arena) const { Derived* entry = Arena::CreateMessage(arena); - entry->default_instance_ = default_instance_; return entry; } @@ -309,13 +305,10 @@ class MapEntryImpl : public Base { clear_has_value(); } - void set_default_instance(MapEntryImpl* default_instance) { - default_instance_ = default_instance; - } - - void InitAsDefaultInstance() { - KeyTypeHandler::AssignDefaultValue(&key_); - ValueTypeHandler::AssignDefaultValue(&value_); + static void InitAsDefaultInstance() { + Derived* d = const_cast(Derived::internal_default_instance()); + KeyTypeHandler::AssignDefaultValue(&d->key_); + ValueTypeHandler::AssignDefaultValue(&d->value_); } Arena* GetArena() const { @@ -393,7 +386,7 @@ class MapEntryImpl : public Base { const Value& value() const { return *value_ptr_; } private: - void UseKeyAndValueFromEntry() GOOGLE_ATTRIBUTE_COLD { + void UseKeyAndValueFromEntry() GOOGLE_PROTOBUF_ATTRIBUTE_COLD { // Update key_ in case we need it later (because key() is called). // This is potentially inefficient, especially if the key is // expensive to copy (e.g., a long string), but this is a cold @@ -411,7 +404,7 @@ class MapEntryImpl : public Base { // into map_, we are not at the end of the input. This is unusual, but // allowed by the spec. bool ReadBeyondKeyValuePair(::google::protobuf::io::CodedInputStream* input) - GOOGLE_ATTRIBUTE_COLD { + GOOGLE_PROTOBUF_ATTRIBUTE_COLD { typedef MoveHelper class MapEntryLite - : public MapEntryImpl, - MessageLite, Key, Value, kKeyFieldType, + : public MapEntryImpl { public: - typedef MapEntryImpl SuperType; MapEntryLite() {} explicit MapEntryLite(Arena* arena) : SuperType(arena) {} - void MergeFrom(const MapEntryLite& other) { - MergeFromInternal(other); - } + void MergeFrom(const MapEntryLite& other) { MergeFromInternal(other); } + private: GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntryLite); }; @@ -563,9 +553,9 @@ class MapEntryLite template struct DeconstructMapEntry; -template -struct DeconstructMapEntry > { +struct DeconstructMapEntry > { typedef K Key; typedef V Value; static const WireFormatLite::FieldType kKeyFieldType = key; @@ -636,10 +626,11 @@ struct FromHelper { template struct MapEntryHelper; -template -struct MapEntryHelper > { +struct MapEntryHelper > { // Provide utilities to parse/serialize key/value. Provide utilities to // manipulate internal stored type. typedef MapTypeHandler KeyTypeHandler; diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h index bd478901..6c75a6da 100644 --- a/src/google/protobuf/map_field.h +++ b/src/google/protobuf/map_field.h @@ -217,8 +217,9 @@ class MapField : public TypeDefinedMapFieldBase { // Define message type for internal repeated field. typedef Derived EntryType; - typedef MapEntryLite EntryLiteType; + typedef MapEntryLite + EntryLiteType; // Define abbreviation for parent MapFieldLite typedef MapFieldLite { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapField); }; -template -struct MapEntryToMapField { - typedef DeconstructMapEntry T; - typedef MapField +template +struct MapEntryToMapField > { + typedef MapField MapFieldType; }; diff --git a/src/google/protobuf/map_field_lite.h b/src/google/protobuf/map_field_lite.h index 12d4e6ba..f648b430 100644 --- a/src/google/protobuf/map_field_lite.h +++ b/src/google/protobuf/map_field_lite.h @@ -121,6 +121,21 @@ bool AllAreInitialized(const Map& t) { return true; } +template +struct MapEntryToMapField : MapEntryToMapField {}; + +template +struct MapEntryToMapField > { + typedef MapFieldLite, + Key, Value, kKeyFieldType, kValueFieldType, + default_enum_value> + MapFieldType; +}; + } // namespace internal } // namespace protobuf diff --git a/src/google/protobuf/map_field_test.cc b/src/google/protobuf/map_field_test.cc index 8617a366..4e0e751c 100644 --- a/src/google/protobuf/map_field_test.cc +++ b/src/google/protobuf/map_field_test.cc @@ -101,7 +101,7 @@ class MapFieldBaseStub : public MapFieldBase { class MapFieldBasePrimitiveTest : public ::testing::Test { protected: - typedef unittest::TestMap::TestMap_MapInt32Int32Entry EntryType; + typedef unittest::TestMap_MapInt32Int32Entry_DoNotUse EntryType; typedef MapField MapFieldType; @@ -206,7 +206,7 @@ class MapFieldStateTest : public testing::TestWithParam { public: protected: - typedef unittest::TestMap::TestMap_MapInt32Int32Entry EntryType; + typedef unittest::TestMap_MapInt32Int32Entry_DoNotUse EntryType; typedef MapField MapFieldType; diff --git a/src/google/protobuf/map_test.cc b/src/google/protobuf/map_test.cc index 960589ce..cea193c8 100644 --- a/src/google/protobuf/map_test.cc +++ b/src/google/protobuf/map_test.cc @@ -130,7 +130,7 @@ class MapImplTest : public ::testing::Test { EXPECT_EQ(value, map_.at(key)); Map::iterator it = map_.find(key); - // interator dereferenceable + // iterator dereferenceable EXPECT_EQ(key, (*it).first); EXPECT_EQ(value, (*it).second); EXPECT_EQ(key, it->first); @@ -158,7 +158,7 @@ class MapImplTest : public ::testing::Test { EXPECT_EQ(value, const_map_.at(key)); Map::const_iterator const_it = const_map_.find(key); - // interator dereferenceable + // iterator dereferenceable EXPECT_EQ(key, (*const_it).first); EXPECT_EQ(value, (*const_it).second); EXPECT_EQ(key, const_it->first); @@ -558,7 +558,7 @@ TEST_F(MapImplTest, IteratorInvalidation) { #endif std::set s; int n = kMaxSizeToTest; - int frog = k1 + n; + unsigned int frog = k1 + n; while (n > 1 && s.size() < 25) { s.insert(n); n = static_cast(n * 100 / (101.0 + (frog & 63))); diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index c01d1974..a0d3feba 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -463,7 +463,7 @@ namespace internal { template<> #if defined(_MSC_VER) && (_MSC_VER >= 1800) // Note: force noinline to workaround MSVC compiler bug with /Zc:inline, issue #240 -GOOGLE_ATTRIBUTE_NOINLINE +GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE #endif Message* GenericTypeHandler::NewFromPrototype( const Message* prototype, google::protobuf::Arena* arena) { @@ -472,7 +472,7 @@ Message* GenericTypeHandler::NewFromPrototype( template<> #if defined(_MSC_VER) && (_MSC_VER >= 1800) // Note: force noinline to workaround MSVC compiler bug with /Zc:inline, issue #240 -GOOGLE_ATTRIBUTE_NOINLINE +GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE #endif google::protobuf::Arena* GenericTypeHandler::GetArena( Message* value) { @@ -481,7 +481,7 @@ google::protobuf::Arena* GenericTypeHandler::GetArena( template<> #if defined(_MSC_VER) && (_MSC_VER >= 1800) // Note: force noinline to workaround MSVC compiler bug with /Zc:inline, issue #240 -GOOGLE_ATTRIBUTE_NOINLINE +GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE #endif void* GenericTypeHandler::GetMaybeArenaPointer( Message* value) { diff --git a/src/google/protobuf/message.h b/src/google/protobuf/message.h index 44fe0fde..ab018596 100644 --- a/src/google/protobuf/message.h +++ b/src/google/protobuf/message.h @@ -327,18 +327,19 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite { // Typedef for backwards-compatibility. typedef google::protobuf::Reflection Reflection; - // Get a Descriptor for this message's type. This describes what - // fields the message contains, the types of those fields, etc. + // Get a non-owning pointer to a Descriptor for this message's type. This + // describes what fields the message contains, the types of those fields, etc. + // This object remains property of the Message. const Descriptor* GetDescriptor() const { return GetMetadata().descriptor; } - // Get the Reflection interface for this Message, which can be used to - // read and modify the fields of the Message dynamically (in other words, - // without knowing the message type at compile time). This object remains - // property of the Message. + // Get a non-owning pointer to the Reflection interface for this Message, + // which can be used to read and modify the fields of the Message dynamically + // (in other words, without knowing the message type at compile time). This + // object remains property of the Message. // // This method remains virtual in case a subclass does not implement // reflection and wants to override the default behavior. - virtual const Reflection* GetReflection() const { + virtual const Reflection* GetReflection() const PROTOBUF_FINAL { return GetMetadata().reflection; } @@ -496,11 +497,14 @@ class LIBPROTOBUF_EXPORT Reflection { int index1, int index2) const = 0; - // List all fields of the message which are currently set. This includes - // extensions. Singular fields will only be listed if HasField(field) would - // return true and repeated fields will only be listed if FieldSize(field) - // would return non-zero. Fields (both normal fields and extension fields) - // will be listed ordered by field number. + // List all fields of the message which are currently set, except for unknown + // fields, but including extension known to the parser (i.e. compiled in). + // Singular fields will only be listed if HasField(field) would return true + // and repeated fields will only be listed if FieldSize(field) would return + // non-zero. Fields (both normal fields and extension fields) will be listed + // ordered by field number. + // Use Reflection::GetUnknownFields() or message.unknown_fields() to also get + // access to fields/extensions unknown to the parser. virtual void ListFields( const Message& message, std::vector* output) const = 0; @@ -922,7 +926,7 @@ class LIBPROTOBUF_EXPORT Reflection { // Returns a raw pointer to the repeated field // - // "cpp_type" and "message_type" are decuded from the type parameter T passed + // "cpp_type" and "message_type" are deduced from the type parameter T passed // to Get(Mutable)RepeatedFieldRef. If T is a generated message type, // "message_type" should be set to its descriptor. Otherwise "message_type" // should be set to NULL. Implementations of this method should check whether diff --git a/src/google/protobuf/message_lite.cc b/src/google/protobuf/message_lite.cc index 83a92d5a..6184472d 100644 --- a/src/google/protobuf/message_lite.cc +++ b/src/google/protobuf/message_lite.cc @@ -103,15 +103,15 @@ string InitializationErrorMessage(const char* action, // call MergePartialFromCodedStream(). However, when parsing very small // messages, every function call introduces significant overhead. To avoid // this without reproducing code, we use these forced-inline helpers. -GOOGLE_ATTRIBUTE_ALWAYS_INLINE bool InlineMergeFromCodedStream( +GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool InlineMergeFromCodedStream( io::CodedInputStream* input, MessageLite* message); -GOOGLE_ATTRIBUTE_ALWAYS_INLINE bool InlineParseFromCodedStream( +GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool InlineParseFromCodedStream( io::CodedInputStream* input, MessageLite* message); -GOOGLE_ATTRIBUTE_ALWAYS_INLINE bool InlineParsePartialFromCodedStream( +GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool InlineParsePartialFromCodedStream( io::CodedInputStream* input, MessageLite* message); -GOOGLE_ATTRIBUTE_ALWAYS_INLINE bool InlineParseFromArray( +GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool InlineParseFromArray( const void* data, int size, MessageLite* message); -GOOGLE_ATTRIBUTE_ALWAYS_INLINE bool InlineParsePartialFromArray( +GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool InlineParsePartialFromArray( const void* data, int size, MessageLite* message); inline bool InlineMergeFromCodedStream(io::CodedInputStream* input, @@ -344,10 +344,13 @@ string MessageLite::SerializePartialAsString() const { return output; } -void MessageLite::SerializeWithCachedSizes(io::CodedOutputStream* output) const - { +void MessageLite::SerializeWithCachedSizes( + io::CodedOutputStream* output) const { GOOGLE_DCHECK(InternalGetTable()); - internal::TableSerialize(*this, static_cast(InternalGetTable()), output); + internal::TableSerialize( + *this, + static_cast(InternalGetTable()), + output); } // The table driven code optimizes the case that the CodedOutputStream buffer @@ -355,20 +358,20 @@ void MessageLite::SerializeWithCachedSizes(io::CodedOutputStream* output) const // If the proto is optimized for speed, this method will be overridden by // generated code for maximum speed. If the proto is optimized for size or // is lite, then we need to specialize this to avoid infinite recursion. -uint8* MessageLite::InternalSerializeWithCachedSizesToArray(bool deterministic, - uint8* target) const { +uint8* MessageLite::InternalSerializeWithCachedSizesToArray( + bool deterministic, uint8* target) const { const internal::SerializationTable* table = static_cast(InternalGetTable()); if (table == NULL) { // We only optimize this when using optimize_for = SPEED. In other cases - // we just use the CodedOutputStream path. - int size = GetCachedSize(); - io::ArrayOutputStream out(target, size); - io::CodedOutputStream coded_out(&out); - coded_out.SetSerializationDeterministic(deterministic); - SerializeWithCachedSizes(&coded_out); - GOOGLE_CHECK(!coded_out.HadError()); - return target + size; + // we just use the CodedOutputStream path. + int size = GetCachedSize(); + io::ArrayOutputStream out(target, size); + io::CodedOutputStream coded_out(&out); + coded_out.SetSerializationDeterministic(deterministic); + SerializeWithCachedSizes(&coded_out); + GOOGLE_CHECK(!coded_out.HadError()); + return target + size; } else { return internal::TableSerializeToArray(*this, table, deterministic, target); } diff --git a/src/google/protobuf/message_lite.h b/src/google/protobuf/message_lite.h index 2075f4b6..5cd6babc 100644 --- a/src/google/protobuf/message_lite.h +++ b/src/google/protobuf/message_lite.h @@ -43,25 +43,7 @@ #include #include #include - - -#if LANG_CXX11 && !defined(__NVCC__) -#define PROTOBUF_CXX11 1 -#else -#define PROTOBUF_CXX11 0 -#endif - -#if PROTOBUF_CXX11 -#define PROTOBUF_FINAL final -#else -#define PROTOBUF_FINAL -#endif - -#ifndef LIBPROTOBUF_EXPORT -#define LIBPROTOBUF_EXPORT -#endif - -#define PROTOBUF_RUNTIME_DEPRECATED(message) +#include namespace google { namespace protobuf { diff --git a/src/google/protobuf/message_unittest.cc b/src/google/protobuf/message_unittest.cc index 06a7f65c..86c43774 100644 --- a/src/google/protobuf/message_unittest.cc +++ b/src/google/protobuf/message_unittest.cc @@ -55,10 +55,10 @@ #include #include -#include #include #include #include +#include namespace google { namespace protobuf { diff --git a/src/google/protobuf/metadata_lite.h b/src/google/protobuf/metadata_lite.h index 6022be92..10692e9b 100644 --- a/src/google/protobuf/metadata_lite.h +++ b/src/google/protobuf/metadata_lite.h @@ -34,6 +34,7 @@ #include #include #include +#include namespace google { namespace protobuf { @@ -62,7 +63,7 @@ class InternalMetadataWithArenaBase { ptr_ = NULL; } - GOOGLE_ATTRIBUTE_ALWAYS_INLINE const T& unknown_fields() const { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE const T& unknown_fields() const { if (GOOGLE_PREDICT_FALSE(have_unknown_fields())) { return PtrValue()->unknown_fields; } else { @@ -70,7 +71,7 @@ class InternalMetadataWithArenaBase { } } - GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* mutable_unknown_fields() { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* mutable_unknown_fields() { if (GOOGLE_PREDICT_TRUE(have_unknown_fields())) { return &PtrValue()->unknown_fields; } else { @@ -78,7 +79,7 @@ class InternalMetadataWithArenaBase { } } - GOOGLE_ATTRIBUTE_ALWAYS_INLINE Arena* arena() const { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE Arena* arena() const { if (GOOGLE_PREDICT_FALSE(have_unknown_fields())) { return PtrValue()->arena; } else { @@ -86,11 +87,11 @@ class InternalMetadataWithArenaBase { } } - GOOGLE_ATTRIBUTE_ALWAYS_INLINE bool have_unknown_fields() const { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool have_unknown_fields() const { return PtrTag() == kTagContainer; } - GOOGLE_ATTRIBUTE_ALWAYS_INLINE void Swap(Derived* other) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Swap(Derived* other) { // Semantics here are that we swap only the unknown fields, not the arena // pointer. We cannot simply swap ptr_ with other->ptr_ because we need to // maintain our own arena ptr. Also, our ptr_ and other's ptr_ may be in @@ -102,19 +103,19 @@ class InternalMetadataWithArenaBase { } } - GOOGLE_ATTRIBUTE_ALWAYS_INLINE void MergeFrom(const Derived& other) { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void MergeFrom(const Derived& other) { if (other.have_unknown_fields()) { static_cast(this)->DoMergeFrom(other.unknown_fields()); } } - GOOGLE_ATTRIBUTE_ALWAYS_INLINE void Clear() { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Clear() { if (have_unknown_fields()) { static_cast(this)->DoClear(); } } - GOOGLE_ATTRIBUTE_ALWAYS_INLINE void* raw_arena_ptr() const { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void* raw_arena_ptr() const { return ptr_; } @@ -132,7 +133,7 @@ class InternalMetadataWithArenaBase { static const intptr_t kPtrValueMask = ~kPtrTagMask; // Accessors for pointer tag and pointer value. - GOOGLE_ATTRIBUTE_ALWAYS_INLINE int PtrTag() const { + GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE int PtrTag() const { return reinterpret_cast(ptr_) & kPtrTagMask; } @@ -147,7 +148,7 @@ class InternalMetadataWithArenaBase { Arena* arena; }; - GOOGLE_ATTRIBUTE_NOINLINE T* mutable_unknown_fields_slow() { + GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE T* mutable_unknown_fields_slow() { Arena* my_arena = arena(); Container* container = Arena::Create(my_arena); // Two-step assignment works around a bug in clang's static analyzer: @@ -190,6 +191,32 @@ class InternalMetadataWithArenaLite } }; +// This helper RAII class is needed to efficiently parse unknown fields. We +// should only call mutable_unknown_fields if there are actual unknown fields. +// The obvious thing to just use a stack string and swap it at the end of the +// parse won't work, because the destructor of StringOutputStream needs to be +// called before we can modify the string (it check-fails). Using +// LiteUnknownFieldSetter setter(&_internal_metadata_); +// StringOutputStream stream(setter.buffer()); +// guarantees that the string is only swapped after stream is destroyed. +class LIBPROTOBUF_EXPORT LiteUnknownFieldSetter { + public: + explicit LiteUnknownFieldSetter(InternalMetadataWithArenaLite* metadata) + : metadata_(metadata) { + if (metadata->have_unknown_fields()) { + buffer_.swap(*metadata->mutable_unknown_fields()); + } + } + ~LiteUnknownFieldSetter() { + if (!buffer_.empty()) metadata_->mutable_unknown_fields()->swap(buffer_); + } + string* buffer() { return &buffer_; } + + private: + InternalMetadataWithArenaLite* metadata_; + string buffer_; +}; + } // namespace internal } // namespace protobuf diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index d8003b8f..1910e362 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -60,6 +60,7 @@ #include #include #include +#include // Forward-declare these so that we can make them friends. @@ -118,6 +119,11 @@ class RepeatedField PROTOBUF_FINAL { RepeatedField& operator=(const RepeatedField& other); +#if LANG_CXX11 + RepeatedField(RepeatedField&& other) noexcept; + RepeatedField& operator=(RepeatedField&& other) noexcept; +#endif + bool empty() const; int size() const; @@ -280,6 +286,10 @@ class RepeatedField PROTOBUF_FINAL { friend class Arena; typedef void InternalArenaConstructable_; + + // Move 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|. @@ -473,8 +483,8 @@ class LIBPROTOBUF_EXPORT RepeatedPtrFieldBase { template const typename TypeHandler::Type* const* data() const; - template - GOOGLE_ATTRIBUTE_ALWAYS_INLINE void Swap(RepeatedPtrFieldBase* other); + template GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE + void Swap(RepeatedPtrFieldBase* other); void SwapElements(int index1, int index2); @@ -524,11 +534,11 @@ class LIBPROTOBUF_EXPORT RepeatedPtrFieldBase { void AddAllocatedInternal(typename TypeHandler::Type* value, google::protobuf::internal::false_type); - template GOOGLE_ATTRIBUTE_NOINLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE void AddAllocatedSlowWithCopy(typename TypeHandler::Type* value, Arena* value_arena, Arena* my_arena); - template GOOGLE_ATTRIBUTE_NOINLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE void AddAllocatedSlowWithoutCopy(typename TypeHandler::Type* value); template @@ -536,7 +546,7 @@ class LIBPROTOBUF_EXPORT RepeatedPtrFieldBase { template typename TypeHandler::Type* ReleaseLastInternal(google::protobuf::internal::false_type); - template GOOGLE_ATTRIBUTE_NOINLINE + template GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE void SwapFallback(RepeatedPtrFieldBase* other); inline Arena* GetArenaNoVirtual() const { @@ -623,8 +633,8 @@ class GenericTypeHandler { } static inline void Clear(GenericType* value) { value->Clear(); } - GOOGLE_ATTRIBUTE_NOINLINE static void Merge(const GenericType& from, - GenericType* to); + GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE + static void Merge(const GenericType& from, GenericType* to); static inline size_t SpaceUsedLong(const GenericType& value) { return value.SpaceUsedLong(); } @@ -770,6 +780,11 @@ class RepeatedPtrField PROTOBUF_FINAL : public internal::RepeatedPtrFieldBase { RepeatedPtrField& operator=(const RepeatedPtrField& other); +#if LANG_CXX11 + RepeatedPtrField(RepeatedPtrField&& other) noexcept; + RepeatedPtrField& operator=(RepeatedPtrField&& other) noexcept; +#endif + bool empty() const; int size() const; @@ -1086,6 +1101,37 @@ RepeatedField::operator=(const RepeatedField& other) { return *this; } +#if LANG_CXX11 + +template +inline RepeatedField::RepeatedField(RepeatedField&& other) noexcept + : RepeatedField() { + // We don't just call Swap(&other) here because it would perform 3 copies if + // the two fields are on different arenas. + if (other.GetArenaNoVirtual()) { + CopyFrom(other); + } else { + InternalSwap(&other); + } +} + +template +inline RepeatedField& RepeatedField::operator=( + RepeatedField&& other) noexcept { + // 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 (this->GetArenaNoVirtual() != other.GetArenaNoVirtual()) { + CopyFrom(other); + } else { + InternalSwap(&other); + } + } + return *this; +} + +#endif // LANG_CXX11 + template inline bool RepeatedField::empty() const { return current_size_ == 0; @@ -1900,6 +1946,38 @@ inline RepeatedPtrField& RepeatedPtrField::operator=( return *this; } +#if LANG_CXX11 + +template +inline RepeatedPtrField::RepeatedPtrField( + RepeatedPtrField&& other) noexcept + : RepeatedPtrField() { + // We don't just call Swap(&other) here because it would perform 3 copies if + // the two fields are on different arenas. + if (other.GetArenaNoVirtual()) { + CopyFrom(other); + } else { + InternalSwap(&other); + } +} + +template +inline RepeatedPtrField& RepeatedPtrField::operator=( + RepeatedPtrField&& other) noexcept { + // 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 (this->GetArenaNoVirtual() != other.GetArenaNoVirtual()) { + CopyFrom(other); + } else { + InternalSwap(&other); + } + } + return *this; +} + +#endif // LANG_CXX11 + template inline bool RepeatedPtrField::empty() const { return RepeatedPtrFieldBase::empty(); @@ -2184,7 +2262,7 @@ class RepeatedPtrIterator : it_(other.it_) { // Force a compiler error if the other type is not convertible to ours. if (false) { - implicit_cast(0); + implicit_cast(static_cast(NULL)); } } diff --git a/src/google/protobuf/repeated_field_unittest.cc b/src/google/protobuf/repeated_field_unittest.cc index ae501465..16919711 100644 --- a/src/google/protobuf/repeated_field_unittest.cc +++ b/src/google/protobuf/repeated_field_unittest.cc @@ -45,17 +45,19 @@ #include #include #include +#include #include #include #include #include namespace google { -using protobuf_unittest::TestAllTypes; - namespace protobuf { namespace { +using ::protobuf_unittest::TestAllTypes; +using ::testing::ElementsAre; + // Test operations on a small RepeatedField. TEST(RepeatedField, Small) { RepeatedField field; @@ -267,15 +269,6 @@ TEST(RepeatedField, MergeFrom) { EXPECT_EQ(5, destination.Get(4)); } -#ifdef PROTOBUF_HAS_DEATH_TEST -#ifndef NDEBUG -TEST(RepeatedField, MergeFromSelf) { - RepeatedField me; - me.Add(3); - EXPECT_DEATH(me.MergeFrom(me), ""); -} -#endif // NDEBUG -#endif // PROTOBUF_HAS_DEATH_TEST TEST(RepeatedField, CopyFrom) { RepeatedField source, destination; @@ -390,6 +383,142 @@ TEST(RepeatedField, SelfAssign) { EXPECT_EQ(8, source.Get(1)); } +#if LANG_CXX11 + +TEST(RepeatedField, MoveConstruct) { + { + RepeatedField source; + source.Add(1); + source.Add(2); + const int* data = source.data(); + RepeatedField destination = std::move(source); + EXPECT_EQ(data, destination.data()); + EXPECT_THAT(destination, ElementsAre(1, 2)); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_TRUE(source.empty()); + } + { + Arena arena; + RepeatedField* source = + Arena::CreateMessage>(&arena); + source->Add(1); + source->Add(2); + RepeatedField destination = std::move(*source); + EXPECT_EQ(NULL, destination.GetArena()); + EXPECT_THAT(destination, ElementsAre(1, 2)); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_THAT(*source, ElementsAre(1, 2)); + } +} + +TEST(RepeatedField, MoveAssign) { + { + RepeatedField source; + source.Add(1); + source.Add(2); + RepeatedField destination; + destination.Add(3); + const int* source_data = source.data(); + const int* destination_data = destination.data(); + destination = std::move(source); + EXPECT_EQ(source_data, destination.data()); + EXPECT_THAT(destination, ElementsAre(1, 2)); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_EQ(destination_data, source.data()); + EXPECT_THAT(source, ElementsAre(3)); + } + { + Arena arena; + RepeatedField* source = + Arena::CreateMessage>(&arena); + source->Add(1); + source->Add(2); + RepeatedField* destination = + Arena::CreateMessage>(&arena); + destination->Add(3); + const int* source_data = source->data(); + const int* destination_data = destination->data(); + *destination = std::move(*source); + EXPECT_EQ(source_data, destination->data()); + EXPECT_THAT(*destination, ElementsAre(1, 2)); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_EQ(destination_data, source->data()); + EXPECT_THAT(*source, ElementsAre(3)); + } + { + Arena source_arena; + RepeatedField* source = + Arena::CreateMessage>(&source_arena); + source->Add(1); + source->Add(2); + Arena destination_arena; + RepeatedField* destination = + Arena::CreateMessage>(&destination_arena); + destination->Add(3); + *destination = std::move(*source); + EXPECT_THAT(*destination, ElementsAre(1, 2)); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_THAT(*source, ElementsAre(1, 2)); + } + { + Arena arena; + RepeatedField* source = + Arena::CreateMessage>(&arena); + source->Add(1); + source->Add(2); + RepeatedField destination; + destination.Add(3); + destination = std::move(*source); + EXPECT_THAT(destination, ElementsAre(1, 2)); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_THAT(*source, ElementsAre(1, 2)); + } + { + RepeatedField source; + source.Add(1); + source.Add(2); + Arena arena; + RepeatedField* destination = + Arena::CreateMessage>(&arena); + destination->Add(3); + *destination = std::move(source); + EXPECT_THAT(*destination, ElementsAre(1, 2)); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_THAT(source, ElementsAre(1, 2)); + } + { + RepeatedField field; + // An alias to defeat -Wself-move. + RepeatedField& alias = field; + field.Add(1); + field.Add(2); + const int* data = field.data(); + field = std::move(alias); + EXPECT_EQ(data, field.data()); + EXPECT_THAT(field, ElementsAre(1, 2)); + } + { + Arena arena; + RepeatedField* field = + Arena::CreateMessage>(&arena); + field->Add(1); + field->Add(2); + const int* data = field->data(); + *field = std::move(*field); + EXPECT_EQ(data, field->data()); + EXPECT_THAT(*field, ElementsAre(1, 2)); + } +} + +#endif // LANG_CXX11 + TEST(RepeatedField, MutableDataIsMutable) { RepeatedField field; field.Add(1); @@ -783,13 +912,6 @@ TEST(RepeatedPtrField, MergeFrom) { EXPECT_EQ("5", destination.Get(4)); } -#ifdef PROTOBUF_HAS_DEATH_TEST -TEST(RepeatedPtrField, MergeFromSelf) { - RepeatedPtrField me; - me.Add()->assign("1"); - EXPECT_DEATH(me.MergeFrom(me), ""); -} -#endif // PROTOBUF_HAS_DEATH_TEST TEST(RepeatedPtrField, CopyFrom) { RepeatedPtrField source, destination; @@ -923,6 +1045,142 @@ TEST(RepeatedPtrField, SelfAssign) { EXPECT_EQ("8", source.Get(1)); } +#if LANG_CXX11 + +TEST(RepeatedPtrField, MoveConstruct) { + { + RepeatedPtrField source; + *source.Add() = "1"; + *source.Add() = "2"; + const string* const* data = source.data(); + RepeatedPtrField destination = std::move(source); + EXPECT_EQ(data, destination.data()); + EXPECT_THAT(destination, ElementsAre("1", "2")); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_TRUE(source.empty()); + } + { + Arena arena; + RepeatedPtrField* source = + Arena::CreateMessage>(&arena); + *source->Add() = "1"; + *source->Add() = "2"; + RepeatedPtrField destination = std::move(*source); + EXPECT_EQ(NULL, destination.GetArena()); + EXPECT_THAT(destination, ElementsAre("1", "2")); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_THAT(*source, ElementsAre("1", "2")); + } +} + +TEST(RepeatedPtrField, MoveAssign) { + { + RepeatedPtrField source; + *source.Add() = "1"; + *source.Add() = "2"; + RepeatedPtrField destination; + *destination.Add() = "3"; + const string* const* source_data = source.data(); + const string* const* destination_data = destination.data(); + destination = std::move(source); + EXPECT_EQ(source_data, destination.data()); + EXPECT_THAT(destination, ElementsAre("1", "2")); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_EQ(destination_data, source.data()); + EXPECT_THAT(source, ElementsAre("3")); + } + { + Arena arena; + RepeatedPtrField* source = + Arena::CreateMessage>(&arena); + *source->Add() = "1"; + *source->Add() = "2"; + RepeatedPtrField* destination = + Arena::CreateMessage>(&arena); + *destination->Add() = "3"; + const string* const* source_data = source->data(); + const string* const* destination_data = destination->data(); + *destination = std::move(*source); + EXPECT_EQ(source_data, destination->data()); + EXPECT_THAT(*destination, ElementsAre("1", "2")); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_EQ(destination_data, source->data()); + EXPECT_THAT(*source, ElementsAre("3")); + } + { + Arena source_arena; + RepeatedPtrField* source = + Arena::CreateMessage>(&source_arena); + *source->Add() = "1"; + *source->Add() = "2"; + Arena destination_arena; + RepeatedPtrField* destination = + Arena::CreateMessage>(&destination_arena); + *destination->Add() = "3"; + *destination = std::move(*source); + EXPECT_THAT(*destination, ElementsAre("1", "2")); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_THAT(*source, ElementsAre("1", "2")); + } + { + Arena arena; + RepeatedPtrField* source = + Arena::CreateMessage>(&arena); + *source->Add() = "1"; + *source->Add() = "2"; + RepeatedPtrField destination; + *destination.Add() = "3"; + destination = std::move(*source); + EXPECT_THAT(destination, ElementsAre("1", "2")); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_THAT(*source, ElementsAre("1", "2")); + } + { + RepeatedPtrField source; + *source.Add() = "1"; + *source.Add() = "2"; + Arena arena; + RepeatedPtrField* destination = + Arena::CreateMessage>(&arena); + *destination->Add() = "3"; + *destination = std::move(source); + EXPECT_THAT(*destination, ElementsAre("1", "2")); + // This property isn't guaranteed but it's useful to have a test that would + // catch changes in this area. + EXPECT_THAT(source, ElementsAre("1", "2")); + } + { + RepeatedPtrField field; + // An alias to defeat -Wself-move. + RepeatedPtrField& alias = field; + *field.Add() = "1"; + *field.Add() = "2"; + const string* const* data = field.data(); + field = std::move(alias); + EXPECT_EQ(data, field.data()); + EXPECT_THAT(field, ElementsAre("1", "2")); + } + { + Arena arena; + RepeatedPtrField* field = + Arena::CreateMessage>(&arena); + *field->Add() = "1"; + *field->Add() = "2"; + const string* const* data = field->data(); + *field = std::move(*field); + EXPECT_EQ(data, field->data()); + EXPECT_THAT(*field, ElementsAre("1", "2")); + } +} + +#endif // LANG_CXX11 + TEST(RepeatedPtrField, MutableDataIsMutable) { RepeatedPtrField field; *field.Add() = "1"; diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc index a69739c4..8024bcd1 100644 --- a/src/google/protobuf/source_context.pb.cc +++ b/src/google/protobuf/source_context.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/source_context.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,56 +15,51 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { class SourceContextDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _SourceContext_default_instance_; - +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto { +void InitDefaultsSourceContextImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_SourceContext_default_instance_; + new (ptr) ::google::protobuf::SourceContext(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::SourceContext::InitAsDefaultInstance(); +} -namespace { +void InitDefaultsSourceContext() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSourceContextImpl); +} ::google::protobuf::Metadata file_level_metadata[1]; -} // namespace - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField - const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, -}; - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField - const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - ::google::protobuf::internal::AuxillaryParseTableField(), -}; -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const - TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, -}; - -const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceContext, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceContext, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceContext, file_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceContext, file_name_), }; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(SourceContext)}, +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::google::protobuf::SourceContext)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { - reinterpret_cast(&_SourceContext_default_instance_), + reinterpret_cast(&::google::protobuf::_SourceContext_default_instance_), }; -namespace { - void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; @@ -79,29 +73,15 @@ void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); } -} // namespace -void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::internal::InitProtobufDefaults(); - _SourceContext_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_SourceContext_default_instance_);} - -void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); -} -namespace { void AddDescriptorsImpl() { InitDefaults(); - static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n$google/protobuf/source_context.proto\022\017" "google.protobuf\"\"\n\rSourceContext\022\021\n\tfile" "_name\030\001 \001(\tB\225\001\n\023com.google.protobufB\022Sou" @@ -115,7 +95,6 @@ void AddDescriptorsImpl() { ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/source_context.proto", &protobuf_RegisterTypes); } -} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); @@ -127,12 +106,14 @@ struct StaticDescriptorInitializer { AddDescriptors(); } } static_descriptor_initializer; - } // namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto - +namespace google { +namespace protobuf { // =================================================================== +void SourceContext::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int SourceContext::kFileNameFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 @@ -140,7 +121,7 @@ const int SourceContext::kFileNameFieldNumber; SourceContext::SourceContext() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaultsSourceContext(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.SourceContext) @@ -177,12 +158,12 @@ void SourceContext::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* SourceContext::descriptor() { - protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const SourceContext& SourceContext::default_instance() { - protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaultsSourceContext(); return *internal_default_instance(); } @@ -381,69 +362,11 @@ void SourceContext::InternalSwap(SourceContext* other) { ::google::protobuf::Metadata SourceContext::GetMetadata() const { protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::file_level_metadata[kIndexInFileMessages]; -} - -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// SourceContext - -// string file_name = 1; -void SourceContext::clear_file_name() { - file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -const ::std::string& SourceContext::file_name() const { - // @@protoc_insertion_point(field_get:google.protobuf.SourceContext.file_name) - return file_name_.GetNoArena(); -} -void SourceContext::set_file_name(const ::std::string& value) { - - file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:google.protobuf.SourceContext.file_name) -} -#if LANG_CXX11 -void SourceContext::set_file_name(::std::string&& value) { - - file_name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.SourceContext.file_name) -} -#endif -void SourceContext::set_file_name(const char* value) { - GOOGLE_DCHECK(value != NULL); - - file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:google.protobuf.SourceContext.file_name) -} -void SourceContext::set_file_name(const char* value, size_t size) { - - file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceContext.file_name) -} -::std::string* SourceContext::mutable_file_name() { - - // @@protoc_insertion_point(field_mutable:google.protobuf.SourceContext.file_name) - return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -::std::string* SourceContext::release_file_name() { - // @@protoc_insertion_point(field_release:google.protobuf.SourceContext.file_name) - - return file_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); -} -void SourceContext::set_allocated_file_name(::std::string* file_name) { - if (file_name != NULL) { - - } else { - - } - file_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), file_name); - // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceContext.file_name) + return ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::file_level_metadata[kIndexInFileMessages]; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h index b4617c57..1e5499ca 100644 --- a/src/google/protobuf/source_context.pb.h +++ b/src/google/protobuf/source_context.pb.h @@ -30,31 +30,33 @@ #include // IWYU pragma: export #include // @@protoc_insertion_point(includes) -namespace google { -namespace protobuf { -class SourceContext; -class SourceContextDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern SourceContextDefaultTypeInternal _SourceContext_default_instance_; -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto { -// Internal implementation detail -- do not call these. +// Internal implementation detail -- do not use these members. struct LIBPROTOBUF_EXPORT TableStruct { static const ::google::protobuf::internal::ParseTableField entries[]; static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; + static const ::google::protobuf::internal::ParseTable schema[1]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; - static void InitDefaultsImpl(); + static const ::google::protobuf::uint32 offsets[]; }; void LIBPROTOBUF_EXPORT AddDescriptors(); -void LIBPROTOBUF_EXPORT InitDefaults(); +void LIBPROTOBUF_EXPORT InitDefaultsSourceContextImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsSourceContext(); +inline void LIBPROTOBUF_EXPORT InitDefaults() { + InitDefaultsSourceContext(); +} } // namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto +namespace google { +namespace protobuf { +class SourceContext; +class SourceContextDefaultTypeInternal; +LIBPROTOBUF_EXPORT extern SourceContextDefaultTypeInternal _SourceContext_default_instance_; +} // namespace protobuf +} // namespace google +namespace google { +namespace protobuf { // =================================================================== @@ -87,6 +89,7 @@ class LIBPROTOBUF_EXPORT SourceContext : public ::google::protobuf::Message /* @ static const ::google::protobuf::Descriptor* descriptor(); static const SourceContext& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const SourceContext* internal_default_instance() { return reinterpret_cast( &_SourceContext_default_instance_); @@ -159,14 +162,14 @@ class LIBPROTOBUF_EXPORT SourceContext : public ::google::protobuf::Message /* @ ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; ::google::protobuf::internal::ArenaStringPtr file_name_; mutable int _cached_size_; - friend struct protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaultsSourceContextImpl(); }; // =================================================================== // =================================================================== -#if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -229,11 +232,9 @@ inline void SourceContext::set_allocated_file_name(::std::string* file_name) { #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index 02d9306e..3bbbbfa4 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/struct.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,23 +15,22 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { -class Struct_FieldsEntryDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; -} _Struct_FieldsEntry_default_instance_; +class Struct_FieldsEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Struct_FieldsEntry_DoNotUse_default_instance_; class StructDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Struct_default_instance_; class ValueDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; int null_value_; double number_value_; ::google::protobuf::internal::ArenaStringPtr string_value_; @@ -41,86 +39,105 @@ public: const ::google::protobuf::ListValue* list_value_; } _Value_default_instance_; class ListValueDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _ListValue_default_instance_; - +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2fstruct_2eproto { +void InitDefaultsListValueImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_Struct_FieldsEntry_DoNotUse_default_instance_; + new (ptr) ::google::protobuf::Struct_FieldsEntry_DoNotUse(); + } + { + void* ptr = &::google::protobuf::_Struct_default_instance_; + new (ptr) ::google::protobuf::Struct(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + { + void* ptr = &::google::protobuf::_Value_default_instance_; + new (ptr) ::google::protobuf::Value(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + { + void* ptr = &::google::protobuf::_ListValue_default_instance_; + new (ptr) ::google::protobuf::ListValue(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Struct_FieldsEntry_DoNotUse::InitAsDefaultInstance(); + ::google::protobuf::Struct::InitAsDefaultInstance(); + ::google::protobuf::Value::InitAsDefaultInstance(); + ::google::protobuf::ListValue::InitAsDefaultInstance(); +} -namespace { +void InitDefaultsListValue() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsListValueImpl); +} ::google::protobuf::Metadata file_level_metadata[4]; const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; -} // namespace - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField - const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, -}; - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField - const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - ::google::protobuf::internal::AuxillaryParseTableField(), -}; -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const - TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, -}; - -const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, value_), + 0, + 1, ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, fields_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct, fields_), ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, _internal_metadata_), ~0u, // no _extensions_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _oneof_case_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, _oneof_case_[0]), ~0u, // no _weak_field_map_ - offsetof(ValueDefaultTypeInternal, null_value_), - offsetof(ValueDefaultTypeInternal, number_value_), - offsetof(ValueDefaultTypeInternal, string_value_), - offsetof(ValueDefaultTypeInternal, bool_value_), - offsetof(ValueDefaultTypeInternal, struct_value_), - offsetof(ValueDefaultTypeInternal, list_value_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, kind_), + offsetof(::google::protobuf::ValueDefaultTypeInternal, null_value_), + offsetof(::google::protobuf::ValueDefaultTypeInternal, number_value_), + offsetof(::google::protobuf::ValueDefaultTypeInternal, string_value_), + offsetof(::google::protobuf::ValueDefaultTypeInternal, bool_value_), + offsetof(::google::protobuf::ValueDefaultTypeInternal, struct_value_), + offsetof(::google::protobuf::ValueDefaultTypeInternal, list_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, kind_), ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ListValue, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, values_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ListValue, values_), }; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(Struct)}, - { 6, -1, sizeof(Value)}, - { 18, -1, sizeof(ListValue)}, +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 7, sizeof(::google::protobuf::Struct_FieldsEntry_DoNotUse)}, + { 9, -1, sizeof(::google::protobuf::Struct)}, + { 15, -1, sizeof(::google::protobuf::Value)}, + { 27, -1, sizeof(::google::protobuf::ListValue)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { - reinterpret_cast(&_Struct_FieldsEntry_default_instance_), - reinterpret_cast(&_Struct_default_instance_), - reinterpret_cast(&_Value_default_instance_), - reinterpret_cast(&_ListValue_default_instance_), + reinterpret_cast(&::google::protobuf::_Struct_FieldsEntry_DoNotUse_default_instance_), + reinterpret_cast(&::google::protobuf::_Struct_default_instance_), + reinterpret_cast(&::google::protobuf::_Value_default_instance_), + reinterpret_cast(&::google::protobuf::_ListValue_default_instance_), }; -namespace { - void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( "google/protobuf/struct.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, file_level_enum_descriptors, NULL); -file_level_metadata[0].reflection = Struct::Struct_FieldsEntry::CreateReflection(file_level_metadata[0].descriptor, _Struct_FieldsEntry_default_instance_._instance.get_mutable()); } void protobuf_AssignDescriptorsOnce() { @@ -128,46 +145,15 @@ void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); } -} // namespace -void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::internal::InitProtobufDefaults(); - _Struct_FieldsEntry_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Struct_FieldsEntry_default_instance_);_Struct_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Struct_default_instance_);_Value_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Value_default_instance_);_ListValue_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_ListValue_default_instance_);_Struct_FieldsEntry_default_instance_._instance.get_mutable()->set_default_instance(_Struct_FieldsEntry_default_instance_._instance.get_mutable()); - _Struct_FieldsEntry_default_instance_._instance.get_mutable()->InitAsDefaultInstance(); - _Value_default_instance_.null_value_ = 0; - _Value_default_instance_.number_value_ = 0; - _Value_default_instance_.string_value_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - _Value_default_instance_.bool_value_ = false; - _Value_default_instance_.struct_value_ = const_cast< ::google::protobuf::Struct*>( - ::google::protobuf::Struct::internal_default_instance()); - _Value_default_instance_.list_value_ = const_cast< ::google::protobuf::ListValue*>( - ::google::protobuf::ListValue::internal_default_instance()); -} - -void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); -} -namespace { void AddDescriptorsImpl() { InitDefaults(); - static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n\034google/protobuf/struct.proto\022\017google.p" "rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo" "gle.protobuf.Struct.FieldsEntry\032E\n\013Field" @@ -191,7 +177,6 @@ void AddDescriptorsImpl() { ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/struct.proto", &protobuf_RegisterTypes); } -} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); @@ -203,9 +188,9 @@ struct StaticDescriptorInitializer { AddDescriptors(); } } static_descriptor_initializer; - } // namespace protobuf_google_2fprotobuf_2fstruct_2eproto - +namespace google { +namespace protobuf { const ::google::protobuf::EnumDescriptor* NullValue_descriptor() { protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_enum_descriptors[0]; @@ -222,25 +207,25 @@ bool NullValue_IsValid(int value) { // =================================================================== -Struct::Struct_FieldsEntry::Struct_FieldsEntry() {} -Struct::Struct_FieldsEntry::Struct_FieldsEntry(::google::protobuf::Arena* arena) : SuperType(arena) {} -::google::protobuf::Metadata Struct::Struct_FieldsEntry::GetMetadata() const { - protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[0]; +Struct_FieldsEntry_DoNotUse::Struct_FieldsEntry_DoNotUse() {} +Struct_FieldsEntry_DoNotUse::Struct_FieldsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void Struct_FieldsEntry_DoNotUse::MergeFrom(const Struct_FieldsEntry_DoNotUse& other) { + MergeFromInternal(other); } -void Struct::Struct_FieldsEntry::MergeFrom( +::google::protobuf::Metadata Struct_FieldsEntry_DoNotUse::GetMetadata() const { + ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[0]; +} +void Struct_FieldsEntry_DoNotUse::MergeFrom( const ::google::protobuf::Message& other) { ::google::protobuf::Message::MergeFrom(other); } -void Struct::Struct_FieldsEntry::MergeFrom(const Struct_FieldsEntry& other) { - MergeFromInternal(other); -} -#if PROTOBUF_INLINE_NOT_IN_HEADERS -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void Struct::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Struct::kFieldsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 @@ -248,7 +233,7 @@ const int Struct::kFieldsFieldNumber; Struct::Struct() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Struct) @@ -257,7 +242,7 @@ Struct::Struct(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), fields_(arena) { - protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Struct) @@ -301,12 +286,12 @@ void Struct::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Struct::descriptor() { - protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Struct& Struct::default_instance() { - protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); return *internal_default_instance(); } @@ -338,8 +323,8 @@ bool Struct::MergePartialFromCodedStream( case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - Struct_FieldsEntry::Parser< ::google::protobuf::internal::MapField< - Struct_FieldsEntry, + Struct_FieldsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + Struct_FieldsEntry_DoNotUse, ::std::string, ::google::protobuf::Value, ::google::protobuf::internal::WireFormatLite::TYPE_STRING, ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, @@ -410,7 +395,7 @@ void Struct::SerializeWithCachedSizes( items[static_cast(n)] = SortItem(&*it); } ::std::sort(&items[0], &items[static_cast(n)], Less()); - ::google::protobuf::scoped_ptr entry; + ::google::protobuf::scoped_ptr entry; for (size_type i = 0; i < n; i++) { entry.reset(fields_.NewEntryWrapper( items[static_cast(i)]->first, items[static_cast(i)]->second)); @@ -422,7 +407,7 @@ void Struct::SerializeWithCachedSizes( Utf8Check::Check(items[static_cast(i)]); } } else { - ::google::protobuf::scoped_ptr entry; + ::google::protobuf::scoped_ptr entry; for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator it = this->fields().begin(); it != this->fields().end(); ++it) { @@ -479,7 +464,7 @@ void Struct::SerializeWithCachedSizes( items[static_cast(n)] = SortItem(&*it); } ::std::sort(&items[0], &items[static_cast(n)], Less()); - ::google::protobuf::scoped_ptr entry; + ::google::protobuf::scoped_ptr entry; for (size_type i = 0; i < n; i++) { entry.reset(fields_.NewEntryWrapper( items[static_cast(i)]->first, items[static_cast(i)]->second)); @@ -493,7 +478,7 @@ void Struct::SerializeWithCachedSizes( Utf8Check::Check(items[static_cast(i)]); } } else { - ::google::protobuf::scoped_ptr entry; + ::google::protobuf::scoped_ptr entry; for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator it = this->fields().begin(); it != this->fields().end(); ++it) { @@ -532,7 +517,7 @@ size_t Struct::ByteSizeLong() const { total_size += 1 * ::google::protobuf::internal::FromIntSize(this->fields_size()); { - ::google::protobuf::scoped_ptr entry; + ::google::protobuf::scoped_ptr entry; for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator it = this->fields().begin(); it != this->fields().end(); ++it) { @@ -626,34 +611,23 @@ void Struct::InternalSwap(Struct* other) { ::google::protobuf::Metadata Struct::GetMetadata() const { protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Struct - -// map fields = 1; -int Struct::fields_size() const { - return fields_.size(); -} -void Struct::clear_fields() { - fields_.Clear(); -} - const ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >& -Struct::fields() const { - // @@protoc_insertion_point(field_map:google.protobuf.Struct.fields) - return fields_.GetMap(); -} - ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >* -Struct::mutable_fields() { - // @@protoc_insertion_point(field_mutable_map:google.protobuf.Struct.fields) - return fields_.MutableMap(); -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void Value::InitAsDefaultInstance() { + ::google::protobuf::_Value_default_instance_.null_value_ = 0; + ::google::protobuf::_Value_default_instance_.number_value_ = 0; + ::google::protobuf::_Value_default_instance_.string_value_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::google::protobuf::_Value_default_instance_.bool_value_ = false; + ::google::protobuf::_Value_default_instance_.struct_value_ = const_cast< ::google::protobuf::Struct*>( + ::google::protobuf::Struct::internal_default_instance()); + ::google::protobuf::_Value_default_instance_.list_value_ = const_cast< ::google::protobuf::ListValue*>( + ::google::protobuf::ListValue::internal_default_instance()); +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Value::kNullValueFieldNumber; const int Value::kNumberValueFieldNumber; @@ -666,7 +640,7 @@ const int Value::kListValueFieldNumber; Value::Value() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Value) @@ -674,7 +648,7 @@ Value::Value() Value::Value(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { - protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Value) @@ -751,12 +725,12 @@ void Value::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Value::descriptor() { - protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Value& Value::default_instance() { - protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); return *internal_default_instance(); } @@ -1194,411 +1168,14 @@ void Value::InternalSwap(Value* other) { ::google::protobuf::Metadata Value::GetMetadata() const { protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Value - -// .google.protobuf.NullValue null_value = 1; -bool Value::has_null_value() const { - return kind_case() == kNullValue; -} -void Value::set_has_null_value() { - _oneof_case_[0] = kNullValue; -} -void Value::clear_null_value() { - if (has_null_value()) { - kind_.null_value_ = 0; - clear_has_kind(); - } -} -::google::protobuf::NullValue Value::null_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.Value.null_value) - if (has_null_value()) { - return static_cast< ::google::protobuf::NullValue >(kind_.null_value_); - } - return static_cast< ::google::protobuf::NullValue >(0); -} -void Value::set_null_value(::google::protobuf::NullValue value) { - if (!has_null_value()) { - clear_kind(); - set_has_null_value(); - } - kind_.null_value_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Value.null_value) -} - -// double number_value = 2; -bool Value::has_number_value() const { - return kind_case() == kNumberValue; -} -void Value::set_has_number_value() { - _oneof_case_[0] = kNumberValue; -} -void Value::clear_number_value() { - if (has_number_value()) { - kind_.number_value_ = 0; - clear_has_kind(); - } -} -double Value::number_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.Value.number_value) - if (has_number_value()) { - return kind_.number_value_; - } - return 0; -} -void Value::set_number_value(double value) { - if (!has_number_value()) { - clear_kind(); - set_has_number_value(); - } - kind_.number_value_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Value.number_value) -} - -// string string_value = 3; -bool Value::has_string_value() const { - return kind_case() == kStringValue; -} -void Value::set_has_string_value() { - _oneof_case_[0] = kStringValue; -} -void Value::clear_string_value() { - if (has_string_value()) { - kind_.string_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - clear_has_kind(); - } -} -const ::std::string& Value::string_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.Value.string_value) - if (has_string_value()) { - return kind_.string_value_.Get(); - } - return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); -} -void Value::set_string_value(const ::std::string& value) { - if (!has_string_value()) { - clear_kind(); - set_has_string_value(); - kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - kind_.string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value) -} -#if LANG_CXX11 -void Value::set_string_value(::std::string&& value) { - // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value) - if (!has_string_value()) { - clear_kind(); - set_has_string_value(); - kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - kind_.string_value_.Set( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Value.string_value) -} -#endif -void Value::set_string_value(const char* value) { - GOOGLE_DCHECK(value != NULL); - if (!has_string_value()) { - clear_kind(); - set_has_string_value(); - kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - kind_.string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.protobuf.Value.string_value) -} -void Value::set_string_value(const char* value, - size_t size) { - if (!has_string_value()) { - clear_kind(); - set_has_string_value(); - kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - kind_.string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.protobuf.Value.string_value) -} -::std::string* Value::mutable_string_value() { - if (!has_string_value()) { - clear_kind(); - set_has_string_value(); - kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - return kind_.string_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_mutable:google.protobuf.Value.string_value) -} -::std::string* Value::release_string_value() { - // @@protoc_insertion_point(field_release:google.protobuf.Value.string_value) - if (has_string_value()) { - clear_has_kind(); - return kind_.string_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - } else { - return NULL; - } -} -::std::string* Value::unsafe_arena_release_string_value() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.string_value) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (has_string_value()) { - clear_has_kind(); - return kind_.string_value_.UnsafeArenaRelease( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - } else { - return NULL; - } -} -void Value::set_allocated_string_value(::std::string* string_value) { - if (!has_string_value()) { - kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - clear_kind(); - if (string_value != NULL) { - set_has_string_value(); - kind_.string_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value, - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.string_value) -} -void Value::unsafe_arena_set_allocated_string_value(::std::string* string_value) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (!has_string_value()) { - kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - } - clear_kind(); - if (string_value) { - set_has_string_value(); - kind_.string_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value, GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.string_value) -} - -// bool bool_value = 4; -bool Value::has_bool_value() const { - return kind_case() == kBoolValue; -} -void Value::set_has_bool_value() { - _oneof_case_[0] = kBoolValue; -} -void Value::clear_bool_value() { - if (has_bool_value()) { - kind_.bool_value_ = false; - clear_has_kind(); - } -} -bool Value::bool_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.Value.bool_value) - if (has_bool_value()) { - return kind_.bool_value_; - } - return false; -} -void Value::set_bool_value(bool value) { - if (!has_bool_value()) { - clear_kind(); - set_has_bool_value(); - } - kind_.bool_value_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Value.bool_value) -} - -// .google.protobuf.Struct struct_value = 5; -bool Value::has_struct_value() const { - return kind_case() == kStructValue; -} -void Value::set_has_struct_value() { - _oneof_case_[0] = kStructValue; -} -void Value::clear_struct_value() { - if (has_struct_value()) { - if (GetArenaNoVirtual() == NULL) { - delete kind_.struct_value_; - } - clear_has_kind(); - } -} - const ::google::protobuf::Struct& Value::struct_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.Value.struct_value) - return has_struct_value() - ? *kind_.struct_value_ - : ::google::protobuf::Struct::default_instance(); -} -::google::protobuf::Struct* Value::mutable_struct_value() { - if (!has_struct_value()) { - clear_kind(); - set_has_struct_value(); - kind_.struct_value_ = - ::google::protobuf::Arena::CreateMessage< ::google::protobuf::Struct >( - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_mutable:google.protobuf.Value.struct_value) - return kind_.struct_value_; -} -::google::protobuf::Struct* Value::release_struct_value() { - // @@protoc_insertion_point(field_release:google.protobuf.Value.struct_value) - if (has_struct_value()) { - clear_has_kind(); - if (GetArenaNoVirtual() != NULL) { - ::google::protobuf::Struct* temp = new ::google::protobuf::Struct(*kind_.struct_value_); - kind_.struct_value_ = NULL; - return temp; - } else { - ::google::protobuf::Struct* temp = kind_.struct_value_; - kind_.struct_value_ = NULL; - return temp; - } - } else { - return NULL; - } -} -void Value::set_allocated_struct_value(::google::protobuf::Struct* struct_value) { - clear_kind(); - if (struct_value) { - if (GetArenaNoVirtual() != NULL && - ::google::protobuf::Arena::GetArena(struct_value) == NULL) { - GetArenaNoVirtual()->Own(struct_value); - } else if (GetArenaNoVirtual() != - ::google::protobuf::Arena::GetArena(struct_value)) { - ::google::protobuf::Struct* new_struct_value = - ::google::protobuf::Arena::CreateMessage< ::google::protobuf::Struct >( - GetArenaNoVirtual()); - new_struct_value->CopyFrom(*struct_value); - struct_value = new_struct_value; - } - set_has_struct_value(); - kind_.struct_value_ = struct_value; - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.struct_value) -} - ::google::protobuf::Struct* Value::unsafe_arena_release_struct_value() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.struct_value) - if (has_struct_value()) { - clear_has_kind(); - ::google::protobuf::Struct* temp = kind_.struct_value_; - kind_.struct_value_ = NULL; - return temp; - } else { - return NULL; - } -} - void Value::unsafe_arena_set_allocated_struct_value(::google::protobuf::Struct* struct_value) { - clear_kind(); - if (struct_value) { - set_has_struct_value(); - kind_.struct_value_ = struct_value; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.struct_value) -} - -// .google.protobuf.ListValue list_value = 6; -bool Value::has_list_value() const { - return kind_case() == kListValue; -} -void Value::set_has_list_value() { - _oneof_case_[0] = kListValue; -} -void Value::clear_list_value() { - if (has_list_value()) { - if (GetArenaNoVirtual() == NULL) { - delete kind_.list_value_; - } - clear_has_kind(); - } -} - const ::google::protobuf::ListValue& Value::list_value() const { - // @@protoc_insertion_point(field_get:google.protobuf.Value.list_value) - return has_list_value() - ? *kind_.list_value_ - : ::google::protobuf::ListValue::default_instance(); -} -::google::protobuf::ListValue* Value::mutable_list_value() { - if (!has_list_value()) { - clear_kind(); - set_has_list_value(); - kind_.list_value_ = - ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ListValue >( - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_mutable:google.protobuf.Value.list_value) - return kind_.list_value_; -} -::google::protobuf::ListValue* Value::release_list_value() { - // @@protoc_insertion_point(field_release:google.protobuf.Value.list_value) - if (has_list_value()) { - clear_has_kind(); - if (GetArenaNoVirtual() != NULL) { - ::google::protobuf::ListValue* temp = new ::google::protobuf::ListValue(*kind_.list_value_); - kind_.list_value_ = NULL; - return temp; - } else { - ::google::protobuf::ListValue* temp = kind_.list_value_; - kind_.list_value_ = NULL; - return temp; - } - } else { - return NULL; - } -} -void Value::set_allocated_list_value(::google::protobuf::ListValue* list_value) { - clear_kind(); - if (list_value) { - if (GetArenaNoVirtual() != NULL && - ::google::protobuf::Arena::GetArena(list_value) == NULL) { - GetArenaNoVirtual()->Own(list_value); - } else if (GetArenaNoVirtual() != - ::google::protobuf::Arena::GetArena(list_value)) { - ::google::protobuf::ListValue* new_list_value = - ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ListValue >( - GetArenaNoVirtual()); - new_list_value->CopyFrom(*list_value); - list_value = new_list_value; - } - set_has_list_value(); - kind_.list_value_ = list_value; - } - // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.list_value) -} - ::google::protobuf::ListValue* Value::unsafe_arena_release_list_value() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.list_value) - if (has_list_value()) { - clear_has_kind(); - ::google::protobuf::ListValue* temp = kind_.list_value_; - kind_.list_value_ = NULL; - return temp; - } else { - return NULL; - } -} - void Value::unsafe_arena_set_allocated_list_value(::google::protobuf::ListValue* list_value) { - clear_kind(); - if (list_value) { - set_has_list_value(); - kind_.list_value_ = list_value; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.list_value) -} - -bool Value::has_kind() const { - return kind_case() != KIND_NOT_SET; -} -void Value::clear_has_kind() { - _oneof_case_[0] = KIND_NOT_SET; -} -Value::KindCase Value::kind_case() const { - return Value::KindCase(_oneof_case_[0]); -} -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== +void ListValue::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int ListValue::kValuesFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 @@ -1606,7 +1183,7 @@ const int ListValue::kValuesFieldNumber; ListValue::ListValue() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ListValue) @@ -1615,7 +1192,7 @@ ListValue::ListValue(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), values_(arena) { - protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.ListValue) @@ -1659,12 +1236,12 @@ void ListValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ListValue::descriptor() { - protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const ListValue& ListValue::default_instance() { - protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValue(); return *internal_default_instance(); } @@ -1865,46 +1442,11 @@ void ListValue::InternalSwap(ListValue* other) { ::google::protobuf::Metadata ListValue::GetMetadata() const { protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// ListValue - -// repeated .google.protobuf.Value values = 1; -int ListValue::values_size() const { - return values_.size(); -} -void ListValue::clear_values() { - values_.Clear(); -} -const ::google::protobuf::Value& ListValue::values(int index) const { - // @@protoc_insertion_point(field_get:google.protobuf.ListValue.values) - return values_.Get(index); -} -::google::protobuf::Value* ListValue::mutable_values(int index) { - // @@protoc_insertion_point(field_mutable:google.protobuf.ListValue.values) - return values_.Mutable(index); -} -::google::protobuf::Value* ListValue::add_values() { - // @@protoc_insertion_point(field_add:google.protobuf.ListValue.values) - return values_.Add(); -} -::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >* -ListValue::mutable_values() { - // @@protoc_insertion_point(field_mutable_list:google.protobuf.ListValue.values) - return &values_; -} -const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >& -ListValue::values() const { - // @@protoc_insertion_point(field_list:google.protobuf.ListValue.values) - return values_; -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h index 57ae7d90..2145ffda 100644 --- a/src/google/protobuf/struct.pb.h +++ b/src/google/protobuf/struct.pb.h @@ -34,6 +34,24 @@ #include #include // @@protoc_insertion_point(includes) + +namespace protobuf_google_2fprotobuf_2fstruct_2eproto { +// Internal implementation detail -- do not use these members. +struct LIBPROTOBUF_EXPORT TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[4]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void LIBPROTOBUF_EXPORT AddDescriptors(); +void LIBPROTOBUF_EXPORT InitDefaultsListValueImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsListValue(); +inline void LIBPROTOBUF_EXPORT InitDefaults() { + InitDefaultsListValue(); +} +} // namespace protobuf_google_2fprotobuf_2fstruct_2eproto namespace google { namespace protobuf { class ListValue; @@ -42,33 +60,17 @@ LIBPROTOBUF_EXPORT extern ListValueDefaultTypeInternal _ListValue_default_instan class Struct; class StructDefaultTypeInternal; LIBPROTOBUF_EXPORT extern StructDefaultTypeInternal _Struct_default_instance_; -class Struct_FieldsEntry; -class Struct_FieldsEntryDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern Struct_FieldsEntryDefaultTypeInternal _Struct_FieldsEntry_default_instance_; +class Struct_FieldsEntry_DoNotUse; +class Struct_FieldsEntry_DoNotUseDefaultTypeInternal; +LIBPROTOBUF_EXPORT extern Struct_FieldsEntry_DoNotUseDefaultTypeInternal _Struct_FieldsEntry_DoNotUse_default_instance_; class Value; class ValueDefaultTypeInternal; LIBPROTOBUF_EXPORT extern ValueDefaultTypeInternal _Value_default_instance_; } // namespace protobuf } // namespace google - namespace google { namespace protobuf { -namespace protobuf_google_2fprotobuf_2fstruct_2eproto { -// Internal implementation detail -- do not call these. -struct LIBPROTOBUF_EXPORT TableStruct { - static const ::google::protobuf::internal::ParseTableField entries[]; - static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; - static const ::google::protobuf::internal::FieldMetadata field_metadata[]; - static const ::google::protobuf::internal::SerializationTable serialization_table[]; - static void InitDefaultsImpl(); -}; -void LIBPROTOBUF_EXPORT AddDescriptors(); -void LIBPROTOBUF_EXPORT InitDefaults(); -} // namespace protobuf_google_2fprotobuf_2fstruct_2eproto - enum NullValue { NULL_VALUE = 0, NullValue_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, @@ -91,6 +93,24 @@ inline bool NullValue_Parse( } // =================================================================== +class Struct_FieldsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + Struct_FieldsEntry_DoNotUse(); + Struct_FieldsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const Struct_FieldsEntry_DoNotUse& other); + static const Struct_FieldsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Struct_FieldsEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) PROTOBUF_FINAL; + ::google::protobuf::Metadata GetMetadata() const; +}; // ------------------------------------------------------------------- @@ -129,6 +149,7 @@ class LIBPROTOBUF_EXPORT Struct : public ::google::protobuf::Message /* @@protoc static const ::google::protobuf::Descriptor* descriptor(); static const Struct& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Struct* internal_default_instance() { return reinterpret_cast( &_Struct_default_instance_); @@ -204,35 +225,15 @@ class LIBPROTOBUF_EXPORT Struct : public ::google::protobuf::Message /* @@protoc template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - public: - class Struct_FieldsEntry : public ::google::protobuf::internal::MapEntry { - public: - typedef ::google::protobuf::internal::MapEntry SuperType; - Struct_FieldsEntry(); - Struct_FieldsEntry(::google::protobuf::Arena* arena); - void MergeFrom(const ::google::protobuf::Message& other) PROTOBUF_FINAL; - void MergeFrom(const Struct_FieldsEntry& other); - static const Message* internal_default_instance() { return reinterpret_cast(&_Struct_FieldsEntry_default_instance_); } - ::google::protobuf::Metadata GetMetadata() const; - }; - private: ::google::protobuf::internal::MapField< - Struct_FieldsEntry, + Struct_FieldsEntry_DoNotUse, ::std::string, ::google::protobuf::Value, ::google::protobuf::internal::WireFormatLite::TYPE_STRING, ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, 0 > fields_; - private: mutable int _cached_size_; - friend struct protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValueImpl(); }; // ------------------------------------------------------------------- @@ -281,6 +282,7 @@ class LIBPROTOBUF_EXPORT Value : public ::google::protobuf::Message /* @@protoc_ KIND_NOT_SET = 0, }; + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Value* internal_default_instance() { return reinterpret_cast( &_Value_default_instance_); @@ -452,7 +454,8 @@ class LIBPROTOBUF_EXPORT Value : public ::google::protobuf::Message /* @@protoc_ mutable int _cached_size_; ::google::protobuf::uint32 _oneof_case_[1]; - friend struct protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValueImpl(); }; // ------------------------------------------------------------------- @@ -491,6 +494,7 @@ class LIBPROTOBUF_EXPORT ListValue : public ::google::protobuf::Message /* @@pro static const ::google::protobuf::Descriptor* descriptor(); static const ListValue& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const ListValue* internal_default_instance() { return reinterpret_cast( &_ListValue_default_instance_); @@ -570,14 +574,14 @@ class LIBPROTOBUF_EXPORT ListValue : public ::google::protobuf::Message /* @@pro typedef void DestructorSkippable_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value > values_; mutable int _cached_size_; - friend struct protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaultsListValueImpl(); }; // =================================================================== // =================================================================== -#if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -728,7 +732,8 @@ inline void Value::set_string_value(const char* value, set_has_string_value(); kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } - kind_.string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + kind_.string_value_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.protobuf.Value.string_value) @@ -886,7 +891,7 @@ inline void Value::set_allocated_struct_value(::google::protobuf::Struct* struct } // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.struct_value) } -inline ::google::protobuf::Struct* Value::unsafe_arena_release_struct_value() { +inline ::google::protobuf::Struct* Value::unsafe_arena_release_struct_value() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.struct_value) if (has_struct_value()) { clear_has_kind(); @@ -974,7 +979,7 @@ inline void Value::set_allocated_list_value(::google::protobuf::ListValue* list_ } // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.list_value) } -inline ::google::protobuf::ListValue* Value::unsafe_arena_release_list_value() { +inline ::google::protobuf::ListValue* Value::unsafe_arena_release_list_value() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.list_value) if (has_list_value()) { clear_has_kind(); @@ -1040,7 +1045,6 @@ ListValue::values() const { #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // ------------------------------------------------------------------- @@ -1050,7 +1054,6 @@ ListValue::values() const { // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/stubs/hash.h b/src/google/protobuf/stubs/hash.h index 612b5861..218cd948 100644 --- a/src/google/protobuf/stubs/hash.h +++ b/src/google/protobuf/stubs/hash.h @@ -93,10 +93,10 @@ # endif // GCC <= 4.1 does not define std::tr1::hash for `long long int` or `long long unsigned int` -# if __GNUC__ == 4 && __GNUC__MINOR__ <= 1 -# define GOOGLE_PROTOBUF_MISSING_HASH -# include -# include +# if __GNUC__ == 4 && defined(__GNUC__MINOR__) && __GNUC__MINOR__ <= 1 +# undef GOOGLE_PROTOBUF_HAS_TR1 +# undef GOOGLE_PROTOBUF_HAVE_HASH_MAP +# undef GOOGLE_PROTOBUF_HAVE_HASH_SET # endif // Version checks for MSC. diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index 0f304c6b..19ac6f1c 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -97,6 +97,8 @@ #include // IWYU pragma: export #endif +#define PROTOBUF_RUNTIME_DEPRECATED(message) + // =================================================================== // from google3/base/port.h @@ -108,6 +110,18 @@ #define LANG_CXX11 1 #endif +#if LANG_CXX11 && !defined(__NVCC__) +#define PROTOBUF_CXX11 1 +#else +#define PROTOBUF_CXX11 0 +#endif + +#if PROTOBUF_CXX11 +#define PROTOBUF_FINAL final +#else +#define PROTOBUF_FINAL +#endif + namespace google { namespace protobuf { @@ -177,6 +191,8 @@ static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF); #endif #endif +#define GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE GOOGLE_ATTRIBUTE_ALWAYS_INLINE + #ifndef GOOGLE_ATTRIBUTE_NOINLINE #if defined(__GNUC__) && (__GNUC__ > 3 ||(__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) // For functions we want to force not inline. @@ -191,23 +207,7 @@ static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF); #endif #endif -#ifndef GOOGLE_ATTRIBUTE_NORETURN -#ifdef __GNUC__ -// Tell the compiler that a given function never returns. -#define GOOGLE_ATTRIBUTE_NORETURN __attribute__((noreturn)) -#else -#define GOOGLE_ATTRIBUTE_NORETURN -#endif -#endif - -#ifndef GOOGLE_ATTRIBUTE_DEPRECATED -#ifdef __GNUC__ -// If the method/variable/type is used anywhere, produce a warning. -#define GOOGLE_ATTRIBUTE_DEPRECATED __attribute__((deprecated)) -#else -#define GOOGLE_ATTRIBUTE_DEPRECATED -#endif -#endif +#define GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE GOOGLE_ATTRIBUTE_NOINLINE #ifndef GOOGLE_PREDICT_TRUE #ifdef __GNUC__ @@ -255,7 +255,6 @@ static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF); #ifdef GOOGLE_PROTOBUF_DONT_USE_UNALIGNED # define GOOGLE_PROTOBUF_USE_UNALIGNED 0 #else -// x86 and x86-64 can perform unaligned loads/stores directly. # if defined(_M_X64) || defined(__x86_64__) || defined(_M_IX86) || defined(__i386__) # define GOOGLE_PROTOBUF_USE_UNALIGNED 1 # else @@ -263,7 +262,49 @@ static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF); # endif #endif -#if GOOGLE_PROTOBUF_USE_UNALIGNED +#define GOOGLE_PROTOBUF_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_COLD + +#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) ||\ + defined(MEMORY_SANITIZER) + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +uint16_t __sanitizer_unaligned_load16(const void *p); +uint32_t __sanitizer_unaligned_load32(const void *p); +uint64_t __sanitizer_unaligned_load64(const void *p); +void __sanitizer_unaligned_store16(void *p, uint16_t v); +void __sanitizer_unaligned_store32(void *p, uint32_t v); +void __sanitizer_unaligned_store64(void *p, uint64_t v); +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +inline uint16 GOOGLE_UNALIGNED_LOAD16(const void *p) { + return __sanitizer_unaligned_load16(p); +} + +inline uint32 GOOGLE_UNALIGNED_LOAD32(const void *p) { + return __sanitizer_unaligned_load32(p); +} + +inline uint64 GOOGLE_UNALIGNED_LOAD64(const void *p) { + return __sanitizer_unaligned_load64(p); +} + +inline void GOOGLE_UNALIGNED_STORE16(void *p, uint16 v) { + __sanitizer_unaligned_store16(p, v); +} + +inline void GOOGLE_UNALIGNED_STORE32(void *p, uint32 v) { + __sanitizer_unaligned_store32(p, v); +} + +inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) { + __sanitizer_unaligned_store64(p, v); +} + +#elif GOOGLE_PROTOBUF_USE_UNALIGNED #define GOOGLE_UNALIGNED_LOAD16(_p) (*reinterpret_cast(_p)) #define GOOGLE_UNALIGNED_LOAD32(_p) (*reinterpret_cast(_p)) @@ -474,6 +515,8 @@ class BigEndian { #define GOOGLE_ATTRIBUTE_SECTION_VARIABLE(name) #endif +#define GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(name) + } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/test_messages_proto2.proto b/src/google/protobuf/test_messages_proto2.proto index cbe0d170..60dbfc75 100644 --- a/src/google/protobuf/test_messages_proto2.proto +++ b/src/google/protobuf/test_messages_proto2.proto @@ -81,10 +81,10 @@ message TestAllTypesProto2 { optional bytes optional_bytes = 15; optional NestedMessage optional_nested_message = 18; - optional ForeignMessage optional_foreign_message = 19; + optional ForeignMessageProto2 optional_foreign_message = 19; optional NestedEnum optional_nested_enum = 21; - optional ForeignEnum optional_foreign_enum = 22; + optional ForeignEnumProto2 optional_foreign_enum = 22; optional string optional_string_piece = 24 [ctype=STRING_PIECE]; optional string optional_cord = 25 [ctype=CORD]; @@ -109,10 +109,10 @@ message TestAllTypesProto2 { repeated bytes repeated_bytes = 45; repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessage repeated_foreign_message = 49; + repeated ForeignMessageProto2 repeated_foreign_message = 49; repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnum repeated_foreign_enum = 52; + repeated ForeignEnumProto2 repeated_foreign_enum = 52; repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; repeated string repeated_cord = 55 [ctype=CORD]; @@ -134,9 +134,9 @@ message TestAllTypesProto2 { map < string, string> map_string_string = 69; map < string, bytes> map_string_bytes = 70; map < string, NestedMessage> map_string_nested_message = 71; - map < string, ForeignMessage> map_string_foreign_message = 72; + map < string, ForeignMessageProto2> map_string_foreign_message = 72; map < string, NestedEnum> map_string_nested_enum = 73; - map < string, ForeignEnum> map_string_foreign_enum = 74; + map < string, ForeignEnumProto2> map_string_foreign_enum = 74; oneof oneof_field { uint32 oneof_uint32 = 111; @@ -201,11 +201,11 @@ message TestAllTypesProto2 { } } -message ForeignMessage { +message ForeignMessageProto2 { optional int32 c = 1; } -enum ForeignEnum { +enum ForeignEnumProto2 { FOREIGN_FOO = 0; FOREIGN_BAR = 1; FOREIGN_BAZ = 2; diff --git a/src/google/protobuf/testing/file.cc b/src/google/protobuf/testing/file.cc index f32222b7..f68aba9a 100644 --- a/src/google/protobuf/testing/file.cc +++ b/src/google/protobuf/testing/file.cc @@ -121,7 +121,7 @@ void File::WriteStringToFileOrDie(const string& contents, const string& name) { bool File::CreateDir(const string& name, int mode) { if (!name.empty()) { - GOOGLE_CHECK_OK(name.back() != '.'); + GOOGLE_CHECK_OK(name[name.size() - 1] != '.'); } return mkdir(name.c_str(), mode) == 0; } diff --git a/src/google/protobuf/testing/zcgunzip.cc b/src/google/protobuf/testing/zcgunzip.cc index 76f8cfe1..349ad86e 100644 --- a/src/google/protobuf/testing/zcgunzip.cc +++ b/src/google/protobuf/testing/zcgunzip.cc @@ -72,7 +72,10 @@ int main(int argc, const char** argv) { } if (inlen > 0) { int err = write(STDOUT_FILENO, inptr, inlen); - assert(err == inlen); + if (err != inlen) { + fprintf(stderr, "write unexpectedly returned %d.\n", err); + return 1; + } } } diff --git a/src/google/protobuf/text_format.cc b/src/google/protobuf/text_format.cc index f1d2e8bc..2ea97785 100644 --- a/src/google/protobuf/text_format.cc +++ b/src/google/protobuf/text_format.cc @@ -1216,7 +1216,7 @@ class TextFormat::Printer::TextGenerator Write(text + pos, size - pos); } else { Write(text, size); - if (text[size - 1] == '\n') { + if (size > 0 && text[size - 1] == '\n') { at_start_of_line_ = true; } } diff --git a/src/google/protobuf/text_format.h b/src/google/protobuf/text_format.h index cd0e307e..57668927 100644 --- a/src/google/protobuf/text_format.h +++ b/src/google/protobuf/text_format.h @@ -49,6 +49,7 @@ #include #include #include +#include namespace google { namespace protobuf { @@ -143,8 +144,8 @@ class LIBPROTOBUF_EXPORT TextFormat { GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FastFieldValuePrinter); }; -// DEPRECATED: Please use FastFieldValuePrinter. - class LIBPROTOBUF_EXPORT FieldValuePrinter { + class LIBPROTOBUF_EXPORT PROTOBUF_RUNTIME_DEPRECATED("Please use FastFieldValuePrinter") + FieldValuePrinter { public: FieldValuePrinter(); virtual ~FieldValuePrinter(); diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc index 44ddc749..0525c18d 100644 --- a/src/google/protobuf/timestamp.pb.cc +++ b/src/google/protobuf/timestamp.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/timestamp.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,57 +15,52 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { class TimestampDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Timestamp_default_instance_; - +} // namespace protobuf +} // namespace google namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto { +void InitDefaultsTimestampImpl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + ::google::protobuf::internal::InitProtobufDefaults(); + { + void* ptr = &::google::protobuf::_Timestamp_default_instance_; + new (ptr) ::google::protobuf::Timestamp(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::google::protobuf::Timestamp::InitAsDefaultInstance(); +} -namespace { +void InitDefaultsTimestamp() { + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTimestampImpl); +} ::google::protobuf::Metadata file_level_metadata[1]; -} // namespace - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField - const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, -}; - -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField - const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - ::google::protobuf::internal::AuxillaryParseTableField(), -}; -PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const - TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { NULL, NULL, 0, -1, -1, -1, -1, NULL, false }, -}; - -const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Timestamp, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, seconds_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, nanos_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Timestamp, seconds_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Timestamp, nanos_), }; -static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(Timestamp)}, +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::google::protobuf::Timestamp)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { - reinterpret_cast(&_Timestamp_default_instance_), + reinterpret_cast(&::google::protobuf::_Timestamp_default_instance_), }; -namespace { - void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; @@ -80,29 +74,15 @@ void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } -void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); } -} // namespace -void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::internal::InitProtobufDefaults(); - _Timestamp_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_Timestamp_default_instance_);} - -void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); -} -namespace { void AddDescriptorsImpl() { InitDefaults(); - static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n\037google/protobuf/timestamp.proto\022\017googl" "e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003" "\022\r\n\005nanos\030\002 \001(\005B~\n\023com.google.protobufB\016" @@ -115,7 +95,6 @@ void AddDescriptorsImpl() { ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/timestamp.proto", &protobuf_RegisterTypes); } -} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); @@ -127,12 +106,14 @@ struct StaticDescriptorInitializer { AddDescriptors(); } } static_descriptor_initializer; - } // namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto - +namespace google { +namespace protobuf { // =================================================================== +void Timestamp::InitAsDefaultInstance() { +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Timestamp::kSecondsFieldNumber; const int Timestamp::kNanosFieldNumber; @@ -141,7 +122,7 @@ const int Timestamp::kNanosFieldNumber; Timestamp::Timestamp() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp(); } SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Timestamp) @@ -149,7 +130,7 @@ Timestamp::Timestamp() Timestamp::Timestamp(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { - protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp(); SharedCtor(); RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:google.protobuf.Timestamp) @@ -198,12 +179,12 @@ void Timestamp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Timestamp::descriptor() { - protobuf_google_2fprotobuf_2ftimestamp_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftimestamp_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; + ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Timestamp& Timestamp::default_instance() { - protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaults(); + ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp(); return *internal_default_instance(); } @@ -436,44 +417,11 @@ void Timestamp::InternalSwap(Timestamp* other) { ::google::protobuf::Metadata Timestamp::GetMetadata() const { protobuf_google_2fprotobuf_2ftimestamp_2eproto::protobuf_AssignDescriptorsOnce(); - return protobuf_google_2fprotobuf_2ftimestamp_2eproto::file_level_metadata[kIndexInFileMessages]; + return ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::file_level_metadata[kIndexInFileMessages]; } -#if PROTOBUF_INLINE_NOT_IN_HEADERS -// Timestamp - -// int64 seconds = 1; -void Timestamp::clear_seconds() { - seconds_ = GOOGLE_LONGLONG(0); -} -::google::protobuf::int64 Timestamp::seconds() const { - // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.seconds) - return seconds_; -} -void Timestamp::set_seconds(::google::protobuf::int64 value) { - - seconds_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.seconds) -} - -// int32 nanos = 2; -void Timestamp::clear_nanos() { - nanos_ = 0; -} -::google::protobuf::int32 Timestamp::nanos() const { - // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.nanos) - return nanos_; -} -void Timestamp::set_nanos(::google::protobuf::int32 value) { - - nanos_ = value; - // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.nanos) -} - -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h index 61596ed4..4ec7f0a0 100644 --- a/src/google/protobuf/timestamp.pb.h +++ b/src/google/protobuf/timestamp.pb.h @@ -30,31 +30,33 @@ #include // IWYU pragma: export #include // @@protoc_insertion_point(includes) -namespace google { -namespace protobuf { -class Timestamp; -class TimestampDefaultTypeInternal; -LIBPROTOBUF_EXPORT extern TimestampDefaultTypeInternal _Timestamp_default_instance_; -} // namespace protobuf -} // namespace google - -namespace google { -namespace protobuf { namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto { -// Internal implementation detail -- do not call these. +// Internal implementation detail -- do not use these members. struct LIBPROTOBUF_EXPORT TableStruct { static const ::google::protobuf::internal::ParseTableField entries[]; static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; + static const ::google::protobuf::internal::ParseTable schema[1]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; - static void InitDefaultsImpl(); + static const ::google::protobuf::uint32 offsets[]; }; void LIBPROTOBUF_EXPORT AddDescriptors(); -void LIBPROTOBUF_EXPORT InitDefaults(); +void LIBPROTOBUF_EXPORT InitDefaultsTimestampImpl(); +void LIBPROTOBUF_EXPORT InitDefaultsTimestamp(); +inline void LIBPROTOBUF_EXPORT InitDefaults() { + InitDefaultsTimestamp(); +} } // namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto +namespace google { +namespace protobuf { +class Timestamp; +class TimestampDefaultTypeInternal; +LIBPROTOBUF_EXPORT extern TimestampDefaultTypeInternal _Timestamp_default_instance_; +} // namespace protobuf +} // namespace google +namespace google { +namespace protobuf { // =================================================================== @@ -93,6 +95,7 @@ class LIBPROTOBUF_EXPORT Timestamp : public ::google::protobuf::Message /* @@pro static const ::google::protobuf::Descriptor* descriptor(); static const Timestamp& default_instance(); + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Timestamp* internal_default_instance() { return reinterpret_cast( &_Timestamp_default_instance_); @@ -173,14 +176,14 @@ class LIBPROTOBUF_EXPORT Timestamp : public ::google::protobuf::Message /* @@pro ::google::protobuf::int64 seconds_; ::google::protobuf::int32 nanos_; mutable int _cached_size_; - friend struct protobuf_google_2fprotobuf_2ftimestamp_2eproto::TableStruct; + friend struct ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::TableStruct; + friend void ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestampImpl(); }; // =================================================================== // =================================================================== -#if !PROTOBUF_INLINE_NOT_IN_HEADERS #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -218,11 +221,9 @@ inline void Timestamp::set_nanos(::google::protobuf::int32 value) { #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) - } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index abb52395..2cdb0146 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -1,7 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/protobuf/type.proto -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include #include @@ -16,134 +15,202 @@ #include #include // @@protoc_insertion_point(includes) - namespace google { namespace protobuf { class TypeDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Type_default_instance_; class FieldDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Field_default_instance_; class EnumDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _Enum_default_instance_; class EnumValueDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _EnumValue_default_instance_; class OptionDefaultTypeInternal { -public: - ::google::protobuf::internal::ExplicitlyConstructed