aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Adam Cozzette <acozzette@google.com>2017-09-12 10:32:01 -0700
committerGravatar Adam Cozzette <acozzette@google.com>2017-09-14 10:03:57 -0700
commit13fd045dbb2b4dacea32be162a41d5a4b0d1802f (patch)
treec219e7eb18b82523e36c6748861c403a14ea66ae
parentd1bc27caef8377a710370189675cb0958443e8f1 (diff)
Integrated internal changes from Google
-rw-r--r--BUILD1
-rw-r--r--Makefile.am1
-rw-r--r--cmake/libprotoc.cmake1
-rw-r--r--conformance/conformance_cpp.cc1
-rw-r--r--csharp/src/Google.Protobuf/Reflection/Descriptor.cs398
-rw-r--r--java/core/src/main/java/com/google/protobuf/CodedInputStream.java882
-rw-r--r--java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java59
-rw-r--r--java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java150
-rw-r--r--java/core/src/main/java/com/google/protobuf/SmallSortedMap.java4
-rw-r--r--java/core/src/main/java/com/google/protobuf/TextFormat.java18
-rw-r--r--java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java3
-rw-r--r--java/core/src/main/java/com/google/protobuf/UnsafeUtil.java11
-rw-r--r--java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java46
-rw-r--r--java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java79
-rw-r--r--java/core/src/test/java/com/google/protobuf/LiteTest.java38
-rw-r--r--java/core/src/test/java/com/google/protobuf/MessageTest.java8
-rw-r--r--java/core/src/test/java/com/google/protobuf/ParserTest.java102
-rw-r--r--java/core/src/test/java/com/google/protobuf/TextFormatTest.java40
-rw-r--r--java/core/src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java247
-rw-r--r--java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java204
-rw-r--r--java/core/src/test/java/com/google/protobuf/WireFormatTest.java70
-rw-r--r--java/util/src/main/java/com/google/protobuf/util/JsonFormat.java3
-rw-r--r--js/binary/decoder.js1
-rw-r--r--js/binary/utils.js1
-rw-r--r--js/binary/utils_test.js1
-rw-r--r--js/compatibility_tests/v3.1.0/message_test.js7
-rw-r--r--js/message.js94
-rw-r--r--js/proto3_test.js48
-rw-r--r--php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php9
-rw-r--r--php/src/Google/Protobuf/Internal/EnumDescriptorProto.php87
-rw-r--r--php/src/Google/Protobuf/Internal/FileOptions.php6
-rw-r--r--python/google/protobuf/descriptor_database.py13
-rw-r--r--python/google/protobuf/descriptor_pool.py27
-rwxr-xr-xpython/google/protobuf/internal/api_implementation.py39
-rw-r--r--python/google/protobuf/internal/descriptor_database_test.py34
-rw-r--r--python/google/protobuf/internal/descriptor_pool_test.py272
-rwxr-xr-xpython/google/protobuf/internal/descriptor_test.py299
-rwxr-xr-xpython/google/protobuf/internal/encoder.py2
-rw-r--r--python/google/protobuf/internal/json_format_test.py60
-rw-r--r--python/google/protobuf/internal/message_factory_test.py16
-rwxr-xr-xpython/google/protobuf/internal/message_test.py208
-rwxr-xr-xpython/google/protobuf/internal/python_message.py37
-rwxr-xr-xpython/google/protobuf/internal/reflection_test.py66
-rwxr-xr-xpython/google/protobuf/internal/service_reflection_test.py4
-rwxr-xr-xpython/google/protobuf/internal/test_util.py54
-rwxr-xr-xpython/google/protobuf/internal/text_format_test.py60
-rwxr-xr-xpython/google/protobuf/internal/unknown_fields_test.py158
-rw-r--r--python/google/protobuf/internal/well_known_types.py28
-rw-r--r--python/google/protobuf/internal/well_known_types_test.py142
-rw-r--r--python/google/protobuf/pyext/map_container.cc19
-rw-r--r--python/google/protobuf/pyext/message.cc129
-rw-r--r--python/google/protobuf/pyext/message_module.cc33
-rw-r--r--python/google/protobuf/pyext/python.proto8
-rw-r--r--python/google/protobuf/pyext/repeated_scalar_container.cc16
-rwxr-xr-xpython/setup.py1
-rw-r--r--src/Makefile.am3
-rw-r--r--src/google/protobuf/any.pb.cc204
-rw-r--r--src/google/protobuf/any.pb.h54
-rw-r--r--src/google/protobuf/api.pb.cc820
-rw-r--r--src/google/protobuf/api.pb.h55
-rwxr-xr-xsrc/google/protobuf/arena.cc25
-rw-r--r--src/google/protobuf/arena.h259
-rw-r--r--src/google/protobuf/arena_impl.h5
-rwxr-xr-xsrc/google/protobuf/arenastring.h28
-rw-r--r--src/google/protobuf/compiler/code_generator.h3
-rw-r--r--src/google/protobuf/compiler/command_line_interface.cc55
-rw-r--r--src/google/protobuf/compiler/command_line_interface.h3
-rw-r--r--src/google/protobuf/compiler/command_line_interface_unittest.cc32
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_enum.cc38
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_enum.h11
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_enum_field.cc5
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_extension.cc40
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_extension.h3
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_field.cc1
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_file.cc1009
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_file.h35
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_generator.cc31
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_helpers.cc223
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_helpers.h125
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_map_field.cc41
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_message.cc681
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_message.h16
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_message_field.cc336
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_message_field.h3
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h61
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_options.h8
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc220
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h64
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_primitive_field.cc7
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_string_field.cc46
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_string_field.h1
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto4
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_unittest.cc15
-rw-r--r--src/google/protobuf/compiler/importer.cc10
-rw-r--r--src/google/protobuf/compiler/java/java_helpers.h15
-rw-r--r--src/google/protobuf/compiler/java/java_message.cc175
-rw-r--r--src/google/protobuf/compiler/java/java_message_lite.cc292
-rw-r--r--src/google/protobuf/compiler/java/java_shared_code_generator.cc11
-rwxr-xr-xsrc/google/protobuf/compiler/js/js_generator.cc92
-rw-r--r--src/google/protobuf/compiler/mock_code_generator.cc12
-rw-r--r--src/google/protobuf/compiler/parser.cc79
-rw-r--r--src/google/protobuf/compiler/parser.h6
-rw-r--r--src/google/protobuf/compiler/parser_unittest.cc98
-rw-r--r--src/google/protobuf/compiler/plugin.cc11
-rw-r--r--src/google/protobuf/compiler/plugin.pb.cc905
-rw-r--r--src/google/protobuf/compiler/plugin.pb.h62
-rw-r--r--src/google/protobuf/compiler/python/python_generator.cc2
-rw-r--r--src/google/protobuf/descriptor.cc337
-rw-r--r--src/google/protobuf/descriptor.h75
-rw-r--r--src/google/protobuf/descriptor.pb.cc8721
-rw-r--r--src/google/protobuf/descriptor.pb.h3053
-rw-r--r--src/google/protobuf/descriptor.proto23
-rw-r--r--src/google/protobuf/descriptor_database_unittest.cc4
-rw-r--r--src/google/protobuf/descriptor_unittest.cc273
-rw-r--r--src/google/protobuf/duration.pb.cc128
-rw-r--r--src/google/protobuf/duration.pb.h39
-rw-r--r--src/google/protobuf/empty.pb.cc96
-rw-r--r--src/google/protobuf/empty.pb.h39
-rw-r--r--src/google/protobuf/extension_set.cc2
-rw-r--r--src/google/protobuf/extension_set.h55
-rw-r--r--src/google/protobuf/extension_set_heavy.cc10
-rw-r--r--src/google/protobuf/field_mask.pb.cc165
-rw-r--r--src/google/protobuf/field_mask.pb.h39
-rw-r--r--src/google/protobuf/generated_message_reflection.cc18
-rw-r--r--src/google/protobuf/generated_message_table_driven.h15
-rw-r--r--src/google/protobuf/has_bits.h10
-rw-r--r--src/google/protobuf/implicit_weak_message.cc51
-rw-r--r--src/google/protobuf/implicit_weak_message.h89
-rw-r--r--src/google/protobuf/io/coded_stream.cc7
-rw-r--r--src/google/protobuf/io/coded_stream.h41
-rw-r--r--src/google/protobuf/io/zero_copy_stream_impl.cc2
-rw-r--r--src/google/protobuf/io/zero_copy_stream_impl_lite.cc21
-rw-r--r--src/google/protobuf/io/zero_copy_stream_impl_lite.h20
-rw-r--r--src/google/protobuf/io/zero_copy_stream_unittest.cc2
-rw-r--r--src/google/protobuf/lite_arena_unittest.cc32
-rw-r--r--src/google/protobuf/lite_unittest.cc15
-rw-r--r--src/google/protobuf/map.h4
-rw-r--r--src/google/protobuf/map_entry.h51
-rw-r--r--src/google/protobuf/map_entry_lite.h65
-rw-r--r--src/google/protobuf/map_field.h17
-rw-r--r--src/google/protobuf/map_field_lite.h15
-rw-r--r--src/google/protobuf/map_field_test.cc4
-rw-r--r--src/google/protobuf/map_test.cc6
-rw-r--r--src/google/protobuf/message.cc6
-rw-r--r--src/google/protobuf/message.h30
-rw-r--r--src/google/protobuf/message_lite.cc39
-rw-r--r--src/google/protobuf/message_lite.h20
-rw-r--r--src/google/protobuf/message_unittest.cc2
-rw-r--r--src/google/protobuf/metadata_lite.h47
-rw-r--r--src/google/protobuf/repeated_field.h94
-rw-r--r--src/google/protobuf/repeated_field_unittest.cc294
-rw-r--r--src/google/protobuf/source_context.pb.cc149
-rw-r--r--src/google/protobuf/source_context.pb.h39
-rw-r--r--src/google/protobuf/struct.pb.cc722
-rw-r--r--src/google/protobuf/struct.pb.h103
-rw-r--r--src/google/protobuf/stubs/hash.h8
-rw-r--r--src/google/protobuf/stubs/port.h81
-rw-r--r--src/google/protobuf/test_messages_proto2.proto16
-rw-r--r--src/google/protobuf/testing/file.cc2
-rw-r--r--src/google/protobuf/testing/zcgunzip.cc5
-rw-r--r--src/google/protobuf/text_format.cc2
-rw-r--r--src/google/protobuf/text_format.h5
-rw-r--r--src/google/protobuf/timestamp.pb.cc128
-rw-r--r--src/google/protobuf/timestamp.pb.h39
-rw-r--r--src/google/protobuf/type.pb.cc1511
-rw-r--r--src/google/protobuf/type.pb.h90
-rw-r--r--src/google/protobuf/unittest_proto3_arena.proto2
-rw-r--r--src/google/protobuf/util/internal/json_escaping.cc2
-rw-r--r--src/google/protobuf/wire_format.h1
-rw-r--r--src/google/protobuf/wire_format_lite.cc2
-rw-r--r--src/google/protobuf/wire_format_lite.h16
-rw-r--r--src/google/protobuf/wrappers.pb.cc758
-rw-r--r--src/google/protobuf/wrappers.pb.h97
173 files changed, 14541 insertions, 13998 deletions
diff --git a/BUILD b/BUILD
index b3369b68..7d80e14f 100644
--- a/BUILD
+++ b/BUILD
@@ -326,6 +326,7 @@ cc_library(
"src/google/protobuf/compiler/cpp/cpp_map_field.cc",
"src/google/protobuf/compiler/cpp/cpp_message.cc",
"src/google/protobuf/compiler/cpp/cpp_message_field.cc",
+ "src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
"src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
"src/google/protobuf/compiler/cpp/cpp_service.cc",
"src/google/protobuf/compiler/cpp/cpp_string_field.cc",
diff --git a/Makefile.am b/Makefile.am
index 89e3700f..0c93debe 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -225,6 +225,7 @@ java_EXTRA_DIST=
java/core/src/main/java/com/google/protobuf/IntArrayList.java \
java/core/src/main/java/com/google/protobuf/Internal.java \
java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java \
+ java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java \
java/core/src/main/java/com/google/protobuf/LazyField.java \
java/core/src/main/java/com/google/protobuf/LazyFieldLite.java \
java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java \
diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake
index 9f2aa0c7..107c1c52 100644
--- a/cmake/libprotoc.cmake
+++ b/cmake/libprotoc.cmake
@@ -11,6 +11,7 @@ set(libprotoc_files
${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_map_field.cc
${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message.cc
${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message_field.cc
+ ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc
${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_service.cc
${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_string_field.cc
diff --git a/conformance/conformance_cpp.cc b/conformance/conformance_cpp.cc
index bf70309a..9540b50e 100644
--- a/conformance/conformance_cpp.cc
+++ b/conformance/conformance_cpp.cc
@@ -52,6 +52,7 @@ using google::protobuf::util::NewTypeResolverForDescriptorPool;
using google::protobuf::util::Status;
using google::protobuf::util::TypeResolver;
using protobuf_test_messages::proto3::TestAllTypesProto3;
+using protobuf_test_messages::proto2::TestAllTypesProto2;
using std::string;
static const char kTypeUrlPrefix[] = "type.googleapis.com";
diff --git a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs
index 8311a2c6..8c37ba86 100644
--- a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs
@@ -70,88 +70,91 @@ namespace Google.Protobuf.Reflection {
"IkMKBUxhYmVsEhIKDkxBQkVMX09QVElPTkFMEAESEgoOTEFCRUxfUkVRVUlS",
"RUQQAhISCg5MQUJFTF9SRVBFQVRFRBADIlQKFE9uZW9mRGVzY3JpcHRvclBy",
"b3RvEgwKBG5hbWUYASABKAkSLgoHb3B0aW9ucxgCIAEoCzIdLmdvb2dsZS5w",
- "cm90b2J1Zi5PbmVvZk9wdGlvbnMijAEKE0VudW1EZXNjcmlwdG9yUHJvdG8S",
+ "cm90b2J1Zi5PbmVvZk9wdGlvbnMipAIKE0VudW1EZXNjcmlwdG9yUHJvdG8S",
"DAoEbmFtZRgBIAEoCRI4CgV2YWx1ZRgCIAMoCzIpLmdvb2dsZS5wcm90b2J1",
"Zi5FbnVtVmFsdWVEZXNjcmlwdG9yUHJvdG8SLQoHb3B0aW9ucxgDIAEoCzIc",
- "Lmdvb2dsZS5wcm90b2J1Zi5FbnVtT3B0aW9ucyJsChhFbnVtVmFsdWVEZXNj",
- "cmlwdG9yUHJvdG8SDAoEbmFtZRgBIAEoCRIOCgZudW1iZXIYAiABKAUSMgoH",
- "b3B0aW9ucxgDIAEoCzIhLmdvb2dsZS5wcm90b2J1Zi5FbnVtVmFsdWVPcHRp",
- "b25zIpABChZTZXJ2aWNlRGVzY3JpcHRvclByb3RvEgwKBG5hbWUYASABKAkS",
- "NgoGbWV0aG9kGAIgAygLMiYuZ29vZ2xlLnByb3RvYnVmLk1ldGhvZERlc2Ny",
- "aXB0b3JQcm90bxIwCgdvcHRpb25zGAMgASgLMh8uZ29vZ2xlLnByb3RvYnVm",
- "LlNlcnZpY2VPcHRpb25zIsEBChVNZXRob2REZXNjcmlwdG9yUHJvdG8SDAoE",
- "bmFtZRgBIAEoCRISCgppbnB1dF90eXBlGAIgASgJEhMKC291dHB1dF90eXBl",
- "GAMgASgJEi8KB29wdGlvbnMYBCABKAsyHi5nb29nbGUucHJvdG9idWYuTWV0",
- "aG9kT3B0aW9ucxIfChBjbGllbnRfc3RyZWFtaW5nGAUgASgIOgVmYWxzZRIf",
- "ChBzZXJ2ZXJfc3RyZWFtaW5nGAYgASgIOgVmYWxzZSLwBQoLRmlsZU9wdGlv",
- "bnMSFAoMamF2YV9wYWNrYWdlGAEgASgJEhwKFGphdmFfb3V0ZXJfY2xhc3Nu",
- "YW1lGAggASgJEiIKE2phdmFfbXVsdGlwbGVfZmlsZXMYCiABKAg6BWZhbHNl",
- "EikKHWphdmFfZ2VuZXJhdGVfZXF1YWxzX2FuZF9oYXNoGBQgASgIQgIYARIl",
- "ChZqYXZhX3N0cmluZ19jaGVja191dGY4GBsgASgIOgVmYWxzZRJGCgxvcHRp",
- "bWl6ZV9mb3IYCSABKA4yKS5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMu",
- "T3B0aW1pemVNb2RlOgVTUEVFRBISCgpnb19wYWNrYWdlGAsgASgJEiIKE2Nj",
- "X2dlbmVyaWNfc2VydmljZXMYECABKAg6BWZhbHNlEiQKFWphdmFfZ2VuZXJp",
- "Y19zZXJ2aWNlcxgRIAEoCDoFZmFsc2USIgoTcHlfZ2VuZXJpY19zZXJ2aWNl",
- "cxgSIAEoCDoFZmFsc2USIwoUcGhwX2dlbmVyaWNfc2VydmljZXMYEyABKAg6",
- "BWZhbHNlEhkKCmRlcHJlY2F0ZWQYFyABKAg6BWZhbHNlEh8KEGNjX2VuYWJs",
- "ZV9hcmVuYXMYHyABKAg6BWZhbHNlEhkKEW9iamNfY2xhc3NfcHJlZml4GCQg",
- "ASgJEhgKEGNzaGFycF9uYW1lc3BhY2UYJSABKAkSFAoMc3dpZnRfcHJlZml4",
- "GCcgASgJEhgKEHBocF9jbGFzc19wcmVmaXgYKCABKAkSFQoNcGhwX25hbWVz",
- "cGFjZRgpIAEoCRJDChR1bmludGVycHJldGVkX29wdGlvbhjnByADKAsyJC5n",
- "b29nbGUucHJvdG9idWYuVW5pbnRlcnByZXRlZE9wdGlvbiI6CgxPcHRpbWl6",
- "ZU1vZGUSCQoFU1BFRUQQARINCglDT0RFX1NJWkUQAhIQCgxMSVRFX1JVTlRJ",
- "TUUQAyoJCOgHEICAgIACSgQIJhAnIvIBCg5NZXNzYWdlT3B0aW9ucxImChdt",
- "ZXNzYWdlX3NldF93aXJlX2Zvcm1hdBgBIAEoCDoFZmFsc2USLgofbm9fc3Rh",
- "bmRhcmRfZGVzY3JpcHRvcl9hY2Nlc3NvchgCIAEoCDoFZmFsc2USGQoKZGVw",
- "cmVjYXRlZBgDIAEoCDoFZmFsc2USEQoJbWFwX2VudHJ5GAcgASgIEkMKFHVu",
- "aW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5V",
- "bmludGVycHJldGVkT3B0aW9uKgkI6AcQgICAgAJKBAgIEAlKBAgJEAoingMK",
- "DEZpZWxkT3B0aW9ucxI6CgVjdHlwZRgBIAEoDjIjLmdvb2dsZS5wcm90b2J1",
- "Zi5GaWVsZE9wdGlvbnMuQ1R5cGU6BlNUUklORxIOCgZwYWNrZWQYAiABKAgS",
- "PwoGanN0eXBlGAYgASgOMiQuZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9u",
- "cy5KU1R5cGU6CUpTX05PUk1BTBITCgRsYXp5GAUgASgIOgVmYWxzZRIZCgpk",
- "ZXByZWNhdGVkGAMgASgIOgVmYWxzZRITCgR3ZWFrGAogASgIOgVmYWxzZRJD",
- "ChR1bmludGVycHJldGVkX29wdGlvbhjnByADKAsyJC5nb29nbGUucHJvdG9i",
- "dWYuVW5pbnRlcnByZXRlZE9wdGlvbiIvCgVDVHlwZRIKCgZTVFJJTkcQABII",
- "CgRDT1JEEAESEAoMU1RSSU5HX1BJRUNFEAIiNQoGSlNUeXBlEg0KCUpTX05P",
- "Uk1BTBAAEg0KCUpTX1NUUklORxABEg0KCUpTX05VTUJFUhACKgkI6AcQgICA",
- "gAJKBAgEEAUiXgoMT25lb2ZPcHRpb25zEkMKFHVuaW50ZXJwcmV0ZWRfb3B0",
- "aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0",
- "aW9uKgkI6AcQgICAgAIikwEKC0VudW1PcHRpb25zEhMKC2FsbG93X2FsaWFz",
- "GAIgASgIEhkKCmRlcHJlY2F0ZWQYAyABKAg6BWZhbHNlEkMKFHVuaW50ZXJw",
- "cmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVy",
- "cHJldGVkT3B0aW9uKgkI6AcQgICAgAJKBAgFEAYifQoQRW51bVZhbHVlT3B0",
- "aW9ucxIZCgpkZXByZWNhdGVkGAEgASgIOgVmYWxzZRJDChR1bmludGVycHJl",
- "dGVkX29wdGlvbhjnByADKAsyJC5nb29nbGUucHJvdG9idWYuVW5pbnRlcnBy",
- "ZXRlZE9wdGlvbioJCOgHEICAgIACInsKDlNlcnZpY2VPcHRpb25zEhkKCmRl",
- "cHJlY2F0ZWQYISABKAg6BWZhbHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9u",
- "GOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9u",
- "KgkI6AcQgICAgAIirQIKDU1ldGhvZE9wdGlvbnMSGQoKZGVwcmVjYXRlZBgh",
- "IAEoCDoFZmFsc2USXwoRaWRlbXBvdGVuY3lfbGV2ZWwYIiABKA4yLy5nb29n",
- "bGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucy5JZGVtcG90ZW5jeUxldmVsOhNJ",
- "REVNUE9URU5DWV9VTktOT1dOEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcH",
- "IAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uIlAK",
- "EElkZW1wb3RlbmN5TGV2ZWwSFwoTSURFTVBPVEVOQ1lfVU5LTk9XThAAEhMK",
- "D05PX1NJREVfRUZGRUNUUxABEg4KCklERU1QT1RFTlQQAioJCOgHEICAgIAC",
- "Ip4CChNVbmludGVycHJldGVkT3B0aW9uEjsKBG5hbWUYAiADKAsyLS5nb29n",
- "bGUucHJvdG9idWYuVW5pbnRlcnByZXRlZE9wdGlvbi5OYW1lUGFydBIYChBp",
- "ZGVudGlmaWVyX3ZhbHVlGAMgASgJEhoKEnBvc2l0aXZlX2ludF92YWx1ZRgE",
- "IAEoBBIaChJuZWdhdGl2ZV9pbnRfdmFsdWUYBSABKAMSFAoMZG91YmxlX3Zh",
- "bHVlGAYgASgBEhQKDHN0cmluZ192YWx1ZRgHIAEoDBIXCg9hZ2dyZWdhdGVf",
- "dmFsdWUYCCABKAkaMwoITmFtZVBhcnQSEQoJbmFtZV9wYXJ0GAEgAigJEhQK",
- "DGlzX2V4dGVuc2lvbhgCIAIoCCLVAQoOU291cmNlQ29kZUluZm8SOgoIbG9j",
- "YXRpb24YASADKAsyKC5nb29nbGUucHJvdG9idWYuU291cmNlQ29kZUluZm8u",
- "TG9jYXRpb24ahgEKCExvY2F0aW9uEhAKBHBhdGgYASADKAVCAhABEhAKBHNw",
- "YW4YAiADKAVCAhABEhgKEGxlYWRpbmdfY29tbWVudHMYAyABKAkSGQoRdHJh",
- "aWxpbmdfY29tbWVudHMYBCABKAkSIQoZbGVhZGluZ19kZXRhY2hlZF9jb21t",
- "ZW50cxgGIAMoCSKnAQoRR2VuZXJhdGVkQ29kZUluZm8SQQoKYW5ub3RhdGlv",
- "bhgBIAMoCzItLmdvb2dsZS5wcm90b2J1Zi5HZW5lcmF0ZWRDb2RlSW5mby5B",
- "bm5vdGF0aW9uGk8KCkFubm90YXRpb24SEAoEcGF0aBgBIAMoBUICEAESEwoL",
- "c291cmNlX2ZpbGUYAiABKAkSDQoFYmVnaW4YAyABKAUSCwoDZW5kGAQgASgF",
- "QowBChNjb20uZ29vZ2xlLnByb3RvYnVmQhBEZXNjcmlwdG9yUHJvdG9zSAFa",
- "PmdpdGh1Yi5jb20vZ29sYW5nL3Byb3RvYnVmL3Byb3RvYy1nZW4tZ28vZGVz",
- "Y3JpcHRvcjtkZXNjcmlwdG9yogIDR1BCqgIaR29vZ2xlLlByb3RvYnVmLlJl",
- "ZmxlY3Rpb24="));
+ "Lmdvb2dsZS5wcm90b2J1Zi5FbnVtT3B0aW9ucxJOCg5yZXNlcnZlZF9yYW5n",
+ "ZRgEIAMoCzI2Lmdvb2dsZS5wcm90b2J1Zi5FbnVtRGVzY3JpcHRvclByb3Rv",
+ "LkVudW1SZXNlcnZlZFJhbmdlEhUKDXJlc2VydmVkX25hbWUYBSADKAkaLwoR",
+ "RW51bVJlc2VydmVkUmFuZ2USDQoFc3RhcnQYASABKAUSCwoDZW5kGAIgASgF",
+ "ImwKGEVudW1WYWx1ZURlc2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEg4K",
+ "Bm51bWJlchgCIAEoBRIyCgdvcHRpb25zGAMgASgLMiEuZ29vZ2xlLnByb3Rv",
+ "YnVmLkVudW1WYWx1ZU9wdGlvbnMikAEKFlNlcnZpY2VEZXNjcmlwdG9yUHJv",
+ "dG8SDAoEbmFtZRgBIAEoCRI2CgZtZXRob2QYAiADKAsyJi5nb29nbGUucHJv",
+ "dG9idWYuTWV0aG9kRGVzY3JpcHRvclByb3RvEjAKB29wdGlvbnMYAyABKAsy",
+ "Hy5nb29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMiwQEKFU1ldGhvZERl",
+ "c2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEhIKCmlucHV0X3R5cGUYAiAB",
+ "KAkSEwoLb3V0cHV0X3R5cGUYAyABKAkSLwoHb3B0aW9ucxgEIAEoCzIeLmdv",
+ "b2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zEh8KEGNsaWVudF9zdHJlYW1p",
+ "bmcYBSABKAg6BWZhbHNlEh8KEHNlcnZlcl9zdHJlYW1pbmcYBiABKAg6BWZh",
+ "bHNlIvAFCgtGaWxlT3B0aW9ucxIUCgxqYXZhX3BhY2thZ2UYASABKAkSHAoU",
+ "amF2YV9vdXRlcl9jbGFzc25hbWUYCCABKAkSIgoTamF2YV9tdWx0aXBsZV9m",
+ "aWxlcxgKIAEoCDoFZmFsc2USKQodamF2YV9nZW5lcmF0ZV9lcXVhbHNfYW5k",
+ "X2hhc2gYFCABKAhCAhgBEiUKFmphdmFfc3RyaW5nX2NoZWNrX3V0ZjgYGyAB",
+ "KAg6BWZhbHNlEkYKDG9wdGltaXplX2ZvchgJIAEoDjIpLmdvb2dsZS5wcm90",
+ "b2J1Zi5GaWxlT3B0aW9ucy5PcHRpbWl6ZU1vZGU6BVNQRUVEEhIKCmdvX3Bh",
+ "Y2thZ2UYCyABKAkSIgoTY2NfZ2VuZXJpY19zZXJ2aWNlcxgQIAEoCDoFZmFs",
+ "c2USJAoVamF2YV9nZW5lcmljX3NlcnZpY2VzGBEgASgIOgVmYWxzZRIiChNw",
+ "eV9nZW5lcmljX3NlcnZpY2VzGBIgASgIOgVmYWxzZRIjChRwaHBfZ2VuZXJp",
+ "Y19zZXJ2aWNlcxgqIAEoCDoFZmFsc2USGQoKZGVwcmVjYXRlZBgXIAEoCDoF",
+ "ZmFsc2USHwoQY2NfZW5hYmxlX2FyZW5hcxgfIAEoCDoFZmFsc2USGQoRb2Jq",
+ "Y19jbGFzc19wcmVmaXgYJCABKAkSGAoQY3NoYXJwX25hbWVzcGFjZRglIAEo",
+ "CRIUCgxzd2lmdF9wcmVmaXgYJyABKAkSGAoQcGhwX2NsYXNzX3ByZWZpeBgo",
+ "IAEoCRIVCg1waHBfbmFtZXNwYWNlGCkgASgJEkMKFHVuaW50ZXJwcmV0ZWRf",
+ "b3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVk",
+ "T3B0aW9uIjoKDE9wdGltaXplTW9kZRIJCgVTUEVFRBABEg0KCUNPREVfU0la",
+ "RRACEhAKDExJVEVfUlVOVElNRRADKgkI6AcQgICAgAJKBAgmECci8gEKDk1l",
+ "c3NhZ2VPcHRpb25zEiYKF21lc3NhZ2Vfc2V0X3dpcmVfZm9ybWF0GAEgASgI",
+ "OgVmYWxzZRIuCh9ub19zdGFuZGFyZF9kZXNjcmlwdG9yX2FjY2Vzc29yGAIg",
+ "ASgIOgVmYWxzZRIZCgpkZXByZWNhdGVkGAMgASgIOgVmYWxzZRIRCgltYXBf",
+ "ZW50cnkYByABKAgSQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQu",
+ "Z29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICA",
+ "AkoECAgQCUoECAkQCiKeAwoMRmllbGRPcHRpb25zEjoKBWN0eXBlGAEgASgO",
+ "MiMuZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucy5DVHlwZToGU1RSSU5H",
+ "Eg4KBnBhY2tlZBgCIAEoCBI/CgZqc3R5cGUYBiABKA4yJC5nb29nbGUucHJv",
+ "dG9idWYuRmllbGRPcHRpb25zLkpTVHlwZToJSlNfTk9STUFMEhMKBGxhenkY",
+ "BSABKAg6BWZhbHNlEhkKCmRlcHJlY2F0ZWQYAyABKAg6BWZhbHNlEhMKBHdl",
+ "YWsYCiABKAg6BWZhbHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMo",
+ "CzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uIi8KBUNU",
+ "eXBlEgoKBlNUUklORxAAEggKBENPUkQQARIQCgxTVFJJTkdfUElFQ0UQAiI1",
+ "CgZKU1R5cGUSDQoJSlNfTk9STUFMEAASDQoJSlNfU1RSSU5HEAESDQoJSlNf",
+ "TlVNQkVSEAIqCQjoBxCAgICAAkoECAQQBSJeCgxPbmVvZk9wdGlvbnMSQwoU",
+ "dW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVm",
+ "LlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiKTAQoLRW51bU9wdGlv",
+ "bnMSEwoLYWxsb3dfYWxpYXMYAiABKAgSGQoKZGVwcmVjYXRlZBgDIAEoCDoF",
+ "ZmFsc2USQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xl",
+ "LnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAkoECAUQ",
+ "BiJ9ChBFbnVtVmFsdWVPcHRpb25zEhkKCmRlcHJlY2F0ZWQYASABKAg6BWZh",
+ "bHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5w",
+ "cm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uKgkI6AcQgICAgAIiewoOU2Vy",
+ "dmljZU9wdGlvbnMSGQoKZGVwcmVjYXRlZBghIAEoCDoFZmFsc2USQwoUdW5p",
+ "bnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVu",
+ "aW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiKtAgoNTWV0aG9kT3B0aW9u",
+ "cxIZCgpkZXByZWNhdGVkGCEgASgIOgVmYWxzZRJfChFpZGVtcG90ZW5jeV9s",
+ "ZXZlbBgiIAEoDjIvLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zLklk",
+ "ZW1wb3RlbmN5TGV2ZWw6E0lERU1QT1RFTkNZX1VOS05PV04SQwoUdW5pbnRl",
+ "cnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50",
+ "ZXJwcmV0ZWRPcHRpb24iUAoQSWRlbXBvdGVuY3lMZXZlbBIXChNJREVNUE9U",
+ "RU5DWV9VTktOT1dOEAASEwoPTk9fU0lERV9FRkZFQ1RTEAESDgoKSURFTVBP",
+ "VEVOVBACKgkI6AcQgICAgAIingIKE1VuaW50ZXJwcmV0ZWRPcHRpb24SOwoE",
+ "bmFtZRgCIAMoCzItLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0",
+ "aW9uLk5hbWVQYXJ0EhgKEGlkZW50aWZpZXJfdmFsdWUYAyABKAkSGgoScG9z",
+ "aXRpdmVfaW50X3ZhbHVlGAQgASgEEhoKEm5lZ2F0aXZlX2ludF92YWx1ZRgF",
+ "IAEoAxIUCgxkb3VibGVfdmFsdWUYBiABKAESFAoMc3RyaW5nX3ZhbHVlGAcg",
+ "ASgMEhcKD2FnZ3JlZ2F0ZV92YWx1ZRgIIAEoCRozCghOYW1lUGFydBIRCglu",
+ "YW1lX3BhcnQYASACKAkSFAoMaXNfZXh0ZW5zaW9uGAIgAigIItUBCg5Tb3Vy",
+ "Y2VDb2RlSW5mbxI6Cghsb2NhdGlvbhgBIAMoCzIoLmdvb2dsZS5wcm90b2J1",
+ "Zi5Tb3VyY2VDb2RlSW5mby5Mb2NhdGlvbhqGAQoITG9jYXRpb24SEAoEcGF0",
+ "aBgBIAMoBUICEAESEAoEc3BhbhgCIAMoBUICEAESGAoQbGVhZGluZ19jb21t",
+ "ZW50cxgDIAEoCRIZChF0cmFpbGluZ19jb21tZW50cxgEIAEoCRIhChlsZWFk",
+ "aW5nX2RldGFjaGVkX2NvbW1lbnRzGAYgAygJIqcBChFHZW5lcmF0ZWRDb2Rl",
+ "SW5mbxJBCgphbm5vdGF0aW9uGAEgAygLMi0uZ29vZ2xlLnByb3RvYnVmLkdl",
+ "bmVyYXRlZENvZGVJbmZvLkFubm90YXRpb24aTwoKQW5ub3RhdGlvbhIQCgRw",
+ "YXRoGAEgAygFQgIQARITCgtzb3VyY2VfZmlsZRgCIAEoCRINCgViZWdpbhgD",
+ "IAEoBRILCgNlbmQYBCABKAVCjwEKE2NvbS5nb29nbGUucHJvdG9idWZCEERl",
+ "c2NyaXB0b3JQcm90b3NIAVo+Z2l0aHViLmNvbS9nb2xhbmcvcHJvdG9idWYv",
+ "cHJvdG9jLWdlbi1nby9kZXNjcmlwdG9yO2Rlc2NyaXB0b3L4AQGiAgNHUEKq",
+ "AhpHb29nbGUuUHJvdG9idWYuUmVmbGVjdGlvbg=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
@@ -162,7 +165,7 @@ namespace Google.Protobuf.Reflection {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.ExtensionRangeOptions), global::Google.Protobuf.Reflection.ExtensionRangeOptions.Parser, new[]{ "UninterpretedOption" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto), global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser, new[]{ "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "OneofIndex", "JsonName", "Options" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type), typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label) }, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.OneofDescriptorProto), global::Google.Protobuf.Reflection.OneofDescriptorProto.Parser, new[]{ "Name", "Options" }, null, null, null),
- new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.EnumDescriptorProto), global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser, new[]{ "Name", "Value", "Options" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.EnumDescriptorProto), global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser, new[]{ "Name", "Value", "Options", "ReservedRange", "ReservedName" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.EnumDescriptorProto.Types.EnumReservedRange), global::Google.Protobuf.Reflection.EnumDescriptorProto.Types.EnumReservedRange.Parser, new[]{ "Start", "End" }, null, null, null)}),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.EnumValueDescriptorProto), global::Google.Protobuf.Reflection.EnumValueDescriptorProto.Parser, new[]{ "Name", "Number", "Options" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.ServiceDescriptorProto), global::Google.Protobuf.Reflection.ServiceDescriptorProto.Parser, new[]{ "Name", "Method", "Options" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Reflection.MethodDescriptorProto), global::Google.Protobuf.Reflection.MethodDescriptorProto.Parser, new[]{ "Name", "InputType", "OutputType", "Options", "ClientStreaming", "ServerStreaming" }, null, null, null),
@@ -2144,6 +2147,8 @@ namespace Google.Protobuf.Reflection {
name_ = other.name_;
value_ = other.value_.Clone();
Options = other.options_ != null ? other.Options.Clone() : null;
+ reservedRange_ = other.reservedRange_.Clone();
+ reservedName_ = other.reservedName_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2183,6 +2188,35 @@ namespace Google.Protobuf.Reflection {
}
}
+ /// <summary>Field number for the "reserved_range" field.</summary>
+ public const int ReservedRangeFieldNumber = 4;
+ private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.EnumDescriptorProto.Types.EnumReservedRange> _repeated_reservedRange_codec
+ = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.EnumDescriptorProto.Types.EnumReservedRange.Parser);
+ private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumDescriptorProto.Types.EnumReservedRange> reservedRange_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumDescriptorProto.Types.EnumReservedRange>();
+ /// <summary>
+ /// 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.
+ /// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField<global::Google.Protobuf.Reflection.EnumDescriptorProto.Types.EnumReservedRange> ReservedRange {
+ get { return reservedRange_; }
+ }
+
+ /// <summary>Field number for the "reserved_name" field.</summary>
+ public const int ReservedNameFieldNumber = 5;
+ private static readonly pb::FieldCodec<string> _repeated_reservedName_codec
+ = pb::FieldCodec.ForString(42);
+ private readonly pbc::RepeatedField<string> reservedName_ = new pbc::RepeatedField<string>();
+ /// <summary>
+ /// Reserved enum value names, which may not be reused. A given name may only
+ /// be reserved once.
+ /// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField<string> ReservedName {
+ get { return reservedName_; }
+ }
+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as EnumDescriptorProto);
@@ -2199,6 +2233,8 @@ namespace Google.Protobuf.Reflection {
if (Name != other.Name) return false;
if(!value_.Equals(other.value_)) return false;
if (!object.Equals(Options, other.Options)) return false;
+ if(!reservedRange_.Equals(other.reservedRange_)) return false;
+ if(!reservedName_.Equals(other.reservedName_)) return false;
return true;
}
@@ -2208,6 +2244,8 @@ namespace Google.Protobuf.Reflection {
if (Name.Length != 0) hash ^= Name.GetHashCode();
hash ^= value_.GetHashCode();
if (options_ != null) hash ^= Options.GetHashCode();
+ hash ^= reservedRange_.GetHashCode();
+ hash ^= reservedName_.GetHashCode();
return hash;
}
@@ -2227,6 +2265,8 @@ namespace Google.Protobuf.Reflection {
output.WriteRawTag(26);
output.WriteMessage(Options);
}
+ reservedRange_.WriteTo(output, _repeated_reservedRange_codec);
+ reservedName_.WriteTo(output, _repeated_reservedName_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2239,6 +2279,8 @@ namespace Google.Protobuf.Reflection {
if (options_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options);
}
+ size += reservedRange_.CalculateSize(_repeated_reservedRange_codec);
+ size += reservedName_.CalculateSize(_repeated_reservedName_codec);
return size;
}
@@ -2257,6 +2299,8 @@ namespace Google.Protobuf.Reflection {
}
Options.MergeFrom(other.Options);
}
+ reservedRange_.Add(other.reservedRange_);
+ reservedName_.Add(other.reservedName_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -2282,10 +2326,184 @@ namespace Google.Protobuf.Reflection {
input.ReadMessage(options_);
break;
}
+ case 34: {
+ reservedRange_.AddEntriesFrom(input, _repeated_reservedRange_codec);
+ break;
+ }
+ case 42: {
+ reservedName_.AddEntriesFrom(input, _repeated_reservedName_codec);
+ break;
+ }
}
}
}
+ #region Nested types
+ /// <summary>Container for nested types declared in the EnumDescriptorProto message type.</summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static partial class Types {
+ /// <summary>
+ /// 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.
+ /// </summary>
+ internal sealed partial class EnumReservedRange : pb::IMessage<EnumReservedRange> {
+ private static readonly pb::MessageParser<EnumReservedRange> _parser = new pb::MessageParser<EnumReservedRange>(() => new EnumReservedRange());
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser<EnumReservedRange> Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Protobuf.Reflection.EnumDescriptorProto.Descriptor.NestedTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public EnumReservedRange() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public EnumReservedRange(EnumReservedRange other) : this() {
+ start_ = other.start_;
+ end_ = other.end_;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public EnumReservedRange Clone() {
+ return new EnumReservedRange(this);
+ }
+
+ /// <summary>Field number for the "start" field.</summary>
+ public const int StartFieldNumber = 1;
+ private int start_;
+ /// <summary>
+ /// Inclusive.
+ /// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Start {
+ get { return start_; }
+ set {
+ start_ = value;
+ }
+ }
+
+ /// <summary>Field number for the "end" field.</summary>
+ public const int EndFieldNumber = 2;
+ private int end_;
+ /// <summary>
+ /// Inclusive.
+ /// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int End {
+ get { return end_; }
+ set {
+ end_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as EnumReservedRange);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(EnumReservedRange other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Start != other.Start) return false;
+ if (End != other.End) return false;
+ return true;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Start != 0) hash ^= Start.GetHashCode();
+ if (End != 0) hash ^= End.GetHashCode();
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Start != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(Start);
+ }
+ if (End != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(End);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Start != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Start);
+ }
+ if (End != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(End);
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(EnumReservedRange other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Start != 0) {
+ Start = other.Start;
+ }
+ if (other.End != 0) {
+ End = other.End;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ input.SkipLastField();
+ break;
+ case 8: {
+ Start = input.ReadInt32();
+ break;
+ }
+ case 16: {
+ End = input.ReadInt32();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+ #endregion
+
}
/// <summary>
@@ -3135,7 +3353,7 @@ namespace Google.Protobuf.Reflection {
}
/// <summary>Field number for the "php_generic_services" field.</summary>
- public const int PhpGenericServicesFieldNumber = 19;
+ public const int PhpGenericServicesFieldNumber = 42;
private bool phpGenericServices_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool PhpGenericServices {
@@ -3366,10 +3584,6 @@ namespace Google.Protobuf.Reflection {
output.WriteRawTag(144, 1);
output.WriteBool(PyGenericServices);
}
- if (PhpGenericServices != false) {
- output.WriteRawTag(152, 1);
- output.WriteBool(PhpGenericServices);
- }
if (JavaGenerateEqualsAndHash != false) {
output.WriteRawTag(160, 1);
output.WriteBool(JavaGenerateEqualsAndHash);
@@ -3406,6 +3620,10 @@ namespace Google.Protobuf.Reflection {
output.WriteRawTag(202, 2);
output.WriteString(PhpNamespace);
}
+ if (PhpGenericServices != false) {
+ output.WriteRawTag(208, 2);
+ output.WriteBool(PhpGenericServices);
+ }
uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec);
}
@@ -3572,10 +3790,6 @@ namespace Google.Protobuf.Reflection {
PyGenericServices = input.ReadBool();
break;
}
- case 152: {
- PhpGenericServices = input.ReadBool();
- break;
- }
case 160: {
JavaGenerateEqualsAndHash = input.ReadBool();
break;
@@ -3612,6 +3826,10 @@ namespace Google.Protobuf.Reflection {
PhpNamespace = input.ReadString();
break;
}
+ case 336: {
+ PhpGenericServices = input.ReadBool();
+ break;
+ }
case 7994: {
uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec);
break;
diff --git a/java/core/src/main/java/com/google/protobuf/CodedInputStream.java b/java/core/src/main/java/com/google/protobuf/CodedInputStream.java
index d6a941b1..511501d4 100644
--- a/java/core/src/main/java/com/google/protobuf/CodedInputStream.java
+++ b/java/core/src/main/java/com/google/protobuf/CodedInputStream.java
@@ -44,6 +44,7 @@ import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Iterator;
import java.util.List;
/**
@@ -85,6 +86,43 @@ public abstract class CodedInputStream {
return new StreamDecoder(input, bufferSize);
}
+ /** Create a new CodedInputStream wrapping the given {@code Iterable <ByteBuffer>}. */
+ public static CodedInputStream newInstance(final Iterable<ByteBuffer> input) {
+ if (!UnsafeDirectNioDecoder.isSupported()) {
+ return newInstance(new IterableByteBufferInputStream(input));
+ }
+ return newInstance(input, false);
+ }
+
+ /** Create a new CodedInputStream wrapping the given {@code Iterable <ByteBuffer>}. */
+ static CodedInputStream newInstance(
+ final Iterable<ByteBuffer> bufs, final boolean bufferIsImmutable) {
+ // flag is to check the type of input's ByteBuffers.
+ // flag equals 1: all ByteBuffers have array.
+ // flag equals 2: all ByteBuffers are direct ByteBuffers.
+ // flag equals 3: some ByteBuffers are direct and some have array.
+ // flag greater than 3: other cases.
+ int flag = 0;
+ // Total size of the input
+ int totalSize = 0;
+ for (ByteBuffer buf : bufs) {
+ totalSize += buf.remaining();
+ if (buf.hasArray()) {
+ flag |= 1;
+ } else if (buf.isDirect()) {
+ flag |= 2;
+ } else {
+ flag |= 4;
+ }
+ }
+ if (flag == 2) {
+ return new IterableDirectByteBufferDecoder(bufs, totalSize, bufferIsImmutable);
+ } else {
+ // TODO(yilunchong): add another decoders to deal case 1 and 3.
+ return newInstance(new IterableByteBufferInputStream(bufs));
+ }
+ }
+
/** Create a new CodedInputStream wrapping the given byte array. */
public static CodedInputStream newInstance(final byte[] buf) {
return newInstance(buf, 0, buf.length);
@@ -3022,4 +3060,848 @@ public abstract class CodedInputStream {
pos = size - tempPos;
}
}
+
+ /**
+ * Implementation of {@link CodedInputStream} that uses an {@link Iterable <ByteBuffer>} as the
+ * data source. Requires the use of {@code sun.misc.Unsafe} to perform fast reads on the buffer.
+ */
+ private static final class IterableDirectByteBufferDecoder extends CodedInputStream {
+ /** The object that need to decode. */
+ private Iterable<ByteBuffer> input;
+ /** The {@link Iterator} with type {@link ByteBuffer} of {@code input} */
+ private Iterator<ByteBuffer> iterator;
+ /** The current ByteBuffer; */
+ private ByteBuffer currentByteBuffer;
+ /**
+ * If {@code true}, indicates that all the buffer are backing a {@link ByteString} and are
+ * therefore considered to be an immutable input source.
+ */
+ private boolean immutable;
+ /**
+ * If {@code true}, indicates that calls to read {@link ByteString} or {@code byte[]}
+ * <strong>may</strong> return slices of the underlying buffer, rather than copies.
+ */
+ private boolean enableAliasing;
+ /** The global total message length limit */
+ private int totalBufferSize;
+ /** The amount of available data in the input beyond {@link #currentLimit}. */
+ private int bufferSizeAfterCurrentLimit;
+ /** The absolute position of the end of the current message. */
+ private int currentLimit = Integer.MAX_VALUE;
+ /** The last tag that was read from this stream. */
+ private int lastTag;
+ /** Total Bytes have been Read from the {@link Iterable} {@link ByteBuffer} */
+ private int totalBytesRead;
+ /** The start position offset of the whole message, used as to reset the totalBytesRead */
+ private int startOffset;
+ /** The current position for current ByteBuffer */
+ private long currentByteBufferPos;
+
+ private long currentByteBufferStartPos;
+ /**
+ * If the current ByteBuffer is unsafe-direct based, currentAddress is the start address of this
+ * ByteBuffer; otherwise should be zero.
+ */
+ private long currentAddress;
+ /** The limit position for current ByteBuffer */
+ private long currentByteBufferLimit;
+
+ /**
+ * The constructor of {@code Iterable<ByteBuffer>} decoder.
+ *
+ * @param inputBufs The input data.
+ * @param size The total size of the input data.
+ * @param immutableFlag whether the input data is immutable.
+ */
+ private IterableDirectByteBufferDecoder(
+ Iterable<ByteBuffer> inputBufs, int size, boolean immutableFlag) {
+ totalBufferSize = size;
+ input = inputBufs;
+ iterator = input.iterator();
+ immutable = immutableFlag;
+ startOffset = totalBytesRead = 0;
+ if (size == 0) {
+ currentByteBuffer = EMPTY_BYTE_BUFFER;
+ currentByteBufferPos = 0;
+ currentByteBufferStartPos = 0;
+ currentByteBufferLimit = 0;
+ currentAddress = 0;
+ } else {
+ tryGetNextByteBuffer();
+ }
+ }
+
+ /** To get the next ByteBuffer from {@code input}, and then update the parameters */
+ private void getNextByteBuffer() throws InvalidProtocolBufferException {
+ if (!iterator.hasNext()) {
+ throw InvalidProtocolBufferException.truncatedMessage();
+ }
+ tryGetNextByteBuffer();
+ }
+
+ private void tryGetNextByteBuffer() {
+ currentByteBuffer = iterator.next();
+ totalBytesRead += (int) (currentByteBufferPos - currentByteBufferStartPos);
+ currentByteBufferPos = currentByteBuffer.position();
+ currentByteBufferStartPos = currentByteBufferPos;
+ currentByteBufferLimit = currentByteBuffer.limit();
+ currentAddress = UnsafeUtil.addressOffset(currentByteBuffer);
+ currentByteBufferPos += currentAddress;
+ currentByteBufferStartPos += currentAddress;
+ currentByteBufferLimit += currentAddress;
+ }
+
+ @Override
+ public int readTag() throws IOException {
+ if (isAtEnd()) {
+ lastTag = 0;
+ return 0;
+ }
+
+ lastTag = readRawVarint32();
+ if (WireFormat.getTagFieldNumber(lastTag) == 0) {
+ // If we actually read zero (or any tag number corresponding to field
+ // number zero), that's not a valid tag.
+ throw InvalidProtocolBufferException.invalidTag();
+ }
+ return lastTag;
+ }
+
+ @Override
+ public void checkLastTagWas(final int value) throws InvalidProtocolBufferException {
+ if (lastTag != value) {
+ throw InvalidProtocolBufferException.invalidEndTag();
+ }
+ }
+
+ @Override
+ public int getLastTag() {
+ return lastTag;
+ }
+
+ @Override
+ public boolean skipField(final int tag) throws IOException {
+ switch (WireFormat.getTagWireType(tag)) {
+ case WireFormat.WIRETYPE_VARINT:
+ skipRawVarint();
+ return true;
+ case WireFormat.WIRETYPE_FIXED64:
+ skipRawBytes(FIXED64_SIZE);
+ return true;
+ case WireFormat.WIRETYPE_LENGTH_DELIMITED:
+ skipRawBytes(readRawVarint32());
+ return true;
+ case WireFormat.WIRETYPE_START_GROUP:
+ skipMessage();
+ checkLastTagWas(
+ WireFormat.makeTag(WireFormat.getTagFieldNumber(tag), WireFormat.WIRETYPE_END_GROUP));
+ return true;
+ case WireFormat.WIRETYPE_END_GROUP:
+ return false;
+ case WireFormat.WIRETYPE_FIXED32:
+ skipRawBytes(FIXED32_SIZE);
+ return true;
+ default:
+ throw InvalidProtocolBufferException.invalidWireType();
+ }
+ }
+
+ @Override
+ public boolean skipField(final int tag, final CodedOutputStream output) throws IOException {
+ switch (WireFormat.getTagWireType(tag)) {
+ case WireFormat.WIRETYPE_VARINT:
+ {
+ long value = readInt64();
+ output.writeRawVarint32(tag);
+ output.writeUInt64NoTag(value);
+ return true;
+ }
+ case WireFormat.WIRETYPE_FIXED64:
+ {
+ long value = readRawLittleEndian64();
+ output.writeRawVarint32(tag);
+ output.writeFixed64NoTag(value);
+ return true;
+ }
+ case WireFormat.WIRETYPE_LENGTH_DELIMITED:
+ {
+ ByteString value = readBytes();
+ output.writeRawVarint32(tag);
+ output.writeBytesNoTag(value);
+ return true;
+ }
+ case WireFormat.WIRETYPE_START_GROUP:
+ {
+ output.writeRawVarint32(tag);
+ skipMessage(output);
+ int endtag =
+ WireFormat.makeTag(
+ WireFormat.getTagFieldNumber(tag), WireFormat.WIRETYPE_END_GROUP);
+ checkLastTagWas(endtag);
+ output.writeRawVarint32(endtag);
+ return true;
+ }
+ case WireFormat.WIRETYPE_END_GROUP:
+ {
+ return false;
+ }
+ case WireFormat.WIRETYPE_FIXED32:
+ {
+ int value = readRawLittleEndian32();
+ output.writeRawVarint32(tag);
+ output.writeFixed32NoTag(value);
+ return true;
+ }
+ default:
+ throw InvalidProtocolBufferException.invalidWireType();
+ }
+ }
+
+ @Override
+ public void skipMessage() throws IOException {
+ while (true) {
+ final int tag = readTag();
+ if (tag == 0 || !skipField(tag)) {
+ return;
+ }
+ }
+ }
+
+ @Override
+ public void skipMessage(CodedOutputStream output) throws IOException {
+ while (true) {
+ final int tag = readTag();
+ if (tag == 0 || !skipField(tag, output)) {
+ return;
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------
+
+ @Override
+ public double readDouble() throws IOException {
+ return Double.longBitsToDouble(readRawLittleEndian64());
+ }
+
+ @Override
+ public float readFloat() throws IOException {
+ return Float.intBitsToFloat(readRawLittleEndian32());
+ }
+
+ @Override
+ public long readUInt64() throws IOException {
+ return readRawVarint64();
+ }
+
+ @Override
+ public long readInt64() throws IOException {
+ return readRawVarint64();
+ }
+
+ @Override
+ public int readInt32() throws IOException {
+ return readRawVarint32();
+ }
+
+ @Override
+ public long readFixed64() throws IOException {
+ return readRawLittleEndian64();
+ }
+
+ @Override
+ public int readFixed32() throws IOException {
+ return readRawLittleEndian32();
+ }
+
+ @Override
+ public boolean readBool() throws IOException {
+ return readRawVarint64() != 0;
+ }
+
+ @Override
+ public String readString() throws IOException {
+ final int size = readRawVarint32();
+ if (size > 0 && size <= currentByteBufferLimit - currentByteBufferPos) {
+ byte[] bytes = new byte[size];
+ UnsafeUtil.copyMemory(currentByteBufferPos, bytes, 0, size);
+ String result = new String(bytes, UTF_8);
+ currentByteBufferPos += size;
+ return result;
+ } else if (size > 0 && size <= remaining()) {
+ // TODO(yilunchong): To use an underlying bytes[] instead of allocating a new bytes[]
+ byte[] bytes = new byte[size];
+ readRawBytesTo(bytes, 0, size);
+ String result = new String(bytes, UTF_8);
+ return result;
+ }
+
+ if (size == 0) {
+ return "";
+ }
+ if (size < 0) {
+ throw InvalidProtocolBufferException.negativeSize();
+ }
+ throw InvalidProtocolBufferException.truncatedMessage();
+ }
+
+ @Override
+ public String readStringRequireUtf8() throws IOException {
+ final int size = readRawVarint32();
+ if (size > 0 && size <= currentByteBufferLimit - currentByteBufferPos) {
+ byte[] bytes = new byte[size];
+ UnsafeUtil.copyMemory(currentByteBufferPos, bytes, 0, size);
+ if (!Utf8.isValidUtf8(bytes)) {
+ throw InvalidProtocolBufferException.invalidUtf8();
+ }
+ String result = new String(bytes, UTF_8);
+ currentByteBufferPos += size;
+ return result;
+ }
+ if (size >= 0 && size <= remaining()) {
+ byte[] bytes = new byte[size];
+ readRawBytesTo(bytes, 0, size);
+ if (!Utf8.isValidUtf8(bytes)) {
+ throw InvalidProtocolBufferException.invalidUtf8();
+ }
+ String result = new String(bytes, UTF_8);
+ return result;
+ }
+
+ if (size == 0) {
+ return "";
+ }
+ if (size <= 0) {
+ throw InvalidProtocolBufferException.negativeSize();
+ }
+ throw InvalidProtocolBufferException.truncatedMessage();
+ }
+
+ @Override
+ public void readGroup(
+ final int fieldNumber,
+ final MessageLite.Builder builder,
+ final ExtensionRegistryLite extensionRegistry)
+ throws IOException {
+ if (recursionDepth >= recursionLimit) {
+ throw InvalidProtocolBufferException.recursionLimitExceeded();
+ }
+ ++recursionDepth;
+ builder.mergeFrom(this, extensionRegistry);
+ checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP));
+ --recursionDepth;
+ }
+
+
+ @Override
+ public <T extends MessageLite> T readGroup(
+ final int fieldNumber,
+ final Parser<T> parser,
+ final ExtensionRegistryLite extensionRegistry)
+ throws IOException {
+ if (recursionDepth >= recursionLimit) {
+ throw InvalidProtocolBufferException.recursionLimitExceeded();
+ }
+ ++recursionDepth;
+ T result = parser.parsePartialFrom(this, extensionRegistry);
+ checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP));
+ --recursionDepth;
+ return result;
+ }
+
+ @Deprecated
+ @Override
+ public void readUnknownGroup(final int fieldNumber, final MessageLite.Builder builder)
+ throws IOException {
+ readGroup(fieldNumber, builder, ExtensionRegistryLite.getEmptyRegistry());
+ }
+
+ @Override
+ public void readMessage(
+ final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry)
+ throws IOException {
+ final int length = readRawVarint32();
+ if (recursionDepth >= recursionLimit) {
+ throw InvalidProtocolBufferException.recursionLimitExceeded();
+ }
+ final int oldLimit = pushLimit(length);
+ ++recursionDepth;
+ builder.mergeFrom(this, extensionRegistry);
+ checkLastTagWas(0);
+ --recursionDepth;
+ popLimit(oldLimit);
+ }
+
+
+ @Override
+ public <T extends MessageLite> T readMessage(
+ final Parser<T> parser, final ExtensionRegistryLite extensionRegistry) throws IOException {
+ int length = readRawVarint32();
+ if (recursionDepth >= recursionLimit) {
+ throw InvalidProtocolBufferException.recursionLimitExceeded();
+ }
+ final int oldLimit = pushLimit(length);
+ ++recursionDepth;
+ T result = parser.parsePartialFrom(this, extensionRegistry);
+ checkLastTagWas(0);
+ --recursionDepth;
+ popLimit(oldLimit);
+ return result;
+ }
+
+ @Override
+ public ByteString readBytes() throws IOException {
+ final int size = readRawVarint32();
+ if (size > 0 && size <= currentByteBufferLimit - currentByteBufferPos) {
+ if (immutable && enableAliasing) {
+ final int idx = (int) (currentByteBufferPos - currentAddress);
+ final ByteString result = ByteString.wrap(slice(idx, idx + size));
+ currentByteBufferPos += size;
+ return result;
+ } else {
+ byte[] bytes;
+ bytes = new byte[size];
+ UnsafeUtil.copyMemory(currentByteBufferPos, bytes, 0, size);
+ currentByteBufferPos += size;
+ return ByteString.wrap(bytes);
+ }
+ } else if (size > 0 && size <= remaining()) {
+ byte[] temp = new byte[size];
+ readRawBytesTo(temp, 0, size);
+ return ByteString.wrap(temp);
+ }
+
+ if (size == 0) {
+ return ByteString.EMPTY;
+ }
+ if (size < 0) {
+ throw InvalidProtocolBufferException.negativeSize();
+ }
+ throw InvalidProtocolBufferException.truncatedMessage();
+ }
+
+ @Override
+ public byte[] readByteArray() throws IOException {
+ return readRawBytes(readRawVarint32());
+ }
+
+ @Override
+ public ByteBuffer readByteBuffer() throws IOException {
+ final int size = readRawVarint32();
+ if (size > 0 && size <= currentRemaining()) {
+ if (!immutable && enableAliasing) {
+ currentByteBufferPos += size;
+ return slice(
+ (int) (currentByteBufferPos - currentAddress - size),
+ (int) (currentByteBufferPos - currentAddress));
+ } else {
+ byte[] bytes = new byte[size];
+ UnsafeUtil.copyMemory(currentByteBufferPos, bytes, 0, size);
+ currentByteBufferPos += size;
+ return ByteBuffer.wrap(bytes);
+ }
+ } else if (size > 0 && size <= remaining()) {
+ byte[] temp = new byte[size];
+ readRawBytesTo(temp, 0, size);
+ return ByteBuffer.wrap(temp);
+ }
+
+ if (size == 0) {
+ return EMPTY_BYTE_BUFFER;
+ }
+ if (size < 0) {
+ throw InvalidProtocolBufferException.negativeSize();
+ }
+ throw InvalidProtocolBufferException.truncatedMessage();
+ }
+
+ @Override
+ public int readUInt32() throws IOException {
+ return readRawVarint32();
+ }
+
+ @Override
+ public int readEnum() throws IOException {
+ return readRawVarint32();
+ }
+
+ @Override
+ public int readSFixed32() throws IOException {
+ return readRawLittleEndian32();
+ }
+
+ @Override
+ public long readSFixed64() throws IOException {
+ return readRawLittleEndian64();
+ }
+
+ @Override
+ public int readSInt32() throws IOException {
+ return decodeZigZag32(readRawVarint32());
+ }
+
+ @Override
+ public long readSInt64() throws IOException {
+ return decodeZigZag64(readRawVarint64());
+ }
+
+ @Override
+ public int readRawVarint32() throws IOException {
+ fastpath:
+ {
+ long tempPos = currentByteBufferPos;
+
+ if (currentByteBufferLimit == currentByteBufferPos) {
+ break fastpath;
+ }
+
+ int x;
+ if ((x = UnsafeUtil.getByte(tempPos++)) >= 0) {
+ currentByteBufferPos++;
+ return x;
+ } else if (currentByteBufferLimit - currentByteBufferPos < 10) {
+ break fastpath;
+ } else if ((x ^= (UnsafeUtil.getByte(tempPos++) << 7)) < 0) {
+ x ^= (~0 << 7);
+ } else if ((x ^= (UnsafeUtil.getByte(tempPos++) << 14)) >= 0) {
+ x ^= (~0 << 7) ^ (~0 << 14);
+ } else if ((x ^= (UnsafeUtil.getByte(tempPos++) << 21)) < 0) {
+ x ^= (~0 << 7) ^ (~0 << 14) ^ (~0 << 21);
+ } else {
+ int y = UnsafeUtil.getByte(tempPos++);
+ x ^= y << 28;
+ x ^= (~0 << 7) ^ (~0 << 14) ^ (~0 << 21) ^ (~0 << 28);
+ if (y < 0
+ && UnsafeUtil.getByte(tempPos++) < 0
+ && UnsafeUtil.getByte(tempPos++) < 0
+ && UnsafeUtil.getByte(tempPos++) < 0
+ && UnsafeUtil.getByte(tempPos++) < 0
+ && UnsafeUtil.getByte(tempPos++) < 0) {
+ break fastpath; // Will throw malformedVarint()
+ }
+ }
+ currentByteBufferPos = tempPos;
+ return x;
+ }
+ return (int) readRawVarint64SlowPath();
+ }
+
+ @Override
+ public long readRawVarint64() throws IOException {
+ fastpath:
+ {
+ long tempPos = currentByteBufferPos;
+
+ if (currentByteBufferLimit == currentByteBufferPos) {
+ break fastpath;
+ }
+
+ long x;
+ int y;
+ if ((y = UnsafeUtil.getByte(tempPos++)) >= 0) {
+ currentByteBufferPos++;
+ return y;
+ } else if (currentByteBufferLimit - currentByteBufferPos < 10) {
+ break fastpath;
+ } else if ((y ^= (UnsafeUtil.getByte(tempPos++) << 7)) < 0) {
+ x = y ^ (~0 << 7);
+ } else if ((y ^= (UnsafeUtil.getByte(tempPos++) << 14)) >= 0) {
+ x = y ^ ((~0 << 7) ^ (~0 << 14));
+ } else if ((y ^= (UnsafeUtil.getByte(tempPos++) << 21)) < 0) {
+ x = y ^ ((~0 << 7) ^ (~0 << 14) ^ (~0 << 21));
+ } else if ((x = y ^ ((long) UnsafeUtil.getByte(tempPos++) << 28)) >= 0L) {
+ x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28);
+ } else if ((x ^= ((long) UnsafeUtil.getByte(tempPos++) << 35)) < 0L) {
+ x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35);
+ } else if ((x ^= ((long) UnsafeUtil.getByte(tempPos++) << 42)) >= 0L) {
+ x ^= (~0L << 7) ^ (~0L << 14) ^ (~0L << 21) ^ (~0L << 28) ^ (~0L << 35) ^ (~0L << 42);
+ } else if ((x ^= ((long) UnsafeUtil.getByte(tempPos++) << 49)) < 0L) {
+ x ^=
+ (~0L << 7)
+ ^ (~0L << 14)
+ ^ (~0L << 21)
+ ^ (~0L << 28)
+ ^ (~0L << 35)
+ ^ (~0L << 42)
+ ^ (~0L << 49);
+ } else {
+ x ^= ((long) UnsafeUtil.getByte(tempPos++) << 56);
+ x ^=
+ (~0L << 7)
+ ^ (~0L << 14)
+ ^ (~0L << 21)
+ ^ (~0L << 28)
+ ^ (~0L << 35)
+ ^ (~0L << 42)
+ ^ (~0L << 49)
+ ^ (~0L << 56);
+ if (x < 0L) {
+ if (UnsafeUtil.getByte(tempPos++) < 0L) {
+ break fastpath; // Will throw malformedVarint()
+ }
+ }
+ }
+ currentByteBufferPos = tempPos;
+ return x;
+ }
+ return readRawVarint64SlowPath();
+ }
+
+ @Override
+ long readRawVarint64SlowPath() throws IOException {
+ long result = 0;
+ for (int shift = 0; shift < 64; shift += 7) {
+ final byte b = readRawByte();
+ result |= (long) (b & 0x7F) << shift;
+ if ((b & 0x80) == 0) {
+ return result;
+ }
+ }
+ throw InvalidProtocolBufferException.malformedVarint();
+ }
+
+ @Override
+ public int readRawLittleEndian32() throws IOException {
+ if (currentRemaining() >= FIXED32_SIZE) {
+ long tempPos = currentByteBufferPos;
+ currentByteBufferPos += FIXED32_SIZE;
+ return (((UnsafeUtil.getByte(tempPos) & 0xff))
+ | ((UnsafeUtil.getByte(tempPos + 1) & 0xff) << 8)
+ | ((UnsafeUtil.getByte(tempPos + 2) & 0xff) << 16)
+ | ((UnsafeUtil.getByte(tempPos + 3) & 0xff) << 24));
+ }
+ return ((readRawByte() & 0xff)
+ | ((readRawByte() & 0xff) << 8)
+ | ((readRawByte() & 0xff) << 16)
+ | ((readRawByte() & 0xff) << 24));
+ }
+
+ @Override
+ public long readRawLittleEndian64() throws IOException {
+ if (currentRemaining() >= FIXED64_SIZE) {
+ long tempPos = currentByteBufferPos;
+ currentByteBufferPos += FIXED64_SIZE;
+ return (((UnsafeUtil.getByte(tempPos) & 0xffL))
+ | ((UnsafeUtil.getByte(tempPos + 1) & 0xffL) << 8)
+ | ((UnsafeUtil.getByte(tempPos + 2) & 0xffL) << 16)
+ | ((UnsafeUtil.getByte(tempPos + 3) & 0xffL) << 24)
+ | ((UnsafeUtil.getByte(tempPos + 4) & 0xffL) << 32)
+ | ((UnsafeUtil.getByte(tempPos + 5) & 0xffL) << 40)
+ | ((UnsafeUtil.getByte(tempPos + 6) & 0xffL) << 48)
+ | ((UnsafeUtil.getByte(tempPos + 7) & 0xffL) << 56));
+ }
+ return ((readRawByte() & 0xffL)
+ | ((readRawByte() & 0xffL) << 8)
+ | ((readRawByte() & 0xffL) << 16)
+ | ((readRawByte() & 0xffL) << 24)
+ | ((readRawByte() & 0xffL) << 32)
+ | ((readRawByte() & 0xffL) << 40)
+ | ((readRawByte() & 0xffL) << 48)
+ | ((readRawByte() & 0xffL) << 56));
+ }
+
+ @Override
+ public void enableAliasing(boolean enabled) {
+ this.enableAliasing = enabled;
+ }
+
+ @Override
+ public void resetSizeCounter() {
+ startOffset = (int) (totalBytesRead + currentByteBufferPos - currentByteBufferStartPos);
+ }
+
+ @Override
+ public int pushLimit(int byteLimit) throws InvalidProtocolBufferException {
+ if (byteLimit < 0) {
+ throw InvalidProtocolBufferException.negativeSize();
+ }
+ byteLimit += getTotalBytesRead();
+ final int oldLimit = currentLimit;
+ if (byteLimit > oldLimit) {
+ throw InvalidProtocolBufferException.truncatedMessage();
+ }
+ currentLimit = byteLimit;
+
+ recomputeBufferSizeAfterLimit();
+
+ return oldLimit;
+ }
+
+ private void recomputeBufferSizeAfterLimit() {
+ totalBufferSize += bufferSizeAfterCurrentLimit;
+ final int bufferEnd = totalBufferSize - startOffset;
+ if (bufferEnd > currentLimit) {
+ // Limit is in current buffer.
+ bufferSizeAfterCurrentLimit = bufferEnd - currentLimit;
+ totalBufferSize -= bufferSizeAfterCurrentLimit;
+ } else {
+ bufferSizeAfterCurrentLimit = 0;
+ }
+ }
+
+ @Override
+ public void popLimit(final int oldLimit) {
+ currentLimit = oldLimit;
+ recomputeBufferSizeAfterLimit();
+ }
+
+ @Override
+ public int getBytesUntilLimit() {
+ if (currentLimit == Integer.MAX_VALUE) {
+ return -1;
+ }
+
+ return currentLimit - getTotalBytesRead();
+ }
+
+ @Override
+ public boolean isAtEnd() throws IOException {
+ return totalBytesRead + currentByteBufferPos - currentByteBufferStartPos == totalBufferSize;
+ }
+
+ @Override
+ public int getTotalBytesRead() {
+ return (int)
+ (totalBytesRead - startOffset + currentByteBufferPos - currentByteBufferStartPos);
+ }
+
+ @Override
+ public byte readRawByte() throws IOException {
+ if (currentRemaining() == 0) {
+ getNextByteBuffer();
+ }
+ return UnsafeUtil.getByte(currentByteBufferPos++);
+ }
+
+ @Override
+ public byte[] readRawBytes(final int length) throws IOException {
+ if (length >= 0 && length <= currentRemaining()) {
+ byte[] bytes = new byte[length];
+ UnsafeUtil.copyMemory(currentByteBufferPos, bytes, 0, length);
+ currentByteBufferPos += length;
+ return bytes;
+ }
+ if (length >= 0 && length <= remaining()) {
+ byte[] bytes = new byte[length];
+ readRawBytesTo(bytes, 0, length);
+ return bytes;
+ }
+
+ if (length <= 0) {
+ if (length == 0) {
+ return EMPTY_BYTE_ARRAY;
+ } else {
+ throw InvalidProtocolBufferException.negativeSize();
+ }
+ }
+
+ throw InvalidProtocolBufferException.truncatedMessage();
+ }
+
+ /**
+ * Try to get raw bytes from {@code input} with the size of {@code length} and copy to {@code
+ * bytes} array. If the size is bigger than the number of remaining bytes in the input, then
+ * throw {@code truncatedMessage} exception.
+ *
+ * @param bytes
+ * @param offset
+ * @param length
+ * @throws IOException
+ */
+ private void readRawBytesTo(byte[] bytes, int offset, final int length) throws IOException {
+ if (length >= 0 && length <= remaining()) {
+ int l = length;
+ while (l > 0) {
+ if (currentRemaining() == 0) {
+ getNextByteBuffer();
+ }
+ int bytesToCopy = Math.min(l, (int) currentRemaining());
+ UnsafeUtil.copyMemory(currentByteBufferPos, bytes, length - l + offset, bytesToCopy);
+ l -= bytesToCopy;
+ currentByteBufferPos += bytesToCopy;
+ }
+ return;
+ }
+
+ if (length <= 0) {
+ if (length == 0) {
+ return;
+ } else {
+ throw InvalidProtocolBufferException.negativeSize();
+ }
+ }
+ throw InvalidProtocolBufferException.truncatedMessage();
+ }
+
+ @Override
+ public void skipRawBytes(final int length) throws IOException {
+ if (length >= 0
+ && length
+ <= (totalBufferSize
+ - totalBytesRead
+ - currentByteBufferPos
+ + currentByteBufferStartPos)) {
+ // We have all the bytes we need already.
+ int l = length;
+ while (l > 0) {
+ if (currentRemaining() == 0) {
+ getNextByteBuffer();
+ }
+ int rl = Math.min(l, (int) currentRemaining());
+ l -= rl;
+ currentByteBufferPos += rl;
+ }
+ return;
+ }
+
+ if (length < 0) {
+ throw InvalidProtocolBufferException.negativeSize();
+ }
+ throw InvalidProtocolBufferException.truncatedMessage();
+ }
+
+ // TODO: optimize to fastpath
+ private void skipRawVarint() throws IOException {
+ for (int i = 0; i < MAX_VARINT_SIZE; i++) {
+ if (readRawByte() >= 0) {
+ return;
+ }
+ }
+ throw InvalidProtocolBufferException.malformedVarint();
+ }
+
+ /**
+ * Try to get the number of remaining bytes in {@code input}.
+ *
+ * @return the number of remaining bytes in {@code input}.
+ */
+ private int remaining() {
+ return (int)
+ (totalBufferSize - totalBytesRead - currentByteBufferPos + currentByteBufferStartPos);
+ }
+
+ /**
+ * Try to get the number of remaining bytes in {@code currentByteBuffer}.
+ *
+ * @return the number of remaining bytes in {@code currentByteBuffer}
+ */
+ private long currentRemaining() {
+ return (currentByteBufferLimit - currentByteBufferPos);
+ }
+
+ private ByteBuffer slice(int begin, int end) throws IOException {
+ int prevPos = currentByteBuffer.position();
+ int prevLimit = currentByteBuffer.limit();
+ try {
+ currentByteBuffer.position(begin);
+ currentByteBuffer.limit(end);
+ return currentByteBuffer.slice();
+ } catch (IllegalArgumentException e) {
+ throw InvalidProtocolBufferException.truncatedMessage();
+ } finally {
+ currentByteBuffer.position(prevPos);
+ currentByteBuffer.limit(prevLimit);
+ }
+ }
+ }
}
diff --git a/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java b/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java
index 7116ae1c..99864964 100644
--- a/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java
+++ b/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java
@@ -220,7 +220,7 @@ public abstract class GeneratedMessageLite<
@Override
public final boolean isInitialized() {
- return dynamicMethod(MethodToInvoke.IS_INITIALIZED, Boolean.TRUE) != null;
+ return isInitialized((MessageType) this, Boolean.TRUE);
}
@Override
@@ -240,6 +240,8 @@ public abstract class GeneratedMessageLite<
public static enum MethodToInvoke {
// Rely on/modify instance state
IS_INITIALIZED,
+ GET_MEMOIZED_IS_INITIALIZED,
+ SET_MEMOIZED_IS_INITIALIZED,
VISIT,
MERGE_FROM_STREAM,
MAKE_IMMUTABLE,
@@ -256,25 +258,30 @@ public abstract class GeneratedMessageLite<
* Theses different kinds of operations are required to implement message-level operations for
* builders in the runtime. This method bundles those operations to reduce the generated methods
* count.
+ *
* <ul>
- * <li>{@code MERGE_FROM_STREAM} is parameterized with an {@link CodedInputStream} and
- * {@link ExtensionRegistryLite}. It consumes the input stream, parsing the contents into the
- * returned protocol buffer. If parsing throws an {@link InvalidProtocolBufferException}, the
- * implementation wraps it in a RuntimeException.
- * <li>{@code NEW_INSTANCE} returns a new instance of the protocol buffer that has not yet been
- * made immutable. See {@code MAKE_IMMUTABLE}.
- * <li>{@code IS_INITIALIZED} is parameterized with a {@code Boolean} detailing whether to
- * memoize. It returns {@code null} for false and the default instance for true. We optionally
- * memoize to support the Builder case, where memoization is not desired.
- * <li>{@code NEW_BUILDER} returns a {@code BuilderType} instance.
- * <li>{@code VISIT} is parameterized with a {@code Visitor} and a {@code MessageType} and
- * recursively iterates through the fields side by side between this and the instance.
- * <li>{@code MAKE_IMMUTABLE} sets all internal fields to an immutable state.
+ * <li>{@code MERGE_FROM_STREAM} is parameterized with an {@link CodedInputStream} and {@link
+ * ExtensionRegistryLite}. It consumes the input stream, parsing the contents into the
+ * returned protocol buffer. If parsing throws an {@link InvalidProtocolBufferException},
+ * the implementation wraps it in a RuntimeException.
+ * <li>{@code NEW_INSTANCE} returns a new instance of the protocol buffer that has not yet been
+ * made immutable. See {@code MAKE_IMMUTABLE}.
+ * <li>{@code IS_INITIALIZED} returns {@code null} for false and the default instance for true.
+ * It doesn't use or modify any memoized value.
+ * <li>{@code GET_MEMOIZED_IS_INITIALIZED} returns the memoized {@code isInitialized} byte
+ * value.
+ * <li>{@code SET_MEMOIZED_IS_INITIALIZED} sets the memoized {@code isInitilaized} byte value to
+ * 1 if the first parameter is not null, or to 0 if the first parameter is null.
+ * <li>{@code NEW_BUILDER} returns a {@code BuilderType} instance.
+ * <li>{@code VISIT} is parameterized with a {@code Visitor} and a {@code MessageType} and
+ * recursively iterates through the fields side by side between this and the instance.
+ * <li>{@code MAKE_IMMUTABLE} sets all internal fields to an immutable state.
* </ul>
+ *
* This method, plus the implementation of the Builder, enables the Builder class to be proguarded
* away entirely on Android.
- * <p>
- * For use by generated code only.
+ *
+ * <p>For use by generated code only.
*/
protected abstract Object dynamicMethod(MethodToInvoke method, Object arg0, Object arg1);
@@ -297,9 +304,9 @@ public abstract class GeneratedMessageLite<
unknownFields = visitor.visitUnknownFields(unknownFields, other.unknownFields);
}
+
/**
- * Merge some unknown fields into the {@link UnknownFieldSetLite} for this
- * message.
+ * Merge some unknown fields into the {@link UnknownFieldSetLite} for this message.
*
* <p>For use by generated code only.
*/
@@ -1403,7 +1410,21 @@ public abstract class GeneratedMessageLite<
*/
protected static final <T extends GeneratedMessageLite<T, ?>> boolean isInitialized(
T message, boolean shouldMemoize) {
- return message.dynamicMethod(MethodToInvoke.IS_INITIALIZED, shouldMemoize) != null;
+ byte memoizedIsInitialized =
+ (Byte) message.dynamicMethod(MethodToInvoke.GET_MEMOIZED_IS_INITIALIZED);
+ if (memoizedIsInitialized == 1) {
+ return true;
+ }
+ if (memoizedIsInitialized == 0) {
+ return false;
+ }
+ boolean isInitialized =
+ message.dynamicMethod(MethodToInvoke.IS_INITIALIZED, Boolean.FALSE) != null;
+ if (shouldMemoize) {
+ message.dynamicMethod(
+ MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED, isInitialized ? message : null);
+ }
+ return isInitialized;
}
protected static final <T extends GeneratedMessageLite<T, ?>> void makeImmutable(T message) {
diff --git a/java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java b/java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java
new file mode 100644
index 00000000..713e8064
--- /dev/null
+++ b/java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java
@@ -0,0 +1,150 @@
+// 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.
+
+package com.google.protobuf;
+
+import static com.google.protobuf.Internal.EMPTY_BYTE_BUFFER;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.util.Iterator;
+
+class IterableByteBufferInputStream extends InputStream {
+ /** The {@link Iterator} with type {@link ByteBuffer} of {@code input} */
+ private Iterator<ByteBuffer> iterator;
+ /** The current ByteBuffer; */
+ private ByteBuffer currentByteBuffer;
+ /** The number of ByteBuffers in the input data. */
+ private int dataSize;
+ /**
+ * Current {@code ByteBuffer}'s index
+ *
+ * <p>If index equals dataSize, then all the data in the InputStream has been consumed
+ */
+ private int currentIndex;
+ /** The current position for current ByteBuffer */
+ private int currentByteBufferPos;
+ /** Whether current ByteBuffer has an array */
+ private boolean hasArray;
+ /**
+ * If the current ByteBuffer is unsafe-direct based, currentArray is null; otherwise should be the
+ * array inside ByteBuffer.
+ */
+ private byte[] currentArray;
+ /** Current ByteBuffer's array offset */
+ private int currentArrayOffset;
+ /**
+ * If the current ByteBuffer is unsafe-direct based, currentAddress is the start address of this
+ * ByteBuffer; otherwise should be zero.
+ */
+ private long currentAddress;
+
+ IterableByteBufferInputStream(Iterable<ByteBuffer> data) {
+ iterator = data.iterator();
+ dataSize = 0;
+ for (ByteBuffer unused : data) {
+ dataSize++;
+ }
+ currentIndex = -1;
+
+ if (!getNextByteBuffer()) {
+ currentByteBuffer = EMPTY_BYTE_BUFFER;
+ currentIndex = 0;
+ currentByteBufferPos = 0;
+ currentAddress = 0;
+ }
+ }
+
+ private boolean getNextByteBuffer() {
+ currentIndex++;
+ if (!iterator.hasNext()) {
+ return false;
+ }
+ currentByteBuffer = iterator.next();
+ currentByteBufferPos = currentByteBuffer.position();
+ if (currentByteBuffer.hasArray()) {
+ hasArray = true;
+ currentArray = currentByteBuffer.array();
+ currentArrayOffset = currentByteBuffer.arrayOffset();
+ } else {
+ hasArray = false;
+ currentAddress = UnsafeUtil.addressOffset(currentByteBuffer);
+ currentArray = null;
+ }
+ return true;
+ }
+
+ private void updateCurrentByteBufferPos(int numberOfBytesRead) {
+ currentByteBufferPos += numberOfBytesRead;
+ if (currentByteBufferPos == currentByteBuffer.limit()) {
+ getNextByteBuffer();
+ }
+ }
+
+ @Override
+ public int read() throws IOException {
+ if (currentIndex == dataSize) {
+ return -1;
+ }
+ if (hasArray) {
+ int result = currentArray[currentByteBufferPos + currentArrayOffset] & 0xFF;
+ updateCurrentByteBufferPos(1);
+ return result;
+ } else {
+ int result = UnsafeUtil.getByte(currentByteBufferPos + currentAddress) & 0xFF;
+ updateCurrentByteBufferPos(1);
+ return result;
+ }
+ }
+
+ @Override
+ public int read(byte[] output, int offset, int length) throws IOException {
+ if (currentIndex == dataSize) {
+ return -1;
+ }
+ int remaining = currentByteBuffer.limit() - currentByteBufferPos;
+ if (length > remaining) {
+ length = remaining;
+ }
+ if (hasArray) {
+ System.arraycopy(
+ currentArray, currentByteBufferPos + currentArrayOffset, output, offset, length);
+ updateCurrentByteBufferPos(length);
+ } else {
+ int prevPos = currentByteBuffer.position();
+ currentByteBuffer.position(currentByteBufferPos);
+ currentByteBuffer.get(output, offset, length);
+ currentByteBuffer.position(prevPos);
+ updateCurrentByteBufferPos(length);
+ }
+ return length;
+ }
+}
diff --git a/java/core/src/main/java/com/google/protobuf/SmallSortedMap.java b/java/core/src/main/java/com/google/protobuf/SmallSortedMap.java
index 66033f58..279edc4d 100644
--- a/java/core/src/main/java/com/google/protobuf/SmallSortedMap.java
+++ b/java/core/src/main/java/com/google/protobuf/SmallSortedMap.java
@@ -540,8 +540,8 @@ class SmallSortedMap<K extends Comparable<K>, V> extends AbstractMap<K, V> {
@Override
public boolean hasNext() {
- return (pos + 1) < entryList.size() ||
- getOverflowIterator().hasNext();
+ return (pos + 1) < entryList.size()
+ || (!overflowEntries.isEmpty() && getOverflowIterator().hasNext());
}
@Override
diff --git a/java/core/src/main/java/com/google/protobuf/TextFormat.java b/java/core/src/main/java/com/google/protobuf/TextFormat.java
index 64094d09..ab9acf2f 100644
--- a/java/core/src/main/java/com/google/protobuf/TextFormat.java
+++ b/java/core/src/main/java/com/google/protobuf/TextFormat.java
@@ -279,9 +279,21 @@ public final class TextFormat {
generator.print(String.format((Locale) null, "0x%016x", (Long) value));
break;
case WireFormat.WIRETYPE_LENGTH_DELIMITED:
- generator.print("\"");
- generator.print(escapeBytes((ByteString) value));
- generator.print("\"");
+ try {
+ // Try to parse and print the field as an embedded message
+ UnknownFieldSet message = UnknownFieldSet.parseFrom((ByteString) value);
+ generator.print("{");
+ generator.eol();
+ generator.indent();
+ Printer.DEFAULT.printUnknownFields(message, generator);
+ generator.outdent();
+ generator.print("}");
+ } catch (InvalidProtocolBufferException e) {
+ // If not parseable as a message, print as a String
+ generator.print("\"");
+ generator.print(escapeBytes((ByteString) value));
+ generator.print("\"");
+ }
break;
case WireFormat.WIRETYPE_START_GROUP:
Printer.DEFAULT.printUnknownFields((UnknownFieldSet) value, generator);
diff --git a/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java b/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java
index d6226fc7..2a614c84 100644
--- a/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java
+++ b/java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java
@@ -81,7 +81,7 @@ public final class UnknownFieldSetLite {
System.arraycopy(second.objects, 0, objects, first.count, second.count);
return new UnknownFieldSetLite(count, tags, objects, true /* isMutable */);
}
-
+
/**
* The number of elements in the set.
*/
@@ -323,6 +323,7 @@ public final class UnknownFieldSetLite {
// Package private for unsafe experimental runtime.
void storeField(int tag, Object value) {
+ checkMutable();
ensureCapacity();
tags[count] = tag;
diff --git a/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java b/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java
index acc03a7c..88315cb6 100644
--- a/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java
+++ b/java/core/src/main/java/com/google/protobuf/UnsafeUtil.java
@@ -252,10 +252,6 @@ final class UnsafeUtil {
MEMORY_ACCESSOR.putLong(address, value);
}
- static void copyMemory(long srcAddress, long targetAddress, long length) {
- MEMORY_ACCESSOR.copyMemory(srcAddress, targetAddress, length);
- }
-
/**
* Gets the offset of the {@code address} field of the given direct {@link ByteBuffer}.
*/
@@ -478,8 +474,6 @@ final class UnsafeUtil {
public abstract void putLong(long address, long value);
- public abstract void copyMemory(long srcAddress, long targetAddress, long length);
-
public abstract Object getStaticObject(Field field);
public abstract void copyMemory(long srcOffset, byte[] target, long targetIndex, long length);
@@ -562,11 +556,6 @@ final class UnsafeUtil {
public void putDouble(Object target, long offset, double value) {
unsafe.putDouble(target, offset, value);
}
-
- @Override
- public void copyMemory(long srcAddress, long targetAddress, long length) {
- unsafe.copyMemory(srcAddress, targetAddress, length);
- }
@Override
public void copyMemory(long srcOffset, byte[] target, long targetIndex, long length) {
diff --git a/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java b/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java
index da2c067e..5ea6b79c 100644
--- a/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java
+++ b/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java
@@ -41,6 +41,7 @@ import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
+import java.util.ArrayList;
import java.util.Arrays;
import junit.framework.TestCase;
@@ -50,6 +51,9 @@ import junit.framework.TestCase;
* @author kenton@google.com Kenton Varda
*/
public class CodedInputStreamTest extends TestCase {
+
+ private static final int DEFAULT_BLOCK_SIZE = 4096;
+
private enum InputType {
ARRAY {
@Override
@@ -77,7 +81,43 @@ public class CodedInputStreamTest extends TestCase {
CodedInputStream newDecoder(byte[] data, int blockSize) {
return CodedInputStream.newInstance(new SmallBlockInputStream(data, blockSize));
}
+ },
+ ITER_DIRECT {
+ @Override
+ CodedInputStream newDecoder(byte[] data, int blockSize) {
+ if (blockSize > DEFAULT_BLOCK_SIZE) {
+ blockSize = DEFAULT_BLOCK_SIZE;
+ }
+ ArrayList <ByteBuffer> input = new ArrayList <ByteBuffer>();
+ for (int i = 0; i < data.length; i += blockSize) {
+ int rl = Math.min(blockSize, data.length - i);
+ ByteBuffer rb = ByteBuffer.allocateDirect(rl);
+ rb.put(data, i, rl);
+ rb.flip();
+ input.add(rb);
+ }
+ return CodedInputStream.newInstance(input);
+ }
+ },
+ STREAM_ITER_DIRECT {
+ @Override
+ CodedInputStream newDecoder(byte[] data, int blockSize) {
+ if (blockSize > DEFAULT_BLOCK_SIZE) {
+ blockSize = DEFAULT_BLOCK_SIZE;
+ }
+ ArrayList <ByteBuffer> input = new ArrayList <ByteBuffer>();
+ for (int i = 0; i < data.length; i += blockSize) {
+ int rl = Math.min(blockSize, data.length - i);
+ ByteBuffer rb = ByteBuffer.allocateDirect(rl);
+ rb.put(data, i, rl);
+ rb.flip();
+ input.add(rb);
+ }
+ return CodedInputStream.newInstance(new IterableByteBufferInputStream(input));
+ }
};
+
+
CodedInputStream newDecoder(byte[] data) {
return newDecoder(data, data.length);
@@ -994,7 +1034,9 @@ public class CodedInputStreamTest extends TestCase {
byte[] data = byteArrayStream.toByteArray();
for (InputType inputType : InputType.values()) {
- if (inputType == InputType.STREAM) {
+ if (inputType == InputType.STREAM
+ || inputType == InputType.STREAM_ITER_DIRECT
+ || inputType == InputType.ITER_DIRECT) {
// Aliasing doesn't apply to stream-backed CIS.
continue;
}
@@ -1019,7 +1061,7 @@ public class CodedInputStreamTest extends TestCase {
assertEquals(inputType.name(), (byte) 89, result.get());
// Enable aliasing
- inputStream = inputType.newDecoder(data);
+ inputStream = inputType.newDecoder(data, data.length);
inputStream.enableAliasing(true);
result = inputStream.readByteBuffer();
assertEquals(inputType.name(), 0, result.capacity());
diff --git a/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java b/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java
index a4311d17..c9ebe7f5 100644
--- a/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java
+++ b/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java
@@ -32,19 +32,14 @@ package com.google.protobuf;
import com.google.protobuf.Descriptors.Descriptor;
import com.google.protobuf.Descriptors.FieldDescriptor;
-import com.google.protobuf.UnittestLite.TestAllExtensionsLite;
import com.google.protobuf.test.UnittestImport;
import protobuf_unittest.EnumWithNoOuter;
import protobuf_unittest.MessageWithNoOuter;
import protobuf_unittest.MultipleFilesTestProto;
import protobuf_unittest.NestedExtension.MyNestedExtension;
-import protobuf_unittest.NestedExtensionLite.MyNestedExtensionLite;
import protobuf_unittest.NonNestedExtension;
import protobuf_unittest.NonNestedExtension.MessageToBeExtended;
import protobuf_unittest.NonNestedExtension.MyNonNestedExtension;
-import protobuf_unittest.NonNestedExtensionLite;
-import protobuf_unittest.NonNestedExtensionLite.MessageLiteToBeExtended;
-import protobuf_unittest.NonNestedExtensionLite.MyNonNestedExtensionLite;
import protobuf_unittest.OuterClassNameTest2OuterClass;
import protobuf_unittest.OuterClassNameTest3OuterClass;
import protobuf_unittest.OuterClassNameTestOuterClass;
@@ -712,70 +707,6 @@ public class GeneratedMessageTest extends TestCase {
}
// =================================================================
- // Lite Extensions.
-
- // We test lite extensions directly because they have a separate
- // implementation from full extensions. In contrast, we do not test
- // lite fields directly since they are implemented exactly the same as
- // regular fields.
-
- public void testLiteExtensionMessageOrBuilder() throws Exception {
- TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.newBuilder();
- TestUtilLite.setAllExtensions(builder);
- TestUtil.assertAllExtensionsSet(builder);
-
- TestAllExtensionsLite message = builder.build();
- TestUtil.assertAllExtensionsSet(message);
- }
-
- public void testLiteExtensionRepeatedSetters() throws Exception {
- TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.newBuilder();
- TestUtilLite.setAllExtensions(builder);
- TestUtilLite.modifyRepeatedExtensions(builder);
- TestUtil.assertRepeatedExtensionsModified(builder);
-
- TestAllExtensionsLite message = builder.build();
- TestUtil.assertRepeatedExtensionsModified(message);
- }
-
- public void testLiteExtensionDefaults() throws Exception {
- TestUtil.assertExtensionsClear(TestAllExtensionsLite.getDefaultInstance());
- TestUtil.assertExtensionsClear(TestAllExtensionsLite.newBuilder().build());
- }
-
- public void testClearLiteExtension() throws Exception {
- // clearExtension() is not actually used in TestUtil, so try it manually.
- assertFalse(
- TestAllExtensionsLite.newBuilder()
- .setExtension(UnittestLite.optionalInt32ExtensionLite, 1)
- .clearExtension(UnittestLite.optionalInt32ExtensionLite)
- .hasExtension(UnittestLite.optionalInt32ExtensionLite));
- assertEquals(0,
- TestAllExtensionsLite.newBuilder()
- .addExtension(UnittestLite.repeatedInt32ExtensionLite, 1)
- .clearExtension(UnittestLite.repeatedInt32ExtensionLite)
- .getExtensionCount(UnittestLite.repeatedInt32ExtensionLite));
- }
-
- public void testLiteExtensionCopy() throws Exception {
- TestAllExtensionsLite original = TestUtilLite.getAllLiteExtensionsSet();
- TestAllExtensionsLite copy =
- TestAllExtensionsLite.newBuilder(original).build();
- TestUtil.assertAllExtensionsSet(copy);
- }
-
- public void testLiteExtensionMergeFrom() throws Exception {
- TestAllExtensionsLite original =
- TestAllExtensionsLite.newBuilder()
- .setExtension(UnittestLite.optionalInt32ExtensionLite, 1).build();
- TestAllExtensionsLite merged =
- TestAllExtensionsLite.newBuilder().mergeFrom(original).build();
- assertTrue(merged.hasExtension(UnittestLite.optionalInt32ExtensionLite));
- assertEquals(
- 1, (int) merged.getExtension(UnittestLite.optionalInt32ExtensionLite));
- }
-
- // =================================================================
// multiple_files_test
// Test that custom options of an file level enum are properly initialized.
@@ -942,16 +873,6 @@ public class GeneratedMessageTest extends TestCase {
MyNestedExtension.recursiveExtension.getDescriptor().getName());
}
- public void testNonNestedExtensionLiteInitialization() {
- assertTrue(NonNestedExtensionLite.nonNestedExtensionLite
- .getMessageDefaultInstance() instanceof MyNonNestedExtensionLite);
- }
-
- public void testNestedExtensionLiteInitialization() {
- assertTrue(MyNestedExtensionLite.recursiveExtensionLite
- .getMessageDefaultInstance() instanceof MessageLiteToBeExtended);
- }
-
public void testInvalidations() throws Exception {
GeneratedMessage.enableAlwaysUseFieldBuildersForTesting();
TestAllTypes.NestedMessage nestedMessage1 =
diff --git a/java/core/src/test/java/com/google/protobuf/LiteTest.java b/java/core/src/test/java/com/google/protobuf/LiteTest.java
index ba8bcb1c..ba4d539d 100644
--- a/java/core/src/test/java/com/google/protobuf/LiteTest.java
+++ b/java/core/src/test/java/com/google/protobuf/LiteTest.java
@@ -1453,6 +1453,36 @@ public class LiteTest extends TestCase {
UnittestLite.optionalFixed32ExtensionLite));
}
+ // Builder.mergeFrom() should keep existing extensions.
+ public void testBuilderMergeFromWithExtensions() throws Exception {
+ TestAllExtensionsLite message =
+ TestAllExtensionsLite.newBuilder()
+ .addExtension(UnittestLite.repeatedInt32ExtensionLite, 12)
+ .build();
+
+ ExtensionRegistryLite registry = ExtensionRegistryLite.newInstance();
+ UnittestLite.registerAllExtensions(registry);
+
+ TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.newBuilder();
+ builder.mergeFrom(message.toByteArray(), registry);
+ builder.mergeFrom(message.toByteArray(), registry);
+ TestAllExtensionsLite result = builder.build();
+ assertEquals(2, result.getExtensionCount(UnittestLite.repeatedInt32ExtensionLite));
+ assertEquals(12, result.getExtension(UnittestLite.repeatedInt32ExtensionLite, 0).intValue());
+ assertEquals(12, result.getExtension(UnittestLite.repeatedInt32ExtensionLite, 1).intValue());
+ }
+
+ // Builder.mergeFrom() should keep existing unknown fields.
+ public void testBuilderMergeFromWithUnknownFields() throws Exception {
+ TestAllTypesLite message = TestAllTypesLite.newBuilder().addRepeatedInt32(1).build();
+
+ NestedMessage.Builder builder = NestedMessage.newBuilder();
+ builder.mergeFrom(message.toByteArray());
+ builder.mergeFrom(message.toByteArray());
+ NestedMessage result = builder.build();
+ assertEquals(message.getSerializedSize() * 2, result.getSerializedSize());
+ }
+
public void testToStringDefaultInstance() throws Exception {
assertToStringEquals("", TestAllTypesLite.getDefaultInstance());
}
@@ -2592,4 +2622,12 @@ public class LiteTest extends TestCase {
return list.iterator();
}
}
+
+ public void testNullExtensionRegistry() throws Exception {
+ try {
+ TestAllTypesLite.parseFrom(new byte[] {}, null);
+ fail();
+ } catch (NullPointerException expected) {
+ }
+ }
}
diff --git a/java/core/src/test/java/com/google/protobuf/MessageTest.java b/java/core/src/test/java/com/google/protobuf/MessageTest.java
index 9d55d0dd..4fc8f78e 100644
--- a/java/core/src/test/java/com/google/protobuf/MessageTest.java
+++ b/java/core/src/test/java/com/google/protobuf/MessageTest.java
@@ -74,6 +74,14 @@ public class MessageTest extends TestCase {
"repeated_string: \"qux\"\n" +
"repeated_string: \"bar\"\n";
+ public void testParsingWithNullExtensionRegistry() throws Exception {
+ try {
+ TestAllTypes.parseFrom(new byte[] {}, null);
+ fail();
+ } catch (NullPointerException expected) {
+ }
+ }
+
public void testMergeFrom() throws Exception {
TestAllTypes result =
TestAllTypes.newBuilder(MERGE_DEST)
diff --git a/java/core/src/test/java/com/google/protobuf/ParserTest.java b/java/core/src/test/java/com/google/protobuf/ParserTest.java
index 4bd34112..1e891112 100644
--- a/java/core/src/test/java/com/google/protobuf/ParserTest.java
+++ b/java/core/src/test/java/com/google/protobuf/ParserTest.java
@@ -30,9 +30,6 @@
package com.google.protobuf;
-import com.google.protobuf.UnittestLite.TestAllTypesLite;
-import com.google.protobuf.UnittestLite.TestPackedExtensionsLite;
-import com.google.protobuf.UnittestLite.TestParsingMergeLite;
import protobuf_unittest.UnittestOptimizeFor;
import protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize;
import protobuf_unittest.UnittestOptimizeFor.TestRequiredOptimizedForSize;
@@ -183,22 +180,12 @@ public class ParserTest extends TestCase {
TestUtil.getExtensionRegistry());
}
- public void testParseExtensionsLite() throws Exception {
- assertRoundTripEquals(
- TestUtilLite.getAllLiteExtensionsSet(), TestUtilLite.getExtensionRegistryLite());
- }
-
public void testParsePacked() throws Exception {
assertRoundTripEquals(TestUtil.getPackedSet());
assertRoundTripEquals(TestUtil.getPackedExtensionsSet(),
TestUtil.getExtensionRegistry());
}
- public void testParsePackedLite() throws Exception {
- assertRoundTripEquals(
- TestUtilLite.getLitePackedExtensionsSet(), TestUtilLite.getExtensionRegistryLite());
- }
-
public void testParseDelimitedTo() throws Exception {
// Write normal Message.
TestAllTypes normalMessage = TestUtil.getAllSet();
@@ -211,26 +198,6 @@ public class ParserTest extends TestCase {
assertMessageEquals(normalMessage, normalMessage.getParserForType().parseDelimitedFrom(input));
}
- public void testParseDelimitedToLite() throws Exception {
- // Write MessageLite with packed extension fields.
- TestPackedExtensionsLite packedMessage = TestUtilLite.getLitePackedExtensionsSet();
- ByteArrayOutputStream output = new ByteArrayOutputStream();
- packedMessage.writeDelimitedTo(output);
- packedMessage.writeDelimitedTo(output);
-
- InputStream input = new ByteArrayInputStream(output.toByteArray());
- assertMessageEquals(
- packedMessage,
- packedMessage
- .getParserForType()
- .parseDelimitedFrom(input, TestUtilLite.getExtensionRegistryLite()));
- assertMessageEquals(
- packedMessage,
- packedMessage
- .getParserForType()
- .parseDelimitedFrom(input, TestUtilLite.getExtensionRegistryLite()));
- }
-
public void testParseUnknownFields() throws Exception {
// All fields will be treated as unknown fields in emptyMessage.
TestEmptyMessage emptyMessage =
@@ -263,14 +230,6 @@ public class ParserTest extends TestCase {
assertEquals("hello", allTypes.getOptionalString());
}
- /** Helper method for {@link #testParsingMergeLite()}.*/
- private void assertMessageMerged(TestAllTypesLite allTypes)
- throws Exception {
- assertEquals(3, allTypes.getOptionalInt32());
- assertEquals(2, allTypes.getOptionalInt64());
- assertEquals("hello", allTypes.getOptionalString());
- }
-
public void testParsingMerge() throws Exception {
// Build messages.
TestAllTypes.Builder builder = TestAllTypes.newBuilder();
@@ -332,67 +291,6 @@ public class ParserTest extends TestCase {
TestParsingMerge.repeatedExt));
}
- public void testParsingMergeLite() throws Exception {
- // Build messages.
- TestAllTypesLite.Builder builder = TestAllTypesLite.newBuilder();
- TestAllTypesLite msg1 = builder.setOptionalInt32(1).build();
- builder.clear();
- TestAllTypesLite msg2 = builder.setOptionalInt64(2).build();
- builder.clear();
- TestAllTypesLite msg3 = builder.setOptionalInt32(3)
- .setOptionalString("hello").build();
-
- // Build groups.
- TestParsingMergeLite.RepeatedFieldsGenerator.Group1 optionalG1 =
- TestParsingMergeLite.RepeatedFieldsGenerator.Group1.newBuilder()
- .setField1(msg1).build();
- TestParsingMergeLite.RepeatedFieldsGenerator.Group1 optionalG2 =
- TestParsingMergeLite.RepeatedFieldsGenerator.Group1.newBuilder()
- .setField1(msg2).build();
- TestParsingMergeLite.RepeatedFieldsGenerator.Group1 optionalG3 =
- TestParsingMergeLite.RepeatedFieldsGenerator.Group1.newBuilder()
- .setField1(msg3).build();
- TestParsingMergeLite.RepeatedFieldsGenerator.Group2 repeatedG1 =
- TestParsingMergeLite.RepeatedFieldsGenerator.Group2.newBuilder()
- .setField1(msg1).build();
- TestParsingMergeLite.RepeatedFieldsGenerator.Group2 repeatedG2 =
- TestParsingMergeLite.RepeatedFieldsGenerator.Group2.newBuilder()
- .setField1(msg2).build();
- TestParsingMergeLite.RepeatedFieldsGenerator.Group2 repeatedG3 =
- TestParsingMergeLite.RepeatedFieldsGenerator.Group2.newBuilder()
- .setField1(msg3).build();
-
- // Assign and serialize RepeatedFieldsGenerator.
- ByteString data = TestParsingMergeLite.RepeatedFieldsGenerator.newBuilder()
- .addField1(msg1).addField1(msg2).addField1(msg3)
- .addField2(msg1).addField2(msg2).addField2(msg3)
- .addField3(msg1).addField3(msg2).addField3(msg3)
- .addGroup1(optionalG1).addGroup1(optionalG2).addGroup1(optionalG3)
- .addGroup2(repeatedG1).addGroup2(repeatedG2).addGroup2(repeatedG3)
- .addExt1(msg1).addExt1(msg2).addExt1(msg3)
- .addExt2(msg1).addExt2(msg2).addExt2(msg3)
- .build().toByteString();
-
- // Parse TestParsingMergeLite.
- ExtensionRegistry registry = ExtensionRegistry.newInstance();
- UnittestLite.registerAllExtensions(registry);
- TestParsingMergeLite parsingMerge = TestParsingMergeLite.parser().parseFrom(data, registry);
-
- // Required and optional fields should be merged.
- assertMessageMerged(parsingMerge.getRequiredAllTypes());
- assertMessageMerged(parsingMerge.getOptionalAllTypes());
- assertMessageMerged(
- parsingMerge.getOptionalGroup().getOptionalGroupAllTypes());
- assertMessageMerged(parsingMerge.getExtension(
- TestParsingMergeLite.optionalExt));
-
- // Repeated fields should not be merged.
- assertEquals(3, parsingMerge.getRepeatedAllTypesCount());
- assertEquals(3, parsingMerge.getRepeatedGroupCount());
- assertEquals(3, parsingMerge.getExtensionCount(
- TestParsingMergeLite.repeatedExt));
- }
-
public void testParseDelimitedFrom_firstByteInterrupted_preservesCause() {
try {
TestUtil.getAllSet().parseDelimitedFrom(
diff --git a/java/core/src/test/java/com/google/protobuf/TextFormatTest.java b/java/core/src/test/java/com/google/protobuf/TextFormatTest.java
index 910f360f..28c4fdea 100644
--- a/java/core/src/test/java/com/google/protobuf/TextFormatTest.java
+++ b/java/core/src/test/java/com/google/protobuf/TextFormatTest.java
@@ -168,6 +168,7 @@ public class TextFormatTest extends TestCase {
// Creates an example unknown field set.
private UnknownFieldSet makeUnknownFieldSet() {
+
return UnknownFieldSet.newBuilder()
.addField(5,
UnknownFieldSet.Field.newBuilder()
@@ -175,6 +176,12 @@ public class TextFormatTest extends TestCase {
.addFixed32(2)
.addFixed64(3)
.addLengthDelimited(ByteString.copyFromUtf8("4"))
+ .addLengthDelimited(UnknownFieldSet.newBuilder()
+ .addField(12,
+ UnknownFieldSet.Field.newBuilder()
+ .addVarint(6)
+ .build())
+ .build().toByteString())
.addGroup(
UnknownFieldSet.newBuilder()
.addField(10,
@@ -207,20 +214,23 @@ public class TextFormatTest extends TestCase {
.build();
assertEquals(
- "5: 1\n" +
- "5: 0x00000002\n" +
- "5: 0x0000000000000003\n" +
- "5: \"4\"\n" +
- "5 {\n" +
- " 10: 5\n" +
- "}\n" +
- "8: 1\n" +
- "8: 2\n" +
- "8: 3\n" +
- "15: 12379813812177893520\n" +
- "15: 0xabcd1234\n" +
- "15: 0xabcdef1234567890\n",
- TextFormat.printToString(message));
+ "5: 1\n"
+ + "5: 0x00000002\n"
+ + "5: 0x0000000000000003\n"
+ + "5: \"4\"\n"
+ + "5: {\n"
+ + " 12: 6\n"
+ + "}\n"
+ + "5 {\n"
+ + " 10: 5\n"
+ + "}\n"
+ + "8: 1\n"
+ + "8: 2\n"
+ + "8: 3\n"
+ + "15: 12379813812177893520\n"
+ + "15: 0xabcd1234\n"
+ + "15: 0xabcdef1234567890\n",
+ TextFormat.printToString(message));
}
public void testPrintField() throws Exception {
@@ -861,7 +871,7 @@ public class TextFormatTest extends TestCase {
}
public void testShortDebugString_unknown() {
- assertEquals("5: 1 5: 0x00000002 5: 0x0000000000000003 5: \"4\" 5 { 10: 5 }"
+ assertEquals("5: 1 5: 0x00000002 5: 0x0000000000000003 5: \"4\" 5: { 12: 6 } 5 { 10: 5 }"
+ " 8: 1 8: 2 8: 3 15: 12379813812177893520 15: 0xabcd1234 15:"
+ " 0xabcdef1234567890",
TextFormat.shortDebugString(makeUnknownFieldSet()));
diff --git a/java/core/src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java b/java/core/src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java
index f8cb0aab..9928d44a 100644
--- a/java/core/src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java
+++ b/java/core/src/test/java/com/google/protobuf/UnknownFieldSetLiteTest.java
@@ -32,11 +32,20 @@ package com.google.protobuf;
import com.google.protobuf.UnittestLite.TestAllExtensionsLite;
import com.google.protobuf.UnittestLite.TestAllTypesLite;
+import protobuf_unittest.UnittestProto;
+import protobuf_unittest.UnittestProto.ForeignEnum;
+import protobuf_unittest.UnittestProto.TestAllExtensions;
+import protobuf_unittest.UnittestProto.TestAllTypes;
+import protobuf_unittest.UnittestProto.TestEmptyMessage;
+import protobuf_unittest.UnittestProto.TestPackedExtensions;
+import protobuf_unittest.UnittestProto.TestPackedTypes;
import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash;
import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.Bar;
import protobuf_unittest.lite_equals_and_hash.LiteEqualsAndHash.Foo;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.util.Arrays;
+import java.util.Map;
import junit.framework.TestCase;
/**
@@ -45,7 +54,44 @@ import junit.framework.TestCase;
* @author dweis@google.com (Daniel Weis)
*/
public class UnknownFieldSetLiteTest extends TestCase {
-
+ @Override
+ public void setUp() throws Exception {
+ allFields = TestUtil.getAllSet();
+ allFieldsData = allFields.toByteString();
+ emptyMessage = TestEmptyMessage.parseFrom(allFieldsData);
+ unknownFields = emptyMessage.getUnknownFields();
+ }
+
+ TestAllTypes allFields;
+ ByteString allFieldsData;
+
+ // Constructs a protocol buffer which contains fields with all the same
+ // numbers as allFieldsData except that each field is some other wire
+ // type.
+ private ByteString getBizarroData() throws Exception {
+ UnknownFieldSet.Builder bizarroFields = UnknownFieldSet.newBuilder();
+
+ UnknownFieldSet.Field varintField = UnknownFieldSet.Field.newBuilder().addVarint(1).build();
+ UnknownFieldSet.Field fixed32Field = UnknownFieldSet.Field.newBuilder().addFixed32(1).build();
+
+ for (Map.Entry<Integer, UnknownFieldSet.Field> entry : unknownFields.asMap().entrySet()) {
+ if (entry.getValue().getVarintList().isEmpty()) {
+ // Original field is not a varint, so use a varint.
+ bizarroFields.addField(entry.getKey(), varintField);
+ } else {
+ // Original field *is* a varint, so use something else.
+ bizarroFields.addField(entry.getKey(), fixed32Field);
+ }
+ }
+
+ return bizarroFields.build().toByteString();
+ }
+
+ // An empty message that has been parsed from allFieldsData. So, it has
+ // unknown fields of every type.
+ TestEmptyMessage emptyMessage;
+ UnknownFieldSet unknownFields;
+
public void testDefaultInstance() {
UnknownFieldSetLite unknownFields = UnknownFieldSetLite.getDefaultInstance();
@@ -331,4 +377,203 @@ public class UnknownFieldSetLiteTest extends TestCase {
}
return ByteString.copyFrom(byteArrayOutputStream.toByteArray());
}
+
+ public void testSerializeLite() throws Exception {
+ UnittestLite.TestEmptyMessageLite emptyMessageLite =
+ UnittestLite.TestEmptyMessageLite.parseFrom(allFieldsData);
+ assertEquals(allFieldsData.size(), emptyMessageLite.getSerializedSize());
+ ByteString data = emptyMessageLite.toByteString();
+ TestAllTypes message = TestAllTypes.parseFrom(data);
+ TestUtil.assertAllFieldsSet(message);
+ assertEquals(allFieldsData, data);
+ }
+
+ public void testAllExtensionsLite() throws Exception {
+ TestAllExtensions allExtensions = TestUtil.getAllExtensionsSet();
+ ByteString allExtensionsData = allExtensions.toByteString();
+ UnittestLite.TestEmptyMessageLite emptyMessageLite =
+ UnittestLite.TestEmptyMessageLite.parser().parseFrom(allExtensionsData);
+ ByteString data = emptyMessageLite.toByteString();
+ TestAllExtensions message = TestAllExtensions.parseFrom(data, TestUtil.getExtensionRegistry());
+ TestUtil.assertAllExtensionsSet(message);
+ assertEquals(allExtensionsData, data);
+ }
+
+ public void testAllPackedFieldsLite() throws Exception {
+ TestPackedTypes allPackedFields = TestUtil.getPackedSet();
+ ByteString allPackedData = allPackedFields.toByteString();
+ UnittestLite.TestEmptyMessageLite emptyMessageLite =
+ UnittestLite.TestEmptyMessageLite.parseFrom(allPackedData);
+ ByteString data = emptyMessageLite.toByteString();
+ TestPackedTypes message = TestPackedTypes.parseFrom(data, TestUtil.getExtensionRegistry());
+ TestUtil.assertPackedFieldsSet(message);
+ assertEquals(allPackedData, data);
+ }
+
+ public void testAllPackedExtensionsLite() throws Exception {
+ TestPackedExtensions allPackedExtensions = TestUtil.getPackedExtensionsSet();
+ ByteString allPackedExtensionsData = allPackedExtensions.toByteString();
+ UnittestLite.TestEmptyMessageLite emptyMessageLite =
+ UnittestLite.TestEmptyMessageLite.parseFrom(allPackedExtensionsData);
+ ByteString data = emptyMessageLite.toByteString();
+ TestPackedExtensions message =
+ TestPackedExtensions.parseFrom(data, TestUtil.getExtensionRegistry());
+ TestUtil.assertPackedExtensionsSet(message);
+ assertEquals(allPackedExtensionsData, data);
+ }
+
+ public void testCopyFromLite() throws Exception {
+ UnittestLite.TestEmptyMessageLite emptyMessageLite =
+ UnittestLite.TestEmptyMessageLite.parseFrom(allFieldsData);
+ UnittestLite.TestEmptyMessageLite emptyMessageLite2 =
+ UnittestLite.TestEmptyMessageLite.newBuilder().mergeFrom(emptyMessageLite).build();
+ assertEquals(emptyMessageLite.toByteString(), emptyMessageLite2.toByteString());
+ }
+
+ public void testMergeFromLite() throws Exception {
+ TestAllTypes message1 =
+ TestAllTypes.newBuilder()
+ .setOptionalInt32(1)
+ .setOptionalString("foo")
+ .addRepeatedString("bar")
+ .setOptionalNestedEnum(TestAllTypes.NestedEnum.BAZ)
+ .build();
+
+ TestAllTypes message2 =
+ TestAllTypes.newBuilder()
+ .setOptionalInt64(2)
+ .setOptionalString("baz")
+ .addRepeatedString("qux")
+ .setOptionalForeignEnum(ForeignEnum.FOREIGN_BAZ)
+ .build();
+
+ ByteString data1 = message1.toByteString();
+ UnittestLite.TestEmptyMessageLite emptyMessageLite1 =
+ UnittestLite.TestEmptyMessageLite.parseFrom(data1);
+ ByteString data2 = message2.toByteString();
+ UnittestLite.TestEmptyMessageLite emptyMessageLite2 =
+ UnittestLite.TestEmptyMessageLite.parseFrom(data2);
+
+ message1 = TestAllTypes.newBuilder(message1).mergeFrom(message2).build();
+ emptyMessageLite1 =
+ UnittestLite.TestEmptyMessageLite.newBuilder(emptyMessageLite1)
+ .mergeFrom(emptyMessageLite2)
+ .build();
+
+ data1 = emptyMessageLite1.toByteString();
+ message2 = TestAllTypes.parseFrom(data1);
+
+ assertEquals(message1, message2);
+ }
+
+ public void testWrongTypeTreatedAsUnknownLite() throws Exception {
+ // Test that fields of the wrong wire type are treated like unknown fields
+ // when parsing.
+
+ ByteString bizarroData = getBizarroData();
+ TestAllTypes allTypesMessage = TestAllTypes.parseFrom(bizarroData);
+ UnittestLite.TestEmptyMessageLite emptyMessageLite =
+ UnittestLite.TestEmptyMessageLite.parseFrom(bizarroData);
+ ByteString data = emptyMessageLite.toByteString();
+ TestAllTypes allTypesMessage2 = TestAllTypes.parseFrom(data);
+
+ assertEquals(allTypesMessage.toString(), allTypesMessage2.toString());
+ }
+
+ public void testUnknownExtensionsLite() throws Exception {
+ // Make sure fields are properly parsed to the UnknownFieldSet even when
+ // they are declared as extension numbers.
+
+ UnittestLite.TestEmptyMessageWithExtensionsLite message =
+ UnittestLite.TestEmptyMessageWithExtensionsLite.parseFrom(allFieldsData);
+
+ assertEquals(allFieldsData, message.toByteString());
+ }
+
+ public void testWrongExtensionTypeTreatedAsUnknownLite() throws Exception {
+ // Test that fields of the wrong wire type are treated like unknown fields
+ // when parsing extensions.
+
+ ByteString bizarroData = getBizarroData();
+ TestAllExtensions allExtensionsMessage = TestAllExtensions.parseFrom(bizarroData);
+ UnittestLite.TestEmptyMessageLite emptyMessageLite =
+ UnittestLite.TestEmptyMessageLite.parseFrom(bizarroData);
+
+ // All fields should have been interpreted as unknown, so the byte strings
+ // should be the same.
+ assertEquals(emptyMessageLite.toByteString(), allExtensionsMessage.toByteString());
+ }
+
+ public void testParseUnknownEnumValueLite() throws Exception {
+ Descriptors.FieldDescriptor singularField =
+ TestAllTypes.getDescriptor().findFieldByName("optional_nested_enum");
+ Descriptors.FieldDescriptor repeatedField =
+ TestAllTypes.getDescriptor().findFieldByName("repeated_nested_enum");
+ assertNotNull(singularField);
+ assertNotNull(repeatedField);
+
+ ByteString data =
+ UnknownFieldSet.newBuilder()
+ .addField(
+ singularField.getNumber(),
+ UnknownFieldSet.Field.newBuilder()
+ .addVarint(TestAllTypes.NestedEnum.BAR.getNumber())
+ .addVarint(5) // not valid
+ .build())
+ .addField(
+ repeatedField.getNumber(),
+ UnknownFieldSet.Field.newBuilder()
+ .addVarint(TestAllTypes.NestedEnum.FOO.getNumber())
+ .addVarint(4) // not valid
+ .addVarint(TestAllTypes.NestedEnum.BAZ.getNumber())
+ .addVarint(6) // not valid
+ .build())
+ .build()
+ .toByteString();
+
+ UnittestLite.TestEmptyMessageLite emptyMessageLite =
+ UnittestLite.TestEmptyMessageLite.parseFrom(data);
+ data = emptyMessageLite.toByteString();
+
+ {
+ TestAllTypes message = TestAllTypes.parseFrom(data);
+ assertEquals(TestAllTypes.NestedEnum.BAR, message.getOptionalNestedEnum());
+ assertEquals(
+ Arrays.asList(TestAllTypes.NestedEnum.FOO, TestAllTypes.NestedEnum.BAZ),
+ message.getRepeatedNestedEnumList());
+ assertEquals(
+ Arrays.asList(5L),
+ message.getUnknownFields().getField(singularField.getNumber()).getVarintList());
+ assertEquals(
+ Arrays.asList(4L, 6L),
+ message.getUnknownFields().getField(repeatedField.getNumber()).getVarintList());
+ }
+
+ {
+ TestAllExtensions message =
+ TestAllExtensions.parseFrom(data, TestUtil.getExtensionRegistry());
+ assertEquals(
+ TestAllTypes.NestedEnum.BAR,
+ message.getExtension(UnittestProto.optionalNestedEnumExtension));
+ assertEquals(
+ Arrays.asList(TestAllTypes.NestedEnum.FOO, TestAllTypes.NestedEnum.BAZ),
+ message.getExtension(UnittestProto.repeatedNestedEnumExtension));
+ assertEquals(
+ Arrays.asList(5L),
+ message.getUnknownFields().getField(singularField.getNumber()).getVarintList());
+ assertEquals(
+ Arrays.asList(4L, 6L),
+ message.getUnknownFields().getField(repeatedField.getNumber()).getVarintList());
+ }
+ }
+
+ public void testClearLite() throws Exception {
+ UnittestLite.TestEmptyMessageLite emptyMessageLite1 =
+ UnittestLite.TestEmptyMessageLite.parseFrom(allFieldsData);
+ UnittestLite.TestEmptyMessageLite emptyMessageLite2 =
+ UnittestLite.TestEmptyMessageLite.newBuilder().mergeFrom(emptyMessageLite1).clear().build();
+ assertEquals(0, emptyMessageLite2.getSerializedSize());
+ ByteString data = emptyMessageLite2.toByteString();
+ assertEquals(0, data.size());
+ }
}
diff --git a/java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java b/java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java
index f81e90b4..1a84806a 100644
--- a/java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java
+++ b/java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java
@@ -445,208 +445,4 @@ public class UnknownFieldSetTest extends TestCase {
}
// =================================================================
-
- public void testSerializeLite() throws Exception {
- UnittestLite.TestEmptyMessageLite emptyMessageLite =
- UnittestLite.TestEmptyMessageLite.parseFrom(allFieldsData);
- assertEquals(allFieldsData.size(), emptyMessageLite.getSerializedSize());
- ByteString data = emptyMessageLite.toByteString();
- TestAllTypes message = TestAllTypes.parseFrom(data);
- TestUtil.assertAllFieldsSet(message);
- assertEquals(allFieldsData, data);
- }
-
- public void testAllExtensionsLite() throws Exception {
- TestAllExtensions allExtensions = TestUtil.getAllExtensionsSet();
- ByteString allExtensionsData = allExtensions.toByteString();
- UnittestLite.TestEmptyMessageLite emptyMessageLite =
- UnittestLite.TestEmptyMessageLite.parser().parseFrom(allExtensionsData);
- ByteString data = emptyMessageLite.toByteString();
- TestAllExtensions message =
- TestAllExtensions.parseFrom(data, TestUtil.getExtensionRegistry());
- TestUtil.assertAllExtensionsSet(message);
- assertEquals(allExtensionsData, data);
- }
-
- public void testAllPackedFieldsLite() throws Exception {
- TestPackedTypes allPackedFields = TestUtil.getPackedSet();
- ByteString allPackedData = allPackedFields.toByteString();
- UnittestLite.TestEmptyMessageLite emptyMessageLite =
- UnittestLite.TestEmptyMessageLite.parseFrom(allPackedData);
- ByteString data = emptyMessageLite.toByteString();
- TestPackedTypes message =
- TestPackedTypes.parseFrom(data, TestUtil.getExtensionRegistry());
- TestUtil.assertPackedFieldsSet(message);
- assertEquals(allPackedData, data);
- }
-
- public void testAllPackedExtensionsLite() throws Exception {
- TestPackedExtensions allPackedExtensions = TestUtil.getPackedExtensionsSet();
- ByteString allPackedExtensionsData = allPackedExtensions.toByteString();
- UnittestLite.TestEmptyMessageLite emptyMessageLite =
- UnittestLite.TestEmptyMessageLite.parseFrom(allPackedExtensionsData);
- ByteString data = emptyMessageLite.toByteString();
- TestPackedExtensions message =
- TestPackedExtensions.parseFrom(data, TestUtil.getExtensionRegistry());
- TestUtil.assertPackedExtensionsSet(message);
- assertEquals(allPackedExtensionsData, data);
- }
-
- public void testCopyFromLite() throws Exception {
- UnittestLite.TestEmptyMessageLite emptyMessageLite =
- UnittestLite.TestEmptyMessageLite.parseFrom(allFieldsData);
- UnittestLite.TestEmptyMessageLite emptyMessageLite2 =
- UnittestLite.TestEmptyMessageLite.newBuilder()
- .mergeFrom(emptyMessageLite).build();
- assertEquals(emptyMessageLite.toByteString(), emptyMessageLite2.toByteString());
- }
-
- public void testMergeFromLite() throws Exception {
- TestAllTypes message1 = TestAllTypes.newBuilder()
- .setOptionalInt32(1)
- .setOptionalString("foo")
- .addRepeatedString("bar")
- .setOptionalNestedEnum(TestAllTypes.NestedEnum.BAZ)
- .build();
-
- TestAllTypes message2 = TestAllTypes.newBuilder()
- .setOptionalInt64(2)
- .setOptionalString("baz")
- .addRepeatedString("qux")
- .setOptionalForeignEnum(ForeignEnum.FOREIGN_BAZ)
- .build();
-
- ByteString data1 = message1.toByteString();
- UnittestLite.TestEmptyMessageLite emptyMessageLite1 =
- UnittestLite.TestEmptyMessageLite.parseFrom(data1);
- ByteString data2 = message2.toByteString();
- UnittestLite.TestEmptyMessageLite emptyMessageLite2 =
- UnittestLite.TestEmptyMessageLite.parseFrom(data2);
-
- message1 = TestAllTypes.newBuilder(message1).mergeFrom(message2).build();
- emptyMessageLite1 = UnittestLite.TestEmptyMessageLite.newBuilder(emptyMessageLite1)
- .mergeFrom(emptyMessageLite2).build();
-
- data1 = emptyMessageLite1.toByteString();
- message2 = TestAllTypes.parseFrom(data1);
-
- assertEquals(message1, message2);
- }
-
- public void testWrongTypeTreatedAsUnknownLite() throws Exception {
- // Test that fields of the wrong wire type are treated like unknown fields
- // when parsing.
-
- ByteString bizarroData = getBizarroData();
- TestAllTypes allTypesMessage = TestAllTypes.parseFrom(bizarroData);
- UnittestLite.TestEmptyMessageLite emptyMessageLite =
- UnittestLite.TestEmptyMessageLite.parseFrom(bizarroData);
- ByteString data = emptyMessageLite.toByteString();
- TestAllTypes allTypesMessage2 = TestAllTypes.parseFrom(data);
-
- assertEquals(allTypesMessage.toString(), allTypesMessage2.toString());
- }
-
- public void testUnknownExtensionsLite() throws Exception {
- // Make sure fields are properly parsed to the UnknownFieldSet even when
- // they are declared as extension numbers.
-
- UnittestLite.TestEmptyMessageWithExtensionsLite message =
- UnittestLite.TestEmptyMessageWithExtensionsLite.parseFrom(allFieldsData);
-
- assertEquals(allFieldsData, message.toByteString());
- }
-
- public void testWrongExtensionTypeTreatedAsUnknownLite() throws Exception {
- // Test that fields of the wrong wire type are treated like unknown fields
- // when parsing extensions.
-
- ByteString bizarroData = getBizarroData();
- TestAllExtensions allExtensionsMessage =
- TestAllExtensions.parseFrom(bizarroData);
- UnittestLite.TestEmptyMessageLite emptyMessageLite =
- UnittestLite.TestEmptyMessageLite.parseFrom(bizarroData);
-
- // All fields should have been interpreted as unknown, so the byte strings
- // should be the same.
- assertEquals(emptyMessageLite.toByteString(),
- allExtensionsMessage.toByteString());
- }
-
- public void testParseUnknownEnumValueLite() throws Exception {
- Descriptors.FieldDescriptor singularField =
- TestAllTypes.getDescriptor().findFieldByName("optional_nested_enum");
- Descriptors.FieldDescriptor repeatedField =
- TestAllTypes.getDescriptor().findFieldByName("repeated_nested_enum");
- assertNotNull(singularField);
- assertNotNull(repeatedField);
-
- ByteString data =
- UnknownFieldSet.newBuilder()
- .addField(singularField.getNumber(),
- UnknownFieldSet.Field.newBuilder()
- .addVarint(TestAllTypes.NestedEnum.BAR.getNumber())
- .addVarint(5) // not valid
- .build())
- .addField(repeatedField.getNumber(),
- UnknownFieldSet.Field.newBuilder()
- .addVarint(TestAllTypes.NestedEnum.FOO.getNumber())
- .addVarint(4) // not valid
- .addVarint(TestAllTypes.NestedEnum.BAZ.getNumber())
- .addVarint(6) // not valid
- .build())
- .build()
- .toByteString();
-
- UnittestLite.TestEmptyMessageLite emptyMessageLite =
- UnittestLite.TestEmptyMessageLite.parseFrom(data);
- data = emptyMessageLite.toByteString();
-
- {
- TestAllTypes message = TestAllTypes.parseFrom(data);
- assertEquals(TestAllTypes.NestedEnum.BAR,
- message.getOptionalNestedEnum());
- assertEquals(
- Arrays.asList(TestAllTypes.NestedEnum.FOO, TestAllTypes.NestedEnum.BAZ),
- message.getRepeatedNestedEnumList());
- assertEquals(Arrays.asList(5L),
- message.getUnknownFields()
- .getField(singularField.getNumber())
- .getVarintList());
- assertEquals(Arrays.asList(4L, 6L),
- message.getUnknownFields()
- .getField(repeatedField.getNumber())
- .getVarintList());
- }
-
- {
- TestAllExtensions message =
- TestAllExtensions.parseFrom(data, TestUtil.getExtensionRegistry());
- assertEquals(TestAllTypes.NestedEnum.BAR,
- message.getExtension(UnittestProto.optionalNestedEnumExtension));
- assertEquals(
- Arrays.asList(TestAllTypes.NestedEnum.FOO, TestAllTypes.NestedEnum.BAZ),
- message.getExtension(UnittestProto.repeatedNestedEnumExtension));
- assertEquals(Arrays.asList(5L),
- message.getUnknownFields()
- .getField(singularField.getNumber())
- .getVarintList());
- assertEquals(Arrays.asList(4L, 6L),
- message.getUnknownFields()
- .getField(repeatedField.getNumber())
- .getVarintList());
- }
- }
-
- public void testClearLite() throws Exception {
- UnittestLite.TestEmptyMessageLite emptyMessageLite1 =
- UnittestLite.TestEmptyMessageLite.parseFrom(allFieldsData);
- UnittestLite.TestEmptyMessageLite emptyMessageLite2 =
- UnittestLite.TestEmptyMessageLite.newBuilder()
- .mergeFrom(emptyMessageLite1).clear().build();
- assertEquals(0, emptyMessageLite2.getSerializedSize());
- ByteString data = emptyMessageLite2.toByteString();
- assertEquals(0, data.size());
- }
-
}
diff --git a/java/core/src/test/java/com/google/protobuf/WireFormatTest.java b/java/core/src/test/java/com/google/protobuf/WireFormatTest.java
index 370860c2..625d4b42 100644
--- a/java/core/src/test/java/com/google/protobuf/WireFormatTest.java
+++ b/java/core/src/test/java/com/google/protobuf/WireFormatTest.java
@@ -30,8 +30,6 @@
package com.google.protobuf;
-import com.google.protobuf.UnittestLite.TestAllExtensionsLite;
-import com.google.protobuf.UnittestLite.TestPackedExtensionsLite;
import protobuf_unittest.UnittestMset.RawMessageSet;
import protobuf_unittest.UnittestMset.TestMessageSetExtension1;
import protobuf_unittest.UnittestMset.TestMessageSetExtension2;
@@ -125,32 +123,6 @@ public class WireFormatTest extends TestCase {
TestUtil.assertPackedFieldsSet(message2);
}
- public void testSerializeExtensionsLite() throws Exception {
- // TestAllTypes and TestAllExtensions should have compatible wire formats,
- // so if we serialize a TestAllExtensions then parse it as TestAllTypes
- // it should work.
-
- TestAllExtensionsLite message = TestUtilLite.getAllLiteExtensionsSet();
- ByteString rawBytes = message.toByteString();
- assertEquals(rawBytes.size(), message.getSerializedSize());
-
- TestAllTypes message2 = TestAllTypes.parseFrom(rawBytes);
-
- TestUtil.assertAllFieldsSet(message2);
- }
-
- public void testSerializePackedExtensionsLite() throws Exception {
- // TestPackedTypes and TestPackedExtensions should have compatible wire
- // formats; check that they serialize to the same string.
- TestPackedExtensionsLite message = TestUtilLite.getLitePackedExtensionsSet();
- ByteString rawBytes = message.toByteString();
-
- TestPackedTypes message2 = TestUtil.getPackedSet();
- ByteString rawBytes2 = message2.toByteString();
-
- assertEquals(rawBytes, rawBytes2);
- }
-
public void testParseExtensions() throws Exception {
// TestAllTypes and TestAllExtensions should have compatible wire formats,
// so if we serialize a TestAllTypes then parse it as TestAllExtensions
@@ -180,48 +152,6 @@ public class WireFormatTest extends TestCase {
TestUtil.assertPackedExtensionsSet(message2);
}
- public void testParseExtensionsLite() throws Exception {
- // TestAllTypes and TestAllExtensions should have compatible wire formats,
- // so if we serialize a TestAllTypes then parse it as TestAllExtensions
- // it should work.
-
- TestAllTypes message = TestUtil.getAllSet();
- ByteString rawBytes = message.toByteString();
-
- ExtensionRegistryLite registry_lite = TestUtilLite.getExtensionRegistryLite();
-
- TestAllExtensionsLite message2 =
- TestAllExtensionsLite.parseFrom(rawBytes, registry_lite);
-
- TestUtil.assertAllExtensionsSet(message2);
-
- // Try again using a full extension registry.
- ExtensionRegistry registry = TestUtil.getExtensionRegistry();
-
- TestAllExtensionsLite message3 =
- TestAllExtensionsLite.parseFrom(rawBytes, registry);
-
- TestUtil.assertAllExtensionsSet(message3);
- }
-
- public void testParsePackedExtensionsLite() throws Exception {
- // Ensure that packed extensions can be properly parsed.
- TestPackedExtensionsLite message = TestUtilLite.getLitePackedExtensionsSet();
- ByteString rawBytes = message.toByteString();
-
- ExtensionRegistryLite registry = TestUtilLite.getExtensionRegistryLite();
-
- TestPackedExtensionsLite message2 =
- TestPackedExtensionsLite.parseFrom(rawBytes, registry);
-
- TestUtil.assertPackedExtensionsSet(message2);
- }
-
- public void testExtensionsSerializedSize() throws Exception {
- assertNotSame(TestUtil.getAllSet().getSerializedSize(),
- TestUtil.getAllExtensionsSet().getSerializedSize());
- }
-
public void testSerializeDelimited() throws Exception {
ByteArrayOutputStream output = new ByteArrayOutputStream();
TestUtil.getAllSet().writeDelimitedTo(output);
diff --git a/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java b/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
index a603d96a..a26dbc2d 100644
--- a/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
+++ b/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
@@ -1522,7 +1522,8 @@ public class JsonFormat {
for (int i = 0; i < array.size(); ++i) {
Object value = parseFieldValue(field, array.get(i), builder);
if (value == null) {
- throw new InvalidProtocolBufferException("Repeated field elements cannot be null");
+ throw new InvalidProtocolBufferException(
+ "Repeated field elements cannot be null in field: " + field.getFullName());
}
builder.addRepeatedField(field, value);
}
diff --git a/js/binary/decoder.js b/js/binary/decoder.js
index 6db28e7c..313d6f3f 100644
--- a/js/binary/decoder.js
+++ b/js/binary/decoder.js
@@ -47,6 +47,7 @@ goog.provide('jspb.BinaryDecoder');
goog.provide('jspb.BinaryIterator');
goog.require('goog.asserts');
+goog.require('goog.crypt');
goog.require('jspb.utils');
diff --git a/js/binary/utils.js b/js/binary/utils.js
index 58f11b54..c706bff4 100644
--- a/js/binary/utils.js
+++ b/js/binary/utils.js
@@ -38,6 +38,7 @@
goog.provide('jspb.utils');
goog.require('goog.asserts');
+goog.require('goog.crypt');
goog.require('goog.crypt.base64');
goog.require('goog.string');
goog.require('jspb.BinaryConstants');
diff --git a/js/binary/utils_test.js b/js/binary/utils_test.js
index 0a2f4f0a..6b481dce 100644
--- a/js/binary/utils_test.js
+++ b/js/binary/utils_test.js
@@ -36,6 +36,7 @@
* @author aappleby@google.com (Austin Appleby)
*/
+goog.require('goog.crypt');
goog.require('goog.crypt.base64');
goog.require('goog.testing.asserts');
goog.require('jspb.BinaryConstants');
diff --git a/js/compatibility_tests/v3.1.0/message_test.js b/js/compatibility_tests/v3.1.0/message_test.js
index b46e50d3..c1023784 100644
--- a/js/compatibility_tests/v3.1.0/message_test.js
+++ b/js/compatibility_tests/v3.1.0/message_test.js
@@ -643,12 +643,7 @@ describe('Message test suite', function() {
it('testInitialization_emptyArray', function() {
var msg = new proto.jspb.test.HasExtensions([]);
- if (jspb.Message.MINIMIZE_MEMORY_ALLOCATIONS) {
- assertArrayEquals([], msg.toArray());
- } else {
- // Extension object is created past all regular fields.
- assertArrayEquals([,,, {}], msg.toArray());
- }
+ assertArrayEquals([], msg.toArray());
});
it('testInitialization_justExtensionObject', function() {
diff --git a/js/message.js b/js/message.js
index f7dcfa96..1484229d 100644
--- a/js/message.js
+++ b/js/message.js
@@ -890,6 +890,100 @@ jspb.Message.setField = function(msg, fieldNumber, value) {
/**
+ * Sets the value of a non-extension integer field of a proto3
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @param {number} value New value
+ * @protected
+ */
+jspb.Message.setProto3IntField = function(msg, fieldNumber, value) {
+ jspb.Message.setFieldIgnoringDefault_(msg, fieldNumber, value, 0);
+};
+
+
+/**
+ * Sets the value of a non-extension floating point field of a proto3
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @param {number} value New value
+ * @protected
+ */
+jspb.Message.setProto3FloatField = function(msg, fieldNumber, value) {
+ jspb.Message.setFieldIgnoringDefault_(msg, fieldNumber, value, 0.0);
+};
+
+
+/**
+ * Sets the value of a non-extension boolean field of a proto3
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @param {boolean} value New value
+ * @protected
+ */
+jspb.Message.setProto3BooleanField = function(msg, fieldNumber, value) {
+ jspb.Message.setFieldIgnoringDefault_(msg, fieldNumber, value, false);
+};
+
+
+/**
+ * Sets the value of a non-extension String field of a proto3
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @param {string} value New value
+ * @protected
+ */
+jspb.Message.setProto3StringField = function(msg, fieldNumber, value) {
+ jspb.Message.setFieldIgnoringDefault_(msg, fieldNumber, value, "");
+};
+
+
+/**
+ * Sets the value of a non-extension Bytes field of a proto3
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @param {!Uint8Array|string} value New value
+ * @protected
+ */
+jspb.Message.setProto3BytesField = function(msg, fieldNumber, value) {
+ jspb.Message.setFieldIgnoringDefault_(msg, fieldNumber, value, "");
+};
+
+
+/**
+ * Sets the value of a non-extension enum field of a proto3
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @param {number} value New value
+ * @protected
+ */
+jspb.Message.setProto3EnumField = function(msg, fieldNumber, value) {
+ jspb.Message.setFieldIgnoringDefault_(msg, fieldNumber, value, 0);
+};
+
+
+
+/**
+ * Sets the value of a non-extension primitive field, with proto3 (non-nullable
+ * primitives) semantics of ignoring values that are equal to the type's
+ * default.
+ * @template T
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @param {!Uint8Array|string|number|boolean|undefined} value New value
+ * @param {!Uint8Array|string|number|boolean} defaultValue The default value.
+ * @private
+ */
+jspb.Message.setFieldIgnoringDefault_ = function(
+ msg, fieldNumber, value, defaultValue) {
+ if (value != defaultValue) {
+ jspb.Message.setField(msg, fieldNumber, value);
+ } else {
+ msg.array[jspb.Message.getIndex_(msg, fieldNumber)] = null;
+ }
+};
+
+
+/**
* Adds a value to a repeated, primitive field.
* @param {!jspb.Message} msg A jspb proto.
* @param {number} fieldNumber The field number.
diff --git a/js/proto3_test.js b/js/proto3_test.js
index 81d6de2f..4aed88ba 100644
--- a/js/proto3_test.js
+++ b/js/proto3_test.js
@@ -72,6 +72,37 @@ function bytesCompare(arr, expected) {
describe('proto3Test', function() {
+
+ /**
+ * Test default values don't affect equality test.
+ */
+ it('testEqualsProto3', function() {
+ var msg1 = new proto.jspb.test.TestProto3();
+ var msg2 = new proto.jspb.test.TestProto3();
+ msg2.setOptionalString('');
+
+ assertTrue(jspb.Message.equals(msg1, msg2));
+ });
+
+
+ /**
+ * Test setting when a field has default semantics.
+ */
+ it('testSetProto3ToValueAndBackToDefault', function() {
+ var msg = new proto.jspb.test.TestProto3();
+
+ // Setting should work normally.
+ msg.setOptionalString('optionalString');
+ assertEquals(msg.getOptionalString(), 'optionalString');
+
+ // Clearing should work too ...
+ msg.setOptionalString('');
+ assertEquals(msg.getOptionalString(), '');
+
+ // ... and shouldn't affect the equality with a brand new message.
+ assertTrue(jspb.Message.equals(msg, new proto.jspb.test.TestProto3()));
+ });
+
/**
* Test defaults for proto3 message fields.
*/
@@ -225,52 +256,65 @@ describe('proto3Test', function() {
* Test that oneofs continue to have a notion of field presence.
*/
it('testOneofs', function() {
+ // Default instance.
var msg = new proto.jspb.test.TestProto3();
-
assertEquals(msg.getOneofUint32(), 0);
assertEquals(msg.getOneofForeignMessage(), undefined);
assertEquals(msg.getOneofString(), '');
assertEquals(msg.getOneofBytes(), '');
+
assertFalse(msg.hasOneofUint32());
+ assertFalse(msg.hasOneofForeignMessage());
assertFalse(msg.hasOneofString());
assertFalse(msg.hasOneofBytes());
+ // Integer field.
msg.setOneofUint32(42);
assertEquals(msg.getOneofUint32(), 42);
assertEquals(msg.getOneofForeignMessage(), undefined);
assertEquals(msg.getOneofString(), '');
assertEquals(msg.getOneofBytes(), '');
+
assertTrue(msg.hasOneofUint32());
+ assertFalse(msg.hasOneofForeignMessage());
assertFalse(msg.hasOneofString());
assertFalse(msg.hasOneofBytes());
-
+ // Sub-message field.
var submsg = new proto.jspb.test.ForeignMessage();
msg.setOneofForeignMessage(submsg);
assertEquals(msg.getOneofUint32(), 0);
assertEquals(msg.getOneofForeignMessage(), submsg);
assertEquals(msg.getOneofString(), '');
assertEquals(msg.getOneofBytes(), '');
+
assertFalse(msg.hasOneofUint32());
+ assertTrue(msg.hasOneofForeignMessage());
assertFalse(msg.hasOneofString());
assertFalse(msg.hasOneofBytes());
+ // String field.
msg.setOneofString('hello');
assertEquals(msg.getOneofUint32(), 0);
assertEquals(msg.getOneofForeignMessage(), undefined);
assertEquals(msg.getOneofString(), 'hello');
assertEquals(msg.getOneofBytes(), '');
+
assertFalse(msg.hasOneofUint32());
+ assertFalse(msg.hasOneofForeignMessage());
assertTrue(msg.hasOneofString());
assertFalse(msg.hasOneofBytes());
+ // Bytes field.
msg.setOneofBytes(goog.crypt.base64.encodeString('\u00FF\u00FF'));
assertEquals(msg.getOneofUint32(), 0);
assertEquals(msg.getOneofForeignMessage(), undefined);
assertEquals(msg.getOneofString(), '');
assertEquals(msg.getOneofBytes_asB64(),
goog.crypt.base64.encodeString('\u00FF\u00FF'));
+
assertFalse(msg.hasOneofUint32());
+ assertFalse(msg.hasOneofForeignMessage());
assertFalse(msg.hasOneofString());
assertTrue(msg.hasOneofBytes());
});
diff --git a/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php b/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php
index 60722d00..b0ca8da0 100644
--- a/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php
+++ b/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php
@@ -110,6 +110,13 @@ class Descriptor
->optional('name', \Google\Protobuf\Internal\GPBType::STRING, 1)
->repeated('value', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.EnumValueDescriptorProto')
->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.EnumOptions')
+ ->repeated('reserved_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.EnumDescriptorProto.EnumReservedRange')
+ ->repeated('reserved_name', \Google\Protobuf\Internal\GPBType::STRING, 5)
+ ->finalizeToPool();
+
+ $pool->addMessage('google.protobuf.internal.EnumDescriptorProto.EnumReservedRange', \Google\Protobuf\Internal\EnumDescriptorProto_EnumReservedRange::class)
+ ->optional('start', \Google\Protobuf\Internal\GPBType::INT32, 1)
+ ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 2)
->finalizeToPool();
$pool->addMessage('google.protobuf.internal.EnumValueDescriptorProto', \Google\Protobuf\Internal\EnumValueDescriptorProto::class)
@@ -144,7 +151,7 @@ class Descriptor
->optional('cc_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 16)
->optional('java_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 17)
->optional('py_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 18)
- ->optional('php_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 19)
+ ->optional('php_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 42)
->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 23)
->optional('cc_enable_arenas', \Google\Protobuf\Internal\GPBType::BOOL, 31)
->optional('objc_class_prefix', \Google\Protobuf\Internal\GPBType::STRING, 36)
diff --git a/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php b/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php
index 816fbae5..930f26ef 100644
--- a/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php
+++ b/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php
@@ -32,6 +32,23 @@ class EnumDescriptorProto extends \Google\Protobuf\Internal\Message
*/
private $options = null;
private $has_options = false;
+ /**
+ * 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.
+ *
+ * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
+ */
+ private $reserved_range;
+ private $has_reserved_range = false;
+ /**
+ * Reserved enum value names, which may not be reused. A given name may only
+ * be reserved once.
+ *
+ * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
+ */
+ private $reserved_name;
+ private $has_reserved_name = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
@@ -122,5 +139,75 @@ class EnumDescriptorProto extends \Google\Protobuf\Internal\Message
return $this->has_options;
}
+ /**
+ * 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.
+ *
+ * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
+ * @return \Google\Protobuf\Internal\RepeatedField
+ */
+ public function getReservedRange()
+ {
+ return $this->reserved_range;
+ }
+
+ /**
+ * 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.
+ *
+ * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
+ * @param \Google\Protobuf\Internal\EnumDescriptorProto_EnumReservedRange[]|\Google\Protobuf\Internal\RepeatedField $var
+ * @return $this
+ */
+ public function setReservedRange($var)
+ {
+ $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto_EnumReservedRange::class);
+ $this->reserved_range = $arr;
+ $this->has_reserved_range = true;
+
+ return $this;
+ }
+
+ public function hasReservedRange()
+ {
+ return $this->has_reserved_range;
+ }
+
+ /**
+ * Reserved enum value names, which may not be reused. A given name may only
+ * be reserved once.
+ *
+ * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
+ * @return \Google\Protobuf\Internal\RepeatedField
+ */
+ public function getReservedName()
+ {
+ return $this->reserved_name;
+ }
+
+ /**
+ * Reserved enum value names, which may not be reused. A given name may only
+ * be reserved once.
+ *
+ * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
+ * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
+ * @return $this
+ */
+ public function setReservedName($var)
+ {
+ $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
+ $this->reserved_name = $arr;
+ $this->has_reserved_name = true;
+
+ return $this;
+ }
+
+ public function hasReservedName()
+ {
+ return $this->has_reserved_name;
+ }
+
}
diff --git a/php/src/Google/Protobuf/Internal/FileOptions.php b/php/src/Google/Protobuf/Internal/FileOptions.php
index c2dd5e08..ee64e4e0 100644
--- a/php/src/Google/Protobuf/Internal/FileOptions.php
+++ b/php/src/Google/Protobuf/Internal/FileOptions.php
@@ -109,7 +109,7 @@ class FileOptions extends \Google\Protobuf\Internal\Message
private $py_generic_services = false;
private $has_py_generic_services = false;
/**
- * Generated from protobuf field <code>optional bool php_generic_services = 19 [default = false];</code>
+ * Generated from protobuf field <code>optional bool php_generic_services = 42 [default = false];</code>
*/
private $php_generic_services = false;
private $has_php_generic_services = false;
@@ -553,7 +553,7 @@ class FileOptions extends \Google\Protobuf\Internal\Message
}
/**
- * Generated from protobuf field <code>optional bool php_generic_services = 19 [default = false];</code>
+ * Generated from protobuf field <code>optional bool php_generic_services = 42 [default = false];</code>
* @return bool
*/
public function getPhpGenericServices()
@@ -562,7 +562,7 @@ class FileOptions extends \Google\Protobuf\Internal\Message
}
/**
- * Generated from protobuf field <code>optional bool php_generic_services = 19 [default = false];</code>
+ * Generated from protobuf field <code>optional bool php_generic_services = 42 [default = false];</code>
* @param bool $var
* @return $this
*/
diff --git a/python/google/protobuf/descriptor_database.py b/python/google/protobuf/descriptor_database.py
index eb45e127..b8f5140b 100644
--- a/python/google/protobuf/descriptor_database.py
+++ b/python/google/protobuf/descriptor_database.py
@@ -107,6 +107,7 @@ class DescriptorDatabase(object):
'some.package.name.Message'
'some.package.name.Message.NestedEnum'
+ 'some.package.name.Message.some_field'
The file descriptor proto containing the specified symbol must be added to
this database using the Add method or else an error will be raised.
@@ -120,8 +121,16 @@ class DescriptorDatabase(object):
Raises:
KeyError if no file contains the specified symbol.
"""
-
- return self._file_desc_protos_by_symbol[symbol]
+ try:
+ return self._file_desc_protos_by_symbol[symbol]
+ except KeyError:
+ # Fields, enum values, and nested extensions are not in
+ # _file_desc_protos_by_symbol. Try to find the top level
+ # descriptor. Non-existent nested symbol under a valid top level
+ # descriptor can also be found. The behavior is the same with
+ # protobuf C++.
+ top_level, _, _ = symbol.rpartition('.')
+ return self._file_desc_protos_by_symbol[top_level]
def _ExtractSymbols(desc_proto, package):
diff --git a/python/google/protobuf/descriptor_pool.py b/python/google/protobuf/descriptor_pool.py
index 3dbe0fd0..cb7146b6 100644
--- a/python/google/protobuf/descriptor_pool.py
+++ b/python/google/protobuf/descriptor_pool.py
@@ -127,9 +127,6 @@ class DescriptorPool(object):
self._service_descriptors = {}
self._file_descriptors = {}
self._toplevel_extensions = {}
- # TODO(jieluo): Remove _file_desc_by_toplevel_extension when
- # FieldDescriptor.file is added in code gen.
- self._file_desc_by_toplevel_extension = {}
# We store extensions in two two-level mappings: The first key is the
# descriptor of the message being extended, the second key is the extension
# full name or its tag number.
@@ -255,11 +252,6 @@ class DescriptorPool(object):
"""
self._AddFileDescriptor(file_desc)
- # TODO(jieluo): This is a temporary solution for FieldDescriptor.file.
- # Remove it when FieldDescriptor.file is added in code gen.
- for extension in file_desc.extensions_by_name.values():
- self._file_desc_by_toplevel_extension[
- extension.full_name] = file_desc
def _AddFileDescriptor(self, file_desc):
"""Adds a FileDescriptor to the pool, non-recursively.
@@ -339,7 +331,7 @@ class DescriptorPool(object):
pass
try:
- return self._file_desc_by_toplevel_extension[symbol]
+ return self._toplevel_extensions[symbol].file
except KeyError:
pass
@@ -405,6 +397,23 @@ class DescriptorPool(object):
message_descriptor = self.FindMessageTypeByName(message_name)
return message_descriptor.fields_by_name[field_name]
+ def FindOneofByName(self, full_name):
+ """Loads the named oneof descriptor from the pool.
+
+ Args:
+ full_name: The full name of the oneof descriptor to load.
+
+ Returns:
+ The oneof descriptor for the named oneof.
+
+ Raises:
+ KeyError: if the oneof cannot be found in the pool.
+ """
+ full_name = _NormalizeFullyQualifiedName(full_name)
+ message_name, _, oneof_name = full_name.rpartition('.')
+ message_descriptor = self.FindMessageTypeByName(message_name)
+ return message_descriptor.oneofs_by_name[oneof_name]
+
def FindExtensionByName(self, full_name):
"""Loads the named extension descriptor from the pool.
diff --git a/python/google/protobuf/internal/api_implementation.py b/python/google/protobuf/internal/api_implementation.py
index 422af590..bce71bb8 100755
--- a/python/google/protobuf/internal/api_implementation.py
+++ b/python/google/protobuf/internal/api_implementation.py
@@ -61,10 +61,15 @@ if _api_version < 0: # Still unspecified?
del _use_fast_cpp_protos
_api_version = 2
except ImportError:
- if _proto_extension_modules_exist_in_build:
- if sys.version_info[0] >= 3: # Python 3 defaults to C++ impl v2.
- _api_version = 2
- # TODO(b/17427486): Make Python 2 default to C++ impl v2.
+ try:
+ # pylint: disable=g-import-not-at-top
+ from google.protobuf.internal import use_pure_python
+ del use_pure_python # Avoids a pylint error and namespace pollution.
+ except ImportError:
+ if _proto_extension_modules_exist_in_build:
+ if sys.version_info[0] >= 3: # Python 3 defaults to C++ impl v2.
+ _api_version = 2
+ # TODO(b/17427486): Make Python 2 default to C++ impl v2.
_default_implementation_type = (
'python' if _api_version <= 0 else 'cpp')
@@ -137,3 +142,29 @@ def Version():
# For internal use only
def IsPythonDefaultSerializationDeterministic():
return _python_deterministic_proto_serialization
+
+# DO NOT USE: For migration and testing only. Will be removed when Proto3
+# defaults to preserve unknowns.
+if _implementation_type == 'cpp':
+ try:
+ # pylint: disable=g-import-not-at-top
+ from google.protobuf.pyext import _message
+
+ def GetPythonProto3PreserveUnknownsDefault():
+ return _message.GetPythonProto3PreserveUnknownsDefault()
+
+ def SetPythonProto3PreserveUnknownsDefault(preserve):
+ _message.SetPythonProto3PreserveUnknownsDefault(preserve)
+ except ImportError:
+ # Unrecognized cpp implementation. Skipping the unknown fields APIs.
+ pass
+else:
+ _python_proto3_preserve_unknowns_default = False
+
+ def GetPythonProto3PreserveUnknownsDefault():
+ return _python_proto3_preserve_unknowns_default
+
+ def SetPythonProto3PreserveUnknownsDefault(preserve):
+ global _python_proto3_preserve_unknowns_default
+ _python_proto3_preserve_unknowns_default = preserve
+
diff --git a/python/google/protobuf/internal/descriptor_database_test.py b/python/google/protobuf/internal/descriptor_database_test.py
index 5225a458..1f1a3db9 100644
--- a/python/google/protobuf/internal/descriptor_database_test.py
+++ b/python/google/protobuf/internal/descriptor_database_test.py
@@ -39,6 +39,7 @@ try:
except ImportError:
import unittest
+from google.protobuf import unittest_pb2
from google.protobuf import descriptor_pb2
from google.protobuf.internal import factory_test2_pb2
from google.protobuf import descriptor_database
@@ -54,16 +55,49 @@ class DescriptorDatabaseTest(unittest.TestCase):
self.assertEqual(file_desc_proto, db.FindFileByName(
'google/protobuf/internal/factory_test2.proto'))
+ # Can find message type.
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
'google.protobuf.python.internal.Factory2Message'))
+ # Can find nested message type.
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
'google.protobuf.python.internal.Factory2Message.NestedFactory2Message'))
+ # Can find enum type.
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
'google.protobuf.python.internal.Factory2Enum'))
+ # Can find nested enum type.
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
'google.protobuf.python.internal.Factory2Message.NestedFactory2Enum'))
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
'google.protobuf.python.internal.MessageWithNestedEnumOnly.NestedEnum'))
+ # Can find field.
+ self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
+ 'google.protobuf.python.internal.Factory2Message.list_field'))
+ # Can find enum value.
+ self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
+ 'google.protobuf.python.internal.Factory2Enum.FACTORY_2_VALUE_0'))
+ # Can find top level extension.
+ self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
+ 'google.protobuf.python.internal.another_field'))
+ # Can find nested extension inside a message.
+ self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
+ 'google.protobuf.python.internal.Factory2Message.one_more_field'))
+
+ # Can find service.
+ file_desc_proto2 = descriptor_pb2.FileDescriptorProto.FromString(
+ unittest_pb2.DESCRIPTOR.serialized_pb)
+ db.Add(file_desc_proto2)
+ self.assertEqual(file_desc_proto2, db.FindFileContainingSymbol(
+ 'protobuf_unittest.TestService'))
+
+ # Non-existent field under a valid top level symbol can also be
+ # found. The behavior is the same with protobuf C++.
+ self.assertEqual(file_desc_proto2, db.FindFileContainingSymbol(
+ 'protobuf_unittest.TestAllTypes.none_field'))
+
+ self.assertRaises(KeyError,
+ db.FindFileContainingSymbol,
+ 'protobuf_unittest.NoneMessage')
+
if __name__ == '__main__':
unittest.main()
diff --git a/python/google/protobuf/internal/descriptor_pool_test.py b/python/google/protobuf/internal/descriptor_pool_test.py
index 6015e6f8..15c857bb 100644
--- a/python/google/protobuf/internal/descriptor_pool_test.py
+++ b/python/google/protobuf/internal/descriptor_pool_test.py
@@ -60,26 +60,8 @@ from google.protobuf import message_factory
from google.protobuf import symbol_database
-class DescriptorPoolTest(unittest.TestCase):
- def setUp(self):
- # TODO(jieluo): Should make the pool which is created by
- # serialized_pb same with generated pool.
- # TODO(jieluo): More test coverage for the generated pool.
- self.pool = descriptor_pool.DescriptorPool()
- self.factory_test1_fd = descriptor_pb2.FileDescriptorProto.FromString(
- factory_test1_pb2.DESCRIPTOR.serialized_pb)
- self.factory_test2_fd = descriptor_pb2.FileDescriptorProto.FromString(
- factory_test2_pb2.DESCRIPTOR.serialized_pb)
- self.pool.Add(self.factory_test1_fd)
- self.pool.Add(self.factory_test2_fd)
-
- self.pool.Add(descriptor_pb2.FileDescriptorProto.FromString(
- unittest_import_public_pb2.DESCRIPTOR.serialized_pb))
- self.pool.Add(descriptor_pb2.FileDescriptorProto.FromString(
- unittest_import_pb2.DESCRIPTOR.serialized_pb))
- self.pool.Add(descriptor_pb2.FileDescriptorProto.FromString(
- unittest_pb2.DESCRIPTOR.serialized_pb))
+class DescriptorPoolTestBase(object):
def testFindFileByName(self):
name1 = 'google/protobuf/internal/factory_test1.proto'
@@ -137,14 +119,6 @@ class DescriptorPoolTest(unittest.TestCase):
self.assertEqual('google/protobuf/unittest.proto',
file_desc5.name)
- # Tests the generated pool.
- assert descriptor_pool.Default().FindFileContainingSymbol(
- 'google.protobuf.python.internal.Factory2Message.one_more_field')
- assert descriptor_pool.Default().FindFileContainingSymbol(
- 'google.protobuf.python.internal.another_field')
- assert descriptor_pool.Default().FindFileContainingSymbol(
- 'protobuf_unittest.TestService')
-
def testFindFileContainingSymbolFailure(self):
with self.assertRaises(KeyError):
self.pool.FindFileContainingSymbol('Does not exist')
@@ -231,6 +205,27 @@ class DescriptorPoolTest(unittest.TestCase):
msg2.fields_by_name[name].containing_oneof)
self.assertIn(msg2.fields_by_name[name], msg2.oneofs[0].fields)
+ def testFindTypeErrors(self):
+ self.assertRaises(TypeError, self.pool.FindExtensionByNumber, '')
+
+ # TODO(jieluo): Fix python to raise correct errors.
+ if api_implementation.Type() == 'cpp':
+ self.assertRaises(TypeError, self.pool.FindMethodByName, 0)
+ self.assertRaises(KeyError, self.pool.FindMethodByName, '')
+ error_type = TypeError
+ else:
+ error_type = AttributeError
+ self.assertRaises(error_type, self.pool.FindMessageTypeByName, 0)
+ self.assertRaises(error_type, self.pool.FindFieldByName, 0)
+ self.assertRaises(error_type, self.pool.FindExtensionByName, 0)
+ self.assertRaises(error_type, self.pool.FindEnumTypeByName, 0)
+ self.assertRaises(error_type, self.pool.FindOneofByName, 0)
+ self.assertRaises(error_type, self.pool.FindServiceByName, 0)
+ self.assertRaises(error_type, self.pool.FindFileContainingSymbol, 0)
+ if api_implementation.Type() == 'python':
+ error_type = KeyError
+ self.assertRaises(error_type, self.pool.FindFileByName, 0)
+
def testFindMessageTypeByNameFailure(self):
with self.assertRaises(KeyError):
self.pool.FindMessageTypeByName('Does not exist')
@@ -270,6 +265,11 @@ class DescriptorPoolTest(unittest.TestCase):
self.pool.FindEnumTypeByName('Does not exist')
def testFindFieldByName(self):
+ if isinstance(self, SecondaryDescriptorFromDescriptorDB):
+ if api_implementation.Type() == 'cpp':
+ # TODO(jieluo): Fix cpp extension to find field correctly
+ # when descriptor pool is using an underlying database.
+ return
field = self.pool.FindFieldByName(
'google.protobuf.python.internal.Factory1Message.list_value')
self.assertEqual(field.name, 'list_value')
@@ -279,7 +279,24 @@ class DescriptorPoolTest(unittest.TestCase):
with self.assertRaises(KeyError):
self.pool.FindFieldByName('Does not exist')
+ def testFindOneofByName(self):
+ if isinstance(self, SecondaryDescriptorFromDescriptorDB):
+ if api_implementation.Type() == 'cpp':
+ # TODO(jieluo): Fix cpp extension to find oneof correctly
+ # when descriptor pool is using an underlying database.
+ return
+ oneof = self.pool.FindOneofByName(
+ 'google.protobuf.python.internal.Factory2Message.oneof_field')
+ self.assertEqual(oneof.name, 'oneof_field')
+ with self.assertRaises(KeyError):
+ self.pool.FindOneofByName('Does not exist')
+
def testFindExtensionByName(self):
+ if isinstance(self, SecondaryDescriptorFromDescriptorDB):
+ if api_implementation.Type() == 'cpp':
+ # TODO(jieluo): Fix cpp extension to find extension correctly
+ # when descriptor pool is using an underlying database.
+ return
# An extension defined in a message.
extension = self.pool.FindExtensionByName(
'google.protobuf.python.internal.Factory2Message.one_more_field')
@@ -352,6 +369,8 @@ class DescriptorPoolTest(unittest.TestCase):
def testFindService(self):
service = self.pool.FindServiceByName('protobuf_unittest.TestService')
self.assertEqual(service.full_name, 'protobuf_unittest.TestService')
+ with self.assertRaises(KeyError):
+ self.pool.FindServiceByName('Does not exist')
def testUserDefinedDB(self):
db = descriptor_database.DescriptorDatabase()
@@ -361,24 +380,17 @@ class DescriptorPoolTest(unittest.TestCase):
self.testFindMessageTypeByName()
def testAddSerializedFile(self):
+ if isinstance(self, SecondaryDescriptorFromDescriptorDB):
+ if api_implementation.Type() == 'cpp':
+ # Cpp extension cannot call Add on a DescriptorPool
+ # that uses a DescriptorDatabase.
+ # TODO(jieluo): Fix python and cpp extension diff.
+ return
self.pool = descriptor_pool.DescriptorPool()
self.pool.AddSerializedFile(self.factory_test1_fd.SerializeToString())
self.pool.AddSerializedFile(self.factory_test2_fd.SerializeToString())
self.testFindMessageTypeByName()
- def testComplexNesting(self):
- more_messages_desc = descriptor_pb2.FileDescriptorProto.FromString(
- more_messages_pb2.DESCRIPTOR.serialized_pb)
- test1_desc = descriptor_pb2.FileDescriptorProto.FromString(
- descriptor_pool_test1_pb2.DESCRIPTOR.serialized_pb)
- test2_desc = descriptor_pb2.FileDescriptorProto.FromString(
- descriptor_pool_test2_pb2.DESCRIPTOR.serialized_pb)
- self.pool.Add(more_messages_desc)
- self.pool.Add(test1_desc)
- self.pool.Add(test2_desc)
- TEST1_FILE.CheckFile(self, self.pool)
- TEST2_FILE.CheckFile(self, self.pool)
-
def testEnumDefaultValue(self):
"""Test the default value of enums which don't start at zero."""
@@ -397,6 +409,12 @@ class DescriptorPoolTest(unittest.TestCase):
self.assertIs(file_descriptor, descriptor_pool_test1_pb2.DESCRIPTOR)
_CheckDefaultValue(file_descriptor)
+ if isinstance(self, SecondaryDescriptorFromDescriptorDB):
+ if api_implementation.Type() == 'cpp':
+ # Cpp extension cannot call Add on a DescriptorPool
+ # that uses a DescriptorDatabase.
+ # TODO(jieluo): Fix python and cpp extension diff.
+ return
# Then check the dynamic pool and its internal DescriptorDatabase.
descriptor_proto = descriptor_pb2.FileDescriptorProto.FromString(
descriptor_pool_test1_pb2.DESCRIPTOR.serialized_pb)
@@ -444,6 +462,110 @@ class DescriptorPoolTest(unittest.TestCase):
unittest_pb2.TestAllTypes.DESCRIPTOR.full_name))
_CheckDefaultValues(message_class())
+ def testAddFileDescriptor(self):
+ if isinstance(self, SecondaryDescriptorFromDescriptorDB):
+ if api_implementation.Type() == 'cpp':
+ # Cpp extension cannot call Add on a DescriptorPool
+ # that uses a DescriptorDatabase.
+ # TODO(jieluo): Fix python and cpp extension diff.
+ return
+ file_desc = descriptor_pb2.FileDescriptorProto(name='some/file.proto')
+ self.pool.Add(file_desc)
+ self.pool.AddSerializedFile(file_desc.SerializeToString())
+
+ def testComplexNesting(self):
+ if isinstance(self, SecondaryDescriptorFromDescriptorDB):
+ if api_implementation.Type() == 'cpp':
+ # Cpp extension cannot call Add on a DescriptorPool
+ # that uses a DescriptorDatabase.
+ # TODO(jieluo): Fix python and cpp extension diff.
+ return
+ more_messages_desc = descriptor_pb2.FileDescriptorProto.FromString(
+ more_messages_pb2.DESCRIPTOR.serialized_pb)
+ test1_desc = descriptor_pb2.FileDescriptorProto.FromString(
+ descriptor_pool_test1_pb2.DESCRIPTOR.serialized_pb)
+ test2_desc = descriptor_pb2.FileDescriptorProto.FromString(
+ descriptor_pool_test2_pb2.DESCRIPTOR.serialized_pb)
+ self.pool.Add(more_messages_desc)
+ self.pool.Add(test1_desc)
+ self.pool.Add(test2_desc)
+ TEST1_FILE.CheckFile(self, self.pool)
+ TEST2_FILE.CheckFile(self, self.pool)
+
+
+class DefaultDescriptorPoolTest(DescriptorPoolTestBase, unittest.TestCase):
+
+ def setUp(self):
+ self.pool = descriptor_pool.Default()
+ self.factory_test1_fd = descriptor_pb2.FileDescriptorProto.FromString(
+ factory_test1_pb2.DESCRIPTOR.serialized_pb)
+ self.factory_test2_fd = descriptor_pb2.FileDescriptorProto.FromString(
+ factory_test2_pb2.DESCRIPTOR.serialized_pb)
+
+ def testFindMethods(self):
+ self.assertIs(
+ self.pool.FindFileByName('google/protobuf/unittest.proto'),
+ unittest_pb2.DESCRIPTOR)
+ self.assertIs(
+ self.pool.FindMessageTypeByName('protobuf_unittest.TestAllTypes'),
+ unittest_pb2.TestAllTypes.DESCRIPTOR)
+ self.assertIs(
+ self.pool.FindFieldByName(
+ 'protobuf_unittest.TestAllTypes.optional_int32'),
+ unittest_pb2.TestAllTypes.DESCRIPTOR.fields_by_name['optional_int32'])
+ self.assertIs(
+ self.pool.FindEnumTypeByName('protobuf_unittest.ForeignEnum'),
+ unittest_pb2.ForeignEnum.DESCRIPTOR)
+ self.assertIs(
+ self.pool.FindExtensionByName(
+ 'protobuf_unittest.optional_int32_extension'),
+ unittest_pb2.DESCRIPTOR.extensions_by_name['optional_int32_extension'])
+ self.assertIs(
+ self.pool.FindOneofByName('protobuf_unittest.TestAllTypes.oneof_field'),
+ unittest_pb2.TestAllTypes.DESCRIPTOR.oneofs_by_name['oneof_field'])
+ self.assertIs(
+ self.pool.FindServiceByName('protobuf_unittest.TestService'),
+ unittest_pb2.DESCRIPTOR.services_by_name['TestService'])
+
+
+class CreateDescriptorPoolTest(DescriptorPoolTestBase, unittest.TestCase):
+
+ def setUp(self):
+ self.pool = descriptor_pool.DescriptorPool()
+ self.factory_test1_fd = descriptor_pb2.FileDescriptorProto.FromString(
+ factory_test1_pb2.DESCRIPTOR.serialized_pb)
+ self.factory_test2_fd = descriptor_pb2.FileDescriptorProto.FromString(
+ factory_test2_pb2.DESCRIPTOR.serialized_pb)
+ self.pool.Add(self.factory_test1_fd)
+ self.pool.Add(self.factory_test2_fd)
+
+ self.pool.Add(descriptor_pb2.FileDescriptorProto.FromString(
+ unittest_import_public_pb2.DESCRIPTOR.serialized_pb))
+ self.pool.Add(descriptor_pb2.FileDescriptorProto.FromString(
+ unittest_import_pb2.DESCRIPTOR.serialized_pb))
+ self.pool.Add(descriptor_pb2.FileDescriptorProto.FromString(
+ unittest_pb2.DESCRIPTOR.serialized_pb))
+
+
+class SecondaryDescriptorFromDescriptorDB(DescriptorPoolTestBase,
+ unittest.TestCase):
+
+ def setUp(self):
+ self.factory_test1_fd = descriptor_pb2.FileDescriptorProto.FromString(
+ factory_test1_pb2.DESCRIPTOR.serialized_pb)
+ self.factory_test2_fd = descriptor_pb2.FileDescriptorProto.FromString(
+ factory_test2_pb2.DESCRIPTOR.serialized_pb)
+ db = descriptor_database.DescriptorDatabase()
+ db.Add(self.factory_test1_fd)
+ db.Add(self.factory_test2_fd)
+ db.Add(descriptor_pb2.FileDescriptorProto.FromString(
+ unittest_import_public_pb2.DESCRIPTOR.serialized_pb))
+ db.Add(descriptor_pb2.FileDescriptorProto.FromString(
+ unittest_import_pb2.DESCRIPTOR.serialized_pb))
+ db.Add(descriptor_pb2.FileDescriptorProto.FromString(
+ unittest_pb2.DESCRIPTOR.serialized_pb))
+ self.pool = descriptor_pool.DescriptorPool(descriptor_db=db)
+
class ProtoFile(object):
@@ -568,6 +690,11 @@ class MessageField(object):
test.assertEqual(msg_desc, field_desc.containing_type)
test.assertEqual(field_type_desc, field_desc.message_type)
test.assertEqual(file_desc, field_desc.file)
+ # TODO(jieluo): Fix python and cpp extension diff for message field
+ # default value.
+ if api_implementation.Type() == 'cpp':
+ test.assertRaises(
+ NotImplementedError, getattr, field_desc, 'default_value')
class StringField(object):
@@ -739,6 +866,25 @@ class AddDescriptorTest(unittest.TestCase):
'some/file.proto')
self.assertEqual(pool.FindMessageTypeByName('package.Message').name,
'Message')
+ # Test no package
+ file_proto = descriptor_pb2.FileDescriptorProto(
+ name='some/filename/container.proto')
+ message_proto = file_proto.message_type.add(
+ name='TopMessage')
+ message_proto.field.add(
+ name='bb',
+ number=1,
+ type=descriptor_pb2.FieldDescriptorProto.TYPE_INT32,
+ label=descriptor_pb2.FieldDescriptorProto.LABEL_OPTIONAL)
+ enum_proto = file_proto.enum_type.add(name='TopEnum')
+ enum_proto.value.add(name='FOREIGN_FOO', number=4)
+ file_proto.service.add(name='TopService')
+ pool = descriptor_pool.DescriptorPool()
+ pool.Add(file_proto)
+ self.assertEqual('TopMessage',
+ pool.FindMessageTypeByName('TopMessage').name)
+ self.assertEqual('TopEnum', pool.FindEnumTypeByName('TopEnum').name)
+ self.assertEqual('TopService', pool.FindServiceByName('TopService').name)
def testFileDescriptorOptionsWithCustomDescriptorPool(self):
# Create a descriptor pool, and add a new FileDescriptorProto to it.
@@ -757,40 +903,18 @@ class AddDescriptorTest(unittest.TestCase):
# The object returned by GetOptions() is cached.
self.assertIs(options, file_descriptor.GetOptions())
-
-class DefaultPoolTest(unittest.TestCase):
-
- def testFindMethods(self):
- pool = descriptor_pool.Default()
- self.assertIs(
- pool.FindFileByName('google/protobuf/unittest.proto'),
- unittest_pb2.DESCRIPTOR)
- self.assertIs(
- pool.FindMessageTypeByName('protobuf_unittest.TestAllTypes'),
- unittest_pb2.TestAllTypes.DESCRIPTOR)
- self.assertIs(
- pool.FindFieldByName('protobuf_unittest.TestAllTypes.optional_int32'),
- unittest_pb2.TestAllTypes.DESCRIPTOR.fields_by_name['optional_int32'])
- self.assertIs(
- pool.FindEnumTypeByName('protobuf_unittest.ForeignEnum'),
- unittest_pb2.ForeignEnum.DESCRIPTOR)
- if api_implementation.Type() != 'cpp':
- self.skipTest('Only the C++ implementation correctly indexes all types')
- self.assertIs(
- pool.FindExtensionByName('protobuf_unittest.optional_int32_extension'),
- unittest_pb2.DESCRIPTOR.extensions_by_name['optional_int32_extension'])
- self.assertIs(
- pool.FindOneofByName('protobuf_unittest.TestAllTypes.oneof_field'),
- unittest_pb2.TestAllTypes.DESCRIPTOR.oneofs_by_name['oneof_field'])
- self.assertIs(
- pool.FindServiceByName('protobuf_unittest.TestService'),
- unittest_pb2.DESCRIPTOR.services_by_name['TestService'])
-
- def testAddFileDescriptor(self):
- pool = descriptor_pool.Default()
- file_desc = descriptor_pb2.FileDescriptorProto(name='some/file.proto')
- pool.Add(file_desc)
- pool.AddSerializedFile(file_desc.SerializeToString())
+ def testAddTypeError(self):
+ pool = descriptor_pool.DescriptorPool()
+ with self.assertRaises(TypeError):
+ pool.AddDescriptor(0)
+ with self.assertRaises(TypeError):
+ pool.AddEnumDescriptor(0)
+ with self.assertRaises(TypeError):
+ pool.AddServiceDescriptor(0)
+ with self.assertRaises(TypeError):
+ pool.AddExtensionDescriptor(0)
+ with self.assertRaises(TypeError):
+ pool.AddFileDescriptor(0)
TEST1_FILE = ProtoFile(
diff --git a/python/google/protobuf/internal/descriptor_test.py b/python/google/protobuf/internal/descriptor_test.py
index c0010081..f1d5934e 100755
--- a/python/google/protobuf/internal/descriptor_test.py
+++ b/python/google/protobuf/internal/descriptor_test.py
@@ -107,6 +107,12 @@ class DescriptorTest(unittest.TestCase):
self.my_message.enum_types_by_name[
'ForeignEnum'].values_by_number[4].name,
self.my_message.EnumValueName('ForeignEnum', 4))
+ with self.assertRaises(KeyError):
+ self.my_message.EnumValueName('ForeignEnum', 999)
+ with self.assertRaises(KeyError):
+ self.my_message.EnumValueName('NoneEnum', 999)
+ with self.assertRaises(TypeError):
+ self.my_message.EnumValueName()
def testEnumFixups(self):
self.assertEqual(self.my_enum, self.my_enum.values[0].type)
@@ -134,15 +140,17 @@ class DescriptorTest(unittest.TestCase):
def testSimpleCustomOptions(self):
file_descriptor = unittest_custom_options_pb2.DESCRIPTOR
- message_descriptor =\
- unittest_custom_options_pb2.TestMessageWithCustomOptions.DESCRIPTOR
+ message_descriptor = (unittest_custom_options_pb2.
+ TestMessageWithCustomOptions.DESCRIPTOR)
field_descriptor = message_descriptor.fields_by_name['field1']
oneof_descriptor = message_descriptor.oneofs_by_name['AnOneof']
enum_descriptor = message_descriptor.enum_types_by_name['AnEnum']
- enum_value_descriptor =\
- message_descriptor.enum_values_by_name['ANENUM_VAL2']
- service_descriptor =\
- unittest_custom_options_pb2.TestServiceWithCustomOptions.DESCRIPTOR
+ enum_value_descriptor = (message_descriptor.
+ enum_values_by_name['ANENUM_VAL2'])
+ other_enum_value_descriptor = (message_descriptor.
+ enum_values_by_name['ANENUM_VAL1'])
+ service_descriptor = (unittest_custom_options_pb2.
+ TestServiceWithCustomOptions.DESCRIPTOR)
method_descriptor = service_descriptor.FindMethodByName('Foo')
file_options = file_descriptor.GetOptions()
@@ -178,6 +186,11 @@ class DescriptorTest(unittest.TestCase):
unittest_custom_options_pb2.DummyMessageContainingEnum.DESCRIPTOR)
self.assertTrue(file_descriptor.has_options)
self.assertFalse(message_descriptor.has_options)
+ self.assertTrue(field_descriptor.has_options)
+ self.assertTrue(oneof_descriptor.has_options)
+ self.assertTrue(enum_descriptor.has_options)
+ self.assertTrue(enum_value_descriptor.has_options)
+ self.assertFalse(other_enum_value_descriptor.has_options)
def testDifferentCustomOptionTypes(self):
kint32min = -2**31
@@ -400,6 +413,12 @@ class DescriptorTest(unittest.TestCase):
self.assertEqual(self.my_file.name, 'some/filename/some.proto')
self.assertEqual(self.my_file.package, 'protobuf_unittest')
self.assertEqual(self.my_file.pool, self.pool)
+ self.assertFalse(self.my_file.has_options)
+ self.assertEqual('proto2', self.my_file.syntax)
+ file_proto = descriptor_pb2.FileDescriptorProto()
+ self.my_file.CopyToProto(file_proto)
+ self.assertEqual(self.my_file.serialized_pb,
+ file_proto.SerializeToString())
# Generated modules also belong to the default pool.
self.assertEqual(unittest_pb2.DESCRIPTOR.pool, descriptor_pool.Default())
@@ -407,13 +426,31 @@ class DescriptorTest(unittest.TestCase):
api_implementation.Type() != 'cpp' or api_implementation.Version() != 2,
'Immutability of descriptors is only enforced in v2 implementation')
def testImmutableCppDescriptor(self):
+ file_descriptor = unittest_pb2.DESCRIPTOR
message_descriptor = unittest_pb2.TestAllTypes.DESCRIPTOR
+ field_descriptor = message_descriptor.fields_by_name['optional_int32']
+ enum_descriptor = message_descriptor.enum_types_by_name['NestedEnum']
+ oneof_descriptor = message_descriptor.oneofs_by_name['oneof_field']
with self.assertRaises(AttributeError):
message_descriptor.fields_by_name = None
with self.assertRaises(TypeError):
message_descriptor.fields_by_name['Another'] = None
with self.assertRaises(TypeError):
message_descriptor.fields.append(None)
+ with self.assertRaises(AttributeError):
+ field_descriptor.containing_type = message_descriptor
+ with self.assertRaises(AttributeError):
+ file_descriptor.has_options = False
+ with self.assertRaises(AttributeError):
+ field_descriptor.has_options = False
+ with self.assertRaises(AttributeError):
+ oneof_descriptor.has_options = False
+ with self.assertRaises(AttributeError):
+ enum_descriptor.has_options = False
+ with self.assertRaises(AttributeError) as e:
+ message_descriptor.has_options = True
+ self.assertEqual('attribute is not writable: has_options',
+ str(e.exception))
class NewDescriptorTest(DescriptorTest):
@@ -442,6 +479,12 @@ class GeneratedDescriptorTest(unittest.TestCase):
self.CheckDescriptorMapping(message_descriptor.fields_by_name)
self.CheckDescriptorMapping(message_descriptor.fields_by_number)
self.CheckDescriptorMapping(message_descriptor.fields_by_camelcase_name)
+ self.CheckDescriptorMapping(message_descriptor.enum_types_by_name)
+ self.CheckDescriptorMapping(message_descriptor.enum_values_by_name)
+ self.CheckDescriptorMapping(message_descriptor.oneofs_by_name)
+ self.CheckDescriptorMapping(message_descriptor.enum_types[0].values_by_name)
+ # Test extension range
+ self.assertEqual(message_descriptor.extension_ranges, [])
def CheckFieldDescriptor(self, field_descriptor):
# Basic properties
@@ -450,6 +493,7 @@ class GeneratedDescriptorTest(unittest.TestCase):
self.assertEqual(field_descriptor.full_name,
'protobuf_unittest.TestAllTypes.optional_int32')
self.assertEqual(field_descriptor.containing_type.name, 'TestAllTypes')
+ self.assertEqual(field_descriptor.file, unittest_pb2.DESCRIPTOR)
# Test equality and hashability
self.assertEqual(field_descriptor, field_descriptor)
self.assertEqual(
@@ -461,32 +505,73 @@ class GeneratedDescriptorTest(unittest.TestCase):
field_descriptor)
self.assertIn(field_descriptor, [field_descriptor])
self.assertIn(field_descriptor, {field_descriptor: None})
+ self.assertEqual(None, field_descriptor.extension_scope)
+ self.assertEqual(None, field_descriptor.enum_type)
+ if api_implementation.Type() == 'cpp':
+ # For test coverage only
+ self.assertEqual(field_descriptor.id, field_descriptor.id)
def CheckDescriptorSequence(self, sequence):
# Verifies that a property like 'messageDescriptor.fields' has all the
# properties of an immutable abc.Sequence.
+ self.assertNotEqual(sequence,
+ unittest_pb2.TestAllExtensions.DESCRIPTOR.fields)
+ self.assertNotEqual(sequence, [])
+ self.assertNotEqual(sequence, 1)
+ self.assertFalse(sequence == 1) # Only for cpp test coverage
+ self.assertEqual(sequence, sequence)
+ expected_list = list(sequence)
+ self.assertEqual(expected_list, sequence)
self.assertGreater(len(sequence), 0) # Sized
- self.assertEqual(len(sequence), len(list(sequence))) # Iterable
+ self.assertEqual(len(sequence), len(expected_list)) # Iterable
+ self.assertEqual(sequence[len(sequence) -1], sequence[-1])
item = sequence[0]
self.assertEqual(item, sequence[0])
self.assertIn(item, sequence) # Container
self.assertEqual(sequence.index(item), 0)
self.assertEqual(sequence.count(item), 1)
+ other_item = unittest_pb2.NestedTestAllTypes.DESCRIPTOR.fields[0]
+ self.assertNotIn(other_item, sequence)
+ self.assertEqual(sequence.count(other_item), 0)
+ self.assertRaises(ValueError, sequence.index, other_item)
+ self.assertRaises(ValueError, sequence.index, [])
reversed_iterator = reversed(sequence)
self.assertEqual(list(reversed_iterator), list(sequence)[::-1])
self.assertRaises(StopIteration, next, reversed_iterator)
+ expected_list[0] = 'change value'
+ self.assertNotEqual(expected_list, sequence)
+ # TODO(jieluo): Change __repr__ support for DescriptorSequence.
+ if api_implementation.Type() == 'python':
+ self.assertEqual(str(list(sequence)), str(sequence))
+ else:
+ self.assertEqual(str(sequence)[0], '<')
def CheckDescriptorMapping(self, mapping):
# Verifies that a property like 'messageDescriptor.fields' has all the
# properties of an immutable abc.Mapping.
+ self.assertNotEqual(
+ mapping, unittest_pb2.TestAllExtensions.DESCRIPTOR.fields_by_name)
+ self.assertNotEqual(mapping, {})
+ self.assertNotEqual(mapping, 1)
+ self.assertFalse(mapping == 1) # Only for cpp test coverage
+ excepted_dict = dict(mapping.items())
+ self.assertEqual(mapping, excepted_dict)
+ self.assertEqual(mapping, mapping)
self.assertGreater(len(mapping), 0) # Sized
- self.assertEqual(len(mapping), len(list(mapping))) # Iterable
+ self.assertEqual(len(mapping), len(excepted_dict)) # Iterable
if sys.version_info >= (3,):
key, item = next(iter(mapping.items()))
else:
key, item = mapping.items()[0]
self.assertIn(key, mapping) # Container
self.assertEqual(mapping.get(key), item)
+ with self.assertRaises(TypeError):
+ mapping.get()
+ # TODO(jieluo): Fix python and cpp extension diff.
+ if api_implementation.Type() == 'python':
+ self.assertRaises(TypeError, mapping.get, [])
+ else:
+ self.assertEqual(None, mapping.get([]))
# keys(), iterkeys() &co
item = (next(iter(mapping.keys())), next(iter(mapping.values())))
self.assertEqual(item, next(iter(mapping.items())))
@@ -497,6 +582,18 @@ class GeneratedDescriptorTest(unittest.TestCase):
CheckItems(mapping.keys(), mapping.iterkeys())
CheckItems(mapping.values(), mapping.itervalues())
CheckItems(mapping.items(), mapping.iteritems())
+ excepted_dict[key] = 'change value'
+ self.assertNotEqual(mapping, excepted_dict)
+ del excepted_dict[key]
+ excepted_dict['new_key'] = 'new'
+ self.assertNotEqual(mapping, excepted_dict)
+ self.assertRaises(KeyError, mapping.__getitem__, 'key_error')
+ self.assertRaises(KeyError, mapping.__getitem__, len(mapping) + 1)
+ # TODO(jieluo): Add __repr__ support for DescriptorMapping.
+ if api_implementation.Type() == 'python':
+ self.assertEqual(len(str(dict(mapping.items()))), len(str(mapping)))
+ else:
+ self.assertEqual(str(mapping)[0], '<')
def testDescriptor(self):
message_descriptor = unittest_pb2.TestAllTypes.DESCRIPTOR
@@ -506,13 +603,26 @@ class GeneratedDescriptorTest(unittest.TestCase):
field_descriptor = message_descriptor.fields_by_camelcase_name[
'optionalInt32']
self.CheckFieldDescriptor(field_descriptor)
+ enum_descriptor = unittest_pb2.DESCRIPTOR.enum_types_by_name[
+ 'ForeignEnum']
+ self.assertEqual(None, enum_descriptor.containing_type)
+ # Test extension range
+ self.assertEqual(
+ unittest_pb2.TestAllExtensions.DESCRIPTOR.extension_ranges,
+ [(1, 536870912)])
+ self.assertEqual(
+ unittest_pb2.TestMultipleExtensionRanges.DESCRIPTOR.extension_ranges,
+ [(42, 43), (4143, 4244), (65536, 536870912)])
def testCppDescriptorContainer(self):
- # Check that the collection is still valid even if the parent disappeared.
- enum = unittest_pb2.TestAllTypes.DESCRIPTOR.enum_types_by_name['NestedEnum']
- values = enum.values
- del enum
- self.assertEqual('FOO', values[0].name)
+ containing_file = unittest_pb2.DESCRIPTOR
+ self.CheckDescriptorSequence(containing_file.dependencies)
+ self.CheckDescriptorMapping(containing_file.message_types_by_name)
+ self.CheckDescriptorMapping(containing_file.enum_types_by_name)
+ self.CheckDescriptorMapping(containing_file.services_by_name)
+ self.CheckDescriptorMapping(containing_file.extensions_by_name)
+ self.CheckDescriptorMapping(
+ unittest_pb2.TestNestedExtension.DESCRIPTOR.extensions_by_name)
def testCppDescriptorContainer_Iterator(self):
# Same test with the iterator
@@ -526,6 +636,18 @@ class GeneratedDescriptorTest(unittest.TestCase):
self.assertEqual(service_descriptor.name, 'TestService')
self.assertEqual(service_descriptor.methods[0].name, 'Foo')
self.assertIs(service_descriptor.file, unittest_pb2.DESCRIPTOR)
+ self.assertEqual(service_descriptor.index, 0)
+ self.CheckDescriptorMapping(service_descriptor.methods_by_name)
+
+ def testOneofDescriptor(self):
+ message_descriptor = unittest_pb2.TestAllTypes.DESCRIPTOR
+ oneof_descriptor = message_descriptor.oneofs_by_name['oneof_field']
+ self.assertFalse(oneof_descriptor.has_options)
+ self.assertEqual(message_descriptor, oneof_descriptor.containing_type)
+ self.assertEqual('oneof_field', oneof_descriptor.name)
+ self.assertEqual('protobuf_unittest.TestAllTypes.oneof_field',
+ oneof_descriptor.full_name)
+ self.assertEqual(0, oneof_descriptor.index)
class DescriptorCopyToProtoTest(unittest.TestCase):
@@ -663,49 +785,64 @@ class DescriptorCopyToProtoTest(unittest.TestCase):
descriptor_pb2.DescriptorProto,
TEST_MESSAGE_WITH_SEVERAL_EXTENSIONS_ASCII)
- # Disable this test so we can make changes to the proto file.
- # TODO(xiaofeng): Enable this test after cl/55530659 is submitted.
- #
- # def testCopyToProto_FileDescriptor(self):
- # UNITTEST_IMPORT_FILE_DESCRIPTOR_ASCII = ("""
- # name: 'google/protobuf/unittest_import.proto'
- # package: 'protobuf_unittest_import'
- # dependency: 'google/protobuf/unittest_import_public.proto'
- # message_type: <
- # name: 'ImportMessage'
- # field: <
- # name: 'd'
- # number: 1
- # label: 1 # Optional
- # type: 5 # TYPE_INT32
- # >
- # >
- # """ +
- # """enum_type: <
- # name: 'ImportEnum'
- # value: <
- # name: 'IMPORT_FOO'
- # number: 7
- # >
- # value: <
- # name: 'IMPORT_BAR'
- # number: 8
- # >
- # value: <
- # name: 'IMPORT_BAZ'
- # number: 9
- # >
- # >
- # options: <
- # java_package: 'com.google.protobuf.test'
- # optimize_for: 1 # SPEED
- # >
- # public_dependency: 0
- # """)
- # self._InternalTestCopyToProto(
- # unittest_import_pb2.DESCRIPTOR,
- # descriptor_pb2.FileDescriptorProto,
- # UNITTEST_IMPORT_FILE_DESCRIPTOR_ASCII)
+ def testCopyToProto_FileDescriptor(self):
+ UNITTEST_IMPORT_FILE_DESCRIPTOR_ASCII = ("""
+ name: 'google/protobuf/unittest_import.proto'
+ package: 'protobuf_unittest_import'
+ dependency: 'google/protobuf/unittest_import_public.proto'
+ message_type: <
+ name: 'ImportMessage'
+ field: <
+ name: 'd'
+ number: 1
+ label: 1 # Optional
+ type: 5 # TYPE_INT32
+ >
+ >
+ """ +
+ """enum_type: <
+ name: 'ImportEnum'
+ value: <
+ name: 'IMPORT_FOO'
+ number: 7
+ >
+ value: <
+ name: 'IMPORT_BAR'
+ number: 8
+ >
+ value: <
+ name: 'IMPORT_BAZ'
+ number: 9
+ >
+ >
+ enum_type: <
+ name: 'ImportEnumForMap'
+ value: <
+ name: 'UNKNOWN'
+ number: 0
+ >
+ value: <
+ name: 'FOO'
+ number: 1
+ >
+ value: <
+ name: 'BAR'
+ number: 2
+ >
+ >
+ options: <
+ java_package: 'com.google.protobuf.test'
+ optimize_for: 1 # SPEED
+ """ +
+ """
+ cc_enable_arenas: true
+ >
+ public_dependency: 0
+ """)
+ self._InternalTestCopyToProto(
+ unittest_import_pb2.DESCRIPTOR,
+ descriptor_pb2.FileDescriptorProto,
+ UNITTEST_IMPORT_FILE_DESCRIPTOR_ASCII)
def testCopyToProto_ServiceDescriptor(self):
TEST_SERVICE_ASCII = """
@@ -721,12 +858,47 @@ class DescriptorCopyToProtoTest(unittest.TestCase):
output_type: '.protobuf_unittest.BarResponse'
>
"""
- # TODO(rocking): enable this test after the proto descriptor change is
- # checked in.
- #self._InternalTestCopyToProto(
- # unittest_pb2.TestService.DESCRIPTOR,
- # descriptor_pb2.ServiceDescriptorProto,
- # TEST_SERVICE_ASCII)
+ self._InternalTestCopyToProto(
+ unittest_pb2.TestService.DESCRIPTOR,
+ descriptor_pb2.ServiceDescriptorProto,
+ TEST_SERVICE_ASCII)
+
+ @unittest.skipIf(
+ api_implementation.Type() == 'python',
+ 'It is not implemented in python.')
+ # TODO(jieluo): Add support for pure python or remove in c extension.
+ def testCopyToProto_MethodDescriptor(self):
+ expected_ascii = """
+ name: 'Foo'
+ input_type: '.protobuf_unittest.FooRequest'
+ output_type: '.protobuf_unittest.FooResponse'
+ """
+ method_descriptor = unittest_pb2.TestService.DESCRIPTOR.FindMethodByName(
+ 'Foo')
+ self._InternalTestCopyToProto(
+ method_descriptor,
+ descriptor_pb2.MethodDescriptorProto,
+ expected_ascii)
+
+ @unittest.skipIf(
+ api_implementation.Type() == 'python',
+ 'Pure python does not raise error.')
+ # TODO(jieluo): Fix pure python to check with the proto type.
+ def testCopyToProto_TypeError(self):
+ file_proto = descriptor_pb2.FileDescriptorProto()
+ self.assertRaises(TypeError,
+ unittest_pb2.TestEmptyMessage.DESCRIPTOR.CopyToProto,
+ file_proto)
+ self.assertRaises(TypeError,
+ unittest_pb2.ForeignEnum.DESCRIPTOR.CopyToProto,
+ file_proto)
+ self.assertRaises(TypeError,
+ unittest_pb2.TestService.DESCRIPTOR.CopyToProto,
+ file_proto)
+ proto = descriptor_pb2.DescriptorProto()
+ self.assertRaises(TypeError,
+ unittest_import_pb2.DESCRIPTOR.CopyToProto,
+ proto)
class MakeDescriptorTest(unittest.TestCase):
@@ -774,6 +946,9 @@ class MakeDescriptorTest(unittest.TestCase):
result.nested_types[0].enum_types[0])
self.assertFalse(result.has_options)
self.assertFalse(result.fields[0].has_options)
+ if api_implementation.Type() == 'cpp':
+ with self.assertRaises(AttributeError):
+ result.fields[0].has_options = False
def testMakeDescriptorWithUnsignedIntField(self):
file_descriptor_proto = descriptor_pb2.FileDescriptorProto()
diff --git a/python/google/protobuf/internal/encoder.py b/python/google/protobuf/internal/encoder.py
index ebec42e5..8c6a1189 100755
--- a/python/google/protobuf/internal/encoder.py
+++ b/python/google/protobuf/internal/encoder.py
@@ -819,7 +819,7 @@ def MapEncoder(field_descriptor):
encode_message = MessageEncoder(field_descriptor.number, False, False)
def EncodeField(write, value, deterministic):
- value_keys = sorted(value.keys()) if deterministic else value.keys()
+ value_keys = sorted(value.keys()) if deterministic else value
for key in value_keys:
entry_msg = message_type._concrete_class(key=key, value=value[key])
encode_message(write, entry_msg, deterministic)
diff --git a/python/google/protobuf/internal/json_format_test.py b/python/google/protobuf/internal/json_format_test.py
index 077b64db..b2cf7622 100644
--- a/python/google/protobuf/internal/json_format_test.py
+++ b/python/google/protobuf/internal/json_format_test.py
@@ -159,6 +159,16 @@ class JsonFormatTest(JsonFormatBase):
json_format.Parse(text, parsed_message)
self.assertEqual(message, parsed_message)
+ def testUnknownEnumToJsonError(self):
+ message = json_format_proto3_pb2.TestMessage()
+ message.enum_value = 999
+ # TODO(jieluo): should accept numeric unknown enum for proto3.
+ with self.assertRaises(json_format.SerializeToJsonError) as e:
+ json_format.MessageToJson(message)
+ self.assertEqual(str(e.exception),
+ 'Enum field contains an integer value which can '
+ 'not mapped to an enum value.')
+
def testExtensionToJsonAndBack(self):
message = unittest_mset_pb2.TestMessageSetContainer()
ext1 = unittest_mset_pb2.TestMessageSetExtension1.message_set_extension
@@ -172,6 +182,10 @@ class JsonFormatTest(JsonFormatBase):
json_format.Parse(message_text, parsed_message)
self.assertEqual(message, parsed_message)
+ def testExtensionErrors(self):
+ self.CheckError('{"[extensionField]": {}}',
+ 'Message type proto3.TestMessage does not have extensions')
+
def testExtensionToDictAndBack(self):
message = unittest_mset_pb2.TestMessageSetContainer()
ext1 = unittest_mset_pb2.TestMessageSetExtension1.message_set_extension
@@ -294,7 +308,18 @@ class JsonFormatTest(JsonFormatBase):
self.assertEqual(message.int32_value, 1)
def testMapFields(self):
- message = json_format_proto3_pb2.TestMap()
+ message = json_format_proto3_pb2.TestNestedMap()
+ self.assertEqual(
+ json.loads(json_format.MessageToJson(message, True)),
+ json.loads('{'
+ '"boolMap": {},'
+ '"int32Map": {},'
+ '"int64Map": {},'
+ '"uint32Map": {},'
+ '"uint64Map": {},'
+ '"stringMap": {},'
+ '"mapMap": {}'
+ '}'))
message.bool_map[True] = 1
message.bool_map[False] = 2
message.int32_map[1] = 2
@@ -307,17 +332,19 @@ class JsonFormatTest(JsonFormatBase):
message.uint64_map[2] = 3
message.string_map['1'] = 2
message.string_map['null'] = 3
+ message.map_map['1'].bool_map[True] = 3
self.assertEqual(
- json.loads(json_format.MessageToJson(message, True)),
+ json.loads(json_format.MessageToJson(message, False)),
json.loads('{'
'"boolMap": {"false": 2, "true": 1},'
'"int32Map": {"1": 2, "2": 3},'
'"int64Map": {"1": 2, "2": 3},'
'"uint32Map": {"1": 2, "2": 3},'
'"uint64Map": {"1": 2, "2": 3},'
- '"stringMap": {"1": 2, "null": 3}'
+ '"stringMap": {"1": 2, "null": 3},'
+ '"mapMap": {"1": {"boolMap": {"true": 3}}}'
'}'))
- parsed_message = json_format_proto3_pb2.TestMap()
+ parsed_message = json_format_proto3_pb2.TestNestedMap()
self.CheckParseBack(message, parsed_message)
def testOneofFields(self):
@@ -703,6 +730,9 @@ class JsonFormatTest(JsonFormatBase):
json_format.Parse,
'{"repeatedInt32Value":[1, null]}',
parsed_message)
+ self.CheckError('{"repeatedMessageValue":[null]}',
+ 'Failed to parse repeatedMessageValue field: null is not'
+ ' allowed to be used as an element in a repeated field.')
def testNanFloat(self):
message = json_format_proto3_pb2.TestMessage()
@@ -727,6 +757,11 @@ class JsonFormatTest(JsonFormatBase):
'{"enumValue": "baz"}',
'Failed to parse enumValue field: Invalid enum value baz '
'for enum type proto3.EnumType.')
+ # TODO(jieluo): fix json format to accept numeric unknown enum for proto3.
+ self.CheckError(
+ '{"enumValue": 12345}',
+ 'Failed to parse enumValue field: Invalid enum value 12345 '
+ 'for enum type proto3.EnumType.')
def testParseBadIdentifer(self):
self.CheckError('{int32Value: 1}',
@@ -799,6 +834,11 @@ class JsonFormatTest(JsonFormatBase):
self.CheckError('{"bytesValue": "AQI*"}',
'Failed to parse bytesValue field: Incorrect padding.')
+ def testInvalidRepeated(self):
+ self.CheckError('{"repeatedInt32Value": 12345}',
+ (r'Failed to parse repeatedInt32Value field: repeated field'
+ r' repeatedInt32Value must be in \[\] which is 12345.'))
+
def testInvalidMap(self):
message = json_format_proto3_pb2.TestMap()
text = '{"int32Map": {"null": 2, "2": 3}}'
@@ -824,6 +864,12 @@ class JsonFormatTest(JsonFormatBase):
json_format.ParseError,
'Failed to load JSON: duplicate key a',
json_format.Parse, text, message)
+ text = r'{"stringMap": 0}'
+ self.assertRaisesRegexp(
+ json_format.ParseError,
+ 'Failed to parse stringMap field: Map field string_map must be '
+ 'in a dict which is 0.',
+ json_format.Parse, text, message)
def testInvalidTimestamp(self):
message = json_format_proto3_pb2.TestTimestamp()
@@ -911,6 +957,12 @@ class JsonFormatTest(JsonFormatBase):
json_format.MessageToJson(message))
self.assertEqual('{\n "int32_value": 12345\n}',
json_format.MessageToJson(message, False, True))
+ # When including_default_value_fields is True.
+ message = json_format_proto3_pb2.TestTimestamp()
+ self.assertEqual('{\n "repeatedValue": []\n}',
+ json_format.MessageToJson(message, True, False))
+ self.assertEqual('{\n "repeated_value": []\n}',
+ json_format.MessageToJson(message, True, True))
# Parsers accept both original proto field names and lowerCamelCase names.
message = json_format_proto3_pb2.TestMessage()
diff --git a/python/google/protobuf/internal/message_factory_test.py b/python/google/protobuf/internal/message_factory_test.py
index aa7af2d0..a1b6bb81 100644
--- a/python/google/protobuf/internal/message_factory_test.py
+++ b/python/google/protobuf/internal/message_factory_test.py
@@ -40,6 +40,7 @@ except ImportError:
import unittest
from google.protobuf import descriptor_pb2
+from google.protobuf.internal import api_implementation
from google.protobuf.internal import factory_test1_pb2
from google.protobuf.internal import factory_test2_pb2
from google.protobuf import descriptor_database
@@ -130,6 +131,21 @@ class MessageFactoryTest(unittest.TestCase):
msg1.Extensions[ext2] = 'test2'
self.assertEqual('test1', msg1.Extensions[ext1])
self.assertEqual('test2', msg1.Extensions[ext2])
+ self.assertEqual(None,
+ msg1.Extensions._FindExtensionByNumber(12321))
+ if api_implementation.Type() == 'cpp':
+ # TODO(jieluo): Fix len to return the correct value.
+ # self.assertEqual(2, len(msg1.Extensions))
+ self.assertEqual(len(msg1.Extensions), len(msg1.Extensions))
+ self.assertRaises(TypeError,
+ msg1.Extensions._FindExtensionByName, 0)
+ self.assertRaises(TypeError,
+ msg1.Extensions._FindExtensionByNumber, '')
+ else:
+ self.assertEqual(None,
+ msg1.Extensions._FindExtensionByName(0))
+ self.assertEqual(None,
+ msg1.Extensions._FindExtensionByNumber(''))
def testDuplicateExtensionNumber(self):
pool = descriptor_pool.DescriptorPool()
diff --git a/python/google/protobuf/internal/message_test.py b/python/google/protobuf/internal/message_test.py
index dda72cdd..4622f10f 100755
--- a/python/google/protobuf/internal/message_test.py
+++ b/python/google/protobuf/internal/message_test.py
@@ -61,6 +61,7 @@ try:
except NameError:
cmp = lambda x, y: (x > y) - (x < y) # Python 3
+from google.protobuf import map_proto2_unittest_pb2
from google.protobuf import map_unittest_pb2
from google.protobuf import unittest_pb2
from google.protobuf import unittest_proto3_arena_pb2
@@ -69,6 +70,7 @@ from google.protobuf import descriptor_pool
from google.protobuf import message_factory
from google.protobuf import text_format
from google.protobuf.internal import api_implementation
+from google.protobuf.internal import encoder
from google.protobuf.internal import packed_field_test_pb2
from google.protobuf.internal import test_util
from google.protobuf.internal import testing_refleaks
@@ -140,6 +142,18 @@ class MessageTest(BaseTestCase):
golden_copy = copy.deepcopy(golden_message)
self.assertEqual(golden_data, golden_copy.SerializeToString())
+ def testParseErrors(self, message_module):
+ msg = message_module.TestAllTypes()
+ self.assertRaises(TypeError, msg.FromString, 0)
+ self.assertRaises(Exception, msg.FromString, '0')
+ # TODO(jieluo): Fix cpp extension to check unexpected end-group tag.
+ # b/27494216
+ if api_implementation.Type() == 'python':
+ end_tag = encoder.TagBytes(1, 4)
+ with self.assertRaises(message.DecodeError) as context:
+ msg.FromString(end_tag)
+ self.assertEqual('Unexpected end-group tag.', str(context.exception))
+
def testDeterminismParameters(self, message_module):
# This message is always deterministically serialized, even if determinism
# is disabled, so we can use it to verify that all the determinism
@@ -609,6 +623,13 @@ class MessageTest(BaseTestCase):
self.assertIsInstance(m.repeated_nested_message,
collections.MutableSequence)
+ def testRepeatedFieldsNotHashable(self, message_module):
+ m = message_module.TestAllTypes()
+ with self.assertRaises(TypeError):
+ hash(m.repeated_int32)
+ with self.assertRaises(TypeError):
+ hash(m.repeated_nested_message)
+
def testRepeatedFieldInsideNestedMessage(self, message_module):
m = message_module.NestedTestAllTypes()
m.payload.repeated_int32.extend([])
@@ -626,6 +647,7 @@ class MessageTest(BaseTestCase):
def testOneofGetCaseNonexistingField(self, message_module):
m = message_module.TestAllTypes()
self.assertRaises(ValueError, m.WhichOneof, 'no_such_oneof_field')
+ self.assertRaises(Exception, m.WhichOneof, 0)
def testOneofDefaultValues(self, message_module):
m = message_module.TestAllTypes()
@@ -1001,6 +1023,8 @@ class MessageTest(BaseTestCase):
m = message_module.TestAllTypes()
with self.assertRaises(IndexError) as _:
m.repeated_nested_message.pop()
+ with self.assertRaises(TypeError) as _:
+ m.repeated_nested_message.pop('0')
for i in range(5):
n = m.repeated_nested_message.add()
n.bb = i
@@ -1009,6 +1033,39 @@ class MessageTest(BaseTestCase):
self.assertEqual(2, m.repeated_nested_message.pop(1).bb)
self.assertEqual([1, 3], [n.bb for n in m.repeated_nested_message])
+ def testRepeatedCompareWithSelf(self, message_module):
+ m = message_module.TestAllTypes()
+ for i in range(5):
+ m.repeated_int32.insert(i, i)
+ n = m.repeated_nested_message.add()
+ n.bb = i
+ self.assertSequenceEqual(m.repeated_int32, m.repeated_int32)
+ self.assertEqual(m.repeated_nested_message, m.repeated_nested_message)
+
+ def testReleasedNestedMessages(self, message_module):
+ """A case that lead to a segfault when a message detached from its parent
+ container has itself a child container.
+ """
+ m = message_module.NestedTestAllTypes()
+ m = m.repeated_child.add()
+ m = m.child
+ m = m.repeated_child.add()
+ self.assertEqual(m.payload.optional_int32, 0)
+
+ def testSetRepeatedComposite(self, message_module):
+ m = message_module.TestAllTypes()
+ with self.assertRaises(AttributeError):
+ m.repeated_int32 = []
+ m.repeated_int32.append(1)
+ if api_implementation.Type() == 'cpp':
+ # For test coverage: cpp has a different path if composite
+ # field is in cache
+ with self.assertRaises(TypeError):
+ m.repeated_int32 = []
+ else:
+ with self.assertRaises(AttributeError):
+ m.repeated_int32 = []
+
# Class to test proto2-only features (required, extensions, etc.)
class Proto2Test(BaseTestCase):
@@ -1061,18 +1118,46 @@ class Proto2Test(BaseTestCase):
self.assertEqual(False, message.optional_bool)
self.assertEqual(0, message.optional_nested_message.bb)
- # TODO(tibell): The C++ implementations actually allows assignment
- # of unknown enum values to *scalar* fields (but not repeated
- # fields). Once checked enum fields becomes the default in the
- # Python implementation, the C++ implementation should follow suit.
def testAssignInvalidEnum(self):
- """It should not be possible to assign an invalid enum number to an
- enum field."""
+ """Assigning an invalid enum number is not allowed in proto2."""
m = unittest_pb2.TestAllTypes()
+ # Proto2 can not assign unknown enum.
with self.assertRaises(ValueError) as _:
m.optional_nested_enum = 1234567
self.assertRaises(ValueError, m.repeated_nested_enum.append, 1234567)
+ # Assignment is a different code path than append for the C++ impl.
+ m.repeated_nested_enum.append(2)
+ m.repeated_nested_enum[0] = 2
+ with self.assertRaises(ValueError):
+ m.repeated_nested_enum[0] = 123456
+
+ # Unknown enum value can be parsed but is ignored.
+ m2 = unittest_proto3_arena_pb2.TestAllTypes()
+ m2.optional_nested_enum = 1234567
+ m2.repeated_nested_enum.append(7654321)
+ serialized = m2.SerializeToString()
+
+ m3 = unittest_pb2.TestAllTypes()
+ m3.ParseFromString(serialized)
+ self.assertFalse(m3.HasField('optional_nested_enum'))
+ # 1 is the default value for optional_nested_enum.
+ self.assertEqual(1, m3.optional_nested_enum)
+ self.assertEqual(0, len(m3.repeated_nested_enum))
+ m2.Clear()
+ m2.ParseFromString(m3.SerializeToString())
+ self.assertEqual(1234567, m2.optional_nested_enum)
+ self.assertEqual(7654321, m2.repeated_nested_enum[0])
+
+ def testUnknownEnumMap(self):
+ m = map_proto2_unittest_pb2.TestEnumMap()
+ m.known_map_field[123] = 0
+ with self.assertRaises(ValueError):
+ m.unknown_map_field[1] = 123
+
+ def testExtensionsErrors(self):
+ msg = unittest_pb2.TestAllTypes()
+ self.assertRaises(AttributeError, getattr, msg, 'Extensions')
def testGoldenExtensions(self):
golden_data = test_util.GoldenFileData('golden_message')
@@ -1297,6 +1382,7 @@ class Proto3Test(BaseTestCase):
"""Assigning an unknown enum value is allowed and preserves the value."""
m = unittest_proto3_arena_pb2.TestAllTypes()
+ # Proto3 can assign unknown enums.
m.optional_nested_enum = 1234567
self.assertEqual(1234567, m.optional_nested_enum)
m.repeated_nested_enum.append(22334455)
@@ -1311,18 +1397,10 @@ class Proto3Test(BaseTestCase):
self.assertEqual(1234567, m2.optional_nested_enum)
self.assertEqual(7654321, m2.repeated_nested_enum[0])
- # ParseFromString in Proto2 should accept unknown enums too.
- m3 = unittest_pb2.TestAllTypes()
- m3.ParseFromString(serialized)
- m2.Clear()
- m2.ParseFromString(m3.SerializeToString())
- self.assertEqual(1234567, m2.optional_nested_enum)
- self.assertEqual(7654321, m2.repeated_nested_enum[0])
-
# Map isn't really a proto3-only feature. But there is no proto2 equivalent
# of google/protobuf/map_unittest.proto right now, so it's not easy to
# test both with the same test like we do for the other proto2/proto3 tests.
- # (google/protobuf/map_protobuf_unittest.proto is very different in the set
+ # (google/protobuf/map_proto2_unittest.proto is very different in the set
# of messages and fields it contains).
def testScalarMapDefaults(self):
msg = map_unittest_pb2.TestMap()
@@ -1383,12 +1461,21 @@ class Proto3Test(BaseTestCase):
msg.map_int32_int32[5] = 15
self.assertEqual(15, msg.map_int32_int32.get(5))
+ self.assertEqual(15, msg.map_int32_int32.get(5))
+ with self.assertRaises(TypeError):
+ msg.map_int32_int32.get('')
self.assertIsNone(msg.map_int32_foreign_message.get(5))
self.assertEqual(10, msg.map_int32_foreign_message.get(5, 10))
submsg = msg.map_int32_foreign_message[5]
self.assertIs(submsg, msg.map_int32_foreign_message.get(5))
+ # TODO(jieluo): Fix python and cpp extension diff.
+ if api_implementation.Type() == 'cpp':
+ with self.assertRaises(TypeError):
+ msg.map_int32_foreign_message.get('')
+ else:
+ self.assertEqual(None, msg.map_int32_foreign_message.get(''))
def testScalarMap(self):
msg = map_unittest_pb2.TestMap()
@@ -1400,8 +1487,13 @@ class Proto3Test(BaseTestCase):
msg.map_int64_int64[-2**33] = -2**34
msg.map_uint32_uint32[123] = 456
msg.map_uint64_uint64[2**33] = 2**34
+ msg.map_int32_float[2] = 1.2
+ msg.map_int32_double[1] = 3.3
msg.map_string_string['abc'] = '123'
+ msg.map_bool_bool[True] = True
msg.map_int32_enum[888] = 2
+ # Unknown numeric enum is supported in proto3.
+ msg.map_int32_enum[123] = 456
self.assertEqual([], msg.FindInitializationErrors())
@@ -1435,8 +1527,24 @@ class Proto3Test(BaseTestCase):
self.assertEqual(-2**34, msg2.map_int64_int64[-2**33])
self.assertEqual(456, msg2.map_uint32_uint32[123])
self.assertEqual(2**34, msg2.map_uint64_uint64[2**33])
+ self.assertAlmostEqual(1.2, msg.map_int32_float[2])
+ self.assertEqual(3.3, msg.map_int32_double[1])
self.assertEqual('123', msg2.map_string_string['abc'])
+ self.assertEqual(True, msg2.map_bool_bool[True])
self.assertEqual(2, msg2.map_int32_enum[888])
+ self.assertEqual(456, msg2.map_int32_enum[123])
+ # TODO(jieluo): Add cpp extension support.
+ if api_implementation.Type() == 'python':
+ self.assertEqual('{-123: -456}',
+ str(msg2.map_int32_int32))
+
+ def testMapEntryAlwaysSerialized(self):
+ msg = map_unittest_pb2.TestMap()
+ msg.map_int32_int32[0] = 0
+ msg.map_string_string[''] = ''
+ self.assertEqual(msg.ByteSize(), 12)
+ self.assertEqual(b'\n\x04\x08\x00\x10\x00r\x04\n\x00\x12\x00',
+ msg.SerializeToString())
def testStringUnicodeConversionInMap(self):
msg = map_unittest_pb2.TestMap()
@@ -1489,6 +1597,11 @@ class Proto3Test(BaseTestCase):
self.assertIn(123, msg2.map_int32_foreign_message)
self.assertIn(-456, msg2.map_int32_foreign_message)
self.assertEqual(2, len(msg2.map_int32_foreign_message))
+ # TODO(jieluo): Fix text format for message map.
+ # TODO(jieluo): Add cpp extension support.
+ if api_implementation.Type() == 'python':
+ self.assertEqual(15,
+ len(str(msg2.map_int32_foreign_message)))
def testNestedMessageMapItemDelete(self):
msg = map_unittest_pb2.TestMap()
@@ -1572,6 +1685,12 @@ class Proto3Test(BaseTestCase):
del msg2.map_int32_foreign_message[222]
self.assertFalse(222 in msg2.map_int32_foreign_message)
+ if api_implementation.Type() == 'cpp':
+ with self.assertRaises(TypeError):
+ del msg2.map_int32_foreign_message['']
+ else:
+ with self.assertRaises(KeyError):
+ del msg2.map_int32_foreign_message['']
def testMergeFromBadType(self):
msg = map_unittest_pb2.TestMap()
@@ -1706,6 +1825,54 @@ class Proto3Test(BaseTestCase):
matching_dict = {2: 4, 3: 6, 4: 8}
self.assertMapIterEquals(msg.map_int32_int32.items(), matching_dict)
+ def testPython2Map(self):
+ if sys.version_info < (3,):
+ msg = map_unittest_pb2.TestMap()
+ msg.map_int32_int32[2] = 4
+ msg.map_int32_int32[3] = 6
+ msg.map_int32_int32[4] = 8
+ msg.map_int32_int32[5] = 10
+ map_int32 = msg.map_int32_int32
+ self.assertEqual(4, len(map_int32))
+ msg2 = map_unittest_pb2.TestMap()
+ msg2.ParseFromString(msg.SerializeToString())
+
+ def CheckItems(seq, iterator):
+ self.assertEqual(next(iterator), seq[0])
+ self.assertEqual(list(iterator), seq[1:])
+
+ CheckItems(map_int32.items(), map_int32.iteritems())
+ CheckItems(map_int32.keys(), map_int32.iterkeys())
+ CheckItems(map_int32.values(), map_int32.itervalues())
+
+ self.assertEqual(6, map_int32.get(3))
+ self.assertEqual(None, map_int32.get(999))
+ self.assertEqual(6, map_int32.pop(3))
+ self.assertEqual(0, map_int32.pop(3))
+ self.assertEqual(3, len(map_int32))
+ key, value = map_int32.popitem()
+ self.assertEqual(2 * key, value)
+ self.assertEqual(2, len(map_int32))
+ map_int32.clear()
+ self.assertEqual(0, len(map_int32))
+
+ with self.assertRaises(KeyError):
+ map_int32.popitem()
+
+ self.assertEqual(0, map_int32.setdefault(2))
+ self.assertEqual(1, len(map_int32))
+
+ map_int32.update(msg2.map_int32_int32)
+ self.assertEqual(4, len(map_int32))
+
+ with self.assertRaises(TypeError):
+ map_int32.update(msg2.map_int32_int32,
+ msg2.map_int32_int32)
+ with self.assertRaises(TypeError):
+ map_int32.update(0)
+ with self.assertRaises(TypeError):
+ map_int32.update(value=12)
+
def testMapItems(self):
# Map items used to have strange behaviors when use c extension. Because
# [] may reorder the map and invalidate any exsting iterators.
@@ -1836,6 +2003,9 @@ class Proto3Test(BaseTestCase):
del msg.map_int32_int32[4]
self.assertEqual(0, len(msg.map_int32_int32))
+ with self.assertRaises(KeyError):
+ del msg.map_int32_all_types[32]
+
def testMapsAreMapping(self):
msg = map_unittest_pb2.TestMap()
self.assertIsInstance(msg.map_int32_int32, collections.Mapping)
@@ -1844,6 +2014,14 @@ class Proto3Test(BaseTestCase):
self.assertIsInstance(msg.map_int32_foreign_message,
collections.MutableMapping)
+ def testMapsCompare(self):
+ msg = map_unittest_pb2.TestMap()
+ msg.map_int32_int32[-123] = -456
+ self.assertEqual(msg.map_int32_int32, msg.map_int32_int32)
+ self.assertEqual(msg.map_int32_foreign_message,
+ msg.map_int32_foreign_message)
+ self.assertNotEqual(msg.map_int32_int32, 0)
+
def testMapFindInitializationErrorsSmokeTest(self):
msg = map_unittest_pb2.TestMap()
msg.map_string_string['abc'] = '123'
diff --git a/python/google/protobuf/internal/python_message.py b/python/google/protobuf/internal/python_message.py
index c363d843..975e3b4d 100755
--- a/python/google/protobuf/internal/python_message.py
+++ b/python/google/protobuf/internal/python_message.py
@@ -1010,11 +1010,16 @@ def _AddByteSizeMethod(message_descriptor, cls):
return self._cached_byte_size
size = 0
- for field_descriptor, field_value in self.ListFields():
- size += field_descriptor._sizer(field_value)
-
- for tag_bytes, value_bytes in self._unknown_fields:
- size += len(tag_bytes) + len(value_bytes)
+ descriptor = self.DESCRIPTOR
+ if descriptor.GetOptions().map_entry:
+ # Fields of map entry should always be serialized.
+ size = descriptor.fields_by_name['key']._sizer(self.key)
+ size += descriptor.fields_by_name['value']._sizer(self.value)
+ else:
+ for field_descriptor, field_value in self.ListFields():
+ size += field_descriptor._sizer(field_value)
+ for tag_bytes, value_bytes in self._unknown_fields:
+ size += len(tag_bytes) + len(value_bytes)
self._cached_byte_size = size
self._cached_byte_size_dirty = False
@@ -1053,11 +1058,20 @@ def _AddSerializePartialToStringMethod(message_descriptor, cls):
api_implementation.IsPythonDefaultSerializationDeterministic())
else:
deterministic = bool(deterministic)
- for field_descriptor, field_value in self.ListFields():
- field_descriptor._encoder(write_bytes, field_value, deterministic)
- for tag_bytes, value_bytes in self._unknown_fields:
- write_bytes(tag_bytes)
- write_bytes(value_bytes)
+
+ descriptor = self.DESCRIPTOR
+ if descriptor.GetOptions().map_entry:
+ # Fields of map entry should always be serialized.
+ descriptor.fields_by_name['key']._encoder(
+ write_bytes, self.key, deterministic)
+ descriptor.fields_by_name['value']._encoder(
+ write_bytes, self.value, deterministic)
+ else:
+ for field_descriptor, field_value in self.ListFields():
+ field_descriptor._encoder(write_bytes, field_value, deterministic)
+ for tag_bytes, value_bytes in self._unknown_fields:
+ write_bytes(tag_bytes)
+ write_bytes(value_bytes)
cls._InternalSerialize = InternalSerialize
@@ -1095,7 +1109,8 @@ def _AddMergeFromStringMethod(message_descriptor, cls):
new_pos = local_SkipField(buffer, new_pos, end, tag_bytes)
if new_pos == -1:
return pos
- if not is_proto3:
+ if (not is_proto3 or
+ api_implementation.GetPythonProto3PreserveUnknownsDefault()):
if not unknown_field_list:
unknown_field_list = self._unknown_fields = []
unknown_field_list.append(
diff --git a/python/google/protobuf/internal/reflection_test.py b/python/google/protobuf/internal/reflection_test.py
index 5ab5225e..0306ff46 100755
--- a/python/google/protobuf/internal/reflection_test.py
+++ b/python/google/protobuf/internal/reflection_test.py
@@ -40,7 +40,6 @@ import gc
import operator
import six
import struct
-import sys
try:
import unittest2 as unittest #PY26
@@ -621,6 +620,14 @@ class ReflectionTest(BaseTestCase):
self.assertRaises(TypeError, setattr, proto, 'optional_int32', 'foo')
self.assertRaises(TypeError, setattr, proto, 'optional_string', 10)
self.assertRaises(TypeError, setattr, proto, 'optional_bytes', 10)
+ self.assertRaises(TypeError, setattr, proto, 'optional_bool', 'foo')
+ self.assertRaises(TypeError, setattr, proto, 'optional_float', 'foo')
+ self.assertRaises(TypeError, setattr, proto, 'optional_double', 'foo')
+ # TODO(jieluo): Fix type checking difference for python and c extension
+ if api_implementation.Type() == 'python':
+ self.assertRaises(TypeError, setattr, proto, 'optional_bool', 1.1)
+ else:
+ proto.optional_bool = 1.1
def assertIntegerTypes(self, integer_fn):
"""Verifies setting of scalar integers.
@@ -687,8 +694,10 @@ class ReflectionTest(BaseTestCase):
self.assertEqual(expected_min, getattr(pb, field_name))
setattr(pb, field_name, expected_max)
self.assertEqual(expected_max, getattr(pb, field_name))
- self.assertRaises(Exception, setattr, pb, field_name, expected_min - 1)
- self.assertRaises(Exception, setattr, pb, field_name, expected_max + 1)
+ self.assertRaises((ValueError, TypeError), setattr, pb, field_name,
+ expected_min - 1)
+ self.assertRaises((ValueError, TypeError), setattr, pb, field_name,
+ expected_max + 1)
TestMinAndMaxIntegers('optional_int32', -(1 << 31), (1 << 31) - 1)
TestMinAndMaxIntegers('optional_uint32', 0, 0xffffffff)
@@ -697,7 +706,7 @@ class ReflectionTest(BaseTestCase):
# A bit of white-box testing since -1 is an int and not a long in C++ and
# so goes down a different path.
pb = unittest_pb2.TestAllTypes()
- with self.assertRaises(Exception):
+ with self.assertRaises((ValueError, TypeError)):
pb.optional_uint64 = integer_fn(-(1 << 63))
pb = unittest_pb2.TestAllTypes()
@@ -721,6 +730,12 @@ class ReflectionTest(BaseTestCase):
proto.repeated_int32[0] = 23
self.assertRaises(IndexError, proto.repeated_int32.__setitem__, 500, 23)
self.assertRaises(TypeError, proto.repeated_int32.__setitem__, 0, 'abc')
+ self.assertRaises(TypeError, proto.repeated_int32.__setitem__, 0, [])
+ self.assertRaises(TypeError, proto.repeated_int32.__setitem__,
+ 'index', 23)
+
+ proto.repeated_string.append('2')
+ self.assertRaises(TypeError, proto.repeated_string.__setitem__, 0, 10)
# Repeated enums tests.
#proto.repeated_nested_enum.append(0)
@@ -1008,6 +1023,14 @@ class ReflectionTest(BaseTestCase):
self.assertEqual(4, len(proto.repeated_nested_message))
self.assertEqual(n1, proto.repeated_nested_message[2])
self.assertEqual(n2, proto.repeated_nested_message[3])
+ self.assertRaises(TypeError,
+ proto.repeated_nested_message.extend, n1)
+ self.assertRaises(TypeError,
+ proto.repeated_nested_message.extend, [0])
+ wrong_message_type = unittest_pb2.TestAllTypes()
+ self.assertRaises(TypeError,
+ proto.repeated_nested_message.extend,
+ [wrong_message_type])
# Test clearing.
proto.ClearField('repeated_nested_message')
@@ -1019,6 +1042,8 @@ class ReflectionTest(BaseTestCase):
self.assertEqual(1, len(proto.repeated_nested_message))
self.assertEqual(23, proto.repeated_nested_message[0].bb)
self.assertRaises(TypeError, proto.repeated_nested_message.add, 23)
+ with self.assertRaises(Exception):
+ proto.repeated_nested_message[0] = 23
def testRepeatedCompositeRemove(self):
proto = unittest_pb2.TestAllTypes()
@@ -1643,8 +1668,11 @@ class ReflectionTest(BaseTestCase):
proto.SerializeToString()
proto.SerializePartialToString()
- def assertNotInitialized(self, proto):
+ def assertNotInitialized(self, proto, error_size=None):
+ errors = []
self.assertFalse(proto.IsInitialized())
+ self.assertFalse(proto.IsInitialized(errors))
+ self.assertEqual(error_size, len(errors))
self.assertRaises(message.EncodeError, proto.SerializeToString)
# "Partial" serialization doesn't care if message is uninitialized.
proto.SerializePartialToString()
@@ -1658,7 +1686,7 @@ class ReflectionTest(BaseTestCase):
# The case of uninitialized required fields.
proto = unittest_pb2.TestRequired()
- self.assertNotInitialized(proto)
+ self.assertNotInitialized(proto, 3)
proto.a = proto.b = proto.c = 2
self.assertInitialized(proto)
@@ -1666,14 +1694,14 @@ class ReflectionTest(BaseTestCase):
proto = unittest_pb2.TestRequiredForeign()
self.assertInitialized(proto)
proto.optional_message.a = 1
- self.assertNotInitialized(proto)
+ self.assertNotInitialized(proto, 2)
proto.optional_message.b = 0
proto.optional_message.c = 0
self.assertInitialized(proto)
# Uninitialized repeated submessage.
message1 = proto.repeated_message.add()
- self.assertNotInitialized(proto)
+ self.assertNotInitialized(proto, 3)
message1.a = message1.b = message1.c = 0
self.assertInitialized(proto)
@@ -1682,11 +1710,11 @@ class ReflectionTest(BaseTestCase):
extension = unittest_pb2.TestRequired.multi
message1 = proto.Extensions[extension].add()
message2 = proto.Extensions[extension].add()
- self.assertNotInitialized(proto)
+ self.assertNotInitialized(proto, 6)
message1.a = 1
message1.b = 1
message1.c = 1
- self.assertNotInitialized(proto)
+ self.assertNotInitialized(proto, 3)
message2.a = 2
message2.b = 2
message2.c = 2
@@ -1696,7 +1724,7 @@ class ReflectionTest(BaseTestCase):
proto = unittest_pb2.TestAllExtensions()
extension = unittest_pb2.TestRequired.single
proto.Extensions[extension].a = 1
- self.assertNotInitialized(proto)
+ self.assertNotInitialized(proto, 2)
proto.Extensions[extension].b = 2
proto.Extensions[extension].c = 3
self.assertInitialized(proto)
@@ -2155,6 +2183,8 @@ class ByteSizeTest(BaseTestCase):
foreign_message_1 = self.proto.repeated_nested_message.add()
foreign_message_1.bb = 9
self.assertEqual(2 + 1 + 2 + 1 + 1 + 1, self.Size())
+ repeated_nested_message = copy.deepcopy(
+ self.proto.repeated_nested_message)
# 2 bytes tag plus 1 byte length plus 1 byte bb tag 1 byte int.
del self.proto.repeated_nested_message[0]
@@ -2175,6 +2205,16 @@ class ByteSizeTest(BaseTestCase):
del self.proto.repeated_nested_message[0]
self.assertEqual(0, self.Size())
+ self.assertEqual(2, len(repeated_nested_message))
+ del repeated_nested_message[0:1]
+ # TODO(jieluo): Fix cpp extension bug when delete repeated message.
+ if api_implementation.Type() == 'python':
+ self.assertEqual(1, len(repeated_nested_message))
+ del repeated_nested_message[-1]
+ # TODO(jieluo): Fix cpp extension bug when delete repeated message.
+ if api_implementation.Type() == 'python':
+ self.assertEqual(0, len(repeated_nested_message))
+
def testRepeatedGroups(self):
# 2-byte START_GROUP plus 2-byte END_GROUP.
group_0 = self.proto.repeatedgroup.add()
@@ -2191,6 +2231,10 @@ class ByteSizeTest(BaseTestCase):
proto.Extensions[extension] = 23
# 1 byte for tag, 1 byte for value.
self.assertEqual(2, proto.ByteSize())
+ field = unittest_pb2.TestAllTypes.DESCRIPTOR.fields_by_name[
+ 'optional_int32']
+ with self.assertRaises(KeyError):
+ proto.Extensions[field] = 23
def testCacheInvalidationForNonrepeatedScalar(self):
# Test non-extension.
diff --git a/python/google/protobuf/internal/service_reflection_test.py b/python/google/protobuf/internal/service_reflection_test.py
index 62900b1d..77239f44 100755
--- a/python/google/protobuf/internal/service_reflection_test.py
+++ b/python/google/protobuf/internal/service_reflection_test.py
@@ -82,6 +82,10 @@ class FooUnitTest(unittest.TestCase):
service_descriptor = unittest_pb2.TestService.GetDescriptor()
srvc.CallMethod(service_descriptor.methods[1], rpc_controller,
unittest_pb2.BarRequest(), MyCallback)
+ self.assertTrue(srvc.GetRequestClass(service_descriptor.methods[1]) is
+ unittest_pb2.BarRequest)
+ self.assertTrue(srvc.GetResponseClass(service_descriptor.methods[1]) is
+ unittest_pb2.BarResponse)
self.assertEqual('Method Bar not implemented.',
rpc_controller.failure_message)
self.assertEqual(None, self.callback_response)
diff --git a/python/google/protobuf/internal/test_util.py b/python/google/protobuf/internal/test_util.py
index 9434b7b1..a6e34ef5 100755
--- a/python/google/protobuf/internal/test_util.py
+++ b/python/google/protobuf/internal/test_util.py
@@ -44,9 +44,9 @@ from google.protobuf import unittest_import_pb2
from google.protobuf import unittest_pb2
try:
- long # Python 2
+ long # Python 2
except NameError:
- long = int # Python 3
+ long = int # Python 3
# Tests whether the given TestAllTypes message is proto2 or not.
@@ -133,22 +133,37 @@ def SetAllNonLazyFields(message):
message.repeated_string_piece.append(u'224')
message.repeated_cord.append(u'225')
- # Add a second one of each field.
- message.repeated_int32.append(301)
- message.repeated_int64.append(302)
- message.repeated_uint32.append(303)
- message.repeated_uint64.append(304)
- message.repeated_sint32.append(305)
- message.repeated_sint64.append(306)
- message.repeated_fixed32.append(307)
- message.repeated_fixed64.append(308)
- message.repeated_sfixed32.append(309)
- message.repeated_sfixed64.append(310)
- message.repeated_float.append(311)
- message.repeated_double.append(312)
- message.repeated_bool.append(False)
- message.repeated_string.append(u'315')
- message.repeated_bytes.append(b'316')
+ # Add a second one of each field and set value by index.
+ message.repeated_int32.append(0)
+ message.repeated_int64.append(0)
+ message.repeated_uint32.append(0)
+ message.repeated_uint64.append(0)
+ message.repeated_sint32.append(0)
+ message.repeated_sint64.append(0)
+ message.repeated_fixed32.append(0)
+ message.repeated_fixed64.append(0)
+ message.repeated_sfixed32.append(0)
+ message.repeated_sfixed64.append(0)
+ message.repeated_float.append(0)
+ message.repeated_double.append(0)
+ message.repeated_bool.append(True)
+ message.repeated_string.append(u'0')
+ message.repeated_bytes.append(b'0')
+ message.repeated_int32[1] = 301
+ message.repeated_int64[1] = 302
+ message.repeated_uint32[1] = 303
+ message.repeated_uint64[1] = 304
+ message.repeated_sint32[1] = 305
+ message.repeated_sint64[1] = 306
+ message.repeated_fixed32[1] = 307
+ message.repeated_fixed64[1] = 308
+ message.repeated_sfixed32[1] = 309
+ message.repeated_sfixed64[1] = 310
+ message.repeated_float[1] = 311
+ message.repeated_double[1] = 312
+ message.repeated_bool[1] = False
+ message.repeated_string[1] = u'315'
+ message.repeated_bytes[1] = b'316'
if IsProto2(message):
message.repeatedgroup.add().a = 317
@@ -157,7 +172,8 @@ def SetAllNonLazyFields(message):
message.repeated_import_message.add().d = 320
message.repeated_lazy_message.add().bb = 327
- message.repeated_nested_enum.append(unittest_pb2.TestAllTypes.BAZ)
+ message.repeated_nested_enum.append(unittest_pb2.TestAllTypes.BAR)
+ message.repeated_nested_enum[1] = unittest_pb2.TestAllTypes.BAZ
message.repeated_foreign_enum.append(unittest_pb2.FOREIGN_BAZ)
if IsProto2(message):
message.repeated_import_enum.append(unittest_import_pb2.IMPORT_BAZ)
diff --git a/python/google/protobuf/internal/text_format_test.py b/python/google/protobuf/internal/text_format_test.py
index 424b29cc..1214c3ea 100755
--- a/python/google/protobuf/internal/text_format_test.py
+++ b/python/google/protobuf/internal/text_format_test.py
@@ -35,6 +35,7 @@
__author__ = 'kenton@google.com (Kenton Varda)'
+import math
import re
import six
import string
@@ -53,8 +54,8 @@ from google.protobuf import unittest_pb2
from google.protobuf import unittest_proto3_arena_pb2
from google.protobuf.internal import api_implementation
from google.protobuf.internal import any_test_pb2 as test_extend_any
-from google.protobuf.internal import test_util
from google.protobuf.internal import message_set_extensions_pb2
+from google.protobuf.internal import test_util
from google.protobuf import descriptor_pool
from google.protobuf import text_format
@@ -371,7 +372,10 @@ class TextFormatTest(TextFormatBase):
def testParseInvalidUtf8(self, message_module):
message = message_module.TestAllTypes()
text = 'repeated_string: "\\xc3\\xc3"'
- self.assertRaises(text_format.ParseError, text_format.Parse, text, message)
+ with self.assertRaises(text_format.ParseError) as e:
+ text_format.Parse(text, message)
+ self.assertEqual(e.exception.GetLine(), 1)
+ self.assertEqual(e.exception.GetColumn(), 28)
def testParseSingleWord(self, message_module):
message = message_module.TestAllTypes()
@@ -784,13 +788,14 @@ class Proto2Tests(TextFormatBase):
' bin: "\xe0"'
' [nested_unknown_ext]: {\n'
' i: 23\n'
+ ' x: x\n'
' test: "test_string"\n'
' floaty_float: -0.315\n'
' num: -inf\n'
' multiline_str: "abc"\n'
' "def"\n'
' "xyz."\n'
- ' [nested_unknown_ext]: <\n'
+ ' [nested_unknown_ext.ext]: <\n'
' i: 23\n'
' i: 24\n'
' pointfloat: .3\n'
@@ -896,6 +901,14 @@ class Proto2Tests(TextFormatBase):
self.assertEqual(23, message.message_set.Extensions[ext1].i)
self.assertEqual('foo', message.message_set.Extensions[ext2].str)
+ def testParseBadIdentifier(self):
+ message = unittest_pb2.TestAllTypes()
+ text = ('optional_nested_message { "bb": 1 }')
+ with self.assertRaises(text_format.ParseError) as e:
+ text_format.Parse(text, message)
+ self.assertEqual(str(e.exception),
+ '1:27 : Expected identifier or number, got "bb".')
+
def testParseBadExtension(self):
message = unittest_pb2.TestAllExtensions()
text = '[unknown_extension]: 8\n'
@@ -1095,6 +1108,19 @@ class Proto3Tests(unittest.TestCase):
' < data: "string" > '
'>')
+ def testUnknownEnums(self):
+ message = unittest_proto3_arena_pb2.TestAllTypes()
+ message2 = unittest_proto3_arena_pb2.TestAllTypes()
+ message.optional_nested_enum = 999
+ text_string = text_format.MessageToString(message)
+ # TODO(jieluo): proto3 should support numeric unknown enum.
+ with self.assertRaises(text_format.ParseError) as e:
+ text_format.Parse(text_string, message2)
+ self.assertEqual(999, message2.optional_nested_enum)
+ self.assertEqual(str(e.exception),
+ '1:23 : Enum type "proto3_arena_unittest.TestAllTypes.'
+ 'NestedEnum" has no value with number 999.')
+
def testMergeExpandedAny(self):
message = any_test_pb2.TestAny()
text = ('any_value {\n'
@@ -1180,6 +1206,15 @@ class Proto3Tests(unittest.TestCase):
message.any_value.Unpack(packed_message)
self.assertEqual('string', packed_message.data)
+ def testMergeMissingAnyEndToken(self):
+ message = any_test_pb2.TestAny()
+ text = ('any_value {\n'
+ ' [type.googleapis.com/protobuf_unittest.OneString] {\n'
+ ' data: "string"\n')
+ with self.assertRaises(text_format.ParseError) as e:
+ text_format.Merge(text, message)
+ self.assertEqual(str(e.exception), '3:11 : Expected "}".')
+
class TokenizerTest(unittest.TestCase):
@@ -1191,7 +1226,7 @@ class TokenizerTest(unittest.TestCase):
'ID9: 22 ID10: -111111111111111111 ID11: -22\n'
'ID12: 2222222222222222222 ID13: 1.23456f ID14: 1.2e+2f '
'false_bool: 0 true_BOOL:t \n true_bool1: 1 false_BOOL1:f '
- 'False_bool: False True_bool: True')
+ 'False_bool: False True_bool: True X:iNf Y:-inF Z:nAN')
tokenizer = text_format.Tokenizer(text.splitlines())
methods = [(tokenizer.ConsumeIdentifier, 'identifier1'), ':',
(tokenizer.ConsumeString, 'string1'),
@@ -1239,7 +1274,13 @@ class TokenizerTest(unittest.TestCase):
(tokenizer.ConsumeIdentifier, 'False_bool'), ':',
(tokenizer.ConsumeBool, False),
(tokenizer.ConsumeIdentifier, 'True_bool'), ':',
- (tokenizer.ConsumeBool, True)]
+ (tokenizer.ConsumeBool, True),
+ (tokenizer.ConsumeIdentifier, 'X'), ':',
+ (tokenizer.ConsumeFloat, float('inf')),
+ (tokenizer.ConsumeIdentifier, 'Y'), ':',
+ (tokenizer.ConsumeFloat, float('-inf')),
+ (tokenizer.ConsumeIdentifier, 'Z'), ':',
+ (tokenizer.ConsumeFloat, float('nan'))]
i = 0
while not tokenizer.AtEnd():
@@ -1248,6 +1289,8 @@ class TokenizerTest(unittest.TestCase):
token = tokenizer.token
self.assertEqual(token, m)
tokenizer.NextToken()
+ elif isinstance(m[1], float) and math.isnan(m[1]):
+ self.assertTrue(math.isnan(m[0]()))
else:
self.assertEqual(m[1], m[0]())
i += 1
@@ -1266,10 +1309,15 @@ class TokenizerTest(unittest.TestCase):
self.assertEqual(int64_max + 1, tokenizer.ConsumeInteger())
self.assertTrue(tokenizer.AtEnd())
- text = '-0 0'
+ text = '-0 0 0 1.2'
tokenizer = text_format.Tokenizer(text.splitlines())
self.assertEqual(0, tokenizer.ConsumeInteger())
self.assertEqual(0, tokenizer.ConsumeInteger())
+ self.assertEqual(True, tokenizer.TryConsumeInteger())
+ self.assertEqual(False, tokenizer.TryConsumeInteger())
+ with self.assertRaises(text_format.ParseError):
+ tokenizer.ConsumeInteger()
+ self.assertEqual(1.2, tokenizer.ConsumeFloat())
self.assertTrue(tokenizer.AtEnd())
def testConsumeIntegers(self):
diff --git a/python/google/protobuf/internal/unknown_fields_test.py b/python/google/protobuf/internal/unknown_fields_test.py
index d614eaa8..9bdb6f27 100755
--- a/python/google/protobuf/internal/unknown_fields_test.py
+++ b/python/google/protobuf/internal/unknown_fields_test.py
@@ -54,10 +54,13 @@ from google.protobuf.internal import type_checkers
BaseTestCase = testing_refleaks.BaseTestCase
-def SkipIfCppImplementation(func):
+# CheckUnknownField() cannot be used by the C++ implementation because
+# some protect members are called. It is not a behavior difference
+# for python and C++ implementation.
+def SkipCheckUnknownFieldIfCppImplementation(func):
return unittest.skipIf(
api_implementation.Type() == 'cpp' and api_implementation.Version() == 2,
- 'C++ implementation does not expose unknown fields to Python')(func)
+ 'Addtional test for pure python involved protect members')(func)
class UnknownFieldsTest(BaseTestCase):
@@ -77,11 +80,24 @@ class UnknownFieldsTest(BaseTestCase):
# stdout.
self.assertTrue(data == self.all_fields_data)
- def testSerializeProto3(self):
- # Verify that proto3 doesn't preserve unknown fields.
+ def expectSerializeProto3(self, preserve):
message = unittest_proto3_arena_pb2.TestEmptyMessage()
message.ParseFromString(self.all_fields_data)
- self.assertEqual(0, len(message.SerializeToString()))
+ if preserve:
+ self.assertEqual(self.all_fields_data, message.SerializeToString())
+ else:
+ self.assertEqual(0, len(message.SerializeToString()))
+
+ def testSerializeProto3(self):
+ # Verify that proto3 unknown fields behavior.
+ default_preserve = (api_implementation
+ .GetPythonProto3PreserveUnknownsDefault())
+ self.assertEqual(False, default_preserve)
+ self.expectSerializeProto3(default_preserve)
+ api_implementation.SetPythonProto3PreserveUnknownsDefault(
+ not default_preserve)
+ self.expectSerializeProto3(not default_preserve)
+ api_implementation.SetPythonProto3PreserveUnknownsDefault(default_preserve)
def testByteSize(self):
self.assertEqual(self.all_fields.ByteSize(), self.empty_message.ByteSize())
@@ -154,12 +170,13 @@ class UnknownFieldsAccessorsTest(BaseTestCase):
self.empty_message = unittest_pb2.TestEmptyMessage()
self.empty_message.ParseFromString(self.all_fields_data)
- # GetUnknownField() checks a detail of the Python implementation, which stores
- # unknown fields as serialized strings. It cannot be used by the C++
- # implementation: it's enough to check that the message is correctly
- # serialized.
+ # CheckUnknownField() is an additional Pure Python check which checks
+ # a detail of unknown fields. It cannot be used by the C++
+ # implementation because some protect members are called.
+ # The test is added for historical reasons. It is not necessary as
+ # serialized string is checked.
- def GetUnknownField(self, name):
+ def CheckUnknownField(self, name, expected_value):
field_descriptor = self.descriptor.fields_by_name[name]
wire_type = type_checkers.FIELD_TYPE_TO_WIRE_TYPE[field_descriptor.type]
field_tag = encoder.TagBytes(field_descriptor.number, wire_type)
@@ -168,42 +185,35 @@ class UnknownFieldsAccessorsTest(BaseTestCase):
if tag_bytes == field_tag:
decoder = unittest_pb2.TestAllTypes._decoders_by_tag[tag_bytes][0]
decoder(value, 0, len(value), self.all_fields, result_dict)
- return result_dict[field_descriptor]
-
- @SkipIfCppImplementation
- def testEnum(self):
- value = self.GetUnknownField('optional_nested_enum')
- self.assertEqual(self.all_fields.optional_nested_enum, value)
-
- @SkipIfCppImplementation
- def testRepeatedEnum(self):
- value = self.GetUnknownField('repeated_nested_enum')
- self.assertEqual(self.all_fields.repeated_nested_enum, value)
-
- @SkipIfCppImplementation
- def testVarint(self):
- value = self.GetUnknownField('optional_int32')
- self.assertEqual(self.all_fields.optional_int32, value)
-
- @SkipIfCppImplementation
- def testFixed32(self):
- value = self.GetUnknownField('optional_fixed32')
- self.assertEqual(self.all_fields.optional_fixed32, value)
-
- @SkipIfCppImplementation
- def testFixed64(self):
- value = self.GetUnknownField('optional_fixed64')
- self.assertEqual(self.all_fields.optional_fixed64, value)
-
- @SkipIfCppImplementation
- def testLengthDelimited(self):
- value = self.GetUnknownField('optional_string')
- self.assertEqual(self.all_fields.optional_string, value)
-
- @SkipIfCppImplementation
- def testGroup(self):
- value = self.GetUnknownField('optionalgroup')
- self.assertEqual(self.all_fields.optionalgroup, value)
+ self.assertEqual(expected_value, result_dict[field_descriptor])
+
+ @SkipCheckUnknownFieldIfCppImplementation
+ def testCheckUnknownFieldValue(self):
+ # Test enum.
+ self.CheckUnknownField('optional_nested_enum',
+ self.all_fields.optional_nested_enum)
+ # Test repeated enum.
+ self.CheckUnknownField('repeated_nested_enum',
+ self.all_fields.repeated_nested_enum)
+
+ # Test varint.
+ self.CheckUnknownField('optional_int32',
+ self.all_fields.optional_int32)
+ # Test fixed32.
+ self.CheckUnknownField('optional_fixed32',
+ self.all_fields.optional_fixed32)
+
+ # Test fixed64.
+ self.CheckUnknownField('optional_fixed64',
+ self.all_fields.optional_fixed64)
+
+ # Test lengthd elimited.
+ self.CheckUnknownField('optional_string',
+ self.all_fields.optional_string)
+
+ # Test group.
+ self.CheckUnknownField('optionalgroup',
+ self.all_fields.optionalgroup)
def testCopyFrom(self):
message = unittest_pb2.TestEmptyMessage()
@@ -263,12 +273,13 @@ class UnknownEnumValuesTest(BaseTestCase):
self.missing_message = missing_enum_values_pb2.TestMissingEnumValues()
self.missing_message.ParseFromString(self.message_data)
- # GetUnknownField() checks a detail of the Python implementation, which stores
- # unknown fields as serialized strings. It cannot be used by the C++
- # implementation: it's enough to check that the message is correctly
- # serialized.
+ # CheckUnknownField() is an additional Pure Python check which checks
+ # a detail of unknown fields. It cannot be used by the C++
+ # implementation because some protect members are called.
+ # The test is added for historical reasons. It is not necessary as
+ # serialized string is checked.
- def GetUnknownField(self, name):
+ def CheckUnknownField(self, name, expected_value):
field_descriptor = self.descriptor.fields_by_name[name]
wire_type = type_checkers.FIELD_TYPE_TO_WIRE_TYPE[field_descriptor.type]
field_tag = encoder.TagBytes(field_descriptor.number, wire_type)
@@ -278,7 +289,7 @@ class UnknownEnumValuesTest(BaseTestCase):
decoder = missing_enum_values_pb2.TestEnumValues._decoders_by_tag[
tag_bytes][0]
decoder(value, 0, len(value), self.message, result_dict)
- return result_dict[field_descriptor]
+ self.assertEqual(expected_value, result_dict[field_descriptor])
def testUnknownParseMismatchEnumValue(self):
just_string = missing_enum_values_pb2.JustString()
@@ -294,38 +305,27 @@ class UnknownEnumValuesTest(BaseTestCase):
self.assertEqual(missing.optional_nested_enum, 0)
def testUnknownEnumValue(self):
- if api_implementation.Type() == 'cpp':
- # The CPP implementation of protos (wrongly) allows unknown enum values
- # for proto2.
- self.assertTrue(self.missing_message.HasField('optional_nested_enum'))
- self.assertEqual(self.message.optional_nested_enum,
- self.missing_message.optional_nested_enum)
- else:
- # On the other hand, the Python implementation considers unknown values
- # as unknown fields. This is the correct behavior.
- self.assertFalse(self.missing_message.HasField('optional_nested_enum'))
- value = self.GetUnknownField('optional_nested_enum')
- self.assertEqual(self.message.optional_nested_enum, value)
- self.missing_message.ClearField('optional_nested_enum')
self.assertFalse(self.missing_message.HasField('optional_nested_enum'))
+ self.assertEqual(self.missing_message.optional_nested_enum, 2)
+ # Clear does not do anything.
+ serialized = self.missing_message.SerializeToString()
+ self.missing_message.ClearField('optional_nested_enum')
+ self.assertEqual(self.missing_message.SerializeToString(), serialized)
def testUnknownRepeatedEnumValue(self):
- if api_implementation.Type() == 'cpp':
- # For repeated enums, both implementations agree.
- self.assertEqual([], self.missing_message.repeated_nested_enum)
- else:
- self.assertEqual([], self.missing_message.repeated_nested_enum)
- value = self.GetUnknownField('repeated_nested_enum')
- self.assertEqual(self.message.repeated_nested_enum, value)
+ self.assertEqual([], self.missing_message.repeated_nested_enum)
def testUnknownPackedEnumValue(self):
- if api_implementation.Type() == 'cpp':
- # For repeated enums, both implementations agree.
- self.assertEqual([], self.missing_message.packed_nested_enum)
- else:
- self.assertEqual([], self.missing_message.packed_nested_enum)
- value = self.GetUnknownField('packed_nested_enum')
- self.assertEqual(self.message.packed_nested_enum, value)
+ self.assertEqual([], self.missing_message.packed_nested_enum)
+
+ @SkipCheckUnknownFieldIfCppImplementation
+ def testCheckUnknownFieldValueForEnum(self):
+ self.CheckUnknownField('optional_nested_enum',
+ self.message.optional_nested_enum)
+ self.CheckUnknownField('repeated_nested_enum',
+ self.message.repeated_nested_enum)
+ self.CheckUnknownField('packed_nested_enum',
+ self.message.packed_nested_enum)
def testRoundTrip(self):
new_message = missing_enum_values_pb2.TestEnumValues()
diff --git a/python/google/protobuf/internal/well_known_types.py b/python/google/protobuf/internal/well_known_types.py
index d0c7ffda..57b96998 100644
--- a/python/google/protobuf/internal/well_known_types.py
+++ b/python/google/protobuf/internal/well_known_types.py
@@ -473,7 +473,7 @@ def _IsValidPath(message_descriptor, path):
parts = path.split('.')
last = parts.pop()
for name in parts:
- field = message_descriptor.fields_by_name[name]
+ field = message_descriptor.fields_by_name.get(name)
if (field is None or
field.label == FieldDescriptor.LABEL_REPEATED or
field.type != FieldDescriptor.TYPE_MESSAGE):
@@ -698,6 +698,12 @@ def _SetStructValue(struct_value, value):
struct_value.string_value = value
elif isinstance(value, _INT_OR_FLOAT):
struct_value.number_value = value
+ elif isinstance(value, dict):
+ struct_value.struct_value.Clear()
+ struct_value.struct_value.update(value)
+ elif isinstance(value, list):
+ struct_value.list_value.Clear()
+ struct_value.list_value.extend(value)
else:
raise ValueError('Unexpected type')
@@ -733,13 +739,21 @@ class Struct(object):
def get_or_create_list(self, key):
"""Returns a list for this key, creating if it didn't exist already."""
+ if not self.fields[key].HasField('list_value'):
+ # Clear will mark list_value modified which will indeed create a list.
+ self.fields[key].list_value.Clear()
return self.fields[key].list_value
def get_or_create_struct(self, key):
"""Returns a struct for this key, creating if it didn't exist already."""
+ if not self.fields[key].HasField('struct_value'):
+ # Clear will mark struct_value modified which will indeed create a struct.
+ self.fields[key].struct_value.Clear()
return self.fields[key].struct_value
- # TODO(haberman): allow constructing/merging from dict.
+ def update(self, dictionary): # pylint: disable=invalid-name
+ for key, value in dictionary.items():
+ _SetStructValue(self.fields[key], value)
class ListValue(object):
@@ -768,11 +782,17 @@ class ListValue(object):
def add_struct(self):
"""Appends and returns a struct value as the next value in the list."""
- return self.values.add().struct_value
+ struct_value = self.values.add().struct_value
+ # Clear will mark struct_value modified which will indeed create a struct.
+ struct_value.Clear()
+ return struct_value
def add_list(self):
"""Appends and returns a list value as the next value in the list."""
- return self.values.add().list_value
+ list_value = self.values.add().list_value
+ # Clear will mark list_value modified which will indeed create a list.
+ list_value.Clear()
+ return list_value
WKTBASES = {
diff --git a/python/google/protobuf/internal/well_known_types_test.py b/python/google/protobuf/internal/well_known_types_test.py
index 123a537c..70975da1 100644
--- a/python/google/protobuf/internal/well_known_types_test.py
+++ b/python/google/protobuf/internal/well_known_types_test.py
@@ -105,6 +105,10 @@ class TimeUtilTest(TimeUtilTestBase):
self.assertEqual(8 * 3600, message.seconds)
self.assertEqual(0, message.nanos)
+ # It is not easy to check with current time. For test coverage only.
+ message.GetCurrentTime()
+ self.assertNotEqual(8 * 3600, message.seconds)
+
def testDurationSerializeAndParse(self):
message = duration_pb2.Duration()
# Generated output should contain 3, 6, or 9 fractional digits.
@@ -268,6 +272,17 @@ class TimeUtilTest(TimeUtilTestBase):
def testInvalidTimestamp(self):
message = timestamp_pb2.Timestamp()
self.assertRaisesRegexp(
+ well_known_types.ParseError,
+ 'Failed to parse timestamp: missing valid timezone offset.',
+ message.FromJsonString,
+ '')
+ self.assertRaisesRegexp(
+ well_known_types.ParseError,
+ 'Failed to parse timestamp: invalid trailing data '
+ '1970-01-01T00:00:01Ztrail.',
+ message.FromJsonString,
+ '1970-01-01T00:00:01Ztrail')
+ self.assertRaisesRegexp(
ValueError,
'time data \'10000-01-01T00:00:00\' does not match'
' format \'%Y-%m-%dT%H:%M:%S\'',
@@ -322,6 +337,13 @@ class TimeUtilTest(TimeUtilTestBase):
r'Duration is not valid\: Seconds -315576000001 must be in range'
r' \[-315576000000\, 315576000000\].',
message.ToJsonString)
+ message.seconds = 0
+ message.nanos = 999999999 + 1
+ self.assertRaisesRegexp(
+ well_known_types.Error,
+ r'Duration is not valid\: Nanos 1000000000 must be in range'
+ r' \[-999999999\, 999999999\].',
+ message.ToJsonString)
class FieldMaskTest(unittest.TestCase):
@@ -363,10 +385,37 @@ class FieldMaskTest(unittest.TestCase):
self.assertTrue(mask.IsValidForDescriptor(msg_descriptor))
for field in msg_descriptor.fields:
self.assertTrue(field.name in mask.paths)
+
+ def testIsValidForDescriptor(self):
+ msg_descriptor = unittest_pb2.TestAllTypes.DESCRIPTOR
+ # Empty mask
+ mask = field_mask_pb2.FieldMask()
+ self.assertTrue(mask.IsValidForDescriptor(msg_descriptor))
+ # All fields from descriptor
+ mask.AllFieldsFromDescriptor(msg_descriptor)
+ self.assertTrue(mask.IsValidForDescriptor(msg_descriptor))
+ # Child under optional message
mask.paths.append('optional_nested_message.bb')
self.assertTrue(mask.IsValidForDescriptor(msg_descriptor))
+ # Repeated field is only allowed in the last position of path
mask.paths.append('repeated_nested_message.bb')
self.assertFalse(mask.IsValidForDescriptor(msg_descriptor))
+ # Invalid top level field
+ mask = field_mask_pb2.FieldMask()
+ mask.paths.append('xxx')
+ self.assertFalse(mask.IsValidForDescriptor(msg_descriptor))
+ # Invalid field in root
+ mask = field_mask_pb2.FieldMask()
+ mask.paths.append('xxx.zzz')
+ self.assertFalse(mask.IsValidForDescriptor(msg_descriptor))
+ # Invalid field in internal node
+ mask = field_mask_pb2.FieldMask()
+ mask.paths.append('optional_nested_message.xxx.zzz')
+ self.assertFalse(mask.IsValidForDescriptor(msg_descriptor))
+ # Invalid field in leaf
+ mask = field_mask_pb2.FieldMask()
+ mask.paths.append('optional_nested_message.xxx')
+ self.assertFalse(mask.IsValidForDescriptor(msg_descriptor))
def testCanonicalFrom(self):
mask = field_mask_pb2.FieldMask()
@@ -422,6 +471,9 @@ class FieldMaskTest(unittest.TestCase):
mask2.FromJsonString('foo.bar,bar')
out_mask.Union(mask1, mask2)
self.assertEqual('bar,foo.bar,quz', out_mask.ToJsonString())
+ src = unittest_pb2.TestAllTypes()
+ with self.assertRaises(ValueError):
+ out_mask.Union(src, mask2)
def testIntersect(self):
mask1 = field_mask_pb2.FieldMask()
@@ -546,6 +598,19 @@ class FieldMaskTest(unittest.TestCase):
self.assertEqual(1, len(nested_dst.payload.repeated_int32))
self.assertEqual(1234, nested_dst.payload.repeated_int32[0])
+ def testMergeErrors(self):
+ src = unittest_pb2.TestAllTypes()
+ dst = unittest_pb2.TestAllTypes()
+ mask = field_mask_pb2.FieldMask()
+ test_util.SetAllFields(src)
+ mask.FromJsonString('optionalInt32.field')
+ with self.assertRaises(ValueError) as e:
+ mask.MergeMessage(src, dst)
+ self.assertEqual('Error: Field optional_int32 in message '
+ 'protobuf_unittest.TestAllTypes is not a singular '
+ 'message field and cannot have sub-fields.',
+ str(e.exception))
+
def testSnakeCaseToCamelCase(self):
self.assertEqual('fooBar',
well_known_types._SnakeCaseToCamelCase('foo_bar'))
@@ -611,6 +676,8 @@ class StructTest(unittest.TestCase):
struct_list = struct.get_or_create_list('key5')
struct_list.extend([6, 'seven', True, False, None])
struct_list.add_struct()['subkey2'] = 9
+ struct['key6'] = {'subkey': {}}
+ struct['key7'] = [2, False]
self.assertTrue(isinstance(struct, well_known_types.Struct))
self.assertEqual(5, struct['key1'])
@@ -621,9 +688,10 @@ class StructTest(unittest.TestCase):
inner_struct['subkey2'] = 9
self.assertEqual([6, 'seven', True, False, None, inner_struct],
list(struct['key5'].items()))
+ self.assertEqual({}, dict(struct['key6']['subkey'].fields))
+ self.assertEqual([2, False], list(struct['key7'].items()))
serialized = struct.SerializeToString()
-
struct2 = struct_pb2.Struct()
struct2.ParseFromString(serialized)
@@ -651,6 +719,17 @@ class StructTest(unittest.TestCase):
struct_list.add_list().extend([1, 'two', True, False, None])
self.assertEqual([1, 'two', True, False, None],
list(struct_list[6].items()))
+ struct_list.extend([{'nested_struct': 30}, ['nested_list', 99], {}, []])
+ self.assertEqual(11, len(struct_list.values))
+ self.assertEqual(30, struct_list[7]['nested_struct'])
+ self.assertEqual('nested_list', struct_list[8][0])
+ self.assertEqual(99, struct_list[8][1])
+ self.assertEqual({}, dict(struct_list[9].fields))
+ self.assertEqual([], list(struct_list[10].items()))
+ struct_list[0] = {'replace': 'set'}
+ struct_list[1] = ['replace', 'set']
+ self.assertEqual('set', struct_list[0]['replace'])
+ self.assertEqual(['replace', 'set'], list(struct_list[1].items()))
text_serialized = str(struct)
struct3 = struct_pb2.Struct()
@@ -660,6 +739,67 @@ class StructTest(unittest.TestCase):
struct.get_or_create_struct('key3')['replace'] = 12
self.assertEqual(12, struct['key3']['replace'])
+ # Tests empty list.
+ struct.get_or_create_list('empty_list')
+ empty_list = struct['empty_list']
+ self.assertEqual([], list(empty_list.items()))
+ list2 = struct_pb2.ListValue()
+ list2.add_list()
+ empty_list = list2[0]
+ self.assertEqual([], list(empty_list.items()))
+
+ # Tests empty struct.
+ struct.get_or_create_struct('empty_struct')
+ empty_struct = struct['empty_struct']
+ self.assertEqual({}, dict(empty_struct.fields))
+ list2.add_struct()
+ empty_struct = list2[1]
+ self.assertEqual({}, dict(empty_struct.fields))
+
+ def testMergeFrom(self):
+ struct = struct_pb2.Struct()
+ struct_class = struct.__class__
+
+ dictionary = {
+ 'key1': 5,
+ 'key2': 'abc',
+ 'key3': True,
+ 'key4': {'subkey': 11.0},
+ 'key5': [6, 'seven', True, False, None, {'subkey2': 9}],
+ 'key6': [['nested_list', True]],
+ 'empty_struct': {},
+ 'empty_list': []
+ }
+ struct.update(dictionary)
+ self.assertEqual(5, struct['key1'])
+ self.assertEqual('abc', struct['key2'])
+ self.assertIs(True, struct['key3'])
+ self.assertEqual(11, struct['key4']['subkey'])
+ inner_struct = struct_class()
+ inner_struct['subkey2'] = 9
+ self.assertEqual([6, 'seven', True, False, None, inner_struct],
+ list(struct['key5'].items()))
+ self.assertEqual(2, len(struct['key6'][0].values))
+ self.assertEqual('nested_list', struct['key6'][0][0])
+ self.assertEqual(True, struct['key6'][0][1])
+ empty_list = struct['empty_list']
+ self.assertEqual([], list(empty_list.items()))
+ empty_struct = struct['empty_struct']
+ self.assertEqual({}, dict(empty_struct.fields))
+
+ # According to documentation: "When parsing from the wire or when merging,
+ # if there are duplicate map keys the last key seen is used".
+ duplicate = {
+ 'key4': {'replace': 20},
+ 'key5': [[False, 5]]
+ }
+ struct.update(duplicate)
+ self.assertEqual(1, len(struct['key4'].fields))
+ self.assertEqual(20, struct['key4']['replace'])
+ self.assertEqual(1, len(struct['key5'].values))
+ self.assertEqual(False, struct['key5'][0][0])
+ self.assertEqual(5, struct['key5'][0][1])
+
class AnyTest(unittest.TestCase):
diff --git a/python/google/protobuf/pyext/map_container.cc b/python/google/protobuf/pyext/map_container.cc
index 43be0701..abd15b77 100644
--- a/python/google/protobuf/pyext/map_container.cc
+++ b/python/google/protobuf/pyext/map_container.cc
@@ -720,14 +720,17 @@ int MapReflectionFriend::MessageMapSetItem(PyObject* _self, PyObject* key,
map_key, &value);
ScopedPyObjectPtr key(PyLong_FromVoidPtr(value.MutableMessageValue()));
- // PyDict_DelItem will have key error if the key is not in the map. We do
- // not want to call PyErr_Clear() which may clear other errors. Thus
- // PyDict_Contains() check is called before delete.
- int contains = PyDict_Contains(self->message_dict, key.get());
- if (contains < 0) {
- return -1;
- }
- if (contains) {
+ PyObject* cmsg_value = PyDict_GetItem(self->message_dict, key.get());
+ if (cmsg_value) {
+ // Need to keep CMessage stay alive if it is still referenced after
+ // deletion. Makes a new message and swaps values into CMessage
+ // instead of just removing.
+ CMessage* cmsg = reinterpret_cast<CMessage*>(cmsg_value);
+ Message* msg = cmsg->message;
+ cmsg->owner.reset(msg->New());
+ cmsg->message = cmsg->owner.get();
+ cmsg->parent = NULL;
+ msg->GetReflection()->Swap(msg, cmsg->message);
if (PyDict_DelItem(self->message_dict, key.get()) < 0) {
return -1;
}
diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc
index 43482c54..0f54506b 100644
--- a/python/google/protobuf/pyext/message.cc
+++ b/python/google/protobuf/pyext/message.cc
@@ -605,19 +605,21 @@ void OutOfRangeError(PyObject* arg) {
template<class RangeType, class ValueType>
bool VerifyIntegerCastAndRange(PyObject* arg, ValueType value) {
- if GOOGLE_PREDICT_FALSE(value == -1 && PyErr_Occurred()) {
- if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
- // Replace it with the same ValueError as pure python protos instead of
- // the default one.
- PyErr_Clear();
+ if
+ GOOGLE_PREDICT_FALSE(value == -1 && PyErr_Occurred()) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ // Replace it with the same ValueError as pure python protos instead of
+ // the default one.
+ PyErr_Clear();
+ OutOfRangeError(arg);
+ } // Otherwise propagate existing error.
+ return false;
+ }
+ if
+ GOOGLE_PREDICT_FALSE(!IsValidNumericCast<RangeType>(value)) {
OutOfRangeError(arg);
- } // Otherwise propagate existing error.
- return false;
- }
- if GOOGLE_PREDICT_FALSE(!IsValidNumericCast<RangeType>(value)) {
- OutOfRangeError(arg);
- return false;
- }
+ return false;
+ }
return true;
}
@@ -626,25 +628,29 @@ bool CheckAndGetInteger(PyObject* arg, T* value) {
// The fast path.
#if PY_MAJOR_VERSION < 3
// For the typical case, offer a fast path.
- if GOOGLE_PREDICT_TRUE(PyInt_Check(arg)) {
- long int_result = PyInt_AsLong(arg);
- if GOOGLE_PREDICT_TRUE(IsValidNumericCast<T>(int_result)) {
- *value = static_cast<T>(int_result);
- return true;
- } else {
- OutOfRangeError(arg);
- return false;
+ if
+ GOOGLE_PREDICT_TRUE(PyInt_Check(arg)) {
+ long int_result = PyInt_AsLong(arg);
+ if
+ GOOGLE_PREDICT_TRUE(IsValidNumericCast<T>(int_result)) {
+ *value = static_cast<T>(int_result);
+ return true;
+ }
+ else {
+ OutOfRangeError(arg);
+ return false;
+ }
}
- }
#endif
// This effectively defines an integer as "an object that can be cast as
// an integer and can be used as an ordinal number".
// This definition includes everything that implements numbers.Integral
// and shouldn't cast the net too wide.
- if GOOGLE_PREDICT_FALSE(!PyIndex_Check(arg)) {
- FormatTypeError(arg, "int, long");
- return false;
- }
+ if
+ GOOGLE_PREDICT_FALSE(!PyIndex_Check(arg)) {
+ FormatTypeError(arg, "int, long");
+ return false;
+ }
// Now we have an integral number so we can safely use PyLong_ functions.
// We need to treat the signed and unsigned cases differently in case arg is
@@ -658,10 +664,11 @@ bool CheckAndGetInteger(PyObject* arg, T* value) {
// Unlike PyLong_AsLongLong, PyLong_AsUnsignedLongLong is very
// picky about the exact type.
PyObject* casted = PyNumber_Long(arg);
- if GOOGLE_PREDICT_FALSE(casted == NULL) {
- // Propagate existing error.
- return false;
- }
+ if
+ GOOGLE_PREDICT_FALSE(casted == NULL) {
+ // Propagate existing error.
+ return false;
+ }
ulong_result = PyLong_AsUnsignedLongLong(casted);
Py_DECREF(casted);
}
@@ -683,10 +690,11 @@ bool CheckAndGetInteger(PyObject* arg, T* value) {
// Valid subclasses of numbers.Integral should have a __long__() method
// so fall back to that.
PyObject* casted = PyNumber_Long(arg);
- if GOOGLE_PREDICT_FALSE(casted == NULL) {
- // Propagate existing error.
- return false;
- }
+ if
+ GOOGLE_PREDICT_FALSE(casted == NULL) {
+ // Propagate existing error.
+ return false;
+ }
long_result = PyLong_AsLongLong(casted);
Py_DECREF(casted);
}
@@ -709,10 +717,11 @@ template bool CheckAndGetInteger<uint64>(PyObject*, uint64*);
bool CheckAndGetDouble(PyObject* arg, double* value) {
*value = PyFloat_AsDouble(arg);
- if GOOGLE_PREDICT_FALSE(*value == -1 && PyErr_Occurred()) {
- FormatTypeError(arg, "int, long, float");
- return false;
- }
+ if
+ GOOGLE_PREDICT_FALSE(*value == -1 && PyErr_Occurred()) {
+ FormatTypeError(arg, "int, long, float");
+ return false;
+ }
return true;
}
@@ -1553,20 +1562,7 @@ PyObject* HasField(CMessage* self, PyObject* arg) {
if (message->GetReflection()->HasField(*message, field_descriptor)) {
Py_RETURN_TRUE;
}
- if (!message->GetReflection()->SupportsUnknownEnumValues() &&
- field_descriptor->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) {
- // Special case: Python HasField() differs in semantics from C++
- // slightly: we return HasField('enum_field') == true if there is
- // an unknown enum value present. To implement this we have to
- // look in the UnknownFieldSet.
- const UnknownFieldSet& unknown_field_set =
- message->GetReflection()->GetUnknownFields(*message);
- for (int i = 0; i < unknown_field_set.field_count(); ++i) {
- if (unknown_field_set.field(i).number() == field_descriptor->number()) {
- Py_RETURN_TRUE;
- }
- }
- }
+
Py_RETURN_FALSE;
}
@@ -1745,12 +1741,6 @@ PyObject* ClearFieldByDescriptor(
AssureWritable(self);
Message* message = self->message;
message->GetReflection()->ClearField(message, field_descriptor);
- if (field_descriptor->cpp_type() == FieldDescriptor::CPPTYPE_ENUM &&
- !message->GetReflection()->SupportsUnknownEnumValues()) {
- UnknownFieldSet* unknown_field_set =
- message->GetReflection()->MutableUnknownFields(message);
- unknown_field_set->DeleteByNumber(field_descriptor->number());
- }
Py_RETURN_NONE;
}
@@ -2345,27 +2335,9 @@ PyObject* InternalGetScalar(const Message* message,
break;
}
case FieldDescriptor::CPPTYPE_ENUM: {
- if (!message->GetReflection()->SupportsUnknownEnumValues() &&
- !message->GetReflection()->HasField(*message, field_descriptor)) {
- // Look for the value in the unknown fields.
- const UnknownFieldSet& unknown_field_set =
- message->GetReflection()->GetUnknownFields(*message);
- for (int i = 0; i < unknown_field_set.field_count(); ++i) {
- if (unknown_field_set.field(i).number() ==
- field_descriptor->number() &&
- unknown_field_set.field(i).type() ==
- google::protobuf::UnknownField::TYPE_VARINT) {
- result = PyInt_FromLong(unknown_field_set.field(i).varint());
- break;
- }
- }
- }
-
- if (result == NULL) {
- const EnumValueDescriptor* enum_value =
- message->GetReflection()->GetEnum(*message, field_descriptor);
- result = PyInt_FromLong(enum_value->number());
- }
+ const EnumValueDescriptor* enum_value =
+ message->GetReflection()->GetEnum(*message, field_descriptor);
+ result = PyInt_FromLong(enum_value->number());
break;
}
default:
@@ -3087,5 +3059,4 @@ bool InitProto2MessageModule(PyObject *m) {
} // namespace python
} // namespace protobuf
-
} // namespace google
diff --git a/python/google/protobuf/pyext/message_module.cc b/python/google/protobuf/pyext/message_module.cc
index d90d9de3..7c4df47f 100644
--- a/python/google/protobuf/pyext/message_module.cc
+++ b/python/google/protobuf/pyext/message_module.cc
@@ -28,8 +28,33 @@
// (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 <Python.h>
+
#include <google/protobuf/pyext/message.h>
+#include <google/protobuf/message_lite.h>
+
+static PyObject* GetPythonProto3PreserveUnknownsDefault(
+ PyObject* /*m*/, PyObject* /*args*/) {
+ if (google::protobuf::internal::GetProto3PreserveUnknownsDefault()) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+}
+
+static PyObject* SetPythonProto3PreserveUnknownsDefault(
+ PyObject* /*m*/, PyObject* arg) {
+ if (!arg || !PyBool_Check(arg)) {
+ PyErr_SetString(
+ PyExc_TypeError,
+ "Argument to SetPythonProto3PreserveUnknownsDefault must be boolean");
+ return NULL;
+ }
+ google::protobuf::internal::SetProto3PreserveUnknownsDefault(PyObject_IsTrue(arg));
+ Py_RETURN_NONE;
+}
+
static const char module_docstring[] =
"python-proto2 is a module that can be used to enhance proto2 Python API\n"
"performance.\n"
@@ -41,6 +66,14 @@ static PyMethodDef ModuleMethods[] = {
{"SetAllowOversizeProtos",
(PyCFunction)google::protobuf::python::cmessage::SetAllowOversizeProtos,
METH_O, "Enable/disable oversize proto parsing."},
+ // DO NOT USE: For migration and testing only.
+ {"GetPythonProto3PreserveUnknownsDefault",
+ (PyCFunction)GetPythonProto3PreserveUnknownsDefault,
+ METH_NOARGS, "Get Proto3 preserve unknowns default."},
+ // DO NOT USE: For migration and testing only.
+ {"SetPythonProto3PreserveUnknownsDefault",
+ (PyCFunction)SetPythonProto3PreserveUnknownsDefault,
+ METH_O, "Enable/disable proto3 unknowns preservation."},
{ NULL, NULL}
};
diff --git a/python/google/protobuf/pyext/python.proto b/python/google/protobuf/pyext/python.proto
index cce645d7..2e50df74 100644
--- a/python/google/protobuf/pyext/python.proto
+++ b/python/google/protobuf/pyext/python.proto
@@ -58,11 +58,11 @@ message ForeignMessage {
repeated int32 d = 2;
}
-message TestAllExtensions {
+message TestAllExtensions { // extension begin
extensions 1 to max;
-}
+} // extension end
-extend TestAllExtensions {
+extend TestAllExtensions { // extension begin
optional TestAllTypes.NestedMessage optional_nested_message_extension = 1;
repeated TestAllTypes.NestedMessage repeated_nested_message_extension = 2;
-}
+} // extension end
diff --git a/python/google/protobuf/pyext/repeated_scalar_container.cc b/python/google/protobuf/pyext/repeated_scalar_container.cc
index 54998800..5a7832cd 100644
--- a/python/google/protobuf/pyext/repeated_scalar_container.cc
+++ b/python/google/protobuf/pyext/repeated_scalar_container.cc
@@ -261,22 +261,6 @@ static PyObject* Item(RepeatedScalarContainer* self, Py_ssize_t index) {
result = ToStringObject(field_descriptor, value);
break;
}
- case FieldDescriptor::CPPTYPE_MESSAGE: {
- PyObject* py_cmsg = PyObject_CallObject(reinterpret_cast<PyObject*>(
- &CMessage_Type), NULL);
- if (py_cmsg == NULL) {
- return NULL;
- }
- CMessage* cmsg = reinterpret_cast<CMessage*>(py_cmsg);
- const Message& msg = reflection->GetRepeatedMessage(
- *message, field_descriptor, index);
- cmsg->owner = self->owner;
- cmsg->parent = self->parent;
- cmsg->message = const_cast<Message*>(&msg);
- cmsg->read_only = false;
- result = reinterpret_cast<PyObject*>(py_cmsg);
- break;
- }
default:
PyErr_Format(
PyExc_SystemError,
diff --git a/python/setup.py b/python/setup.py
index 70b7de5c..efb74fe7 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -78,6 +78,7 @@ def generate_proto(source, require = True):
def GenerateUnittestProtos():
generate_proto("../src/google/protobuf/any_test.proto", False)
+ generate_proto("../src/google/protobuf/map_proto2_unittest.proto", False)
generate_proto("../src/google/protobuf/map_unittest.proto", False)
generate_proto("../src/google/protobuf/test_messages_proto3.proto", False)
generate_proto("../src/google/protobuf/test_messages_proto2.proto", False)
diff --git a/src/Makefile.am b/src/Makefile.am
index 1999213c..2bc65664 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -356,7 +356,10 @@ libprotoc_la_SOURCES = \
google/protobuf/compiler/cpp/cpp_message.h \
google/protobuf/compiler/cpp/cpp_message_field.cc \
google/protobuf/compiler/cpp/cpp_message_field.h \
+ google/protobuf/compiler/cpp/cpp_message_layout_helper.h \
google/protobuf/compiler/cpp/cpp_options.h \
+ google/protobuf/compiler/cpp/cpp_padding_optimizer.cc \
+ google/protobuf/compiler/cpp/cpp_padding_optimizer.h \
google/protobuf/compiler/cpp/cpp_primitive_field.cc \
google/protobuf/compiler/cpp/cpp_primitive_field.h \
google/protobuf/compiler/cpp/cpp_service.cc \
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 <google/protobuf/any.pb.h>
#include <algorithm>
@@ -16,57 +15,52 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
class AnyDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Any>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Any>
+ _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<const ::google::protobuf::Message*>(&_Any_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::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<const char*>(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<const char*>(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 <google/protobuf/unknown_field_set.h>
#include <google/protobuf/any.h>
// @@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<const Any*>(
&_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 <google/protobuf/api.pb.h>
#include <algorithm>
@@ -16,97 +15,129 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
class ApiDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Api>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Api>
+ _instance;
} _Api_default_instance_;
class MethodDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Method>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Method>
+ _instance;
} _Method_default_instance_;
class MixinDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Mixin>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Mixin>
+ _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<const ::google::protobuf::Message*>(&_Api_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_Method_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_Mixin_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Api_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Method_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::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<const char*>(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<const char*>(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<const ::google::protobuf::SourceContext*>(
- &::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<const char*>(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<const char*>(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<const char*>(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<const char*>(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<const char*>(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 <google/protobuf/source_context.pb.h>
#include <google/protobuf/type.pb.h>
// @@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<const Api*>(
&_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<const Method*>(
&_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<const Mixin*>(
&_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 <sanitizer/asan_interface.h>
#endif // ADDRESS_SANITIZER
+#include <google/protobuf/stubs/port.h>
+
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 <google/protobuf/arena_impl.h>
+#include <google/protobuf/stubs/port.h>
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 <typename T> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+#if LANG_CXX11
+ template <typename T, typename... Args>
+ GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateMessage(
+ ::google::protobuf::Arena* arena, Args&&... args) {
+ static_assert(
+ InternalHelper<T>::is_arena_constructable::value,
+ "CreateMessage can only construct types that are ArenaConstructable");
+ if (arena == NULL) {
+ return new T(NULL, std::forward<Args>(args)...);
+ } else {
+ return arena->CreateMessageInternal<T>(std::forward<Args>(args)...);
+ }
+ }
+#endif
+ template <typename T> 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 <typename T, typename Arg> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename T, typename Arg> 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 <typename T, typename Arg1, typename Arg2> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename T, typename Arg1, typename Arg2>
+ 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 <typename T, typename... Args> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename T, typename... Args>
+ GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
static T* Create(::google::protobuf::Arena* arena, Args&&... args) {
if (arena == NULL) {
return new T(std::forward<Args>(args)...);
@@ -337,7 +347,7 @@ class LIBPROTOBUF_EXPORT Arena {
}
}
#endif
- template <typename T> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename T> 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 <typename T, typename Arg> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename T, typename Arg> 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 <typename T, typename Arg1, typename Arg2> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename T, typename Arg1, typename Arg2>
+ 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 <typename T, typename Arg1, typename Arg2, typename Arg3>
- 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 <typename T, typename Arg1, typename Arg2, typename Arg3,
typename Arg4>
- 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 <typename T, typename Arg1, typename Arg2, typename Arg3,
typename Arg4, typename Arg5>
- 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 <typename T, typename Arg1, typename Arg2, typename Arg3,
typename Arg4, typename Arg5, typename Arg6>
- 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 <typename T, typename Arg1, typename Arg2, typename Arg3,
typename Arg4, typename Arg5, typename Arg6, typename Arg7>
- 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 <typename T, typename Arg1, typename Arg2, typename Arg3,
typename Arg4, typename Arg5, typename Arg6, typename Arg7,
typename Arg8>
- 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 <typename T> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
static T* CreateArray(::google::protobuf::Arena* arena, size_t num_elements) {
GOOGLE_CHECK_LE(num_elements,
std::numeric_limits<size_t>::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 <typename T> GOOGLE_ATTRIBUTE_NOINLINE
+ template <typename T> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
void Own(T* object) {
OwnInternal(object, google::protobuf::internal::is_convertible<T*, ::google::protobuf::Message*>());
}
@@ -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 <typename T> GOOGLE_ATTRIBUTE_NOINLINE
+ template <typename T> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
void OwnDestructor(T* object) {
if (object != NULL) {
impl_.AddCleanup(object, &internal::arena_destruct_object<T>);
@@ -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<typename T> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template<typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
static ::google::protobuf::Arena* GetArena(const T* value) {
return GetArenaInternal(value, is_arena_constructable<T>());
}
@@ -612,6 +630,7 @@ class LIBPROTOBUF_EXPORT Arena {
struct is_arena_constructable : InternalHelper<T>::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<typename T> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template<typename T> 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 <typename Msg>
- GOOGLE_ATTRIBUTE_ALWAYS_INLINE static Msg* CreateMaybeMessage(Arena* arena,
- google::protobuf::internal::true_type) {
+ template <typename Msg> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
+ static Msg* CreateMaybeMessage(Arena* arena, google::protobuf::internal::true_type) {
return CreateMessage<Msg>(arena);
}
- template <typename T>
- GOOGLE_ATTRIBUTE_ALWAYS_INLINE static T* CreateMaybeMessage(Arena* arena,
- google::protobuf::internal::false_type) {
+ template <typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
+ static T* CreateMaybeMessage(Arena* arena, google::protobuf::internal::false_type) {
return Create<T>(arena);
}
- template <typename T>
- GOOGLE_ATTRIBUTE_ALWAYS_INLINE static T* CreateMaybeMessage(Arena* arena) {
+ template <typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
+ static T* CreateMaybeMessage(Arena* arena) {
return CreateMaybeMessage<T>(arena, is_arena_constructable<T>());
}
// Just allocate the required size for the given type assuming the
// type has a trivial constructor.
- template<typename T> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template<typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
T* CreateInternalRawArray(size_t num_elements) {
GOOGLE_CHECK_LE(num_elements,
std::numeric_limits<size_t>::max() / sizeof(T))
@@ -671,84 +688,91 @@ class LIBPROTOBUF_EXPORT Arena {
}
#if LANG_CXX11
- template <typename T, typename... Args> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename T, typename... Args>
+ GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
T* CreateInternal(bool skip_explicit_ownership, Args&&... args) {
return new (AllocateInternal<T>(skip_explicit_ownership))
T(std::forward<Args>(args)...);
}
#else
- template <typename T> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
T* CreateInternal(bool skip_explicit_ownership) {
return new (AllocateInternal<T>(skip_explicit_ownership)) T();
}
- template <typename T, typename Arg> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename T, typename Arg> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
T* CreateInternal(bool skip_explicit_ownership, const Arg& arg) {
return new (AllocateInternal<T>(skip_explicit_ownership)) T(arg);
}
template <typename T, typename Arg1, typename Arg2>
- 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<T>(skip_explicit_ownership)) T(arg1, arg2);
}
template <typename T, typename Arg1, typename Arg2, typename Arg3>
- 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<T>(skip_explicit_ownership))
T(arg1, arg2, arg3);
}
template <typename T, typename Arg1, typename Arg2, typename Arg3,
typename Arg4>
- 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<T>(skip_explicit_ownership))
T(arg1, arg2, arg3, arg4);
}
template <typename T, typename Arg1, typename Arg2, typename Arg3,
typename Arg4, typename Arg5>
- 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<T>(skip_explicit_ownership))
T(arg1, arg2, arg3, arg4, arg5);
}
template <typename T, typename Arg1, typename Arg2, typename Arg3,
typename Arg4, typename Arg5, typename Arg6>
- 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<T>(skip_explicit_ownership))
T(arg1, arg2, arg3, arg4, arg5, arg6);
}
template <typename T, typename Arg1, typename Arg2, typename Arg3,
typename Arg4, typename Arg5, typename Arg6, typename Arg7>
- 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<T>(skip_explicit_ownership))
T(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
@@ -756,36 +780,46 @@ class LIBPROTOBUF_EXPORT Arena {
template <typename T, typename Arg1, typename Arg2, typename Arg3,
typename Arg4, typename Arg5, typename Arg6, typename Arg7,
typename Arg8>
- 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<T>(skip_explicit_ownership))
T(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
}
#endif
+#if LANG_CXX11
+ template <typename T, typename... Args>
+ GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* CreateMessageInternal(
+ Args&&... args) {
+ return InternalHelper<T>::Construct(
+ AllocateInternal<T>(InternalHelper<T>::is_destructor_skippable::value),
+ this, std::forward<Args>(args)...);
+ }
+#endif
template <typename T>
- GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateMessageInternal() {
+ GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* CreateMessageInternal() {
return InternalHelper<T>::Construct(
AllocateInternal<T>(InternalHelper<T>::is_destructor_skippable::value),
this);
}
- template <typename T, typename Arg>
- GOOGLE_ATTRIBUTE_ALWAYS_INLINE T* CreateMessageInternal(const Arg& arg) {
+ template <typename T, typename Arg> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
+ T* CreateMessageInternal(const Arg& arg) {
return InternalHelper<T>::Construct(
AllocateInternal<T>(InternalHelper<T>::is_destructor_skippable::value),
this, arg);
}
template <typename T, typename Arg1, typename Arg2>
- 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<T>::Construct(
AllocateInternal<T>(InternalHelper<T>::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<typename T> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template<typename T> 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<typename T> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template<typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
void OwnInternal(T* object, google::protobuf::internal::false_type) {
if (object != NULL) {
impl_.AddCleanup(object, &internal::arena_delete_object<T>);
@@ -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 <typename T>
- GOOGLE_ATTRIBUTE_ALWAYS_INLINE static ::google::protobuf::Arena* GetArenaInternal(
+ template <typename T> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
+ static ::google::protobuf::Arena* GetArenaInternal(
const T* value, google::protobuf::internal::true_type) {
return InternalHelper<T>::GetArena(value);
}
template <typename T>
- 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 <google/protobuf/stubs/mutex.h>
#include <google/protobuf/stubs/type_traits.h>
+#include <google/protobuf/stubs/port.h>
+
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 <string>
-#include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/arena.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/fastmem.h>
-#include <google/protobuf/arena.h>
-
-
+#include <google/protobuf/stubs/logging.h>
+#include <google/protobuf/stubs/port.h>
// 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<std::pair<string, string> >*);
} // 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 <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/stringprintf.h>
-#include <google/protobuf/compiler/importer.h>
-#include <google/protobuf/compiler/code_generator.h>
-#include <google/protobuf/compiler/plugin.pb.h>
#include <google/protobuf/compiler/subprocess.h>
#include <google/protobuf/compiler/zip_writer.h>
#include <google/protobuf/compiler/plugin.pb.h>
@@ -83,16 +80,11 @@
#include <google/protobuf/descriptor.h>
#include <google/protobuf/dynamic_message.h>
#include <google/protobuf/text_format.h>
-#include <google/protobuf/dynamic_message.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/io/printer.h>
-#include <google/protobuf/stubs/io_win32.h>
-#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/stubs/substitute.h>
#include <google/protobuf/stubs/map_util.h>
#include <google/protobuf/stubs/stl_util.h>
+#include <google/protobuf/stubs/io_win32.h>
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<pair<string, string> >* 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<string>* 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<string> 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 <<
+" @<filename> 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"
+" @<filename> 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<string>* 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 <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
+
#ifndef _MSC_VER
#include <unistd.h>
#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<string, string> 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<string, string> 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<string, string> vars;
- vars["extendee" ] = ExtendeeClassName(descriptor_);
- vars["number" ] = SimpleItoa(descriptor_->number());
- vars["field_type" ] = SimpleItoa(static_cast<int>(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<string, string>* 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<string>* 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<string>* 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<MessageGenerator>[file->message_type_count()]),
enum_generators_owner_(
new google::protobuf::scoped_ptr<EnumGenerator>[file->enum_type_count()]),
service_generators_owner_(
new google::protobuf::scoped_ptr<ServiceGenerator>[file->service_count()]),
extension_generators_owner_(
new google::protobuf::scoped_ptr<ExtensionGenerator>[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<const Descriptor*> 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<string> names_to_undef;
- CollectMacroNames(file_, &names_to_undef);
+ std::vector<const FieldDescriptor*> 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 <algorithm>\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<const FieldDescriptor*> 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<std::pair<string, string> > messages;
+ std::set<std::pair<string, string> > 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<std::pair<string, string> >::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<std::pair<string, string> >::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<string, ForwardDeclarations *>::const_iterator
it = namespaces_.begin(),
@@ -532,13 +587,11 @@ class FileGenerator::ForwardDeclarations {
std::map<string, const EnumDescriptor*> 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<size_t> 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<size_t> 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<int> field_metadata_offsets;
- int idx = 0;
+ std::vector<std::pair<size_t, size_t> > 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<const Descriptor*> 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<const "
+ "::google::protobuf::Message*>(&$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<std::pair<size_t, size_t> > 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<const "
- "::google::protobuf::Message*>(&_$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<string, string> 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<size_t> 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<size_t> 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<int> 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<const Descriptor*> 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 <google/protobuf/implicit_weak_message.h>\n");
+ }
printer->Print(
"#include <google/protobuf/stubs/common.h>\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 <algorithm>
#include <memory>
#ifndef _SHARED_PTR_H
#include <google/protobuf/stubs/shared_ptr.h>
#endif
+#include <set>
#include <string>
#include <vector>
#include <google/protobuf/stubs/common.h>
@@ -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<MessageGenerator*> message_generators_;
@@ -155,10 +174,8 @@ class FileGenerator {
std::vector<ServiceGenerator*> service_generators_;
std::vector<ExtensionGenerator*> 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<google::protobuf::scoped_ptr<MessageGenerator> >
- 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<google::protobuf::scoped_ptr<EnumGenerator> > enum_generators_owner_;
google::protobuf::scoped_array<google::protobuf::scoped_ptr<ServiceGenerator> >
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 <google/protobuf/io/printer.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/descriptor.pb.h>
+#include <google/protobuf/stubs/strutil.h>
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<io::ZeroCopyOutputStream> output(
- generator_context->Open(basename + ".h"));
+ generator_context->Open(basename + ".pb.h"));
GeneratedCodeInfo annotations;
io::AnnotationProtoCollector<GeneratedCodeInfo> 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<io::ZeroCopyOutputStream> 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<io::ZeroCopyOutputStream> output(
+ generator_context->Open(basename + "." + SimpleItoa(i) + ".cc"));
+ io::Printer printer(output.get(), '$');
+ file_generator.GenerateSourceForMessage(i, &printer);
+ }
+ } else {
google::protobuf::scoped_ptr<io::ZeroCopyOutputStream> 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 <google/protobuf/stubs/hash.h>
#include <limits>
#include <map>
+#include <queue>
#include <vector>
-#include <google/protobuf/stubs/hash.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
@@ -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 <typename I>
+string Base63(I n, int k) {
+ string res;
+ while (k-- > 0) {
+ res += Base63Char(static_cast<int>(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<const Descriptor*> FlattenMessagesInFile(
- const FileDescriptor* file) {
- std::vector<const Descriptor*> result;
+void FlattenMessagesInFile(const FileDescriptor* file,
+ std::vector<const Descriptor*>* 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<const SCC*> 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<const FieldDescriptor*>* 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<const FieldDescriptor*>* 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<const Descriptor*>* 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 <map>
#include <string>
#include <google/protobuf/compiler/cpp/cpp_options.h>
+#include <google/protobuf/io/printer.h>
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/descriptor.h>
+#include <google/protobuf/stubs/strutil.h>
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
+// "<namespace>::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 <typename Desc>
+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 <typename Desc>
+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<const Descriptor*> FlattenMessagesInFile(
- const FileDescriptor* file);
+void FlattenMessagesInFile(const FileDescriptor* file,
+ std::vector<const Descriptor*>* result);
+inline std::vector<const Descriptor*> FlattenMessagesInFile(
+ const FileDescriptor* file) {
+ std::vector<const Descriptor*> 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<string> 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<string> 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<const Descriptor*> descriptors;
+ std::vector<const SCC*> 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<const FieldDescriptor*>* fields);
+void ListAllTypesForServices(const FileDescriptor* fd,
+ std::vector<const Descriptor*>* 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<const "
- "Message*>(&_$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<google::protobuf::uint32>(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 <google/protobuf/compiler/cpp/cpp_extension.h>
#include <google/protobuf/compiler/cpp/cpp_field.h>
#include <google/protobuf/compiler/cpp/cpp_helpers.h>
+#include <google/protobuf/compiler/cpp/cpp_padding_optimizer.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/printer.h>
#include <google/protobuf/descriptor.pb.h>
@@ -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<const FieldDescriptor*>& 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<const FieldDescriptor*> 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<const FieldDescriptor*>* 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<FieldGroup> aligned_to_1[kMaxFamily];
- std::vector<FieldGroup> aligned_to_4[kMaxFamily];
- std::vector<FieldGroup> 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<string, string>* variables) {
GOOGLE_CHECK(IsMapEntryMessage(descriptor));
+ std::map<string, string>& 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<EnumGenerator>[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<MessageGenerator*>* 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<EnumGenerator*>* enum_generators,
std::vector<ExtensionGenerator*>* 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<string, string> 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<const "
+ "$classname$*>(&_$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<const $classname$*>(\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<string, string> 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<string> 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<string, string> 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<const FieldDescriptor*> 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<string, string> 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<const Descriptor::ExtensionRange*> 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<const "
"void*>(::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<string, string> 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<const void*>(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<const "
"void*>($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<string, string> 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<string> 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<size_t, size_t> MessageGenerator::GenerateOffsets(
io::Printer* printer) {
- if (IsMapEntryMessage(descriptor_)) return std::make_pair(0, 0);
std::map<string, string> 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<size_t, size_t> 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<uint32>(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<uint32>(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 <string>
#include <google/protobuf/compiler/cpp/cpp_field.h>
#include <google/protobuf/compiler/cpp/cpp_helpers.h>
+#include <google/protobuf/compiler/cpp/cpp_message_layout_helper.h>
#include <google/protobuf/compiler/cpp/cpp_options.h>
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<MessageGenerator*>* list);
// Append the two types of nested generators to the corresponding vector.
void AddGenerators(std::vector<EnumGenerator*>* enum_generators,
std::vector<ExtensionGenerator*>* 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<uint32> 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<const FieldDescriptor *> optimized_order_;
std::vector<int> has_bit_indices_;
int max_has_bit_index_;
- google::protobuf::scoped_array<google::protobuf::scoped_ptr<MessageGenerator> > nested_generators_;
google::protobuf::scoped_array<google::protobuf::scoped_ptr<EnumGenerator> > enum_generators_;
google::protobuf::scoped_array<google::protobuf::scoped_ptr<ExtensionGenerator> > 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<MessageLayoutHelper> 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<string, string>* 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<const google::protobuf::MessageLite*>(\n"
+ " &$type_default_instance$);\n"
+ " } else {\n"
+ " return *reinterpret_cast<const google::protobuf::MessageLite*>(\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<const google::protobuf::MessageLite*>(\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<const google::protobuf::MessageLite*>(\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<const google::protobuf::MessageLite*>(\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()) + "<T>";
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 <class T>\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<const google::protobuf::MessageLite*>(\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 <class T>\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 <class T>\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 <class T>\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 <class T>\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 <class T>\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<string, string> 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<const $type$*>(\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<string, string> 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<string, string> 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 <google/protobuf/compiler/cpp/cpp_options.h>
+#include <google/protobuf/descriptor.h>
+
+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<const FieldDescriptor*>* 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 <google/protobuf/compiler/cpp/cpp_padding_optimizer.h>
+
+#include <google/protobuf/compiler/cpp/cpp_helpers.h>
+
+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<const FieldDescriptor*>& 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<const FieldDescriptor*> 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<const FieldDescriptor*>* 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<FieldGroup> aligned_to_1[kMaxFamily];
+ std::vector<FieldGroup> aligned_to_4[kMaxFamily];
+ std::vector<FieldGroup> 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 <google/protobuf/compiler/cpp/cpp_message_layout_helper.h>
+
+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<const FieldDescriptor*>* 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<const char*>(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<const char*>(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<string, string> 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<const Message&>(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 <google/protobuf/compiler/parser.h>
#include <google/protobuf/io/tokenizer.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/strutil.h>
+#include <google/protobuf/stubs/io_win32.h>
#ifdef _WIN32
#include <ctype.h>
#endif
+namespace google {
+namespace protobuf {
+namespace compiler {
+
#ifdef _MSC_VER
// DO NOT include <io.h>, 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,17 +825,11 @@ 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<const FieldDescriptor * > 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<int32>(tag)));
- printer->Indent();
-
- field_generators_.get(field).GenerateParsingCode(printer);
-
- printer->Outdent();
- printer->Print(
- " break;\n"
- "}\n");
+ google::protobuf::scoped_array<const FieldDescriptor* > 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<int32>(packed_tag)));
+ printer->Print("case $tag$: {\n", "tag",
+ SimpleItoa(static_cast<int32>(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<int32>(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 <google/protobuf/stubs/substitute.h>
#include <gtest/gtest.h>
-#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<FieldDescriptorProto>* extensions,
RepeatedPtrField<DescriptorProto>* 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 <unistd.h>
#endif
-#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/compiler/plugin.pb.h>
#include <google/protobuf/compiler/code_generator.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
+#include <google/protobuf/stubs/io_win32.h>
+
+
+namespace google {
+namespace protobuf {
+namespace compiler {
#if defined(_MSC_VER)
// DO NOT include <io.h>, 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 <google/protobuf/compiler/plugin.pb.h>
#include <algorithm>
@@ -16,121 +15,168 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
namespace compiler {
class VersionDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Version>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Version>
+ _instance;
} _Version_default_instance_;
class CodeGeneratorRequestDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorRequest>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorRequest>
+ _instance;
} _CodeGeneratorRequest_default_instance_;
class CodeGeneratorResponse_FileDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorResponse_File>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorResponse_File>
+ _instance;
} _CodeGeneratorResponse_File_default_instance_;
class CodeGeneratorResponseDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorResponse>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<CodeGeneratorResponse>
+ _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<const ::google::protobuf::Message*>(&_Version_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_CodeGeneratorRequest_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_CodeGeneratorResponse_File_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_CodeGeneratorResponse_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::compiler::_Version_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::compiler::_CodeGeneratorRequest_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::compiler::_CodeGeneratorResponse_File_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::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<const char*>(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<const char*>(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<const char*>(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<const char*>(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<const ::google::protobuf::compiler::Version*>(
- &::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<const char*>(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<const char*>(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<const char*>(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<const char*>(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<const Version*>(
&_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<const CodeGeneratorRequest*>(
&_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<const CodeGeneratorResponse_File*>(
&_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<const CodeGeneratorResponse*>(
&_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<const FieldDescriptor*>* out) const;
@@ -752,11 +752,27 @@ class FileDescriptorTables {
const SourceCodeInfo_Location* GetSourceLocation(
const std::vector<int>& 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<FileDescriptor>();
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<const string*>(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<string> 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<int>* 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<EnumDescriptor>() and AllocateArray<EnumDescriptor>() 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 <google/protobuf/descriptor.pb.h>
#include <algorithm>
@@ -16,214 +15,668 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
class FileDescriptorSetDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<FileDescriptorSet>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<FileDescriptorSet>
+ _instance;
} _FileDescriptorSet_default_instance_;
class FileDescriptorProtoDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<FileDescriptorProto>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<FileDescriptorProto>
+ _instance;
} _FileDescriptorProto_default_instance_;
class DescriptorProto_ExtensionRangeDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto_ExtensionRange>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto_ExtensionRange>
+ _instance;
} _DescriptorProto_ExtensionRange_default_instance_;
class DescriptorProto_ReservedRangeDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto_ReservedRange>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto_ReservedRange>
+ _instance;
} _DescriptorProto_ReservedRange_default_instance_;
class DescriptorProtoDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<DescriptorProto>
+ _instance;
} _DescriptorProto_default_instance_;
class ExtensionRangeOptionsDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<ExtensionRangeOptions>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<ExtensionRangeOptions>
+ _instance;
} _ExtensionRangeOptions_default_instance_;
class FieldDescriptorProtoDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<FieldDescriptorProto>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<FieldDescriptorProto>
+ _instance;
} _FieldDescriptorProto_default_instance_;
class OneofDescriptorProtoDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<OneofDescriptorProto>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<OneofDescriptorProto>
+ _instance;
} _OneofDescriptorProto_default_instance_;
+class EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal {
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<EnumDescriptorProto_EnumReservedRange>
+ _instance;
+} _EnumDescriptorProto_EnumReservedRange_default_instance_;
class EnumDescriptorProtoDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<EnumDescriptorProto>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<EnumDescriptorProto>
+ _instance;
} _EnumDescriptorProto_default_instance_;
class EnumValueDescriptorProtoDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<EnumValueDescriptorProto>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<EnumValueDescriptorProto>
+ _instance;
} _EnumValueDescriptorProto_default_instance_;
class ServiceDescriptorProtoDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<ServiceDescriptorProto>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<ServiceDescriptorProto>
+ _instance;
} _ServiceDescriptorProto_default_instance_;
class MethodDescriptorProtoDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<MethodDescriptorProto>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<MethodDescriptorProto>
+ _instance;
} _MethodDescriptorProto_default_instance_;
class FileOptionsDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<FileOptions>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<FileOptions>
+ _instance;
} _FileOptions_default_instance_;
class MessageOptionsDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<MessageOptions>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<MessageOptions>
+ _instance;
} _MessageOptions_default_instance_;
class FieldOptionsDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<FieldOptions>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<FieldOptions>
+ _instance;
} _FieldOptions_default_instance_;
class OneofOptionsDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<OneofOptions>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<OneofOptions>
+ _instance;
} _OneofOptions_default_instance_;
class EnumOptionsDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<EnumOptions>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<EnumOptions>
+ _instance;
} _EnumOptions_default_instance_;
class EnumValueOptionsDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<EnumValueOptions>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<EnumValueOptions>
+ _instance;
} _EnumValueOptions_default_instance_;
class ServiceOptionsDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<ServiceOptions>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<ServiceOptions>
+ _instance;
} _ServiceOptions_default_instance_;
class MethodOptionsDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<MethodOptions>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<MethodOptions>
+ _instance;
} _MethodOptions_default_instance_;
class UninterpretedOption_NamePartDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<UninterpretedOption_NamePart>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<UninterpretedOption_NamePart>
+ _instance;
} _UninterpretedOption_NamePart_default_instance_;
class UninterpretedOptionDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<UninterpretedOption>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<UninterpretedOption>
+ _instance;
} _UninterpretedOption_default_instance_;
class SourceCodeInfo_LocationDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<SourceCodeInfo_Location>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<SourceCodeInfo_Location>
+ _instance;
} _SourceCodeInfo_Location_default_instance_;
class SourceCodeInfoDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<SourceCodeInfo>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<SourceCodeInfo>
+ _instance;
} _SourceCodeInfo_default_instance_;
class GeneratedCodeInfo_AnnotationDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<GeneratedCodeInfo_Annotation>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<GeneratedCodeInfo_Annotation>
+ _instance;
} _GeneratedCodeInfo_Annotation_default_instance_;
class GeneratedCodeInfoDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<GeneratedCodeInfo>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<GeneratedCodeInfo>
+ _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;
+
+ ::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();
+}
+
+void InitDefaultsDescriptorProto_ExtensionRange() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDescriptorProto_ExtensionRangeImpl);
+}
+
+void InitDefaultsDescriptorProto_ReservedRangeImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::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 InitDefaultsDescriptorProto_ReservedRange() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDescriptorProto_ReservedRangeImpl);
+}
+
+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);
+}
+
+void InitDefaultsExtensionRangeOptionsImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ 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 InitDefaultsExtensionRangeOptions() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsExtensionRangeOptionsImpl);
+}
+
+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();
+}
+
+void InitDefaultsFieldDescriptorProto() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFieldDescriptorProtoImpl);
+}
+
+void InitDefaultsOneofDescriptorProtoImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::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();
+}
+
+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();
+}
+
+void InitDefaultsEnumDescriptorProto_EnumReservedRange() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumDescriptorProto_EnumReservedRangeImpl);
+}
+
+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();
+}
-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_),
+void InitDefaultsEnumDescriptorProto() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumDescriptorProtoImpl);
+}
+
+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();
+}
+
+void InitDefaultsEnumValueDescriptorProto() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumValueDescriptorProtoImpl);
+}
+
+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();
+}
+
+void InitDefaultsServiceDescriptorProto() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsServiceDescriptorProtoImpl);
+}
+
+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();
+}
+
+void InitDefaultsMethodDescriptorProto() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMethodDescriptorProtoImpl);
+}
+
+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();
+}
+
+void InitDefaultsFileOptions() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFileOptionsImpl);
+}
+
+void InitDefaultsMessageOptionsImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::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();
+}
+
+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);
+ }
+ ::google::protobuf::FieldOptions::InitAsDefaultInstance();
+}
+
+void InitDefaultsFieldOptions() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFieldOptionsImpl);
+}
+
+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();
+}
+
+void InitDefaultsOneofOptions() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsOneofOptionsImpl);
+}
+
+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 InitDefaultsEnumOptions() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumOptionsImpl);
+}
+
+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();
+}
+
+void InitDefaultsEnumValueOptions() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumValueOptionsImpl);
+}
+
+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);
+ }
+ ::google::protobuf::ServiceOptions::InitAsDefaultInstance();
+}
+
+void InitDefaultsServiceOptions() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsServiceOptionsImpl);
+}
+
+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();
+}
+
+void InitDefaultsMethodOptions() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMethodOptionsImpl);
+}
+
+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);
+ }
+ ::google::protobuf::UninterpretedOption_NamePart::InitAsDefaultInstance();
+}
+
+void InitDefaultsUninterpretedOption_NamePart() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsUninterpretedOption_NamePartImpl);
+}
+
+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();
+}
+
+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);
+ }
+ ::google::protobuf::SourceCodeInfo_Location::InitAsDefaultInstance();
+}
+
+void InitDefaultsSourceCodeInfo_Location() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsSourceCodeInfo_LocationImpl);
+}
+
+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();
+}
+
+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);
+ }
+ ::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();
+}
+
+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(FileDescriptorSet, file_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FileDescriptorSet, file_),
~0u,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _internal_metadata_),
+ 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(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_),
+ 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,
@@ -236,41 +689,41 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION
3,
4,
2,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _internal_metadata_),
+ 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(DescriptorProto_ExtensionRange, start_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, end_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, options_),
+ 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(DescriptorProto_ReservedRange, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, _internal_metadata_),
+ 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(DescriptorProto_ReservedRange, start_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, end_),
+ 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(DescriptorProto, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _internal_metadata_),
+ 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(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_),
+ 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,
@@ -281,28 +734,28 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION
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_),
+ 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(ExtensionRangeOptions, uninterpreted_option_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, uninterpreted_option_),
~0u,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _internal_metadata_),
+ 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(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_),
+ 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,
@@ -313,135 +766,148 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION
7,
4,
5,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, _internal_metadata_),
+ 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(OneofDescriptorProto, name_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, options_),
+ 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(EnumDescriptorProto, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _internal_metadata_),
+ 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(EnumDescriptorProto, name_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, value_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, options_),
+ 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,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _internal_metadata_),
+ ~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(EnumValueDescriptorProto, name_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, number_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, options_),
+ 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(ServiceDescriptorProto, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _internal_metadata_),
+ 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(ServiceDescriptorProto, name_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, method_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, options_),
+ 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(MethodDescriptorProto, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _internal_metadata_),
+ 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(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_),
+ 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(FileOptions, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _internal_metadata_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _extensions_),
+ 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(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_),
+ 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,
- 8,
9,
10,
+ 11,
17,
2,
- 11,
12,
13,
14,
15,
16,
+ 8,
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_),
+ 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(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_),
+ 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(FieldOptions, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _internal_metadata_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _extensions_),
+ 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(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_),
+ 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,
@@ -449,74 +915,74 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION
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_),
+ 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(OneofOptions, uninterpreted_option_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::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_),
+ 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(EnumOptions, allow_alias_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, deprecated_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, uninterpreted_option_),
+ 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(EnumValueOptions, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _internal_metadata_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _extensions_),
+ 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(EnumValueOptions, deprecated_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, uninterpreted_option_),
+ 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(ServiceOptions, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _internal_metadata_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _extensions_),
+ 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(ServiceOptions, deprecated_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, uninterpreted_option_),
+ 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(MethodOptions, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _internal_metadata_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _extensions_),
+ 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(MethodOptions, deprecated_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, idempotency_level_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, uninterpreted_option_),
+ 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(UninterpretedOption_NamePart, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _internal_metadata_),
+ 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(UninterpretedOption_NamePart, name_part_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, is_extension_),
+ 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(UninterpretedOption, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _internal_metadata_),
+ 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(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_),
+ 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,
@@ -524,109 +990,109 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION
5,
1,
2,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _internal_metadata_),
+ 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(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_),
+ 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(SourceCodeInfo, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _internal_metadata_),
+ 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(SourceCodeInfo, location_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::SourceCodeInfo, location_),
~0u,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _internal_metadata_),
+ 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(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_),
+ 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(GeneratedCodeInfo, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, _internal_metadata_),
+ 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(GeneratedCodeInfo, annotation_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::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)},
+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<const ::google::protobuf::Message*>(&_FileDescriptorSet_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_FileDescriptorProto_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_DescriptorProto_ExtensionRange_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_DescriptorProto_ReservedRange_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_DescriptorProto_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_ExtensionRangeOptions_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_FieldDescriptorProto_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_OneofDescriptorProto_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_EnumDescriptorProto_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_EnumValueDescriptorProto_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_ServiceDescriptorProto_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_MethodDescriptorProto_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_FileOptions_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_MessageOptions_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_FieldOptions_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_OneofOptions_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_EnumOptions_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_EnumValueOptions_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_ServiceOptions_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_MethodOptions_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_UninterpretedOption_NamePart_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_UninterpretedOption_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_SourceCodeInfo_Location_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_SourceCodeInfo_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_GeneratedCodeInfo_Annotation_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_GeneratedCodeInfo_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_FileDescriptorSet_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_FileDescriptorProto_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_DescriptorProto_ExtensionRange_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_DescriptorProto_ReservedRange_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_DescriptorProto_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_ExtensionRangeOptions_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_FieldDescriptorProto_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_OneofDescriptorProto_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_EnumDescriptorProto_EnumReservedRange_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_EnumDescriptorProto_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_EnumValueDescriptorProto_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_ServiceDescriptorProto_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_MethodDescriptorProto_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_FileOptions_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_MessageOptions_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_FieldOptions_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_OneofOptions_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_EnumOptions_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_EnumValueOptions_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_ServiceOptions_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_MethodOptions_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_UninterpretedOption_NamePart_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_UninterpretedOption_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_SourceCodeInfo_Location_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_SourceCodeInfo_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_GeneratedCodeInfo_Annotation_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_GeneratedCodeInfo_default_instance_),
};
-namespace {
-
void protobuf_AssignDescriptors() {
AddDescriptors();
::google::protobuf::MessageFactory* factory = NULL;
@@ -640,99 +1106,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, 26);
+ ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 27);
}
-} // namespace
-void TableStruct::InitDefaultsImpl() {
- 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());
-}
-
-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/descriptor.proto\022\017goog"
"le.protobuf\"G\n\021FileDescriptorSet\0222\n\004file"
"\030\001 \003(\0132$.google.protobuf.FileDescriptorP"
@@ -787,105 +1169,108 @@ void AddDescriptorsImpl() {
"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"
+ "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\"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"
+ "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\":\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"
+ "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\"/\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"
+ "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, 5813);
+ descriptor, 5968);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"google/protobuf/descriptor.proto", &protobuf_RegisterTypes);
}
-} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
@@ -897,9 +1282,9 @@ struct 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];
@@ -1071,6 +1456,8 @@ const int MethodOptions::IdempotencyLevel_ARRAYSIZE;
// ===================================================================
+void FileDescriptorSet::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int FileDescriptorSet::kFileFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -1078,11 +1465,20 @@ const int FileDescriptorSet::kFileFieldNumber;
FileDescriptorSet::FileDescriptorSet()
: ::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::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),
@@ -1103,29 +1499,37 @@ FileDescriptorSet::~FileDescriptorSet() {
}
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;
+ ::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::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorSet();
return *internal_default_instance();
}
FileDescriptorSet* FileDescriptorSet::New(::google::protobuf::Arena* arena) const {
- FileDescriptorSet* n = new FileDescriptorSet;
- if (arena != NULL) {
- arena->Own(n);
- }
- return n;
+ return ::google::protobuf::Arena::CreateMessage<FileDescriptorSet>(arena);
}
void FileDescriptorSet::Clear() {
@@ -1297,6 +1701,21 @@ bool FileDescriptorSet::IsInitialized() const {
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) {
@@ -1309,46 +1728,98 @@ void FileDescriptorSet::InternalSwap(FileDescriptorSet* other) {
::google::protobuf::Metadata FileDescriptorSet::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 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 FileDescriptorSet::clear_file() {
- file_.Clear();
+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;
+ }
}
-const ::google::protobuf::FileDescriptorProto& FileDescriptorSet::file(int index) const {
- // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorSet.file)
- return file_.Get(index);
+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;
+ }
}
-::google::protobuf::FileDescriptorProto* FileDescriptorSet::mutable_file(int index) {
- // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorSet.file)
- return file_.Mutable(index);
+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)
}
-::google::protobuf::FileDescriptorProto* FileDescriptorSet::add_file() {
- // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorSet.file)
- return file_.Add();
+void FileDescriptorProto::_slow_mutable_source_code_info() {
+ source_code_info_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::SourceCodeInfo >(
+ GetArenaNoVirtual());
}
-::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*
-FileDescriptorSet::mutable_file() {
- // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorSet.file)
- return &file_;
+::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;
+ }
}
-const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >&
-FileDescriptorSet::file() const {
- // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorSet.file)
- return file_;
+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)
}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
-
-// ===================================================================
-
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int FileDescriptorProto::kNameFieldNumber;
const int FileDescriptorProto::kPackageFieldNumber;
@@ -1367,11 +1838,26 @@ const int FileDescriptorProto::kSyntaxFieldNumber;
FileDescriptorProto::FileDescriptorProto()
: ::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::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),
@@ -1387,15 +1873,18 @@ FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& 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());
}
package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.has_package()) {
- package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.package_);
+ package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.package(),
+ GetArenaNoVirtual());
}
syntax_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.has_syntax()) {
- syntax_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.syntax_);
+ syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.syntax(),
+ GetArenaNoVirtual());
}
if (from.has_options()) {
options_ = new ::google::protobuf::FileOptions(*from.options_);
@@ -1426,34 +1915,42 @@ FileDescriptorProto::~FileDescriptorProto() {
}
void FileDescriptorProto::SharedDtor() {
- name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- syntax_.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);
+ 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;
+ ::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();
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFileDescriptorProto();
return *internal_default_instance();
}
FileDescriptorProto* FileDescriptorProto::New(::google::protobuf::Arena* arena) const {
- FileDescriptorProto* n = new FileDescriptorProto;
- if (arena != NULL) {
- arena->Own(n);
- }
- return n;
+ return ::google::protobuf::Arena::CreateMessage<FileDescriptorProto>(arena);
}
void FileDescriptorProto::Clear() {
@@ -1473,15 +1970,15 @@ void FileDescriptorProto::Clear() {
if (cached_has_bits & 31u) {
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(!package_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
- (*package_.UnsafeRawStringPointer())->clear();
+ package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
if (cached_has_bits & 0x00000004u) {
GOOGLE_DCHECK(!syntax_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
- (*syntax_.UnsafeRawStringPointer())->clear();
+ syntax_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
if (cached_has_bits & 0x00000008u) {
GOOGLE_DCHECK(options_ != NULL);
@@ -2075,16 +2572,13 @@ void FileDescriptorProto::MergeFrom(const FileDescriptorProto& from) {
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 31u) {
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_package();
- package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.package_);
+ set_package(from.package());
}
if (cached_has_bits & 0x00000004u) {
- set_has_syntax();
- syntax_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.syntax_);
+ set_syntax(from.syntax());
}
if (cached_has_bits & 0x00000008u) {
mutable_options()->::google::protobuf::FileOptions::MergeFrom(from.options());
@@ -2122,6 +2616,21 @@ bool FileDescriptorProto::IsInitialized() const {
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 FileDescriptorProto::InternalSwap(FileDescriptorProto* other) {
@@ -2145,546 +2654,56 @@ void FileDescriptorProto::InternalSwap(FileDescriptorProto* other) {
::google::protobuf::Metadata FileDescriptorProto::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<const char*>(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<const char*>(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<const char*>(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<const char*>(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_;
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
}
-// 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();
+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());
}
-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<const ::google::protobuf::FileOptions*>(
- &::google::protobuf::_FileOptions_default_instance_);
+void DescriptorProto_ExtensionRange::_slow_mutable_options() {
+ options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::ExtensionRangeOptions >(
+ GetArenaNoVirtual());
}
-::google::protobuf::FileOptions* FileDescriptorProto::mutable_options() {
- set_has_options();
+::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::_slow_release_options() {
if (options_ == NULL) {
- options_ = new ::google::protobuf::FileOptions;
+ return NULL;
+ } else {
+ ::google::protobuf::ExtensionRangeOptions* temp = new ::google::protobuf::ExtensionRangeOptions(*options_);
+ options_ = NULL;
+ return temp;
}
- // @@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 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;
+ }
}
-void FileDescriptorProto::set_allocated_options(::google::protobuf::FileOptions* options) {
- delete options_;
+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_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<const ::google::protobuf::SourceCodeInfo*>(
- &::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_;
+ // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options)
}
-::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<const char*>(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)
-}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
-
-// ===================================================================
-
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int DescriptorProto_ExtensionRange::kStartFieldNumber;
const int DescriptorProto_ExtensionRange::kEndFieldNumber;
@@ -2694,11 +2713,19 @@ const int DescriptorProto_ExtensionRange::kOptionsFieldNumber;
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.DescriptorProto.ExtensionRange)
}
+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),
@@ -2729,30 +2756,38 @@ DescriptorProto_ExtensionRange::~DescriptorProto_ExtensionRange() {
}
void DescriptorProto_ExtensionRange::SharedDtor() {
+ ::google::protobuf::Arena* arena = GetArenaNoVirtual();
+ GOOGLE_DCHECK(arena == NULL);
+ if (arena != NULL) {
+ return;
+ }
+
if (this != internal_default_instance()) delete options_;
}
+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* DescriptorProto_ExtensionRange::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 DescriptorProto_ExtensionRange& DescriptorProto_ExtensionRange::default_instance() {
- protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ExtensionRange();
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;
+ return ::google::protobuf::Arena::CreateMessage<DescriptorProto_ExtensionRange>(arena);
}
void DescriptorProto_ExtensionRange::Clear() {
@@ -3007,6 +3042,21 @@ bool DescriptorProto_ExtensionRange::IsInitialized() const {
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 DescriptorProto_ExtensionRange::InternalSwap(DescriptorProto_ExtensionRange* other) {
@@ -3021,110 +3071,14 @@ void DescriptorProto_ExtensionRange::InternalSwap(DescriptorProto_ExtensionRange
::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
-// 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();
-}
-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<const ::google::protobuf::ExtensionRangeOptions*>(
- &::google::protobuf::_ExtensionRangeOptions_default_instance_);
-}
-::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::mutable_options() {
- set_has_options();
- if (options_ == NULL) {
- options_ = new ::google::protobuf::ExtensionRangeOptions;
- }
- // @@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_ExtensionRange::set_allocated_options(::google::protobuf::ExtensionRangeOptions* options) {
- delete options_;
- options_ = options;
- if (options) {
- set_has_options();
- } else {
- clear_has_options();
- }
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options)
+ 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_ReservedRange::kStartFieldNumber;
const int DescriptorProto_ReservedRange::kEndFieldNumber;
@@ -3133,11 +3087,19 @@ const int DescriptorProto_ReservedRange::kEndFieldNumber;
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.ReservedRange)
}
+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),
@@ -3163,29 +3125,37 @@ DescriptorProto_ReservedRange::~DescriptorProto_ReservedRange() {
}
void DescriptorProto_ReservedRange::SharedDtor() {
+ ::google::protobuf::Arena* arena = GetArenaNoVirtual();
+ GOOGLE_DCHECK(arena == NULL);
+ if (arena != NULL) {
+ return;
+ }
+
}
+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_ReservedRange::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 DescriptorProto_ReservedRange& DescriptorProto_ReservedRange::default_instance() {
- protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto_ReservedRange();
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;
+ return ::google::protobuf::Arena::CreateMessage<DescriptorProto_ReservedRange>(arena);
}
void DescriptorProto_ReservedRange::Clear() {
@@ -3398,6 +3368,21 @@ bool DescriptorProto_ReservedRange::IsInitialized() const {
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_ReservedRange::InternalSwap(DescriptorProto_ReservedRange* other) {
@@ -3411,64 +3396,56 @@ void DescriptorProto_ReservedRange::InternalSwap(DescriptorProto_ReservedRange*
::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_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::InitAsDefaultInstance() {
+ ::google::protobuf::_DescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::MessageOptions*>(
+ ::google::protobuf::MessageOptions::internal_default_instance());
}
-void DescriptorProto_ReservedRange::clear_has_end() {
- _has_bits_[0] &= ~0x00000002u;
+void DescriptorProto::_slow_mutable_options() {
+ options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::MessageOptions >(
+ GetArenaNoVirtual());
}
-void DescriptorProto_ReservedRange::clear_end() {
- end_ = 0;
- clear_has_end();
+::google::protobuf::MessageOptions* DescriptorProto::_slow_release_options() {
+ if (options_ == NULL) {
+ return NULL;
+ } else {
+ ::google::protobuf::MessageOptions* temp = new ::google::protobuf::MessageOptions(*options_);
+ options_ = NULL;
+ return temp;
+ }
}
-::google::protobuf::int32 DescriptorProto_ReservedRange::end() const {
- // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.end)
- return end_;
+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_ReservedRange::set_end(::google::protobuf::int32 value) {
- set_has_end();
- end_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.end)
+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_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.options)
}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
-
-// ===================================================================
-
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int DescriptorProto::kNameFieldNumber;
const int DescriptorProto::kFieldFieldNumber;
@@ -3485,11 +3462,27 @@ const int DescriptorProto::kReservedNameFieldNumber;
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)
}
+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),
@@ -3506,7 +3499,8 @@ DescriptorProto::DescriptorProto(const DescriptorProto& 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());
}
if (from.has_options()) {
options_ = new ::google::protobuf::MessageOptions(*from.options_);
@@ -3528,31 +3522,39 @@ DescriptorProto::~DescriptorProto() {
}
void DescriptorProto::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 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::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 DescriptorProto& DescriptorProto::default_instance() {
- protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsDescriptorProto();
return *internal_default_instance();
}
DescriptorProto* DescriptorProto::New(::google::protobuf::Arena* arena) const {
- DescriptorProto* n = new DescriptorProto;
- if (arena != NULL) {
- arena->Own(n);
- }
- return n;
+ return ::google::protobuf::Arena::CreateMessage<DescriptorProto>(arena);
}
void DescriptorProto::Clear() {
@@ -3573,7 +3575,7 @@ void DescriptorProto::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);
@@ -4082,8 +4084,7 @@ void DescriptorProto::MergeFrom(const DescriptorProto& 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::MessageOptions::MergeFrom(from.options());
@@ -4120,6 +4121,21 @@ bool DescriptorProto::IsInitialized() const {
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::InternalSwap(DescriptorProto* other) {
@@ -4141,404 +4157,14 @@ void DescriptorProto::InternalSwap(DescriptorProto* other) {
::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
-
-// 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<const char*>(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_;
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
}
-// 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_;
-}
-
-// 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();
-}
-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<const ::google::protobuf::MessageOptions*>(
- &::google::protobuf::_MessageOptions_default_instance_);
-}
-::google::protobuf::MessageOptions* DescriptorProto::mutable_options() {
- set_has_options();
- if (options_ == NULL) {
- options_ = new ::google::protobuf::MessageOptions;
- }
- // @@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 DescriptorProto::set_allocated_options(::google::protobuf::MessageOptions* options) {
- 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<const char*>(value), size);
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.reserved_name)
-}
-::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<const char*>(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
// ===================================================================
+void ExtensionRangeOptions::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int ExtensionRangeOptions::kUninterpretedOptionFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -4546,11 +4172,21 @@ const int ExtensionRangeOptions::kUninterpretedOptionFieldNumber;
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.ExtensionRangeOptions)
}
+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),
@@ -4572,29 +4208,37 @@ ExtensionRangeOptions::~ExtensionRangeOptions() {
}
void ExtensionRangeOptions::SharedDtor() {
+ ::google::protobuf::Arena* arena = GetArenaNoVirtual();
+ GOOGLE_DCHECK(arena == NULL);
+ if (arena != NULL) {
+ return;
+ }
+
}
+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* ExtensionRangeOptions::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 ExtensionRangeOptions& ExtensionRangeOptions::default_instance() {
- protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsExtensionRangeOptions();
return *internal_default_instance();
}
ExtensionRangeOptions* ExtensionRangeOptions::New(::google::protobuf::Arena* arena) const {
- ExtensionRangeOptions* n = new ExtensionRangeOptions;
- if (arena != NULL) {
- arena->Own(n);
- }
- return n;
+ return ::google::protobuf::Arena::CreateMessage<ExtensionRangeOptions>(arena);
}
void ExtensionRangeOptions::Clear() {
@@ -4788,6 +4432,21 @@ bool ExtensionRangeOptions::IsInitialized() const {
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 ExtensionRangeOptions::InternalSwap(ExtensionRangeOptions* other) {
@@ -4801,46 +4460,56 @@ void ExtensionRangeOptions::InternalSwap(ExtensionRangeOptions* other) {
::google::protobuf::Metadata ExtensionRangeOptions::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 FieldDescriptorProto::InitAsDefaultInstance() {
+ ::google::protobuf::_FieldDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::FieldOptions*>(
+ ::google::protobuf::FieldOptions::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 FieldDescriptorProto::_slow_mutable_options() {
+ options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::FieldOptions >(
+ GetArenaNoVirtual());
}
-::google::protobuf::UninterpretedOption* ExtensionRangeOptions::add_uninterpreted_option() {
- // @@protoc_insertion_point(field_add:google.protobuf.ExtensionRangeOptions.uninterpreted_option)
- return uninterpreted_option_.Add();
+::google::protobuf::FieldOptions* FieldDescriptorProto::_slow_release_options() {
+ if (options_ == NULL) {
+ return NULL;
+ } else {
+ ::google::protobuf::FieldOptions* temp = new ::google::protobuf::FieldOptions(*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 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;
+ }
}
-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 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_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.options)
}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
-
-// ===================================================================
-
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int FieldDescriptorProto::kNameFieldNumber;
const int FieldDescriptorProto::kNumberFieldNumber;
@@ -4857,11 +4526,19 @@ const int FieldDescriptorProto::kOptionsFieldNumber;
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.FieldDescriptorProto)
}
+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),
@@ -4870,23 +4547,28 @@ 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_);
+ name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
+ GetArenaNoVirtual());
}
extendee_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.has_extendee()) {
- extendee_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.extendee_);
+ extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.extendee(),
+ GetArenaNoVirtual());
}
type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.has_type_name()) {
- type_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.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_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.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_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.json_name_);
+ json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.json_name(),
+ GetArenaNoVirtual());
}
if (from.has_options()) {
options_ = new ::google::protobuf::FieldOptions(*from.options_);
@@ -4919,35 +4601,43 @@ FieldDescriptorProto::~FieldDescriptorProto() {
}
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());
+ ::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 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* FieldDescriptorProto::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 FieldDescriptorProto& FieldDescriptorProto::default_instance() {
- protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsFieldDescriptorProto();
return *internal_default_instance();
}
FieldDescriptorProto* FieldDescriptorProto::New(::google::protobuf::Arena* arena) const {
- FieldDescriptorProto* n = new FieldDescriptorProto;
- if (arena != NULL) {
- arena->Own(n);
- }
- return n;
+ return ::google::protobuf::Arena::CreateMessage<FieldDescriptorProto>(arena);
}
void FieldDescriptorProto::Clear() {
@@ -4960,23 +4650,23 @@ void FieldDescriptorProto::Clear() {
if (cached_has_bits & 63u) {
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(!extendee_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
- (*extendee_.UnsafeRawStringPointer())->clear();
+ extendee_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
if (cached_has_bits & 0x00000004u) {
GOOGLE_DCHECK(!type_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
- (*type_name_.UnsafeRawStringPointer())->clear();
+ type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
if (cached_has_bits & 0x00000008u) {
GOOGLE_DCHECK(!default_value_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
- (*default_value_.UnsafeRawStringPointer())->clear();
+ default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
if (cached_has_bits & 0x00000010u) {
GOOGLE_DCHECK(!json_name_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
- (*json_name_.UnsafeRawStringPointer())->clear();
+ json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
if (cached_has_bits & 0x00000020u) {
GOOGLE_DCHECK(options_ != NULL);
@@ -5491,24 +5181,19 @@ void FieldDescriptorProto::MergeFrom(const FieldDescriptorProto& from) {
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 255u) {
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_);
+ set_extendee(from.extendee());
}
if (cached_has_bits & 0x00000004u) {
- set_has_type_name();
- type_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_name_);
+ set_type_name(from.type_name());
}
if (cached_has_bits & 0x00000008u) {
- set_has_default_value();
- default_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.default_value_);
+ set_default_value(from.default_value());
}
if (cached_has_bits & 0x00000010u) {
- set_has_json_name();
- json_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.json_name_);
+ set_json_name(from.json_name());
}
if (cached_has_bits & 0x00000020u) {
mutable_options()->::google::protobuf::FieldOptions::MergeFrom(from.options());
@@ -5555,6 +5240,21 @@ bool FieldDescriptorProto::IsInitialized() const {
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 FieldDescriptorProto::InternalSwap(FieldDescriptorProto* other) {
@@ -5576,475 +5276,56 @@ void FieldDescriptorProto::InternalSwap(FieldDescriptorProto* other) {
::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<const char*>(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)
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
}
-// 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<const char*>(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<const char*>(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<const char*>(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<const char*>(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());
+void OneofDescriptorProto::InitAsDefaultInstance() {
+ ::google::protobuf::_OneofDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::OneofOptions*>(
+ ::google::protobuf::OneofOptions::internal_default_instance());
}
-::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 OneofDescriptorProto::_slow_mutable_options() {
+ options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::OneofOptions >(
+ GetArenaNoVirtual());
}
-void FieldDescriptorProto::set_allocated_json_name(::std::string* json_name) {
- if (json_name != NULL) {
- set_has_json_name();
+::google::protobuf::OneofOptions* OneofDescriptorProto::_slow_release_options() {
+ if (options_ == NULL) {
+ return NULL;
} else {
- clear_has_json_name();
+ ::google::protobuf::OneofOptions* temp = new ::google::protobuf::OneofOptions(*options_);
+ options_ = NULL;
+ return temp;
}
- json_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name);
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.json_name)
-}
-
-// 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<const ::google::protobuf::FieldOptions*>(
- &::google::protobuf::_FieldOptions_default_instance_);
+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;
+ }
}
-::google::protobuf::FieldOptions* FieldDescriptorProto::mutable_options() {
- set_has_options();
- if (options_ == NULL) {
- options_ = new ::google::protobuf::FieldOptions;
+void OneofDescriptorProto::unsafe_arena_set_allocated_options(
+ ::google::protobuf::OneofOptions* options) {
+ if (GetArenaNoVirtual() == NULL) {
+ delete options_;
}
- // @@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 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)
+ // @@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 OneofDescriptorProto::kNameFieldNumber;
const int OneofDescriptorProto::kOptionsFieldNumber;
@@ -6053,11 +5334,19 @@ const int OneofDescriptorProto::kOptionsFieldNumber;
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.OneofDescriptorProto)
}
+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),
@@ -6066,7 +5355,8 @@ OneofDescriptorProto::OneofDescriptorProto(const OneofDescriptorProto& 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());
}
if (from.has_options()) {
options_ = new ::google::protobuf::OneofOptions(*from.options_);
@@ -6088,31 +5378,39 @@ OneofDescriptorProto::~OneofDescriptorProto() {
}
void OneofDescriptorProto::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 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* OneofDescriptorProto::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 OneofDescriptorProto& OneofDescriptorProto::default_instance() {
- protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsOneofDescriptorProto();
return *internal_default_instance();
}
OneofDescriptorProto* OneofDescriptorProto::New(::google::protobuf::Arena* arena) const {
- OneofDescriptorProto* n = new OneofDescriptorProto;
- if (arena != NULL) {
- arena->Own(n);
- }
- return n;
+ return ::google::protobuf::Arena::CreateMessage<OneofDescriptorProto>(arena);
}
void OneofDescriptorProto::Clear() {
@@ -6125,7 +5423,7 @@ void OneofDescriptorProto::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);
@@ -6315,8 +5613,7 @@ 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_);
+ set_name(from.name());
}
if (cached_has_bits & 0x00000002u) {
mutable_options()->::google::protobuf::OneofOptions::MergeFrom(from.options());
@@ -6347,6 +5644,21 @@ bool OneofDescriptorProto::IsInitialized() const {
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;
+ }
+ }
+}
+void OneofDescriptorProto::UnsafeArenaSwap(OneofDescriptorProto* other) {
+ if (other == this) return;
+ GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
InternalSwap(other);
}
void OneofDescriptorProto::InternalSwap(OneofDescriptorProto* other) {
@@ -6360,149 +5672,421 @@ void OneofDescriptorProto::InternalSwap(OneofDescriptorProto* other) {
::google::protobuf::Metadata OneofDescriptorProto::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<const char*>(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();
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+}
+
+
+// ===================================================================
+
+void EnumDescriptorProto_EnumReservedRange::InitAsDefaultInstance() {
+}
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int EnumDescriptorProto_EnumReservedRange::kStartFieldNumber;
+const int EnumDescriptorProto_EnumReservedRange::kEndFieldNumber;
+#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
+
+EnumDescriptorProto_EnumReservedRange::EnumDescriptorProto_EnumReservedRange()
+ : ::google::protobuf::Message(), _internal_metadata_(NULL) {
+ if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto_EnumReservedRange();
+ }
+ SharedCtor();
+ // @@protoc_insertion_point(constructor:google.protobuf.EnumDescriptorProto.EnumReservedRange)
+}
+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_);
+ ::memcpy(&start_, &from.start_,
+ static_cast<size_t>(reinterpret_cast<char*>(&end_) -
+ reinterpret_cast<char*>(&start_)) + sizeof(end_));
+ // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumDescriptorProto.EnumReservedRange)
+}
+
+void EnumDescriptorProto_EnumReservedRange::SharedCtor() {
+ _cached_size_ = 0;
+ ::memset(&start_, 0, static_cast<size_t>(
+ reinterpret_cast<char*>(&end_) -
+ reinterpret_cast<char*>(&start_)) + sizeof(end_));
+}
+
+EnumDescriptorProto_EnumReservedRange::~EnumDescriptorProto_EnumReservedRange() {
+ // @@protoc_insertion_point(destructor:google.protobuf.EnumDescriptorProto.EnumReservedRange)
+ SharedDtor();
+}
+
+void EnumDescriptorProto_EnumReservedRange::SharedDtor() {
+ ::google::protobuf::Arena* arena = GetArenaNoVirtual();
+ GOOGLE_DCHECK(arena == NULL);
+ if (arena != NULL) {
+ return;
+ }
+
+}
+
+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* EnumDescriptorProto_EnumReservedRange::descriptor() {
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+}
+
+const EnumDescriptorProto_EnumReservedRange& EnumDescriptorProto_EnumReservedRange::default_instance() {
+ ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::InitDefaultsEnumDescriptorProto_EnumReservedRange();
+ return *internal_default_instance();
+}
+
+EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto_EnumReservedRange::New(::google::protobuf::Arena* arena) const {
+ return ::google::protobuf::Arena::CreateMessage<EnumDescriptorProto_EnumReservedRange>(arena);
+}
+
+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) {
+ ::memset(&start_, 0, static_cast<size_t>(
+ reinterpret_cast<char*>(&end_) -
+ reinterpret_cast<char*>(&start_)) + sizeof(end_));
+ }
+ _has_bits_.Clear();
+ _internal_metadata_.Clear();
+}
+
+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.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 int32 start = 1;
+ case 1: {
+ 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_)));
+ } else {
+ goto handle_unusual;
+ }
+ break;
+ }
+
+ // optional int32 end = 2;
+ case 2: {
+ 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_)));
+ } 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.EnumDescriptorProto.EnumReservedRange)
+ return true;
+failure:
+ // @@protoc_insertion_point(parse_failure:google.protobuf.EnumDescriptorProto.EnumReservedRange)
+ return false;
+#undef DO_
+}
+
+void EnumDescriptorProto_EnumReservedRange::SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const {
+ // @@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 int32 start = 1;
+ if (cached_has_bits & 0x00000001u) {
+ ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->start(), output);
+ }
+
+ // optional int32 end = 2;
+ if (cached_has_bits & 0x00000002u) {
+ ::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.EnumDescriptorProto.EnumReservedRange)
+}
+
+::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.EnumDescriptorProto.EnumReservedRange)
+ ::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);
+ }
+
+ // 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.EnumDescriptorProto.EnumReservedRange)
+ return target;
+}
+
+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()) {
+ total_size +=
+ ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+ _internal_metadata_.unknown_fields());
+ }
+ if (_has_bits_[0 / 32] & 3u) {
+ // optional int32 start = 1;
+ if (has_start()) {
+ total_size += 1 +
+ ::google::protobuf::internal::WireFormatLite::Int32Size(
+ this->start());
+ }
+
+ // optional int32 end = 2;
+ if (has_end()) {
+ total_size += 1 +
+ ::google::protobuf::internal::WireFormatLite::Int32Size(
+ this->end());
+ }
+
+ }
+ 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 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 EnumDescriptorProto_EnumReservedRange* source =
+ ::google::protobuf::internal::DynamicCastToGenerated<const EnumDescriptorProto_EnumReservedRange>(
+ &from);
+ if (source == NULL) {
+ // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumDescriptorProto.EnumReservedRange)
+ ::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
- clear_has_name();
+ // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumDescriptorProto.EnumReservedRange)
+ MergeFrom(*source);
}
- name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.name)
}
-// optional .google.protobuf.OneofOptions options = 2;
-bool OneofDescriptorProto::has_options() const {
- return (_has_bits_[0] & 0x00000002u) != 0;
+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;
+ (void) cached_has_bits;
+
+ cached_has_bits = from._has_bits_[0];
+ if (cached_has_bits & 3u) {
+ if (cached_has_bits & 0x00000001u) {
+ start_ = from.start_;
+ }
+ if (cached_has_bits & 0x00000002u) {
+ end_ = from.end_;
+ }
+ _has_bits_[0] |= cached_has_bits;
+ }
}
-void OneofDescriptorProto::set_has_options() {
- _has_bits_[0] |= 0x00000002u;
+
+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::clear_has_options() {
- _has_bits_[0] &= ~0x00000002u;
+
+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);
}
-void OneofDescriptorProto::clear_options() {
- if (options_ != NULL) options_->::google::protobuf::OneofOptions::Clear();
- clear_has_options();
+
+bool EnumDescriptorProto_EnumReservedRange::IsInitialized() const {
+ return true;
}
-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<const ::google::protobuf::OneofOptions*>(
- &::google::protobuf::_OneofOptions_default_instance_);
+
+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;
+ }
+ }
}
-::google::protobuf::OneofOptions* OneofDescriptorProto::mutable_options() {
- set_has_options();
+void EnumDescriptorProto_EnumReservedRange::UnsafeArenaSwap(EnumDescriptorProto_EnumReservedRange* other) {
+ if (other == this) return;
+ GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
+ InternalSwap(other);
+}
+void EnumDescriptorProto_EnumReservedRange::InternalSwap(EnumDescriptorProto_EnumReservedRange* other) {
+ using std::swap;
+ 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 EnumDescriptorProto_EnumReservedRange::GetMetadata() const {
+ protobuf_google_2fprotobuf_2fdescriptor_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
+}
+
+
+// ===================================================================
+
+void EnumDescriptorProto::InitAsDefaultInstance() {
+ ::google::protobuf::_EnumDescriptorProto_default_instance_._instance.get_mutable()->options_ = const_cast< ::google::protobuf::EnumOptions*>(
+ ::google::protobuf::EnumOptions::internal_default_instance());
+}
+void EnumDescriptorProto::_slow_mutable_options() {
+ options_ = ::google::protobuf::Arena::CreateMessage< ::google::protobuf::EnumOptions >(
+ GetArenaNoVirtual());
+}
+::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<EnumDescriptorProto>(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);
@@ -6623,6 +6217,35 @@ bool EnumDescriptorProto::MergePartialFromCodedStream(
break;
}
+ // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 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_reserved_range()));
+ } else {
+ goto handle_unusual;
+ }
+ break;
+ }
+
+ // repeated string reserved_name = 5;
+ case 5: {
+ if (static_cast< ::google::protobuf::uint8>(tag) ==
+ 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<int>(this->reserved_name(this->reserved_name_size() - 1).length()),
+ ::google::protobuf::internal::WireFormat::PARSE,
+ "google.protobuf.EnumDescriptorProto.reserved_name");
+ } else {
+ goto handle_unusual;
+ }
+ break;
+ }
+
default: {
handle_unusual:
if (tag == 0) {
@@ -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<unsigned int>(this->reserved_range_size()); i < n; i++) {
+ ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+ 4, this->reserved_range(static_cast<int>(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<int>(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<unsigned int>(this->reserved_range_size()); i < n; i++) {
+ target = ::google::protobuf::internal::WireFormatLite::
+ InternalWriteMessageNoVirtualToArray(
+ 4, this->reserved_range(static_cast<int>(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<int>(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<unsigned int>(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<int>(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<const char*>(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<const ::google::protobuf::EnumOptions*>(
- &::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<EnumValueDescriptorProto>(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<const char*>(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<const ::google::protobuf::EnumValueOptions*>(
- &::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<ServiceDescriptorProto>(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<const char*>(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<const ::google::protobuf::ServiceOptions*>(
- &::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<MethodDescriptorProto>(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<size_t>(
- reinterpret_cast<char*>(&server_streaming_) -
- reinterpret_cast<char*>(&client_streaming_)) + sizeof(server_streaming_));
- }
+ ::memset(&client_streaming_, 0, static_cast<size_t>(
+ reinterpret_cast<char*>(&server_streaming_) -
+ reinterpret_cast<char*>(&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<const char*>(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<const char*>(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<const char*>(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)
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
}
-// 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<const ::google::protobuf::MethodOptions*>(
- &::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)
-}
-
-#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<size_t>(reinterpret_cast<char*>(&optimize_for_) -
- reinterpret_cast<char*>(&java_multiple_files_)) + sizeof(optimize_for_));
+ reinterpret_cast<char*>(&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<size_t>(
- reinterpret_cast<char*>(&cc_enable_arenas_) -
- reinterpret_cast<char*>(&java_multiple_files_)) + sizeof(cc_enable_arenas_));
+ ::memset(&cc_enable_arenas_, 0, static_cast<size_t>(
+ reinterpret_cast<char*>(&deprecated_) -
+ reinterpret_cast<char*>(&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<FileOptions>(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<size_t>(
- reinterpret_cast<char*>(&deprecated_) -
- reinterpret_cast<char*>(&java_multiple_files_)) + sizeof(deprecated_));
+ ::memset(&cc_enable_arenas_, 0, static_cast<size_t>(
+ reinterpret_cast<char*>(&php_generic_services_) -
+ reinterpret_cast<char*>(&cc_enable_arenas_)) + sizeof(php_generic_services_));
}
if (cached_has_bits & 196608u) {
- cc_enable_arenas_ = false;
+ deprecated_ = false;
optimize_for_ = 1;
}
_has_bits_.Clear();
@@ -9122,20 +8359,6 @@ bool FileOptions::MergePartialFromCodedStream(
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_)));
- } else {
- goto handle_unusual;
- }
- break;
- }
-
// optional bool java_generate_equals_and_hash = 20 [deprecated = true];
case 20: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
@@ -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<unsigned int>(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<unsigned int>(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<const char*>(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<const char*>(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)
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
}
-// 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<const char*>(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)
-}
-
-// 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<const char*>(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<const char*>(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<const char*>(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<const char*>(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<const char*>(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<MessageOptions>(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<size_t>(
- reinterpret_cast<char*>(&map_entry_) -
- reinterpret_cast<char*>(&message_set_wire_format_)) + sizeof(map_entry_));
- }
+ ::memset(&message_set_wire_format_, 0, static_cast<size_t>(
+ reinterpret_cast<char*>(&map_entry_) -
+ reinterpret_cast<char*>(&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)
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
}
-// 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_;
-}
-
-#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<FieldOptions>(arena);
}
void FieldOptions::Clear() {
@@ -11752,6 +10139,21 @@ bool FieldOptions::IsInitialized() const {
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)
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
}
-// 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)
-}
-
-// 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<OneofOptions>(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<EnumOptions>(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<size_t>(
- reinterpret_cast<char*>(&deprecated_) -
- reinterpret_cast<char*>(&allow_alias_)) + sizeof(deprecated_));
- }
+ ::memset(&allow_alias_, 0, static_cast<size_t>(
+ reinterpret_cast<char*>(&deprecated_) -
+ reinterpret_cast<char*>(&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];
+ 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_;
-}
-
-#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<EnumValueOptions>(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];
+ 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_;
-}
-
-#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<ServiceOptions>(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<MethodOptions>(arena);
}
void MethodOptions::Clear() {
@@ -13771,6 +11918,21 @@ bool MethodOptions::IsInitialized() const {
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;
+ }
+ }
+}
+void MethodOptions::UnsafeArenaSwap(MethodOptions* other) {
+ if (other == this) return;
+ GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
InternalSwap(other);
}
void MethodOptions::InternalSwap(MethodOptions* other) {
@@ -13786,95 +11948,14 @@ void MethodOptions::InternalSwap(MethodOptions* other) {
::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)
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
}
-// 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);
-}
-::google::protobuf::UninterpretedOption* MethodOptions::mutable_uninterpreted_option(int index) {
- // @@protoc_insertion_point(field_mutable:google.protobuf.MethodOptions.uninterpreted_option)
- return uninterpreted_option_.Mutable(index);
-}
-::google::protobuf::UninterpretedOption* MethodOptions::add_uninterpreted_option() {
- // @@protoc_insertion_point(field_add:google.protobuf.MethodOptions.uninterpreted_option)
- return uninterpreted_option_.Add();
-}
-::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*
-MethodOptions::mutable_uninterpreted_option() {
- // @@protoc_insertion_point(field_mutable_list:google.protobuf.MethodOptions.uninterpreted_option)
- return &uninterpreted_option_;
-}
-const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&
-MethodOptions::uninterpreted_option() const {
- // @@protoc_insertion_point(field_list:google.protobuf.MethodOptions.uninterpreted_option)
- return uninterpreted_option_;
-}
-
-#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<UninterpretedOption_NamePart>(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<const char*>(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<size_t>(reinterpret_cast<char*>(&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<UninterpretedOption>(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<const char*>(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)
+ return ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::file_level_metadata[kIndexInFileMessages];
}
-// 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<const char*>(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<const char*>(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)
-}
-
-#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<SourceCodeInfo_Location>(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];
+ 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<const char*>(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<const char*>(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<const char*>(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<const char*>(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_;
-}
-
-#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<SourceCodeInfo>(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<size_t>(reinterpret_cast<char*>(&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<GeneratedCodeInfo_Annotation>(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<const char*>(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<GeneratedCodeInfo>(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 <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
// @@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<const FileDescriptorSet*>(
&_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 <typename T> 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<const FileDescriptorProto*>(
&_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 <typename T> 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<const DescriptorProto_ExtensionRange*>(
&_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 <typename T> 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<const DescriptorProto_ReservedRange*>(
&_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 <typename T> 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<const DescriptorProto*>(
&_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 <typename T> 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<const ExtensionRangeOptions*>(
&_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 <typename T> 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<const FieldDescriptorProto*>(
&_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 <typename T> 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<const OneofDescriptorProto*>(
&_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 <typename T> 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<const EnumDescriptorProto_EnumReservedRange*>(
+ &_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 <typename T> 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<const EnumDescriptorProto*>(
&_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 <typename T> 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<const EnumValueDescriptorProto*>(
&_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 <typename T> 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<const ServiceDescriptorProto*>(
&_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 <typename T> 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<const MethodDescriptorProto*>(
&_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 <typename T> 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<const FileOptions*>(
&_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 <typename T> 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<const MessageOptions*>(
&_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 <typename T> 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<const FieldOptions*>(
&_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 <typename T> 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<const OneofOptions*>(
&_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 <typename T> 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<const EnumOptions*>(
&_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 <typename T> 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<const EnumValueOptions*>(
&_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 <typename T> 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<const ServiceOptions*>(
&_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 <typename T> 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<const MethodOptions*>(
&_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 <typename T> 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<const UninterpretedOption_NamePart*>(
&_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 <typename T> 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<const UninterpretedOption*>(
&_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 <typename T> 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<const SourceCodeInfo_Location*>(
&_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 <typename T> 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<const SourceCodeInfo*>(
&_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 <typename T> 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<const GeneratedCodeInfo_Annotation*>(
&_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 <typename T> 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<const GeneratedCodeInfo*>(
&_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 <typename T> 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<const char*>(value), size));
+ name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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,6 +7791,112 @@ inline void EnumDescriptorProto::set_allocated_options(::google::protobuf::EnumO
}
// @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.options)
}
+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<const char*>(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<const char*>(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_;
+}
// -------------------------------------------------------------------
@@ -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<const char*>(value), size));
+ name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ input_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ output_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ java_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ java_outer_classname_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ go_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ objc_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ csharp_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ swift_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ php_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ identifier_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ leading_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ trailing_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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<const char*>(value), size));
+ source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(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,6 @@ GeneratedCodeInfo::annotation() const {
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
-#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS
// -------------------------------------------------------------------
// -------------------------------------------------------------------
@@ -9389,9 +11271,10 @@ GeneratedCodeInfo::annotation() const {
// -------------------------------------------------------------------
+// -------------------------------------------------------------------
-// @@protoc_insertion_point(namespace_scope)
+// @@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 <limits>
#include <memory>
#ifndef _SHARED_PTR_H
#include <google/protobuf/stubs/shared_ptr.h>
@@ -62,6 +63,7 @@
#include <google/protobuf/testing/googletest.h>
#include <gtest/gtest.h>
+
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 <google/protobuf/duration.pb.h>
#include <algorithm>
@@ -16,57 +15,52 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
class DurationDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Duration>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Duration>
+ _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<const ::google::protobuf::Message*>(&_Duration_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::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 <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@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<const Duration*>(
&_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 <google/protobuf/empty.pb.h>
#include <algorithm>
@@ -16,55 +15,50 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
class EmptyDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Empty>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Empty>
+ _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<const ::google::protobuf::Message*>(&_Empty_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::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 <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@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<const Empty*>(
&_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 <typename ExtendeeT>
+// 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 <typename ExtendeeT>
+ static void Register(int number, FieldType type, bool is_packed) {
+ ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number,
+ type, false, is_packed);
+ }
};
template <typename Type>
@@ -751,6 +760,11 @@ class RepeatedPrimitiveTypeTraits {
bool is_packed, ExtensionSet* set);
static const RepeatedFieldType* GetDefaultRepeatedField();
+ template <typename ExtendeeT>
+ 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 <typename ExtendeeT>
+ 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 <typename ExtendeeT>
+ 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 <typename ExtendeeT>
+ static void Register(int number, FieldType type, bool is_packed) {
+ ExtensionSet::RegisterEnumExtension(&ExtendeeT::default_instance(), number,
+ type, false, is_packed, IsValid);
+ }
};
template <typename Type, bool IsValid(int)>
@@ -980,6 +1010,11 @@ class RepeatedEnumTypeTraits {
return reinterpret_cast<const RepeatedField<Type>*>(
RepeatedPrimitiveTypeTraits<int32>::GetDefaultRepeatedField());
}
+ template <typename ExtendeeT>
+ 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<Type*>(set->UnsafeArenaReleaseMessage(
number, Type::default_instance()));
}
+ template <typename ExtendeeT>
+ 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 <typename ExtendeeT>
+ 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<ExtendeeType>(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 <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
+#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/unknown_field_set.h>
#include <google/protobuf/wire_format.h>
#include <google/protobuf/wire_format_lite_inl.h>
@@ -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 <google/protobuf/field_mask.pb.h>
#include <algorithm>
@@ -16,56 +15,51 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
class FieldMaskDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<FieldMask>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<FieldMask>
+ _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<const ::google::protobuf::Message*>(&_FieldMask_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::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<const char*>(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<const char*>(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 <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@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<const FieldMask*>(
&_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 <google/protobuf/map.h>
#include <google/protobuf/map_entry_lite.h>
+#include <google/protobuf/map_field_lite.h>
#include <google/protobuf/message_lite.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/wire_format_lite_inl.h>
@@ -197,20 +198,6 @@ bool MergePartialFromCodedStream(MessageLite* msg, const ParseTable& table,
bool MergePartialFromCodedStreamLite(MessageLite* msg, const ParseTable& table,
io::CodedInputStream* input);
-template <typename MEntry>
-struct MapEntryToMapField;
-
-template <typename Key, typename Value, WireFormatLite::FieldType kKeyFieldType,
- WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-struct MapEntryToMapField<MapEntryLite<Key, Value, kKeyFieldType,
- kValueFieldType, default_enum_value> > {
- typedef MapFieldLite<MapEntryLite<Key, Value, kKeyFieldType, kValueFieldType,
- default_enum_value>,
- Key, Value, kKeyFieldType, kValueFieldType,
- default_enum_value>
- MapFieldType;
-};
-
template <typename Entry>
bool ParseMap(io::CodedInputStream* input, void* map_field) {
typedef typename MapEntryToMapField<Entry>::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 <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/port.h>
namespace google {
namespace protobuf {
@@ -40,17 +41,18 @@ namespace internal {
template<size_t doublewords>
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 <google/protobuf/implicit_weak_message.h>
+
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
+#include <google/protobuf/wire_format_lite.h>
+
+namespace google {
+namespace protobuf {
+namespace internal {
+
+::google::protobuf::internal::ExplicitlyConstructed<ImplicitWeakMessage>
+ 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 <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/message_lite.h>
+
+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<ImplicitWeakMessage>(arena);
+ }
+
+ Arena* GetArena() const { return arena_; }
+
+ void Clear() { data_.clear(); }
+
+ bool IsInitialized() const { return true; }
+
+ void CheckTypeAndMergeFrom(const MessageLite& other) {
+ data_.append(static_cast<const ImplicitWeakMessage&>(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<ImplicitWeakMessage>
+ 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<bool, const uint8*> ReadVarint32FromArray(
+GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
+::std::pair<bool, const uint8*> ReadVarint32FromArray(
uint32 first_byte, const uint8* buffer,
uint32* value);
inline ::std::pair<bool, const uint8*> ReadVarint32FromArray(
@@ -352,8 +353,8 @@ inline ::std::pair<bool, const uint8*> ReadVarint32FromArray(
return std::make_pair(true, ptr);
}
-GOOGLE_ATTRIBUTE_ALWAYS_INLINE::std::pair<bool, const uint8*> ReadVarint64FromArray(
- const uint8* buffer, uint64* value);
+GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE::std::pair<bool, const uint8*>
+ReadVarint64FromArray(const uint8* buffer, uint64* value);
inline ::std::pair<bool, const uint8*> 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 <google/protobuf/stubs/atomicops.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/stubs/port.h>
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<uint32, bool> ReadTagWithCutoff(
- uint32 cutoff) {
+ GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
+ std::pair<uint32, bool> ReadTagWithCutoff(uint32 cutoff) {
std::pair<uint32, bool> result = ReadTagWithCutoffNoLastTag(cutoff);
last_tag_ = result.first;
return result;
}
- GOOGLE_ATTRIBUTE_ALWAYS_INLINE std::pair<uint32, bool> ReadTagWithCutoffNoLastTag(
- uint32 cutoff);
+ GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
+ std::pair<uint32, bool> 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 <algorithm>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/stl_util.h>
+#include <google/protobuf/stubs/io_win32.h>
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<string*>* 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<string*>* callback);
-
- // implements ZeroCopyOutputStream, overriding StringOutputStream -----------
- bool Next(void** data, int* size);
- int64 ByteCount() const;
-
- private:
- const google::protobuf::scoped_ptr<ResultCallback<string*> > 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 <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/testing/googletest.h>
#include <google/protobuf/testing/file.h>
#include <gtest/gtest.h>
+#include <google/protobuf/stubs/io_win32.h>
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<char> 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<char> arena_block_;
+ google::protobuf::scoped_ptr<Arena> 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<protobuf_unittest::TestArenaMapLite>(&arena);
+ Arena::CreateMessage<protobuf_unittest::TestArenaMapLite>(arena_.get());
google::protobuf::MapLiteTestUtil::SetArenaMapFields(from);
from->SerializeToString(&data);
protobuf_unittest::TestArenaMapLite* to =
- google::protobuf::Arena::CreateMessage<protobuf_unittest::TestArenaMapLite>(&arena);
+ Arena::CreateMessage<protobuf_unittest::TestArenaMapLite>(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<protobuf_unittest::ForeignMessageArenaLite>(
- &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<const ::google::protobuf::uint8*>(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<Derived, Message, Key, Value, kKeyFieldType,
kValueFieldType, default_enum_value> {
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<Derived, Message, Key, Value, kKeyFieldType,
@@ -118,11 +95,9 @@ class MapEntry
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- private:
- static uint32 offsets_[2];
- static uint32 has_bits_[2];
InternalMetadataWithArena _internal_metadata_;
+ private:
friend class ::google::protobuf::Arena;
template <typename C, typename K, typename V,
WireFormatLite::FieldType k_wire_type, WireFormatLite::FieldType,
@@ -133,32 +108,18 @@ class MapEntry
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntry);
};
-template <typename Derived, typename Key, typename Value,
- WireFormatLite::FieldType kKeyFieldType,
- WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-uint32 MapEntry<Derived, Key, Value, kKeyFieldType, kValueFieldType,
- default_enum_value>::offsets_[2] = {
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, key_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, value_),
-};
-
-template <typename Derived, typename Key, typename Value,
- WireFormatLite::FieldType kKeyFieldType,
- WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-uint32 MapEntry<Derived, Key, Value, kKeyFieldType, kValueFieldType,
- default_enum_value>::has_bits_[2] = {0, 1};
-
// Specialization for the full runtime
template <typename Derived, typename Key, typename Value,
WireFormatLite::FieldType kKeyFieldType,
WireFormatLite::FieldType kValueFieldType, int default_enum_value>
struct MapEntryHelper<MapEntry<Derived, Key, Value, kKeyFieldType,
kValueFieldType, default_enum_value> >
- : MapEntryHelper<MapEntryLite<Key, Value, kKeyFieldType, kValueFieldType,
- default_enum_value> > {
+ : MapEntryHelper<MapEntryLite<Derived, Key, Value, kKeyFieldType,
+ kValueFieldType, default_enum_value> > {
explicit MapEntryHelper(const MapPair<Key, Value>& map_pair)
- : MapEntryHelper<MapEntryLite<Key, Value, kKeyFieldType, kValueFieldType,
- default_enum_value> >(map_pair) {}
+ : MapEntryHelper<MapEntryLite<Derived, Key, Value, kKeyFieldType,
+ kValueFieldType, default_enum_value> >(
+ map_pair) {}
};
template <typename Derived, typename K, typename V,
diff --git a/src/google/protobuf/map_entry_lite.h b/src/google/protobuf/map_entry_lite.h
index 0bccf4d2..7f8636a9 100644
--- a/src/google/protobuf/map_entry_lite.h
+++ b/src/google/protobuf/map_entry_lite.h
@@ -36,6 +36,7 @@
#include <google/protobuf/arena.h>
#include <google/protobuf/map.h>
#include <google/protobuf/map_type_handler.h>
+#include <google/protobuf/stubs/port.h>
#include <google/protobuf/wire_format_lite_inl.h>
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<Derived>(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*>(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<KeyTypeHandler::kIsEnum,
KeyTypeHandler::kIsMessage,
KeyTypeHandler::kWireType ==
@@ -517,13 +510,13 @@ class MapEntryImpl : public Base {
return arena_;
}
- MapEntryImpl* default_instance_;
-
+ public: // Needed for constructing tables
KeyOnMemory key_;
ValueOnMemory value_;
Arena* arena_;
uint32 _has_bits_[1];
+ private:
friend class ::google::protobuf::Arena;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
@@ -537,23 +530,20 @@ class MapEntryImpl : public Base {
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntryImpl);
};
-template <typename Key, typename Value, WireFormatLite::FieldType kKeyFieldType,
+template <typename T, typename Key, typename Value,
+ WireFormatLite::FieldType kKeyFieldType,
WireFormatLite::FieldType kValueFieldType, int default_enum_value>
class MapEntryLite
- : public MapEntryImpl<MapEntryLite<Key, Value, kKeyFieldType,
- kValueFieldType, default_enum_value>,
- MessageLite, Key, Value, kKeyFieldType,
+ : public MapEntryImpl<T, MessageLite, Key, Value, kKeyFieldType,
kValueFieldType, default_enum_value> {
public:
- typedef MapEntryImpl<MapEntryLite, MessageLite, Key, Value, kKeyFieldType,
+ typedef MapEntryImpl<T, MessageLite, Key, Value, kKeyFieldType,
kValueFieldType, default_enum_value>
SuperType;
MapEntryLite() {}
explicit MapEntryLite(Arena* arena) : SuperType(arena) {}
- void MergeFrom(const MapEntryLite<Key, Value, kKeyFieldType, kValueFieldType,
- default_enum_value>& other) {
- MergeFromInternal(other);
- }
+ void MergeFrom(const MapEntryLite& other) { MergeFromInternal(other); }
+
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntryLite);
};
@@ -563,9 +553,9 @@ class MapEntryLite
template <typename Derived>
struct DeconstructMapEntry;
-template <typename K, typename V, WireFormatLite::FieldType key,
+template <typename T, typename K, typename V, WireFormatLite::FieldType key,
WireFormatLite::FieldType value, int default_enum>
-struct DeconstructMapEntry<MapEntryLite<K, V, key, value, default_enum> > {
+struct DeconstructMapEntry<MapEntryLite<T, K, V, key, value, default_enum> > {
typedef K Key;
typedef V Value;
static const WireFormatLite::FieldType kKeyFieldType = key;
@@ -636,10 +626,11 @@ struct FromHelper<WireFormatLite::TYPE_MESSAGE> {
template <typename MapEntryType>
struct MapEntryHelper;
-template <typename Key, typename Value, WireFormatLite::FieldType kKeyFieldType,
+template <typename T, typename Key, typename Value,
+ WireFormatLite::FieldType kKeyFieldType,
WireFormatLite::FieldType kValueFieldType, int default_enum_value>
-struct MapEntryHelper<MapEntryLite<Key, Value, kKeyFieldType, kValueFieldType,
- default_enum_value> > {
+struct MapEntryHelper<MapEntryLite<T, Key, Value, kKeyFieldType,
+ kValueFieldType, default_enum_value> > {
// Provide utilities to parse/serialize key/value. Provide utilities to
// manipulate internal stored type.
typedef MapTypeHandler<kKeyFieldType, Key> 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<Key, T> {
// Define message type for internal repeated field.
typedef Derived EntryType;
- typedef MapEntryLite<Key, T, kKeyFieldType, kValueFieldType,
- default_enum_value> EntryLiteType;
+ typedef MapEntryLite<Derived, Key, T, kKeyFieldType, kValueFieldType,
+ default_enum_value>
+ EntryLiteType;
// Define abbreviation for parent MapFieldLite
typedef MapFieldLite<Derived, Key, T, kKeyFieldType, kValueFieldType,
@@ -295,11 +296,13 @@ class MapField : public TypeDefinedMapFieldBase<Key, T> {
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapField);
};
-template <typename MEntry>
-struct MapEntryToMapField {
- typedef DeconstructMapEntry<typename MEntry::SuperType> T;
- typedef MapField<MEntry, typename T::Key, typename T::Value, T::kKeyFieldType,
- T::kValueFieldType, T::default_enum_value>
+template <typename T, typename Key, typename Value,
+ WireFormatLite::FieldType kKeyFieldType,
+ WireFormatLite::FieldType kValueFieldType, int default_enum_value>
+struct MapEntryToMapField<MapEntry<T, Key, Value, kKeyFieldType,
+ kValueFieldType, default_enum_value> > {
+ typedef MapField<T, Key, Value, kKeyFieldType, kValueFieldType,
+ default_enum_value>
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<Key, T>& t) {
return true;
}
+template <typename MEntry>
+struct MapEntryToMapField : MapEntryToMapField<typename MEntry::SuperType> {};
+
+template <typename T, typename Key, typename Value,
+ WireFormatLite::FieldType kKeyFieldType,
+ WireFormatLite::FieldType kValueFieldType, int default_enum_value>
+struct MapEntryToMapField<MapEntryLite<T, Key, Value, kKeyFieldType,
+ kValueFieldType, default_enum_value> > {
+ typedef MapFieldLite<MapEntryLite<T, Key, Value, kKeyFieldType,
+ kValueFieldType, default_enum_value>,
+ 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<EntryType, int32, int32, WireFormatLite::TYPE_INT32,
WireFormatLite::TYPE_INT32, false>
MapFieldType;
@@ -206,7 +206,7 @@ class MapFieldStateTest
: public testing::TestWithParam<State> {
public:
protected:
- typedef unittest::TestMap::TestMap_MapInt32Int32Entry EntryType;
+ typedef unittest::TestMap_MapInt32Int32Entry_DoNotUse EntryType;
typedef MapField<EntryType, int32, int32, WireFormatLite::TYPE_INT32,
WireFormatLite::TYPE_INT32, false>
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<int32, int32>::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<int32, int32>::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<int> 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<int>(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<Message>::NewFromPrototype(
const Message* prototype, google::protobuf::Arena* arena) {
@@ -472,7 +472,7 @@ Message* GenericTypeHandler<Message>::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<Message>::GetArena(
Message* value) {
@@ -481,7 +481,7 @@ google::protobuf::Arena* GenericTypeHandler<Message>::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<Message>::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<const FieldDescriptor*>* 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<const internal::SerializationTable*>(InternalGetTable()), output);
+ internal::TableSerialize(
+ *this,
+ static_cast<const internal::SerializationTable*>(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<const internal::SerializationTable*>(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 <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/once.h>
-
-
-#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 <google/protobuf/stubs/port.h>
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 <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/testing/googletest.h>
#include <gtest/gtest.h>
+#include <google/protobuf/stubs/io_win32.h>
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 <google/protobuf/stubs/common.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/stubs/port.h>
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<Container>()->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<Container>()->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<Container>()->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<Derived*>(this)->DoMergeFrom(other.unknown_fields());
}
}
- GOOGLE_ATTRIBUTE_ALWAYS_INLINE void Clear() {
+ GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Clear() {
if (have_unknown_fields()) {
static_cast<Derived*>(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<intptr_t>(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<Container>(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 <google/protobuf/stubs/type_traits.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/message_lite.h>
+#include <google/protobuf/stubs/port.h>
// 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 <typename TypeHandler>
const typename TypeHandler::Type* const* data() const;
- template <typename TypeHandler>
- GOOGLE_ATTRIBUTE_ALWAYS_INLINE void Swap(RepeatedPtrFieldBase* other);
+ template <typename TypeHandler> 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 <typename TypeHandler> GOOGLE_ATTRIBUTE_NOINLINE
+ template <typename TypeHandler> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
void AddAllocatedSlowWithCopy(typename TypeHandler::Type* value,
Arena* value_arena,
Arena* my_arena);
- template <typename TypeHandler> GOOGLE_ATTRIBUTE_NOINLINE
+ template <typename TypeHandler> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE
void AddAllocatedSlowWithoutCopy(typename TypeHandler::Type* value);
template <typename TypeHandler>
@@ -536,7 +546,7 @@ class LIBPROTOBUF_EXPORT RepeatedPtrFieldBase {
template <typename TypeHandler>
typename TypeHandler::Type* ReleaseLastInternal(google::protobuf::internal::false_type);
- template<typename TypeHandler> GOOGLE_ATTRIBUTE_NOINLINE
+ template<typename TypeHandler> 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<Element>::operator=(const RepeatedField& other) {
return *this;
}
+#if LANG_CXX11
+
+template <typename Element>
+inline RepeatedField<Element>::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 <typename Element>
+inline RepeatedField<Element>& RepeatedField<Element>::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 <typename Element>
inline bool RepeatedField<Element>::empty() const {
return current_size_ == 0;
@@ -1900,6 +1946,38 @@ inline RepeatedPtrField<Element>& RepeatedPtrField<Element>::operator=(
return *this;
}
+#if LANG_CXX11
+
+template <typename Element>
+inline RepeatedPtrField<Element>::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 <typename Element>
+inline RepeatedPtrField<Element>& RepeatedPtrField<Element>::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 <typename Element>
inline bool RepeatedPtrField<Element>::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<Element*, OtherElement*>(0);
+ implicit_cast<Element*>(static_cast<OtherElement*>(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 <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/unittest.pb.h>
+#include <gmock/gmock.h>
#include <google/protobuf/testing/googletest.h>
#include <gtest/gtest.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/stubs/stl_util.h>
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<int> 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<int> me;
- me.Add(3);
- EXPECT_DEATH(me.MergeFrom(me), "");
-}
-#endif // NDEBUG
-#endif // PROTOBUF_HAS_DEATH_TEST
TEST(RepeatedField, CopyFrom) {
RepeatedField<int> source, destination;
@@ -390,6 +383,142 @@ TEST(RepeatedField, SelfAssign) {
EXPECT_EQ(8, source.Get(1));
}
+#if LANG_CXX11
+
+TEST(RepeatedField, MoveConstruct) {
+ {
+ RepeatedField<int> source;
+ source.Add(1);
+ source.Add(2);
+ const int* data = source.data();
+ RepeatedField<int> 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<int>* source =
+ Arena::CreateMessage<RepeatedField<int>>(&arena);
+ source->Add(1);
+ source->Add(2);
+ RepeatedField<int> 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<int> source;
+ source.Add(1);
+ source.Add(2);
+ RepeatedField<int> 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<int>* source =
+ Arena::CreateMessage<RepeatedField<int>>(&arena);
+ source->Add(1);
+ source->Add(2);
+ RepeatedField<int>* destination =
+ Arena::CreateMessage<RepeatedField<int>>(&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<int>* source =
+ Arena::CreateMessage<RepeatedField<int>>(&source_arena);
+ source->Add(1);
+ source->Add(2);
+ Arena destination_arena;
+ RepeatedField<int>* destination =
+ Arena::CreateMessage<RepeatedField<int>>(&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<int>* source =
+ Arena::CreateMessage<RepeatedField<int>>(&arena);
+ source->Add(1);
+ source->Add(2);
+ RepeatedField<int> 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<int> source;
+ source.Add(1);
+ source.Add(2);
+ Arena arena;
+ RepeatedField<int>* destination =
+ Arena::CreateMessage<RepeatedField<int>>(&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<int> field;
+ // An alias to defeat -Wself-move.
+ RepeatedField<int>& 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<int>* field =
+ Arena::CreateMessage<RepeatedField<int>>(&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<int> 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<string> me;
- me.Add()->assign("1");
- EXPECT_DEATH(me.MergeFrom(me), "");
-}
-#endif // PROTOBUF_HAS_DEATH_TEST
TEST(RepeatedPtrField, CopyFrom) {
RepeatedPtrField<string> source, destination;
@@ -923,6 +1045,142 @@ TEST(RepeatedPtrField, SelfAssign) {
EXPECT_EQ("8", source.Get(1));
}
+#if LANG_CXX11
+
+TEST(RepeatedPtrField, MoveConstruct) {
+ {
+ RepeatedPtrField<string> source;
+ *source.Add() = "1";
+ *source.Add() = "2";
+ const string* const* data = source.data();
+ RepeatedPtrField<string> 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<string>* source =
+ Arena::CreateMessage<RepeatedPtrField<string>>(&arena);
+ *source->Add() = "1";
+ *source->Add() = "2";
+ RepeatedPtrField<string> 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<string> source;
+ *source.Add() = "1";
+ *source.Add() = "2";
+ RepeatedPtrField<string> 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<string>* source =
+ Arena::CreateMessage<RepeatedPtrField<string>>(&arena);
+ *source->Add() = "1";
+ *source->Add() = "2";
+ RepeatedPtrField<string>* destination =
+ Arena::CreateMessage<RepeatedPtrField<string>>(&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<string>* source =
+ Arena::CreateMessage<RepeatedPtrField<string>>(&source_arena);
+ *source->Add() = "1";
+ *source->Add() = "2";
+ Arena destination_arena;
+ RepeatedPtrField<string>* destination =
+ Arena::CreateMessage<RepeatedPtrField<string>>(&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<string>* source =
+ Arena::CreateMessage<RepeatedPtrField<string>>(&arena);
+ *source->Add() = "1";
+ *source->Add() = "2";
+ RepeatedPtrField<string> 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<string> source;
+ *source.Add() = "1";
+ *source.Add() = "2";
+ Arena arena;
+ RepeatedPtrField<string>* destination =
+ Arena::CreateMessage<RepeatedPtrField<string>>(&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<string> field;
+ // An alias to defeat -Wself-move.
+ RepeatedPtrField<string>& 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<string>* field =
+ Arena::CreateMessage<RepeatedPtrField<string>>(&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<string> 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 <google/protobuf/source_context.pb.h>
#include <algorithm>
@@ -16,56 +15,51 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
class SourceContextDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<SourceContext>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<SourceContext>
+ _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<const ::google::protobuf::Message*>(&_SourceContext_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::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<const char*>(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 <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@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<const SourceContext*>(
&_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 <google/protobuf/struct.pb.h>
#include <algorithm>
@@ -16,23 +15,22 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
-class Struct_FieldsEntryDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Struct::Struct_FieldsEntry>
- _instance;
-} _Struct_FieldsEntry_default_instance_;
+class Struct_FieldsEntry_DoNotUseDefaultTypeInternal {
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Struct_FieldsEntry_DoNotUse>
+ _instance;
+} _Struct_FieldsEntry_DoNotUse_default_instance_;
class StructDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Struct>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Struct>
+ _instance;
} _Struct_default_instance_;
class ValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Value>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Value>
+ _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<ListValue>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<ListValue>
+ _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<const ::google::protobuf::Message*>(&_Struct_FieldsEntry_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_Struct_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_Value_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_ListValue_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Struct_FieldsEntry_DoNotUse_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Struct_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Value_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::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<ptrdiff_t>(n)] = SortItem(&*it);
}
::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
- ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
+ ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry;
for (size_type i = 0; i < n; i++) {
entry.reset(fields_.NewEntryWrapper(
items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
@@ -422,7 +407,7 @@ void Struct::SerializeWithCachedSizes(
Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
}
} else {
- ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
+ ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it) {
@@ -479,7 +464,7 @@ void Struct::SerializeWithCachedSizes(
items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
}
::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
- ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
+ ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry;
for (size_type i = 0; i < n; i++) {
entry.reset(fields_.NewEntryWrapper(
items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
@@ -493,7 +478,7 @@ void Struct::SerializeWithCachedSizes(
Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
}
} else {
- ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
+ ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it) {
@@ -532,7 +517,7 @@ size_t Struct::ByteSizeLong() const {
total_size += 1 *
::google::protobuf::internal::FromIntSize(this->fields_size());
{
- ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry;
+ ::google::protobuf::scoped_ptr<Struct_FieldsEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it) {
@@ -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<string, .google.protobuf.Value> 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<const char*>(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 <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
// @@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<Struct_FieldsEntry_DoNotUse,
+ ::std::string, ::google::protobuf::Value,
+ ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
+ ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
+ 0 > {
+public:
+ typedef ::google::protobuf::internal::MapEntry<Struct_FieldsEntry_DoNotUse,
+ ::std::string, ::google::protobuf::Value,
+ ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
+ ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
+ 0 > 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<const Struct_FieldsEntry_DoNotUse*>(&_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<const Struct*>(
&_Struct_default_instance_);
@@ -204,35 +225,15 @@ class LIBPROTOBUF_EXPORT Struct : public ::google::protobuf::Message /* @@protoc
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- public:
- class Struct_FieldsEntry : public ::google::protobuf::internal::MapEntry<Struct_FieldsEntry,
- ::std::string, ::google::protobuf::Value,
- ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
- ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
- 0 > {
- public:
- typedef ::google::protobuf::internal::MapEntry<Struct_FieldsEntry,
- ::std::string, ::google::protobuf::Value,
- ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
- ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
- 0 > 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<const Message*>(&_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<const Value*>(
&_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<const ListValue*>(
&_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<const char*>(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 <map>
-# include <set>
+# 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 <byteswap.h> // 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<const uint16 *>(_p))
#define GOOGLE_UNALIGNED_LOAD32(_p) (*reinterpret_cast<const uint32 *>(_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 <google/protobuf/stubs/common.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/message.h>
+#include <google/protobuf/message_lite.h>
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 <google/protobuf/timestamp.pb.h>
#include <algorithm>
@@ -16,57 +15,52 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
class TimestampDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Timestamp>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Timestamp>
+ _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<const ::google::protobuf::Message*>(&_Timestamp_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::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 <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@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<const Timestamp*>(
&_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 <google/protobuf/type.pb.h>
#include <algorithm>
@@ -16,134 +15,202 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
class TypeDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Type>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Type>
+ _instance;
} _Type_default_instance_;
class FieldDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Field>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Field>
+ _instance;
} _Field_default_instance_;
class EnumDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Enum>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Enum>
+ _instance;
} _Enum_default_instance_;
class EnumValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<EnumValue>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<EnumValue>
+ _instance;
} _EnumValue_default_instance_;
class OptionDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Option>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Option>
+ _instance;
} _Option_default_instance_;
-
+} // namespace protobuf
+} // namespace google
namespace protobuf_google_2fprotobuf_2ftype_2eproto {
+void InitDefaultsTypeImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+ ::google::protobuf::internal::InitProtobufDefaults();
+ protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsField();
+ protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption();
+ protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaultsSourceContext();
+ {
+ void* ptr = &::google::protobuf::_Type_default_instance_;
+ new (ptr) ::google::protobuf::Type();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::Type::InitAsDefaultInstance();
+}
-namespace {
+void InitDefaultsType() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTypeImpl);
+}
-::google::protobuf::Metadata file_level_metadata[5];
-const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[3];
+void InitDefaultsFieldImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
-} // namespace
+ ::google::protobuf::internal::InitProtobufDefaults();
+ protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption();
+ {
+ void* ptr = &::google::protobuf::_Field_default_instance_;
+ new (ptr) ::google::protobuf::Field();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::Field::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 InitDefaultsField() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFieldImpl);
+}
-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 },
-};
+void InitDefaultsEnumImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumValue();
+ protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption();
+ protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaultsSourceContext();
+ {
+ void* ptr = &::google::protobuf::_Enum_default_instance_;
+ new (ptr) ::google::protobuf::Enum();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::Enum::InitAsDefaultInstance();
+}
+
+void InitDefaultsEnum() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumImpl);
+}
+
+void InitDefaultsEnumValueImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption();
+ {
+ void* ptr = &::google::protobuf::_EnumValue_default_instance_;
+ new (ptr) ::google::protobuf::EnumValue();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::EnumValue::InitAsDefaultInstance();
+}
+
+void InitDefaultsEnumValue() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEnumValueImpl);
+}
+
+void InitDefaultsOptionImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ protobuf_google_2fprotobuf_2fany_2eproto::InitDefaultsAny();
+ {
+ void* ptr = &::google::protobuf::_Option_default_instance_;
+ new (ptr) ::google::protobuf::Option();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::Option::InitAsDefaultInstance();
+}
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+void InitDefaultsOption() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsOptionImpl);
+}
+
+::google::protobuf::Metadata file_level_metadata[5];
+const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[3];
+
+const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, name_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, fields_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, oneofs_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, options_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, source_context_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Type, syntax_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, name_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, fields_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, oneofs_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, options_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, source_context_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Type, syntax_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, kind_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, cardinality_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, number_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, name_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, type_url_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, oneof_index_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, packed_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, options_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, json_name_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Field, default_value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, kind_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, cardinality_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, number_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, name_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, type_url_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, oneof_index_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, packed_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, options_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, json_name_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Field, default_value_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, name_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, enumvalue_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, options_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, source_context_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Enum, syntax_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, name_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, enumvalue_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, options_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, source_context_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Enum, syntax_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, name_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, number_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValue, options_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValue, name_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValue, number_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::EnumValue, options_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Option, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, name_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Option, value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Option, name_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Option, value_),
};
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- { 0, -1, sizeof(Type)},
- { 11, -1, sizeof(Field)},
- { 26, -1, sizeof(Enum)},
- { 36, -1, sizeof(EnumValue)},
- { 44, -1, sizeof(Option)},
+static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+ { 0, -1, sizeof(::google::protobuf::Type)},
+ { 11, -1, sizeof(::google::protobuf::Field)},
+ { 26, -1, sizeof(::google::protobuf::Enum)},
+ { 36, -1, sizeof(::google::protobuf::EnumValue)},
+ { 44, -1, sizeof(::google::protobuf::Option)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
- reinterpret_cast<const ::google::protobuf::Message*>(&_Type_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_Field_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_Enum_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_EnumValue_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_Option_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Type_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Field_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Enum_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_EnumValue_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Option_default_instance_),
};
-namespace {
-
void protobuf_AssignDescriptors() {
AddDescriptors();
::google::protobuf::MessageFactory* factory = NULL;
@@ -157,45 +224,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, 5);
}
-} // namespace
-void TableStruct::InitDefaultsImpl() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- ::google::protobuf::internal::InitProtobufDefaults();
- ::google::protobuf::protobuf_google_2fprotobuf_2fany_2eproto::InitDefaults();
- ::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::InitDefaults();
- _Type_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_Type_default_instance_);_Field_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_Field_default_instance_);_Enum_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_Enum_default_instance_);_EnumValue_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_EnumValue_default_instance_);_Option_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_Option_default_instance_);_Type_default_instance_._instance.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>(
- ::google::protobuf::SourceContext::internal_default_instance());
- _Enum_default_instance_._instance.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>(
- ::google::protobuf::SourceContext::internal_default_instance());
- _Option_default_instance_._instance.get_mutable()->value_ = const_cast< ::google::protobuf::Any*>(
- ::google::protobuf::Any::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\032google/protobuf/type.proto\022\017google.pro"
"tobuf\032\031google/protobuf/any.proto\032$google"
"/protobuf/source_context.proto\"\327\001\n\004Type\022"
@@ -241,10 +278,9 @@ void AddDescriptorsImpl() {
descriptor, 1594);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"google/protobuf/type.proto", &protobuf_RegisterTypes);
- ::google::protobuf::protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptors();
- ::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors();
+ ::protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptors();
+ ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors();
}
-} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
@@ -256,9 +292,9 @@ struct StaticDescriptorInitializer {
AddDescriptors();
}
} static_descriptor_initializer;
-
} // namespace protobuf_google_2fprotobuf_2ftype_2eproto
-
+namespace google {
+namespace protobuf {
const ::google::protobuf::EnumDescriptor* Field_Kind_descriptor() {
protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_enum_descriptors[0];
@@ -356,6 +392,10 @@ bool Syntax_IsValid(int value) {
// ===================================================================
+void Type::InitAsDefaultInstance() {
+ ::google::protobuf::_Type_default_instance_._instance.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>(
+ ::google::protobuf::SourceContext::internal_default_instance());
+}
void Type::_slow_mutable_source_context() {
source_context_ = ::google::protobuf::Arena::Create< ::google::protobuf::SourceContext >(
GetArenaNoVirtual());
@@ -369,13 +409,6 @@ void Type::_slow_mutable_source_context() {
return temp;
}
}
-::google::protobuf::SourceContext* Type::unsafe_arena_release_source_context() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Type.source_context)
-
- ::google::protobuf::SourceContext* temp = source_context_;
- source_context_ = NULL;
- return temp;
-}
void Type::unsafe_arena_set_allocated_source_context(
::google::protobuf::SourceContext* source_context) {
if (GetArenaNoVirtual() == NULL) {
@@ -401,7 +434,7 @@ const int Type::kSyntaxFieldNumber;
Type::Type()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsType();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.Type)
@@ -412,7 +445,7 @@ Type::Type(::google::protobuf::Arena* arena)
fields_(arena),
oneofs_(arena),
options_(arena) {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsType();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Type)
@@ -475,12 +508,12 @@ void Type::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Type::descriptor() {
- protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Type& Type::default_instance() {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsType();
return *internal_default_instance();
}
@@ -897,286 +930,14 @@ void Type::InternalSwap(Type* other) {
::google::protobuf::Metadata Type::GetMetadata() const {
protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// Type
-
-// string name = 1;
-void Type::clear_name() {
- name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-const ::std::string& Type::name() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Type.name)
- return name_.Get();
-}
-void Type::set_name(const ::std::string& value) {
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set:google.protobuf.Type.name)
-}
-#if LANG_CXX11
-void Type::set_name(::std::string&& value) {
-
- name_.Set(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Type.name)
-}
-#endif
-void Type::set_name(const char* value) {
- GOOGLE_DCHECK(value != NULL);
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_char:google.protobuf.Type.name)
-}
-void Type::set_name(const char* value,
- size_t size) {
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
- reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.Type.name)
-}
-::std::string* Type::mutable_name() {
-
- // @@protoc_insertion_point(field_mutable:google.protobuf.Type.name)
- return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Type::release_name() {
- // @@protoc_insertion_point(field_release:google.protobuf.Type.name)
-
- return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Type::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Type.name)
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
- return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
-}
-void Type::set_allocated_name(::std::string* name) {
- if (name != NULL) {
-
- } else {
-
- }
- name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.name)
-}
-void Type::unsafe_arena_set_allocated_name(
- ::std::string* name) {
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
- if (name != NULL) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- name, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Type.name)
-}
-
-// repeated .google.protobuf.Field fields = 2;
-int Type::fields_size() const {
- return fields_.size();
-}
-void Type::clear_fields() {
- fields_.Clear();
-}
-const ::google::protobuf::Field& Type::fields(int index) const {
- // @@protoc_insertion_point(field_get:google.protobuf.Type.fields)
- return fields_.Get(index);
-}
-::google::protobuf::Field* Type::mutable_fields(int index) {
- // @@protoc_insertion_point(field_mutable:google.protobuf.Type.fields)
- return fields_.Mutable(index);
-}
-::google::protobuf::Field* Type::add_fields() {
- // @@protoc_insertion_point(field_add:google.protobuf.Type.fields)
- return fields_.Add();
-}
-::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >*
-Type::mutable_fields() {
- // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.fields)
- return &fields_;
-}
-const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >&
-Type::fields() const {
- // @@protoc_insertion_point(field_list:google.protobuf.Type.fields)
- return fields_;
+ return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
}
-// repeated string oneofs = 3;
-int Type::oneofs_size() const {
- return oneofs_.size();
-}
-void Type::clear_oneofs() {
- oneofs_.Clear();
-}
-const ::std::string& Type::oneofs(int index) const {
- // @@protoc_insertion_point(field_get:google.protobuf.Type.oneofs)
- return oneofs_.Get(index);
-}
-::std::string* Type::mutable_oneofs(int index) {
- // @@protoc_insertion_point(field_mutable:google.protobuf.Type.oneofs)
- return oneofs_.Mutable(index);
-}
-void Type::set_oneofs(int index, const ::std::string& value) {
- // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs)
- oneofs_.Mutable(index)->assign(value);
-}
-#if LANG_CXX11
-void Type::set_oneofs(int index, ::std::string&& value) {
- // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs)
- oneofs_.Mutable(index)->assign(std::move(value));
-}
-#endif
-void Type::set_oneofs(int index, const char* value) {
- GOOGLE_DCHECK(value != NULL);
- oneofs_.Mutable(index)->assign(value);
- // @@protoc_insertion_point(field_set_char:google.protobuf.Type.oneofs)
-}
-void Type::set_oneofs(int index, const char* value, size_t size) {
- oneofs_.Mutable(index)->assign(
- reinterpret_cast<const char*>(value), size);
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.Type.oneofs)
-}
-::std::string* Type::add_oneofs() {
- // @@protoc_insertion_point(field_add_mutable:google.protobuf.Type.oneofs)
- return oneofs_.Add();
-}
-void Type::add_oneofs(const ::std::string& value) {
- oneofs_.Add()->assign(value);
- // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs)
-}
-#if LANG_CXX11
-void Type::add_oneofs(::std::string&& value) {
- oneofs_.Add(std::move(value));
- // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs)
-}
-#endif
-void Type::add_oneofs(const char* value) {
- GOOGLE_DCHECK(value != NULL);
- oneofs_.Add()->assign(value);
- // @@protoc_insertion_point(field_add_char:google.protobuf.Type.oneofs)
-}
-void Type::add_oneofs(const char* value, size_t size) {
- oneofs_.Add()->assign(reinterpret_cast<const char*>(value), size);
- // @@protoc_insertion_point(field_add_pointer:google.protobuf.Type.oneofs)
-}
-const ::google::protobuf::RepeatedPtrField< ::std::string>&
-Type::oneofs() const {
- // @@protoc_insertion_point(field_list:google.protobuf.Type.oneofs)
- return oneofs_;
-}
-::google::protobuf::RepeatedPtrField< ::std::string>*
-Type::mutable_oneofs() {
- // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.oneofs)
- return &oneofs_;
-}
-
-// repeated .google.protobuf.Option options = 4;
-int Type::options_size() const {
- return options_.size();
-}
-void Type::clear_options() {
- options_.Clear();
-}
-const ::google::protobuf::Option& Type::options(int index) const {
- // @@protoc_insertion_point(field_get:google.protobuf.Type.options)
- return options_.Get(index);
-}
-::google::protobuf::Option* Type::mutable_options(int index) {
- // @@protoc_insertion_point(field_mutable:google.protobuf.Type.options)
- return options_.Mutable(index);
-}
-::google::protobuf::Option* Type::add_options() {
- // @@protoc_insertion_point(field_add:google.protobuf.Type.options)
- return options_.Add();
-}
-::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-Type::mutable_options() {
- // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.options)
- return &options_;
-}
-const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-Type::options() const {
- // @@protoc_insertion_point(field_list:google.protobuf.Type.options)
- return options_;
-}
-
-// .google.protobuf.SourceContext source_context = 5;
-bool Type::has_source_context() const {
- return this != internal_default_instance() && source_context_ != NULL;
-}
-void Type::clear_source_context() {
- if (GetArenaNoVirtual() == NULL && source_context_ != NULL) delete source_context_;
- source_context_ = NULL;
-}
-const ::google::protobuf::SourceContext& Type::source_context() const {
- const ::google::protobuf::SourceContext* p = source_context_;
- // @@protoc_insertion_point(field_get:google.protobuf.Type.source_context)
- return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::SourceContext*>(
- &::google::protobuf::_SourceContext_default_instance_);
-}
-::google::protobuf::SourceContext* Type::mutable_source_context() {
-
- if (source_context_ == NULL) {
- _slow_mutable_source_context();
- }
- // @@protoc_insertion_point(field_mutable:google.protobuf.Type.source_context)
- return source_context_;
-}
-::google::protobuf::SourceContext* Type::release_source_context() {
- // @@protoc_insertion_point(field_release:google.protobuf.Type.source_context)
-
- if (GetArenaNoVirtual() != NULL) {
- return _slow_release_source_context();
- } else {
- ::google::protobuf::SourceContext* temp = source_context_;
- source_context_ = NULL;
- return temp;
- }
-}
- void Type::set_allocated_source_context(::google::protobuf::SourceContext* source_context) {
- ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
- if (message_arena == NULL) {
- delete source_context_;
- }
- if (source_context != NULL) {
- if (message_arena != NULL) {
- message_arena->Own(source_context);
- }
- }
- source_context_ = source_context;
- if (source_context) {
-
- } else {
-
- }
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.source_context)
-}
-
-// .google.protobuf.Syntax syntax = 6;
-void Type::clear_syntax() {
- syntax_ = 0;
-}
-::google::protobuf::Syntax Type::syntax() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Type.syntax)
- return static_cast< ::google::protobuf::Syntax >(syntax_);
-}
-void Type::set_syntax(::google::protobuf::Syntax value) {
-
- syntax_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.Type.syntax)
-}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void Field::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Field::kKindFieldNumber;
const int Field::kCardinalityFieldNumber;
@@ -1193,7 +954,7 @@ const int Field::kDefaultValueFieldNumber;
Field::Field()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsField();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.Field)
@@ -1202,7 +963,7 @@ Field::Field(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena),
options_(arena) {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsField();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Field)
@@ -1280,12 +1041,12 @@ void Field::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Field::descriptor() {
- protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Field& Field::default_instance() {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsField();
return *internal_default_instance();
}
@@ -1862,416 +1623,16 @@ void Field::InternalSwap(Field* other) {
::google::protobuf::Metadata Field::GetMetadata() const {
protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
+ return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// Field
-
-// .google.protobuf.Field.Kind kind = 1;
-void Field::clear_kind() {
- kind_ = 0;
-}
-::google::protobuf::Field_Kind Field::kind() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Field.kind)
- return static_cast< ::google::protobuf::Field_Kind >(kind_);
-}
-void Field::set_kind(::google::protobuf::Field_Kind value) {
-
- kind_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.Field.kind)
-}
-
-// .google.protobuf.Field.Cardinality cardinality = 2;
-void Field::clear_cardinality() {
- cardinality_ = 0;
-}
-::google::protobuf::Field_Cardinality Field::cardinality() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Field.cardinality)
- return static_cast< ::google::protobuf::Field_Cardinality >(cardinality_);
-}
-void Field::set_cardinality(::google::protobuf::Field_Cardinality value) {
-
- cardinality_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.Field.cardinality)
-}
-
-// int32 number = 3;
-void Field::clear_number() {
- number_ = 0;
-}
-::google::protobuf::int32 Field::number() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Field.number)
- return number_;
-}
-void Field::set_number(::google::protobuf::int32 value) {
-
- number_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.Field.number)
-}
-
-// string name = 4;
-void Field::clear_name() {
- name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-const ::std::string& Field::name() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Field.name)
- return name_.Get();
-}
-void Field::set_name(const ::std::string& value) {
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set:google.protobuf.Field.name)
-}
-#if LANG_CXX11
-void Field::set_name(::std::string&& value) {
-
- name_.Set(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Field.name)
-}
-#endif
-void Field::set_name(const char* value) {
- GOOGLE_DCHECK(value != NULL);
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_char:google.protobuf.Field.name)
-}
-void Field::set_name(const char* value,
- size_t size) {
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
- reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.name)
-}
-::std::string* Field::mutable_name() {
-
- // @@protoc_insertion_point(field_mutable:google.protobuf.Field.name)
- return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Field::release_name() {
- // @@protoc_insertion_point(field_release:google.protobuf.Field.name)
-
- return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Field::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.name)
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
- return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
-}
-void Field::set_allocated_name(::std::string* name) {
- if (name != NULL) {
-
- } else {
-
- }
- name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.name)
-}
-void Field::unsafe_arena_set_allocated_name(
- ::std::string* name) {
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
- if (name != NULL) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- name, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.name)
-}
-
-// string type_url = 6;
-void Field::clear_type_url() {
- type_url_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-const ::std::string& Field::type_url() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Field.type_url)
- return type_url_.Get();
-}
-void Field::set_type_url(const ::std::string& value) {
-
- type_url_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set:google.protobuf.Field.type_url)
-}
-#if LANG_CXX11
-void Field::set_type_url(::std::string&& value) {
-
- type_url_.Set(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Field.type_url)
-}
-#endif
-void Field::set_type_url(const char* value) {
- GOOGLE_DCHECK(value != NULL);
-
- type_url_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_char:google.protobuf.Field.type_url)
-}
-void Field::set_type_url(const char* value,
- size_t size) {
-
- type_url_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
- reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.type_url)
-}
-::std::string* Field::mutable_type_url() {
-
- // @@protoc_insertion_point(field_mutable:google.protobuf.Field.type_url)
- return type_url_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Field::release_type_url() {
- // @@protoc_insertion_point(field_release:google.protobuf.Field.type_url)
-
- return type_url_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Field::unsafe_arena_release_type_url() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.type_url)
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
- return type_url_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
-}
-void Field::set_allocated_type_url(::std::string* type_url) {
- if (type_url != NULL) {
-
- } else {
-
- }
- type_url_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url,
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.type_url)
-}
-void Field::unsafe_arena_set_allocated_type_url(
- ::std::string* type_url) {
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
- if (type_url != NULL) {
-
- } else {
-
- }
- type_url_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- type_url, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.type_url)
-}
-
-// int32 oneof_index = 7;
-void Field::clear_oneof_index() {
- oneof_index_ = 0;
-}
-::google::protobuf::int32 Field::oneof_index() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Field.oneof_index)
- return oneof_index_;
-}
-void Field::set_oneof_index(::google::protobuf::int32 value) {
-
- oneof_index_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.Field.oneof_index)
-}
-
-// bool packed = 8;
-void Field::clear_packed() {
- packed_ = false;
-}
-bool Field::packed() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Field.packed)
- return packed_;
-}
-void Field::set_packed(bool value) {
-
- packed_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.Field.packed)
-}
-
-// repeated .google.protobuf.Option options = 9;
-int Field::options_size() const {
- return options_.size();
-}
-void Field::clear_options() {
- options_.Clear();
-}
-const ::google::protobuf::Option& Field::options(int index) const {
- // @@protoc_insertion_point(field_get:google.protobuf.Field.options)
- return options_.Get(index);
-}
-::google::protobuf::Option* Field::mutable_options(int index) {
- // @@protoc_insertion_point(field_mutable:google.protobuf.Field.options)
- return options_.Mutable(index);
-}
-::google::protobuf::Option* Field::add_options() {
- // @@protoc_insertion_point(field_add:google.protobuf.Field.options)
- return options_.Add();
-}
-::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-Field::mutable_options() {
- // @@protoc_insertion_point(field_mutable_list:google.protobuf.Field.options)
- return &options_;
-}
-const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-Field::options() const {
- // @@protoc_insertion_point(field_list:google.protobuf.Field.options)
- return options_;
-}
-
-// string json_name = 10;
-void Field::clear_json_name() {
- json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-const ::std::string& Field::json_name() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Field.json_name)
- return json_name_.Get();
-}
-void Field::set_json_name(const ::std::string& value) {
-
- json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set:google.protobuf.Field.json_name)
-}
-#if LANG_CXX11
-void Field::set_json_name(::std::string&& value) {
-
- json_name_.Set(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Field.json_name)
-}
-#endif
-void Field::set_json_name(const char* value) {
- GOOGLE_DCHECK(value != NULL);
-
- json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_char:google.protobuf.Field.json_name)
-}
-void Field::set_json_name(const char* value,
- size_t size) {
-
- json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
- reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.json_name)
-}
-::std::string* Field::mutable_json_name() {
-
- // @@protoc_insertion_point(field_mutable:google.protobuf.Field.json_name)
- return json_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Field::release_json_name() {
- // @@protoc_insertion_point(field_release:google.protobuf.Field.json_name)
-
- return json_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Field::unsafe_arena_release_json_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.json_name)
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
- return json_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
-}
-void Field::set_allocated_json_name(::std::string* json_name) {
- if (json_name != NULL) {
-
- } else {
-
- }
- json_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name,
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.json_name)
-}
-void Field::unsafe_arena_set_allocated_json_name(
- ::std::string* json_name) {
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
- if (json_name != NULL) {
-
- } else {
-
- }
- json_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- json_name, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.json_name)
-}
-
-// string default_value = 11;
-void Field::clear_default_value() {
- default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-const ::std::string& Field::default_value() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Field.default_value)
- return default_value_.Get();
-}
-void Field::set_default_value(const ::std::string& value) {
-
- default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set:google.protobuf.Field.default_value)
-}
-#if LANG_CXX11
-void Field::set_default_value(::std::string&& value) {
-
- default_value_.Set(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Field.default_value)
-}
-#endif
-void Field::set_default_value(const char* value) {
- GOOGLE_DCHECK(value != NULL);
-
- default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_char:google.protobuf.Field.default_value)
-}
-void Field::set_default_value(const char* value,
- size_t size) {
-
- default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
- reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.default_value)
-}
-::std::string* Field::mutable_default_value() {
-
- // @@protoc_insertion_point(field_mutable:google.protobuf.Field.default_value)
- return default_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Field::release_default_value() {
- // @@protoc_insertion_point(field_release:google.protobuf.Field.default_value)
-
- return default_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Field::unsafe_arena_release_default_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.default_value)
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
- return default_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
-}
-void Field::set_allocated_default_value(::std::string* default_value) {
- if (default_value != NULL) {
-
- } else {
-
- }
- default_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value,
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.default_value)
-}
-void Field::unsafe_arena_set_allocated_default_value(
- ::std::string* default_value) {
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
- if (default_value != NULL) {
-
- } else {
-
- }
- default_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- default_value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.default_value)
-}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void Enum::InitAsDefaultInstance() {
+ ::google::protobuf::_Enum_default_instance_._instance.get_mutable()->source_context_ = const_cast< ::google::protobuf::SourceContext*>(
+ ::google::protobuf::SourceContext::internal_default_instance());
+}
void Enum::_slow_mutable_source_context() {
source_context_ = ::google::protobuf::Arena::Create< ::google::protobuf::SourceContext >(
GetArenaNoVirtual());
@@ -2285,13 +1646,6 @@ void Enum::_slow_mutable_source_context() {
return temp;
}
}
-::google::protobuf::SourceContext* Enum::unsafe_arena_release_source_context() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Enum.source_context)
-
- ::google::protobuf::SourceContext* temp = source_context_;
- source_context_ = NULL;
- return temp;
-}
void Enum::unsafe_arena_set_allocated_source_context(
::google::protobuf::SourceContext* source_context) {
if (GetArenaNoVirtual() == NULL) {
@@ -2316,7 +1670,7 @@ const int Enum::kSyntaxFieldNumber;
Enum::Enum()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnum();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.Enum)
@@ -2326,7 +1680,7 @@ Enum::Enum(::google::protobuf::Arena* arena)
_internal_metadata_(arena),
enumvalue_(arena),
options_(arena) {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnum();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Enum)
@@ -2388,12 +1742,12 @@ void Enum::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Enum::descriptor() {
- protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Enum& Enum::default_instance() {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnum();
return *internal_default_instance();
}
@@ -2762,217 +2116,14 @@ void Enum::InternalSwap(Enum* other) {
::google::protobuf::Metadata Enum::GetMetadata() const {
protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
+ return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// Enum
-
-// string name = 1;
-void Enum::clear_name() {
- name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-const ::std::string& Enum::name() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Enum.name)
- return name_.Get();
-}
-void Enum::set_name(const ::std::string& value) {
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set:google.protobuf.Enum.name)
-}
-#if LANG_CXX11
-void Enum::set_name(::std::string&& value) {
-
- name_.Set(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Enum.name)
-}
-#endif
-void Enum::set_name(const char* value) {
- GOOGLE_DCHECK(value != NULL);
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_char:google.protobuf.Enum.name)
-}
-void Enum::set_name(const char* value,
- size_t size) {
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
- reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.Enum.name)
-}
-::std::string* Enum::mutable_name() {
-
- // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.name)
- return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Enum::release_name() {
- // @@protoc_insertion_point(field_release:google.protobuf.Enum.name)
-
- return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Enum::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Enum.name)
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
- return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
-}
-void Enum::set_allocated_name(::std::string* name) {
- if (name != NULL) {
-
- } else {
-
- }
- name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.name)
-}
-void Enum::unsafe_arena_set_allocated_name(
- ::std::string* name) {
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
- if (name != NULL) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- name, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Enum.name)
-}
-
-// repeated .google.protobuf.EnumValue enumvalue = 2;
-int Enum::enumvalue_size() const {
- return enumvalue_.size();
-}
-void Enum::clear_enumvalue() {
- enumvalue_.Clear();
-}
-const ::google::protobuf::EnumValue& Enum::enumvalue(int index) const {
- // @@protoc_insertion_point(field_get:google.protobuf.Enum.enumvalue)
- return enumvalue_.Get(index);
-}
-::google::protobuf::EnumValue* Enum::mutable_enumvalue(int index) {
- // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.enumvalue)
- return enumvalue_.Mutable(index);
-}
-::google::protobuf::EnumValue* Enum::add_enumvalue() {
- // @@protoc_insertion_point(field_add:google.protobuf.Enum.enumvalue)
- return enumvalue_.Add();
-}
-::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >*
-Enum::mutable_enumvalue() {
- // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.enumvalue)
- return &enumvalue_;
-}
-const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >&
-Enum::enumvalue() const {
- // @@protoc_insertion_point(field_list:google.protobuf.Enum.enumvalue)
- return enumvalue_;
-}
-
-// repeated .google.protobuf.Option options = 3;
-int Enum::options_size() const {
- return options_.size();
-}
-void Enum::clear_options() {
- options_.Clear();
-}
-const ::google::protobuf::Option& Enum::options(int index) const {
- // @@protoc_insertion_point(field_get:google.protobuf.Enum.options)
- return options_.Get(index);
-}
-::google::protobuf::Option* Enum::mutable_options(int index) {
- // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.options)
- return options_.Mutable(index);
-}
-::google::protobuf::Option* Enum::add_options() {
- // @@protoc_insertion_point(field_add:google.protobuf.Enum.options)
- return options_.Add();
-}
-::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-Enum::mutable_options() {
- // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.options)
- return &options_;
-}
-const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-Enum::options() const {
- // @@protoc_insertion_point(field_list:google.protobuf.Enum.options)
- return options_;
-}
-
-// .google.protobuf.SourceContext source_context = 4;
-bool Enum::has_source_context() const {
- return this != internal_default_instance() && source_context_ != NULL;
-}
-void Enum::clear_source_context() {
- if (GetArenaNoVirtual() == NULL && source_context_ != NULL) delete source_context_;
- source_context_ = NULL;
-}
-const ::google::protobuf::SourceContext& Enum::source_context() const {
- const ::google::protobuf::SourceContext* p = source_context_;
- // @@protoc_insertion_point(field_get:google.protobuf.Enum.source_context)
- return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::SourceContext*>(
- &::google::protobuf::_SourceContext_default_instance_);
-}
-::google::protobuf::SourceContext* Enum::mutable_source_context() {
-
- if (source_context_ == NULL) {
- _slow_mutable_source_context();
- }
- // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.source_context)
- return source_context_;
-}
-::google::protobuf::SourceContext* Enum::release_source_context() {
- // @@protoc_insertion_point(field_release:google.protobuf.Enum.source_context)
-
- if (GetArenaNoVirtual() != NULL) {
- return _slow_release_source_context();
- } else {
- ::google::protobuf::SourceContext* temp = source_context_;
- source_context_ = NULL;
- return temp;
- }
-}
- void Enum::set_allocated_source_context(::google::protobuf::SourceContext* source_context) {
- ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
- if (message_arena == NULL) {
- delete source_context_;
- }
- if (source_context != NULL) {
- if (message_arena != NULL) {
- message_arena->Own(source_context);
- }
- }
- source_context_ = source_context;
- if (source_context) {
-
- } else {
-
- }
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.source_context)
-}
-
-// .google.protobuf.Syntax syntax = 5;
-void Enum::clear_syntax() {
- syntax_ = 0;
-}
-::google::protobuf::Syntax Enum::syntax() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Enum.syntax)
- return static_cast< ::google::protobuf::Syntax >(syntax_);
-}
-void Enum::set_syntax(::google::protobuf::Syntax value) {
-
- syntax_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.Enum.syntax)
-}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void EnumValue::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int EnumValue::kNameFieldNumber;
const int EnumValue::kNumberFieldNumber;
@@ -2982,7 +2133,7 @@ const int EnumValue::kOptionsFieldNumber;
EnumValue::EnumValue()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumValue();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.EnumValue)
@@ -2991,7 +2142,7 @@ EnumValue::EnumValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena),
options_(arena) {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumValue();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.EnumValue)
@@ -3044,12 +2195,12 @@ void EnumValue::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* EnumValue::descriptor() {
- protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const EnumValue& EnumValue::default_instance() {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumValue();
return *internal_default_instance();
}
@@ -3335,135 +2486,16 @@ void EnumValue::InternalSwap(EnumValue* other) {
::google::protobuf::Metadata EnumValue::GetMetadata() const {
protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// EnumValue
-
-// string name = 1;
-void EnumValue::clear_name() {
- name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-const ::std::string& EnumValue::name() const {
- // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.name)
- return name_.Get();
-}
-void EnumValue::set_name(const ::std::string& value) {
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set:google.protobuf.EnumValue.name)
-}
-#if LANG_CXX11
-void EnumValue::set_name(::std::string&& value) {
-
- name_.Set(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_rvalue:google.protobuf.EnumValue.name)
-}
-#endif
-void EnumValue::set_name(const char* value) {
- GOOGLE_DCHECK(value != NULL);
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_char:google.protobuf.EnumValue.name)
-}
-void EnumValue::set_name(const char* value,
- size_t size) {
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
- reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumValue.name)
-}
-::std::string* EnumValue::mutable_name() {
-
- // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.name)
- return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* EnumValue::release_name() {
- // @@protoc_insertion_point(field_release:google.protobuf.EnumValue.name)
-
- return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* EnumValue::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValue.name)
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
- return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
-}
-void EnumValue::set_allocated_name(::std::string* name) {
- if (name != NULL) {
-
- } else {
-
- }
- name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValue.name)
-}
-void EnumValue::unsafe_arena_set_allocated_name(
- ::std::string* name) {
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
- if (name != NULL) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- name, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValue.name)
-}
-
-// int32 number = 2;
-void EnumValue::clear_number() {
- number_ = 0;
-}
-::google::protobuf::int32 EnumValue::number() const {
- // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.number)
- return number_;
-}
-void EnumValue::set_number(::google::protobuf::int32 value) {
-
- number_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.EnumValue.number)
-}
-
-// repeated .google.protobuf.Option options = 3;
-int EnumValue::options_size() const {
- return options_.size();
-}
-void EnumValue::clear_options() {
- options_.Clear();
-}
-const ::google::protobuf::Option& EnumValue::options(int index) const {
- // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.options)
- return options_.Get(index);
-}
-::google::protobuf::Option* EnumValue::mutable_options(int index) {
- // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.options)
- return options_.Mutable(index);
-}
-::google::protobuf::Option* EnumValue::add_options() {
- // @@protoc_insertion_point(field_add:google.protobuf.EnumValue.options)
- return options_.Add();
-}
-::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*
-EnumValue::mutable_options() {
- // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValue.options)
- return &options_;
-}
-const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&
-EnumValue::options() const {
- // @@protoc_insertion_point(field_list:google.protobuf.EnumValue.options)
- return options_;
+ return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void Option::InitAsDefaultInstance() {
+ ::google::protobuf::_Option_default_instance_._instance.get_mutable()->value_ = const_cast< ::google::protobuf::Any*>(
+ ::google::protobuf::Any::internal_default_instance());
+}
void Option::_slow_mutable_value() {
value_ = ::google::protobuf::Arena::Create< ::google::protobuf::Any >(
GetArenaNoVirtual());
@@ -3477,13 +2509,6 @@ void Option::_slow_mutable_value() {
return temp;
}
}
-::google::protobuf::Any* Option::unsafe_arena_release_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Option.value)
-
- ::google::protobuf::Any* temp = value_;
- value_ = NULL;
- return temp;
-}
void Option::unsafe_arena_set_allocated_value(
::google::protobuf::Any* value) {
if (GetArenaNoVirtual() == NULL) {
@@ -3505,7 +2530,7 @@ const int Option::kValueFieldNumber;
Option::Option()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.Option)
@@ -3513,7 +2538,7 @@ Option::Option()
Option::Option(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Option)
@@ -3570,12 +2595,12 @@ void Option::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Option::descriptor() {
- protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Option& Option::default_instance() {
- protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOption();
return *internal_default_instance();
}
@@ -3824,143 +2849,11 @@ void Option::InternalSwap(Option* other) {
::google::protobuf::Metadata Option::GetMetadata() const {
protobuf_google_2fprotobuf_2ftype_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2ftype_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// Option
-
-// string name = 1;
-void Option::clear_name() {
- name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-const ::std::string& Option::name() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Option.name)
- return name_.Get();
-}
-void Option::set_name(const ::std::string& value) {
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set:google.protobuf.Option.name)
-}
-#if LANG_CXX11
-void Option::set_name(::std::string&& value) {
-
- name_.Set(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Option.name)
-}
-#endif
-void Option::set_name(const char* value) {
- GOOGLE_DCHECK(value != NULL);
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_char:google.protobuf.Option.name)
-}
-void Option::set_name(const char* value,
- size_t size) {
-
- name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
- reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.Option.name)
-}
-::std::string* Option::mutable_name() {
-
- // @@protoc_insertion_point(field_mutable:google.protobuf.Option.name)
- return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Option::release_name() {
- // @@protoc_insertion_point(field_release:google.protobuf.Option.name)
-
- return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* Option::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Option.name)
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
- return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
-}
-void Option::set_allocated_name(::std::string* name) {
- if (name != NULL) {
-
- } else {
-
- }
- name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.name)
-}
-void Option::unsafe_arena_set_allocated_name(
- ::std::string* name) {
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
- if (name != NULL) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- name, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Option.name)
-}
-
-// .google.protobuf.Any value = 2;
-bool Option::has_value() const {
- return this != internal_default_instance() && value_ != NULL;
-}
-void Option::clear_value() {
- if (GetArenaNoVirtual() == NULL && value_ != NULL) delete value_;
- value_ = NULL;
-}
-const ::google::protobuf::Any& Option::value() const {
- const ::google::protobuf::Any* p = value_;
- // @@protoc_insertion_point(field_get:google.protobuf.Option.value)
- return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::Any*>(
- &::google::protobuf::_Any_default_instance_);
-}
-::google::protobuf::Any* Option::mutable_value() {
-
- if (value_ == NULL) {
- _slow_mutable_value();
- }
- // @@protoc_insertion_point(field_mutable:google.protobuf.Option.value)
- return value_;
-}
-::google::protobuf::Any* Option::release_value() {
- // @@protoc_insertion_point(field_release:google.protobuf.Option.value)
-
- if (GetArenaNoVirtual() != NULL) {
- return _slow_release_value();
- } else {
- ::google::protobuf::Any* temp = value_;
- value_ = NULL;
- return temp;
- }
-}
- void Option::set_allocated_value(::google::protobuf::Any* value) {
- ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
- if (message_arena == NULL) {
- delete value_;
- }
- if (value != NULL) {
- if (message_arena != NULL) {
- message_arena->Own(value);
- }
- }
- value_ = value;
- if (value) {
-
- } else {
-
- }
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.value)
+ return ::protobuf_google_2fprotobuf_2ftype_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/type.pb.h b/src/google/protobuf/type.pb.h
index cc76cc97..8834e167 100644
--- a/src/google/protobuf/type.pb.h
+++ b/src/google/protobuf/type.pb.h
@@ -33,6 +33,36 @@
#include <google/protobuf/any.pb.h>
#include <google/protobuf/source_context.pb.h>
// @@protoc_insertion_point(includes)
+
+namespace protobuf_google_2fprotobuf_2ftype_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[5];
+ 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 InitDefaultsTypeImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsType();
+void LIBPROTOBUF_EXPORT InitDefaultsFieldImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsField();
+void LIBPROTOBUF_EXPORT InitDefaultsEnumImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsEnum();
+void LIBPROTOBUF_EXPORT InitDefaultsEnumValueImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsEnumValue();
+void LIBPROTOBUF_EXPORT InitDefaultsOptionImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsOption();
+inline void LIBPROTOBUF_EXPORT InitDefaults() {
+ InitDefaultsType();
+ InitDefaultsField();
+ InitDefaultsEnum();
+ InitDefaultsEnumValue();
+ InitDefaultsOption();
+}
+} // namespace protobuf_google_2fprotobuf_2ftype_2eproto
namespace google {
namespace protobuf {
class Enum;
@@ -52,25 +82,9 @@ class TypeDefaultTypeInternal;
LIBPROTOBUF_EXPORT extern TypeDefaultTypeInternal _Type_default_instance_;
} // namespace protobuf
} // namespace google
-
namespace google {
namespace protobuf {
-namespace protobuf_google_2fprotobuf_2ftype_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_2ftype_2eproto
-
enum Field_Kind {
Field_Kind_TYPE_UNKNOWN = 0,
Field_Kind_TYPE_DOUBLE = 1,
@@ -190,6 +204,7 @@ class LIBPROTOBUF_EXPORT Type : public ::google::protobuf::Message /* @@protoc_i
static const ::google::protobuf::Descriptor* descriptor();
static const Type& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Type* internal_default_instance() {
return reinterpret_cast<const Type*>(
&_Type_default_instance_);
@@ -347,7 +362,8 @@ class LIBPROTOBUF_EXPORT Type : public ::google::protobuf::Message /* @@protoc_i
::google::protobuf::SourceContext* source_context_;
int syntax_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsTypeImpl();
};
// -------------------------------------------------------------------
@@ -386,6 +402,7 @@ class LIBPROTOBUF_EXPORT Field : public ::google::protobuf::Message /* @@protoc_
static const ::google::protobuf::Descriptor* descriptor();
static const Field& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Field* internal_default_instance() {
return reinterpret_cast<const Field*>(
&_Field_default_instance_);
@@ -662,7 +679,8 @@ class LIBPROTOBUF_EXPORT Field : public ::google::protobuf::Message /* @@protoc_
::google::protobuf::int32 oneof_index_;
bool packed_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsFieldImpl();
};
// -------------------------------------------------------------------
@@ -701,6 +719,7 @@ class LIBPROTOBUF_EXPORT Enum : public ::google::protobuf::Message /* @@protoc_i
static const ::google::protobuf::Descriptor* descriptor();
static const Enum& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Enum* internal_default_instance() {
return reinterpret_cast<const Enum*>(
&_Enum_default_instance_);
@@ -835,7 +854,8 @@ class LIBPROTOBUF_EXPORT Enum : public ::google::protobuf::Message /* @@protoc_i
::google::protobuf::SourceContext* source_context_;
int syntax_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumImpl();
};
// -------------------------------------------------------------------
@@ -874,6 +894,7 @@ class LIBPROTOBUF_EXPORT EnumValue : public ::google::protobuf::Message /* @@pro
static const ::google::protobuf::Descriptor* descriptor();
static const EnumValue& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const EnumValue* internal_default_instance() {
return reinterpret_cast<const EnumValue*>(
&_EnumValue_default_instance_);
@@ -978,7 +999,8 @@ class LIBPROTOBUF_EXPORT EnumValue : public ::google::protobuf::Message /* @@pro
::google::protobuf::internal::ArenaStringPtr name_;
::google::protobuf::int32 number_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsEnumValueImpl();
};
// -------------------------------------------------------------------
@@ -1017,6 +1039,7 @@ class LIBPROTOBUF_EXPORT Option : public ::google::protobuf::Message /* @@protoc
static const ::google::protobuf::Descriptor* descriptor();
static const Option& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Option* internal_default_instance() {
return reinterpret_cast<const Option*>(
&_Option_default_instance_);
@@ -1118,14 +1141,14 @@ class LIBPROTOBUF_EXPORT Option : public ::google::protobuf::Message /* @@protoc
::google::protobuf::internal::ArenaStringPtr name_;
::google::protobuf::Any* value_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaultsOptionImpl();
};
// ===================================================================
// ===================================================================
-#if !PROTOBUF_INLINE_NOT_IN_HEADERS
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
@@ -1387,6 +1410,13 @@ inline void Type::set_allocated_source_context(::google::protobuf::SourceContex
}
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.source_context)
}
+inline ::google::protobuf::SourceContext* Type::unsafe_arena_release_source_context() {
+ // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Type.source_context)
+
+ ::google::protobuf::SourceContext* temp = source_context_;
+ source_context_ = NULL;
+ return temp;
+}
// .google.protobuf.Syntax syntax = 6;
inline void Type::clear_syntax() {
@@ -1996,6 +2026,13 @@ inline void Enum::set_allocated_source_context(::google::protobuf::SourceContex
}
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.source_context)
}
+inline ::google::protobuf::SourceContext* Enum::unsafe_arena_release_source_context() {
+ // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Enum.source_context)
+
+ ::google::protobuf::SourceContext* temp = source_context_;
+ source_context_ = NULL;
+ return temp;
+}
// .google.protobuf.Syntax syntax = 5;
inline void Enum::clear_syntax() {
@@ -2264,11 +2301,17 @@ inline void Option::set_allocated_value(::google::protobuf::Any* value) {
}
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.value)
}
+inline ::google::protobuf::Any* Option::unsafe_arena_release_value() {
+ // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Option.value)
+
+ ::google::protobuf::Any* temp = value_;
+ value_ = NULL;
+ return temp;
+}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
-#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS
// -------------------------------------------------------------------
// -------------------------------------------------------------------
@@ -2280,7 +2323,6 @@ inline void Option::set_allocated_value(::google::protobuf::Any* value) {
// @@protoc_insertion_point(namespace_scope)
-
} // namespace protobuf
} // namespace google
diff --git a/src/google/protobuf/unittest_proto3_arena.proto b/src/google/protobuf/unittest_proto3_arena.proto
index 9375d85a..ea88ec90 100644
--- a/src/google/protobuf/unittest_proto3_arena.proto
+++ b/src/google/protobuf/unittest_proto3_arena.proto
@@ -187,6 +187,7 @@ message TestUnpackedTypes {
message NestedTestAllTypes {
NestedTestAllTypes child = 1;
TestAllTypes payload = 2;
+ repeated NestedTestAllTypes repeated_child = 3;
}
// Define these after TestAllTypes to make sure the compiler can handle
@@ -205,4 +206,3 @@ enum ForeignEnum {
// TestEmptyMessage is used to test behavior of unknown fields.
message TestEmptyMessage {
}
-
diff --git a/src/google/protobuf/util/internal/json_escaping.cc b/src/google/protobuf/util/internal/json_escaping.cc
index 18b7f923..06b9a7f2 100644
--- a/src/google/protobuf/util/internal/json_escaping.cc
+++ b/src/google/protobuf/util/internal/json_escaping.cc
@@ -207,7 +207,7 @@ StringPiece ToHex(uint16 cp, char* buffer) {
buffer[3] = kHex[cp & 0x0f];
cp >>= 4;
buffer[2] = kHex[cp & 0x0f];
- return StringPiece(buffer).substr(0, 6);
+ return StringPiece(buffer, 6);
}
// Stores the 32-bit unicode code point as its hexadecimal digits in buffer
diff --git a/src/google/protobuf/wire_format.h b/src/google/protobuf/wire_format.h
index 01ee1337..d602d214 100644
--- a/src/google/protobuf/wire_format.h
+++ b/src/google/protobuf/wire_format.h
@@ -41,7 +41,6 @@
#include <string>
#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/message.h>
#include <google/protobuf/wire_format_lite.h>
diff --git a/src/google/protobuf/wire_format_lite.cc b/src/google/protobuf/wire_format_lite.cc
index 359353c3..cd343b74 100644
--- a/src/google/protobuf/wire_format_lite.cc
+++ b/src/google/protobuf/wire_format_lite.cc
@@ -586,7 +586,7 @@ void WireFormatLite::WriteMessageMaybeToArray(int field_number,
}
}
-GOOGLE_ATTRIBUTE_ALWAYS_INLINE static bool ReadBytesToString(
+GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static bool ReadBytesToString(
io::CodedInputStream* input, string* value);
inline static bool ReadBytesToString(io::CodedInputStream* input,
string* value) {
diff --git a/src/google/protobuf/wire_format_lite.h b/src/google/protobuf/wire_format_lite.h
index 3e079ea5..8a1540b7 100644
--- a/src/google/protobuf/wire_format_lite.h
+++ b/src/google/protobuf/wire_format_lite.h
@@ -41,10 +41,12 @@
#define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
#include <string>
+
#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/message_lite.h>
-#include <google/protobuf/io/coded_stream.h> // for CodedOutputStream::Varint32Size
+#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/repeated_field.h>
// Do UTF-8 validation on string type in Debug build only
#ifndef NDEBUG
@@ -149,7 +151,7 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
// Helper method to get the CppType for a particular Type.
static CppType FieldTypeToCppType(FieldType type);
- // Given a FieldSescriptor::Type return its WireType
+ // Given a FieldDescriptor::Type return its WireType
static inline WireFormatLite::WireType WireTypeForFieldType(
WireFormatLite::FieldType type) {
return kWireTypeForFieldType[type];
@@ -256,7 +258,7 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
// that file to use these.
#ifdef NDEBUG
-#define INL GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+#define INL GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
#else
// Avoid excessive inlining in non-optimized builds. Without other optimizations
// the inlining is not going to provide benefits anyway and the huge resulting
@@ -712,7 +714,8 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
// A helper method for the repeated primitive reader. This method has
// optimizations for primitive types that have fixed size on the wire, and
// can be read using potentially faster paths.
- template <typename CType, enum FieldType DeclaredType> GOOGLE_ATTRIBUTE_ALWAYS_INLINE
+ template <typename CType, enum FieldType DeclaredType>
+ GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
static bool ReadRepeatedFixedSizePrimitive(
int tag_size,
uint32 tag,
@@ -721,7 +724,8 @@ class LIBPROTOBUF_EXPORT WireFormatLite {
// Like ReadRepeatedFixedSizePrimitive but for packed primitive fields.
template <typename CType, enum FieldType DeclaredType>
- GOOGLE_ATTRIBUTE_ALWAYS_INLINE static bool ReadPackedFixedSizePrimitive(
+ GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE
+ static bool ReadPackedFixedSizePrimitive(
google::protobuf::io::CodedInputStream* input, RepeatedField<CType>* value);
static const CppType kFieldTypeToCppTypeMap[];
diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc
index d76e8aa6..110b6b56 100644
--- a/src/google/protobuf/wrappers.pb.cc
+++ b/src/google/protobuf/wrappers.pb.cc
@@ -1,7 +1,6 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/wrappers.proto
-#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include <google/protobuf/wrappers.pb.h>
#include <algorithm>
@@ -16,168 +15,291 @@
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
-
namespace google {
namespace protobuf {
class DoubleValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<DoubleValue>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<DoubleValue>
+ _instance;
} _DoubleValue_default_instance_;
class FloatValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<FloatValue>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<FloatValue>
+ _instance;
} _FloatValue_default_instance_;
class Int64ValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Int64Value>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Int64Value>
+ _instance;
} _Int64Value_default_instance_;
class UInt64ValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<UInt64Value>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<UInt64Value>
+ _instance;
} _UInt64Value_default_instance_;
class Int32ValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<Int32Value>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<Int32Value>
+ _instance;
} _Int32Value_default_instance_;
class UInt32ValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<UInt32Value>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<UInt32Value>
+ _instance;
} _UInt32Value_default_instance_;
class BoolValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<BoolValue>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<BoolValue>
+ _instance;
} _BoolValue_default_instance_;
class StringValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<StringValue>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<StringValue>
+ _instance;
} _StringValue_default_instance_;
class BytesValueDefaultTypeInternal {
-public:
- ::google::protobuf::internal::ExplicitlyConstructed<BytesValue>
- _instance;
+ public:
+ ::google::protobuf::internal::ExplicitlyConstructed<BytesValue>
+ _instance;
} _BytesValue_default_instance_;
-
+} // namespace protobuf
+} // namespace google
namespace protobuf_google_2fprotobuf_2fwrappers_2eproto {
+void InitDefaultsDoubleValueImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+ ::google::protobuf::internal::InitProtobufDefaults();
+ {
+ void* ptr = &::google::protobuf::_DoubleValue_default_instance_;
+ new (ptr) ::google::protobuf::DoubleValue();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::DoubleValue::InitAsDefaultInstance();
+}
-namespace {
+void InitDefaultsDoubleValue() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDoubleValueImpl);
+}
-::google::protobuf::Metadata file_level_metadata[9];
+void InitDefaultsFloatValueImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
-} // namespace
+ ::google::protobuf::internal::InitProtobufDefaults();
+ {
+ void* ptr = &::google::protobuf::_FloatValue_default_instance_;
+ new (ptr) ::google::protobuf::FloatValue();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::FloatValue::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 InitDefaultsFloatValue() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsFloatValueImpl);
+}
-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 },
-};
+void InitDefaultsInt64ValueImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ {
+ void* ptr = &::google::protobuf::_Int64Value_default_instance_;
+ new (ptr) ::google::protobuf::Int64Value();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::Int64Value::InitAsDefaultInstance();
+}
+
+void InitDefaultsInt64Value() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsInt64ValueImpl);
+}
+
+void InitDefaultsUInt64ValueImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ {
+ void* ptr = &::google::protobuf::_UInt64Value_default_instance_;
+ new (ptr) ::google::protobuf::UInt64Value();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::UInt64Value::InitAsDefaultInstance();
+}
+
+void InitDefaultsUInt64Value() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsUInt64ValueImpl);
+}
+
+void InitDefaultsInt32ValueImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ {
+ void* ptr = &::google::protobuf::_Int32Value_default_instance_;
+ new (ptr) ::google::protobuf::Int32Value();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::Int32Value::InitAsDefaultInstance();
+}
+
+void InitDefaultsInt32Value() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsInt32ValueImpl);
+}
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+void InitDefaultsUInt32ValueImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ {
+ void* ptr = &::google::protobuf::_UInt32Value_default_instance_;
+ new (ptr) ::google::protobuf::UInt32Value();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::UInt32Value::InitAsDefaultInstance();
+}
+
+void InitDefaultsUInt32Value() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsUInt32ValueImpl);
+}
+
+void InitDefaultsBoolValueImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ {
+ void* ptr = &::google::protobuf::_BoolValue_default_instance_;
+ new (ptr) ::google::protobuf::BoolValue();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::BoolValue::InitAsDefaultInstance();
+}
+
+void InitDefaultsBoolValue() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsBoolValueImpl);
+}
+
+void InitDefaultsStringValueImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ {
+ void* ptr = &::google::protobuf::_StringValue_default_instance_;
+ new (ptr) ::google::protobuf::StringValue();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::StringValue::InitAsDefaultInstance();
+}
+
+void InitDefaultsStringValue() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsStringValueImpl);
+}
+
+void InitDefaultsBytesValueImpl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::InitProtobufDefaults();
+ {
+ void* ptr = &::google::protobuf::_BytesValue_default_instance_;
+ new (ptr) ::google::protobuf::BytesValue();
+ ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+ }
+ ::google::protobuf::BytesValue::InitAsDefaultInstance();
+}
+
+void InitDefaultsBytesValue() {
+ static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+ ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsBytesValueImpl);
+}
+
+::google::protobuf::Metadata file_level_metadata[9];
+
+const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DoubleValue, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DoubleValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DoubleValue, value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::DoubleValue, value_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatValue, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FloatValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatValue, value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::FloatValue, value_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int64Value, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Int64Value, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int64Value, value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Int64Value, value_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt64Value, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UInt64Value, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt64Value, value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UInt64Value, value_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int32Value, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Int32Value, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Int32Value, value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Int32Value, value_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt32Value, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UInt32Value, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UInt32Value, value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::UInt32Value, value_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BoolValue, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::BoolValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BoolValue, value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::BoolValue, value_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringValue, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::StringValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringValue, value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::StringValue, value_),
~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BytesValue, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::BytesValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BytesValue, value_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::BytesValue, value_),
};
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- { 0, -1, sizeof(DoubleValue)},
- { 6, -1, sizeof(FloatValue)},
- { 12, -1, sizeof(Int64Value)},
- { 18, -1, sizeof(UInt64Value)},
- { 24, -1, sizeof(Int32Value)},
- { 30, -1, sizeof(UInt32Value)},
- { 36, -1, sizeof(BoolValue)},
- { 42, -1, sizeof(StringValue)},
- { 48, -1, sizeof(BytesValue)},
+static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+ { 0, -1, sizeof(::google::protobuf::DoubleValue)},
+ { 6, -1, sizeof(::google::protobuf::FloatValue)},
+ { 12, -1, sizeof(::google::protobuf::Int64Value)},
+ { 18, -1, sizeof(::google::protobuf::UInt64Value)},
+ { 24, -1, sizeof(::google::protobuf::Int32Value)},
+ { 30, -1, sizeof(::google::protobuf::UInt32Value)},
+ { 36, -1, sizeof(::google::protobuf::BoolValue)},
+ { 42, -1, sizeof(::google::protobuf::StringValue)},
+ { 48, -1, sizeof(::google::protobuf::BytesValue)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
- reinterpret_cast<const ::google::protobuf::Message*>(&_DoubleValue_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_FloatValue_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_Int64Value_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_UInt64Value_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_Int32Value_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_UInt32Value_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_BoolValue_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_StringValue_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&_BytesValue_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_DoubleValue_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_FloatValue_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Int64Value_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_UInt64Value_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Int32Value_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_UInt32Value_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_BoolValue_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_StringValue_default_instance_),
+ reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_BytesValue_default_instance_),
};
-namespace {
-
void protobuf_AssignDescriptors() {
AddDescriptors();
::google::protobuf::MessageFactory* factory = NULL;
@@ -191,45 +313,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, 9);
}
-} // namespace
-void TableStruct::InitDefaultsImpl() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- ::google::protobuf::internal::InitProtobufDefaults();
- _DoubleValue_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_DoubleValue_default_instance_);_FloatValue_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_FloatValue_default_instance_);_Int64Value_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_Int64Value_default_instance_);_UInt64Value_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_UInt64Value_default_instance_);_Int32Value_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_Int32Value_default_instance_);_UInt32Value_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_UInt32Value_default_instance_);_BoolValue_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_BoolValue_default_instance_);_StringValue_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_StringValue_default_instance_);_BytesValue_default_instance_._instance.DefaultConstruct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(
- &_BytesValue_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/wrappers.proto\022\017google"
".protobuf\"\034\n\013DoubleValue\022\r\n\005value\030\001 \001(\001\""
"\033\n\nFloatValue\022\r\n\005value\030\001 \001(\002\"\033\n\nInt64Val"
@@ -248,7 +340,6 @@ void AddDescriptorsImpl() {
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"google/protobuf/wrappers.proto", &protobuf_RegisterTypes);
}
-} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
@@ -260,12 +351,14 @@ struct StaticDescriptorInitializer {
AddDescriptors();
}
} static_descriptor_initializer;
-
} // namespace protobuf_google_2fprotobuf_2fwrappers_2eproto
-
+namespace google {
+namespace protobuf {
// ===================================================================
+void DoubleValue::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int DoubleValue::kValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -273,7 +366,7 @@ const int DoubleValue::kValueFieldNumber;
DoubleValue::DoubleValue()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsDoubleValue();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.DoubleValue)
@@ -281,7 +374,7 @@ DoubleValue::DoubleValue()
DoubleValue::DoubleValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsDoubleValue();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.DoubleValue)
@@ -326,12 +419,12 @@ void DoubleValue::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* DoubleValue::descriptor() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const DoubleValue& DoubleValue::default_instance() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsDoubleValue();
return *internal_default_instance();
}
@@ -525,30 +618,14 @@ void DoubleValue::InternalSwap(DoubleValue* other) {
::google::protobuf::Metadata DoubleValue::GetMetadata() const {
protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// DoubleValue
-
-// double value = 1;
-void DoubleValue::clear_value() {
- value_ = 0;
-}
-double DoubleValue::value() const {
- // @@protoc_insertion_point(field_get:google.protobuf.DoubleValue.value)
- return value_;
-}
-void DoubleValue::set_value(double value) {
-
- value_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.DoubleValue.value)
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void FloatValue::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int FloatValue::kValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -556,7 +633,7 @@ const int FloatValue::kValueFieldNumber;
FloatValue::FloatValue()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsFloatValue();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.FloatValue)
@@ -564,7 +641,7 @@ FloatValue::FloatValue()
FloatValue::FloatValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsFloatValue();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.FloatValue)
@@ -609,12 +686,12 @@ void FloatValue::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* FloatValue::descriptor() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const FloatValue& FloatValue::default_instance() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsFloatValue();
return *internal_default_instance();
}
@@ -808,30 +885,14 @@ void FloatValue::InternalSwap(FloatValue* other) {
::google::protobuf::Metadata FloatValue::GetMetadata() const {
protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// FloatValue
-
-// float value = 1;
-void FloatValue::clear_value() {
- value_ = 0;
-}
-float FloatValue::value() const {
- // @@protoc_insertion_point(field_get:google.protobuf.FloatValue.value)
- return value_;
-}
-void FloatValue::set_value(float value) {
-
- value_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.FloatValue.value)
-}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void Int64Value::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Int64Value::kValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -839,7 +900,7 @@ const int Int64Value::kValueFieldNumber;
Int64Value::Int64Value()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt64Value();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.Int64Value)
@@ -847,7 +908,7 @@ Int64Value::Int64Value()
Int64Value::Int64Value(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt64Value();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Int64Value)
@@ -892,12 +953,12 @@ void Int64Value::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Int64Value::descriptor() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Int64Value& Int64Value::default_instance() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt64Value();
return *internal_default_instance();
}
@@ -1093,30 +1154,14 @@ void Int64Value::InternalSwap(Int64Value* other) {
::google::protobuf::Metadata Int64Value::GetMetadata() const {
protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// Int64Value
-
-// int64 value = 1;
-void Int64Value::clear_value() {
- value_ = GOOGLE_LONGLONG(0);
-}
-::google::protobuf::int64 Int64Value::value() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Int64Value.value)
- return value_;
-}
-void Int64Value::set_value(::google::protobuf::int64 value) {
-
- value_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.Int64Value.value)
-}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void UInt64Value::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int UInt64Value::kValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -1124,7 +1169,7 @@ const int UInt64Value::kValueFieldNumber;
UInt64Value::UInt64Value()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt64Value();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.UInt64Value)
@@ -1132,7 +1177,7 @@ UInt64Value::UInt64Value()
UInt64Value::UInt64Value(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt64Value();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.UInt64Value)
@@ -1177,12 +1222,12 @@ void UInt64Value::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* UInt64Value::descriptor() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const UInt64Value& UInt64Value::default_instance() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt64Value();
return *internal_default_instance();
}
@@ -1378,30 +1423,14 @@ void UInt64Value::InternalSwap(UInt64Value* other) {
::google::protobuf::Metadata UInt64Value::GetMetadata() const {
protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// UInt64Value
-
-// uint64 value = 1;
-void UInt64Value::clear_value() {
- value_ = GOOGLE_ULONGLONG(0);
-}
-::google::protobuf::uint64 UInt64Value::value() const {
- // @@protoc_insertion_point(field_get:google.protobuf.UInt64Value.value)
- return value_;
-}
-void UInt64Value::set_value(::google::protobuf::uint64 value) {
-
- value_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.UInt64Value.value)
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void Int32Value::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Int32Value::kValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -1409,7 +1438,7 @@ const int Int32Value::kValueFieldNumber;
Int32Value::Int32Value()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt32Value();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.Int32Value)
@@ -1417,7 +1446,7 @@ Int32Value::Int32Value()
Int32Value::Int32Value(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt32Value();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Int32Value)
@@ -1462,12 +1491,12 @@ void Int32Value::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Int32Value::descriptor() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Int32Value& Int32Value::default_instance() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt32Value();
return *internal_default_instance();
}
@@ -1663,30 +1692,14 @@ void Int32Value::InternalSwap(Int32Value* other) {
::google::protobuf::Metadata Int32Value::GetMetadata() const {
protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// Int32Value
-
-// int32 value = 1;
-void Int32Value::clear_value() {
- value_ = 0;
-}
-::google::protobuf::int32 Int32Value::value() const {
- // @@protoc_insertion_point(field_get:google.protobuf.Int32Value.value)
- return value_;
-}
-void Int32Value::set_value(::google::protobuf::int32 value) {
-
- value_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.Int32Value.value)
-}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void UInt32Value::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int UInt32Value::kValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -1694,7 +1707,7 @@ const int UInt32Value::kValueFieldNumber;
UInt32Value::UInt32Value()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt32Value();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.UInt32Value)
@@ -1702,7 +1715,7 @@ UInt32Value::UInt32Value()
UInt32Value::UInt32Value(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt32Value();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.UInt32Value)
@@ -1747,12 +1760,12 @@ void UInt32Value::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* UInt32Value::descriptor() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const UInt32Value& UInt32Value::default_instance() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt32Value();
return *internal_default_instance();
}
@@ -1948,30 +1961,14 @@ void UInt32Value::InternalSwap(UInt32Value* other) {
::google::protobuf::Metadata UInt32Value::GetMetadata() const {
protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// UInt32Value
-
-// uint32 value = 1;
-void UInt32Value::clear_value() {
- value_ = 0u;
-}
-::google::protobuf::uint32 UInt32Value::value() const {
- // @@protoc_insertion_point(field_get:google.protobuf.UInt32Value.value)
- return value_;
-}
-void UInt32Value::set_value(::google::protobuf::uint32 value) {
-
- value_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.UInt32Value.value)
-}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void BoolValue::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int BoolValue::kValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -1979,7 +1976,7 @@ const int BoolValue::kValueFieldNumber;
BoolValue::BoolValue()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBoolValue();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.BoolValue)
@@ -1987,7 +1984,7 @@ BoolValue::BoolValue()
BoolValue::BoolValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBoolValue();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.BoolValue)
@@ -2032,12 +2029,12 @@ void BoolValue::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* BoolValue::descriptor() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const BoolValue& BoolValue::default_instance() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBoolValue();
return *internal_default_instance();
}
@@ -2231,30 +2228,14 @@ void BoolValue::InternalSwap(BoolValue* other) {
::google::protobuf::Metadata BoolValue::GetMetadata() const {
protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// BoolValue
-
-// bool value = 1;
-void BoolValue::clear_value() {
- value_ = false;
-}
-bool BoolValue::value() const {
- // @@protoc_insertion_point(field_get:google.protobuf.BoolValue.value)
- return value_;
-}
-void BoolValue::set_value(bool value) {
-
- value_ = value;
- // @@protoc_insertion_point(field_set:google.protobuf.BoolValue.value)
-}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void StringValue::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int StringValue::kValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -2262,7 +2243,7 @@ const int StringValue::kValueFieldNumber;
StringValue::StringValue()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsStringValue();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.StringValue)
@@ -2270,7 +2251,7 @@ StringValue::StringValue()
StringValue::StringValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsStringValue();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.StringValue)
@@ -2320,12 +2301,12 @@ void StringValue::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* StringValue::descriptor() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const StringValue& StringValue::default_instance() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsStringValue();
return *internal_default_instance();
}
@@ -2534,91 +2515,14 @@ void StringValue::InternalSwap(StringValue* other) {
::google::protobuf::Metadata StringValue::GetMetadata() const {
protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
}
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// StringValue
-
-// string value = 1;
-void StringValue::clear_value() {
- value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-const ::std::string& StringValue::value() const {
- // @@protoc_insertion_point(field_get:google.protobuf.StringValue.value)
- return value_.Get();
-}
-void StringValue::set_value(const ::std::string& value) {
-
- value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set:google.protobuf.StringValue.value)
-}
-#if LANG_CXX11
-void StringValue::set_value(::std::string&& value) {
-
- value_.Set(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_rvalue:google.protobuf.StringValue.value)
-}
-#endif
-void StringValue::set_value(const char* value) {
- GOOGLE_DCHECK(value != NULL);
-
- value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_char:google.protobuf.StringValue.value)
-}
-void StringValue::set_value(const char* value,
- size_t size) {
-
- value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
- reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.StringValue.value)
-}
-::std::string* StringValue::mutable_value() {
-
- // @@protoc_insertion_point(field_mutable:google.protobuf.StringValue.value)
- return value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* StringValue::release_value() {
- // @@protoc_insertion_point(field_release:google.protobuf.StringValue.value)
-
- return value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* StringValue::unsafe_arena_release_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.StringValue.value)
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
- return value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
-}
-void StringValue::set_allocated_value(::std::string* value) {
- if (value != NULL) {
-
- } else {
-
- }
- value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.StringValue.value)
-}
-void StringValue::unsafe_arena_set_allocated_value(
- ::std::string* value) {
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
- if (value != NULL) {
-
- } else {
-
- }
- value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.StringValue.value)
-}
-
-#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
+void BytesValue::InitAsDefaultInstance() {
+}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int BytesValue::kValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -2626,7 +2530,7 @@ const int BytesValue::kValueFieldNumber;
BytesValue::BytesValue()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBytesValue();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.BytesValue)
@@ -2634,7 +2538,7 @@ BytesValue::BytesValue()
BytesValue::BytesValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBytesValue();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.BytesValue)
@@ -2684,12 +2588,12 @@ void BytesValue::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* BytesValue::descriptor() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
+ return ::protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const BytesValue& BytesValue::default_instance() {
- protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
+ ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBytesValue();
return *internal_default_instance();
}
@@ -2886,91 +2790,11 @@ void BytesValue::InternalSwap(BytesValue* other) {
::google::protobuf::Metadata BytesValue::GetMetadata() const {
protobuf_google_2fprotobuf_2fwrappers_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fwrappers_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-#if PROTOBUF_INLINE_NOT_IN_HEADERS
-// BytesValue
-
-// bytes value = 1;
-void BytesValue::clear_value() {
- value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-const ::std::string& BytesValue::value() const {
- // @@protoc_insertion_point(field_get:google.protobuf.BytesValue.value)
- return value_.Get();
-}
-void BytesValue::set_value(const ::std::string& value) {
-
- value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set:google.protobuf.BytesValue.value)
-}
-#if LANG_CXX11
-void BytesValue::set_value(::std::string&& value) {
-
- value_.Set(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_rvalue:google.protobuf.BytesValue.value)
-}
-#endif
-void BytesValue::set_value(const char* value) {
- GOOGLE_DCHECK(value != NULL);
-
- value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_char:google.protobuf.BytesValue.value)
-}
-void BytesValue::set_value(const void* value,
- size_t size) {
-
- value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
- reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_pointer:google.protobuf.BytesValue.value)
-}
-::std::string* BytesValue::mutable_value() {
-
- // @@protoc_insertion_point(field_mutable:google.protobuf.BytesValue.value)
- return value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* BytesValue::release_value() {
- // @@protoc_insertion_point(field_release:google.protobuf.BytesValue.value)
-
- return value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
-}
-::std::string* BytesValue::unsafe_arena_release_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.BytesValue.value)
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
-
- return value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
-}
-void BytesValue::set_allocated_value(::std::string* value) {
- if (value != NULL) {
-
- } else {
-
- }
- value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,
- GetArenaNoVirtual());
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.BytesValue.value)
-}
-void BytesValue::unsafe_arena_set_allocated_value(
- ::std::string* value) {
- GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
- if (value != NULL) {
-
- } else {
-
- }
- value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- value, GetArenaNoVirtual());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.BytesValue.value)
+ return ::protobuf_google_2fprotobuf_2fwrappers_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/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h
index 29d6b738..9ed1c0b2 100644
--- a/src/google/protobuf/wrappers.pb.h
+++ b/src/google/protobuf/wrappers.pb.h
@@ -30,6 +30,48 @@
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
+
+namespace protobuf_google_2fprotobuf_2fwrappers_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[9];
+ 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 InitDefaultsDoubleValueImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsDoubleValue();
+void LIBPROTOBUF_EXPORT InitDefaultsFloatValueImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsFloatValue();
+void LIBPROTOBUF_EXPORT InitDefaultsInt64ValueImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsInt64Value();
+void LIBPROTOBUF_EXPORT InitDefaultsUInt64ValueImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsUInt64Value();
+void LIBPROTOBUF_EXPORT InitDefaultsInt32ValueImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsInt32Value();
+void LIBPROTOBUF_EXPORT InitDefaultsUInt32ValueImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsUInt32Value();
+void LIBPROTOBUF_EXPORT InitDefaultsBoolValueImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsBoolValue();
+void LIBPROTOBUF_EXPORT InitDefaultsStringValueImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsStringValue();
+void LIBPROTOBUF_EXPORT InitDefaultsBytesValueImpl();
+void LIBPROTOBUF_EXPORT InitDefaultsBytesValue();
+inline void LIBPROTOBUF_EXPORT InitDefaults() {
+ InitDefaultsDoubleValue();
+ InitDefaultsFloatValue();
+ InitDefaultsInt64Value();
+ InitDefaultsUInt64Value();
+ InitDefaultsInt32Value();
+ InitDefaultsUInt32Value();
+ InitDefaultsBoolValue();
+ InitDefaultsStringValue();
+ InitDefaultsBytesValue();
+}
+} // namespace protobuf_google_2fprotobuf_2fwrappers_2eproto
namespace google {
namespace protobuf {
class BoolValue;
@@ -61,25 +103,9 @@ class UInt64ValueDefaultTypeInternal;
LIBPROTOBUF_EXPORT extern UInt64ValueDefaultTypeInternal _UInt64Value_default_instance_;
} // namespace protobuf
} // namespace google
-
namespace google {
namespace protobuf {
-namespace protobuf_google_2fprotobuf_2fwrappers_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_2fwrappers_2eproto
-
// ===================================================================
class LIBPROTOBUF_EXPORT DoubleValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DoubleValue) */ {
@@ -117,6 +143,7 @@ class LIBPROTOBUF_EXPORT DoubleValue : public ::google::protobuf::Message /* @@p
static const ::google::protobuf::Descriptor* descriptor();
static const DoubleValue& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const DoubleValue* internal_default_instance() {
return reinterpret_cast<const DoubleValue*>(
&_DoubleValue_default_instance_);
@@ -190,7 +217,8 @@ class LIBPROTOBUF_EXPORT DoubleValue : public ::google::protobuf::Message /* @@p
typedef void DestructorSkippable_;
double value_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsDoubleValueImpl();
};
// -------------------------------------------------------------------
@@ -229,6 +257,7 @@ class LIBPROTOBUF_EXPORT FloatValue : public ::google::protobuf::Message /* @@pr
static const ::google::protobuf::Descriptor* descriptor();
static const FloatValue& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const FloatValue* internal_default_instance() {
return reinterpret_cast<const FloatValue*>(
&_FloatValue_default_instance_);
@@ -302,7 +331,8 @@ class LIBPROTOBUF_EXPORT FloatValue : public ::google::protobuf::Message /* @@pr
typedef void DestructorSkippable_;
float value_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsFloatValueImpl();
};
// -------------------------------------------------------------------
@@ -341,6 +371,7 @@ class LIBPROTOBUF_EXPORT Int64Value : public ::google::protobuf::Message /* @@pr
static const ::google::protobuf::Descriptor* descriptor();
static const Int64Value& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Int64Value* internal_default_instance() {
return reinterpret_cast<const Int64Value*>(
&_Int64Value_default_instance_);
@@ -414,7 +445,8 @@ class LIBPROTOBUF_EXPORT Int64Value : public ::google::protobuf::Message /* @@pr
typedef void DestructorSkippable_;
::google::protobuf::int64 value_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt64ValueImpl();
};
// -------------------------------------------------------------------
@@ -453,6 +485,7 @@ class LIBPROTOBUF_EXPORT UInt64Value : public ::google::protobuf::Message /* @@p
static const ::google::protobuf::Descriptor* descriptor();
static const UInt64Value& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const UInt64Value* internal_default_instance() {
return reinterpret_cast<const UInt64Value*>(
&_UInt64Value_default_instance_);
@@ -526,7 +559,8 @@ class LIBPROTOBUF_EXPORT UInt64Value : public ::google::protobuf::Message /* @@p
typedef void DestructorSkippable_;
::google::protobuf::uint64 value_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt64ValueImpl();
};
// -------------------------------------------------------------------
@@ -565,6 +599,7 @@ class LIBPROTOBUF_EXPORT Int32Value : public ::google::protobuf::Message /* @@pr
static const ::google::protobuf::Descriptor* descriptor();
static const Int32Value& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Int32Value* internal_default_instance() {
return reinterpret_cast<const Int32Value*>(
&_Int32Value_default_instance_);
@@ -638,7 +673,8 @@ class LIBPROTOBUF_EXPORT Int32Value : public ::google::protobuf::Message /* @@pr
typedef void DestructorSkippable_;
::google::protobuf::int32 value_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsInt32ValueImpl();
};
// -------------------------------------------------------------------
@@ -677,6 +713,7 @@ class LIBPROTOBUF_EXPORT UInt32Value : public ::google::protobuf::Message /* @@p
static const ::google::protobuf::Descriptor* descriptor();
static const UInt32Value& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const UInt32Value* internal_default_instance() {
return reinterpret_cast<const UInt32Value*>(
&_UInt32Value_default_instance_);
@@ -750,7 +787,8 @@ class LIBPROTOBUF_EXPORT UInt32Value : public ::google::protobuf::Message /* @@p
typedef void DestructorSkippable_;
::google::protobuf::uint32 value_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsUInt32ValueImpl();
};
// -------------------------------------------------------------------
@@ -789,6 +827,7 @@ class LIBPROTOBUF_EXPORT BoolValue : public ::google::protobuf::Message /* @@pro
static const ::google::protobuf::Descriptor* descriptor();
static const BoolValue& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const BoolValue* internal_default_instance() {
return reinterpret_cast<const BoolValue*>(
&_BoolValue_default_instance_);
@@ -862,7 +901,8 @@ class LIBPROTOBUF_EXPORT BoolValue : public ::google::protobuf::Message /* @@pro
typedef void DestructorSkippable_;
bool value_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBoolValueImpl();
};
// -------------------------------------------------------------------
@@ -901,6 +941,7 @@ class LIBPROTOBUF_EXPORT StringValue : public ::google::protobuf::Message /* @@p
static const ::google::protobuf::Descriptor* descriptor();
static const StringValue& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const StringValue* internal_default_instance() {
return reinterpret_cast<const StringValue*>(
&_StringValue_default_instance_);
@@ -985,7 +1026,8 @@ class LIBPROTOBUF_EXPORT StringValue : public ::google::protobuf::Message /* @@p
typedef void DestructorSkippable_;
::google::protobuf::internal::ArenaStringPtr value_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsStringValueImpl();
};
// -------------------------------------------------------------------
@@ -1024,6 +1066,7 @@ class LIBPROTOBUF_EXPORT BytesValue : public ::google::protobuf::Message /* @@pr
static const ::google::protobuf::Descriptor* descriptor();
static const BytesValue& default_instance();
+ static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const BytesValue* internal_default_instance() {
return reinterpret_cast<const BytesValue*>(
&_BytesValue_default_instance_);
@@ -1108,14 +1151,14 @@ class LIBPROTOBUF_EXPORT BytesValue : public ::google::protobuf::Message /* @@pr
typedef void DestructorSkippable_;
::google::protobuf::internal::ArenaStringPtr value_;
mutable int _cached_size_;
- friend struct protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;
+ friend void ::protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaultsBytesValueImpl();
};
// ===================================================================
// ===================================================================
-#if !PROTOBUF_INLINE_NOT_IN_HEADERS
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
@@ -1405,7 +1448,6 @@ inline void BytesValue::unsafe_arena_set_allocated_value(
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
-#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS
// -------------------------------------------------------------------
// -------------------------------------------------------------------
@@ -1425,7 +1467,6 @@ inline void BytesValue::unsafe_arena_set_allocated_value(
// @@protoc_insertion_point(namespace_scope)
-
} // namespace protobuf
} // namespace google